summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile60
-rw-r--r--lib/atf/libatf-c++/Makefile5
-rw-r--r--lib/atf/libatf-c++/Makefile.depend17
-rw-r--r--lib/atf/libatf-c/Makefile.depend20
-rw-r--r--lib/clang/Makefile28
-rw-r--r--lib/clang/clang.build.mk58
-rw-r--r--lib/clang/include/AArch64GenAsmMatcher.inc2
-rw-r--r--lib/clang/include/AArch64GenAsmWriter.inc2
-rw-r--r--lib/clang/include/AArch64GenAsmWriter1.inc2
-rw-r--r--lib/clang/include/AArch64GenCallingConv.inc2
-rw-r--r--lib/clang/include/AArch64GenDAGISel.inc2
-rw-r--r--lib/clang/include/AArch64GenDisassemblerTables.inc2
-rw-r--r--lib/clang/include/AArch64GenFastISel.inc2
-rw-r--r--lib/clang/include/AArch64GenInstrInfo.inc2
-rw-r--r--lib/clang/include/AArch64GenMCCodeEmitter.inc2
-rw-r--r--lib/clang/include/AArch64GenMCPseudoLowering.inc2
-rw-r--r--lib/clang/include/AArch64GenRegisterInfo.inc2
-rw-r--r--lib/clang/include/AArch64GenSubtargetInfo.inc2
-rw-r--r--lib/clang/include/Makefile18
-rw-r--r--lib/clang/include/Makefile.depend12
-rw-r--r--lib/clang/include/MipsGenFastISel.inc2
-rw-r--r--lib/clang/include/PPCGenDisassemblerTables.inc2
-rw-r--r--lib/clang/include/clang/AST/AttrVisitor.inc2
-rw-r--r--lib/clang/include/clang/Basic/AttrHasAttributeImpl.inc2
-rw-r--r--lib/clang/include/clang/Basic/Version.inc10
-rw-r--r--lib/clang/include/clang/Config/config.h23
-rw-r--r--lib/clang/include/clang/Driver/CC1AsOptions.inc2
-rw-r--r--lib/clang/include/clang/Lex/AttrSpellings.inc2
-rw-r--r--lib/clang/include/clang/Parse/AttrIdentifierArg.inc2
-rw-r--r--lib/clang/include/clang/Parse/AttrLateParsed.inc2
-rw-r--r--lib/clang/include/clang/Parse/AttrParserStringSwitches.inc2
-rw-r--r--lib/clang/include/clang/Parse/AttrTypeArg.inc2
-rw-r--r--lib/clang/include/llvm/Config/AsmParsers.def1
-rw-r--r--lib/clang/include/llvm/Config/AsmPrinters.def1
-rw-r--r--lib/clang/include/llvm/Config/Disassemblers.def2
-rw-r--r--lib/clang/include/llvm/Config/Targets.def1
-rw-r--r--lib/clang/include/llvm/Config/config.h156
-rw-r--r--lib/clang/include/llvm/Config/llvm-config.h49
-rw-r--r--lib/clang/include/llvm/Support/DataTypes.h72
-rw-r--r--lib/clang/libclanganalysis/Makefile5
-rw-r--r--lib/clang/libclanganalysis/Makefile.depend163
-rw-r--r--lib/clang/libclangarcmigrate/Makefile1
-rw-r--r--lib/clang/libclangarcmigrate/Makefile.depend203
-rw-r--r--lib/clang/libclangast/Makefile3
-rw-r--r--lib/clang/libclangast/Makefile.depend539
-rw-r--r--lib/clang/libclangbasic/Makefile12
-rw-r--r--lib/clang/libclangbasic/Makefile.depend47
-rw-r--r--lib/clang/libclangcodegen/Makefile10
-rw-r--r--lib/clang/libclangcodegen/Makefile.depend552
-rw-r--r--lib/clang/libclangdriver/Makefile10
-rw-r--r--lib/clang/libclangdriver/Makefile.depend66
-rw-r--r--lib/clang/libclangedit/Makefile.depend27
-rw-r--r--lib/clang/libclangfrontend/Makefile7
-rw-r--r--lib/clang/libclangfrontend/Makefile.depend186
-rw-r--r--lib/clang/libclangfrontendtool/Makefile7
-rw-r--r--lib/clang/libclangfrontendtool/Makefile.depend24
-rw-r--r--lib/clang/libclanglex/Makefile2
-rw-r--r--lib/clang/libclanglex/Makefile.depend85
-rw-r--r--lib/clang/libclangparse/Makefile7
-rw-r--r--lib/clang/libclangparse/Makefile.depend225
-rw-r--r--lib/clang/libclangrewritecore/Makefile (renamed from lib/clang/libclangrewrite/Makefile)4
-rw-r--r--lib/clang/libclangrewritecore/Makefile.depend25
-rw-r--r--lib/clang/libclangrewritefrontend/Makefile4
-rw-r--r--lib/clang/libclangrewritefrontend/Makefile.depend73
-rw-r--r--lib/clang/libclangsema/Makefile3
-rw-r--r--lib/clang/libclangsema/Makefile.depend695
-rw-r--r--lib/clang/libclangserialization/Makefile.depend117
-rw-r--r--lib/clang/libclangstaticanalyzercheckers/Makefile3
-rw-r--r--lib/clang/libclangstaticanalyzercheckers/Makefile.depend721
-rw-r--r--lib/clang/libclangstaticanalyzercore/Makefile.depend285
-rw-r--r--lib/clang/libclangstaticanalyzerfrontend/Makefile6
-rw-r--r--lib/clang/libclangstaticanalyzerfrontend/Makefile.depend37
-rw-r--r--lib/clang/liblldb/Makefile4
-rw-r--r--lib/clang/liblldbAPI/Makefile9
-rw-r--r--lib/clang/liblldbBreakpoint/Makefile4
-rw-r--r--lib/clang/liblldbCommands/Makefile4
-rw-r--r--lib/clang/liblldbCore/Makefile7
-rw-r--r--lib/clang/liblldbDataFormatters/Makefile9
-rw-r--r--lib/clang/liblldbExpression/Makefile1
-rw-r--r--lib/clang/liblldbHostCommon/Makefile16
-rw-r--r--lib/clang/liblldbHostFreeBSD/Makefile5
-rw-r--r--lib/clang/liblldbHostPOSIX/Makefile16
-rw-r--r--lib/clang/liblldbInterpreter/Makefile6
-rw-r--r--lib/clang/liblldbPluginABISysV_ppc/Makefile15
-rw-r--r--lib/clang/liblldbPluginABISysV_ppc64/Makefile15
-rw-r--r--lib/clang/liblldbPluginInstructionARM64/Makefile10
-rw-r--r--lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile17
-rw-r--r--lib/clang/liblldbPluginJITLoaderGDB/Makefile15
-rw-r--r--lib/clang/liblldbPluginMemoryHistoryASan/Makefile15
-rw-r--r--lib/clang/liblldbPluginObjectFileJIT/Makefile17
-rw-r--r--lib/clang/liblldbPluginPlatformFreeBSD/Makefile4
-rw-r--r--lib/clang/liblldbPluginPlatformGDB/Makefile4
-rw-r--r--lib/clang/liblldbPluginProcessElfCore/Makefile1
-rw-r--r--lib/clang/liblldbPluginProcessGDBRemote/Makefile4
-rw-r--r--lib/clang/liblldbPluginProcessPOSIX/Makefile15
-rw-r--r--lib/clang/liblldbPluginProcessUtility/Makefile18
-rw-r--r--lib/clang/liblldbPluginSymbolFileDWARF/Makefile4
-rw-r--r--lib/clang/liblldbSymbol/Makefile1
-rw-r--r--lib/clang/liblldbTarget/Makefile16
-rw-r--r--lib/clang/liblldbUtility/Makefile8
-rw-r--r--lib/clang/libllvmaarch64asmparser/Makefile16
-rw-r--r--lib/clang/libllvmaarch64codegen/Makefile46
-rw-r--r--lib/clang/libllvmaarch64desc/Makefile24
-rw-r--r--lib/clang/libllvmaarch64disassembler/Makefile20
-rw-r--r--lib/clang/libllvmaarch64info/Makefile15
-rw-r--r--lib/clang/libllvmaarch64instprinter/Makefile17
-rw-r--r--lib/clang/libllvmaarch64utils/Makefile15
-rw-r--r--lib/clang/libllvmanalysis/Makefile13
-rw-r--r--lib/clang/libllvmanalysis/Makefile.depend51
-rw-r--r--lib/clang/libllvmarmasmparser/Makefile.depend25
-rw-r--r--lib/clang/libllvmarmcodegen/Makefile3
-rw-r--r--lib/clang/libllvmarmcodegen/Makefile.depend223
-rw-r--r--lib/clang/libllvmarmdesc/Makefile6
-rw-r--r--lib/clang/libllvmarmdesc/Makefile.depend61
-rw-r--r--lib/clang/libllvmarmdisassembler/Makefile.depend25
-rw-r--r--lib/clang/libllvmarminfo/Makefile.depend23
-rw-r--r--lib/clang/libllvmarminstprinter/Makefile.depend25
-rw-r--r--lib/clang/libllvmasmparser/Makefile.depend16
-rw-r--r--lib/clang/libllvmasmprinter/Makefile11
-rw-r--r--lib/clang/libllvmasmprinter/Makefile.depend19
-rw-r--r--lib/clang/libllvmbitreader/Makefile.depend19
-rw-r--r--lib/clang/libllvmbitwriter/Makefile.depend16
-rw-r--r--lib/clang/libllvmcodegen/Makefile15
-rw-r--r--lib/clang/libllvmcodegen/Makefile.depend35
-rw-r--r--lib/clang/libllvmcore/Makefile12
-rw-r--r--lib/clang/libllvmcore/Makefile.depend37
-rw-r--r--lib/clang/libllvmdebuginfo/Makefile7
-rw-r--r--lib/clang/libllvmdebuginfo/Makefile.depend16
-rw-r--r--lib/clang/libllvmexecutionengine/Makefile2
-rw-r--r--lib/clang/libllvmexecutionengine/Makefile.depend16
-rw-r--r--lib/clang/libllvminstcombine/Makefile.depend43
-rw-r--r--lib/clang/libllvminstrumentation/Makefile3
-rw-r--r--lib/clang/libllvminstrumentation/Makefile.depend29
-rw-r--r--lib/clang/libllvminterpreter/Makefile.depend23
-rw-r--r--lib/clang/libllvmipa/Makefile1
-rw-r--r--lib/clang/libllvmipa/Makefile.depend25
-rw-r--r--lib/clang/libllvmipo/Makefile.depend31
-rw-r--r--lib/clang/libllvmirreader/Makefile.depend16
-rw-r--r--lib/clang/libllvmjit/Makefile12
-rw-r--r--lib/clang/libllvmjit/Makefile.depend16
-rw-r--r--lib/clang/libllvmlinker/Makefile.depend16
-rw-r--r--lib/clang/libllvmmc/Makefile23
-rw-r--r--lib/clang/libllvmmc/Makefile.depend16
-rw-r--r--lib/clang/libllvmmcdisassembler/Makefile5
-rw-r--r--lib/clang/libllvmmcdisassembler/Makefile.depend16
-rw-r--r--lib/clang/libllvmmcjit/Makefile.depend16
-rw-r--r--lib/clang/libllvmmcparser/Makefile.depend16
-rw-r--r--lib/clang/libllvmmipsasmparser/Makefile.depend25
-rw-r--r--lib/clang/libllvmmipscodegen/Makefile7
-rw-r--r--lib/clang/libllvmmipscodegen/Makefile.depend225
-rw-r--r--lib/clang/libllvmmipsdesc/Makefile9
-rw-r--r--lib/clang/libllvmmipsdesc/Makefile.depend45
-rw-r--r--lib/clang/libllvmmipsdisassembler/Makefile.depend25
-rw-r--r--lib/clang/libllvmmipsinfo/Makefile.depend23
-rw-r--r--lib/clang/libllvmmipsinstprinter/Makefile.depend25
-rw-r--r--lib/clang/libllvmobjcarcopts/Makefile3
-rw-r--r--lib/clang/libllvmobjcarcopts/Makefile.depend19
-rw-r--r--lib/clang/libllvmobject/Makefile4
-rw-r--r--lib/clang/libllvmobject/Makefile.depend16
-rw-r--r--lib/clang/libllvmoption/Makefile.depend16
-rw-r--r--lib/clang/libllvmpowerpcasmparser/Makefile.depend25
-rw-r--r--lib/clang/libllvmpowerpccodegen/Makefile4
-rw-r--r--lib/clang/libllvmpowerpccodegen/Makefile.depend139
-rw-r--r--lib/clang/libllvmpowerpcdesc/Makefile.depend49
-rw-r--r--lib/clang/libllvmpowerpcdisassembler/Makefile16
-rw-r--r--lib/clang/libllvmpowerpcinfo/Makefile.depend23
-rw-r--r--lib/clang/libllvmpowerpcinstprinter/Makefile.depend25
-rw-r--r--lib/clang/libllvmprofiledata/Makefile18
-rw-r--r--lib/clang/libllvmruntimedyld/Makefile3
-rw-r--r--lib/clang/libllvmruntimedyld/Makefile.depend16
-rw-r--r--lib/clang/libllvmscalaropts/Makefile8
-rw-r--r--lib/clang/libllvmscalaropts/Makefile.depend67
-rw-r--r--lib/clang/libllvmselectiondag/Makefile1
-rw-r--r--lib/clang/libllvmselectiondag/Makefile.depend29
-rw-r--r--lib/clang/libllvmsparcasmparser/Makefile.depend25
-rw-r--r--lib/clang/libllvmsparccodegen/Makefile2
-rw-r--r--lib/clang/libllvmsparccodegen/Makefile.depend103
-rw-r--r--lib/clang/libllvmsparcdesc/Makefile.depend43
-rw-r--r--lib/clang/libllvmsparcdisassembler/Makefile.depend25
-rw-r--r--lib/clang/libllvmsparcinfo/Makefile.depend23
-rw-r--r--lib/clang/libllvmsparcinstprinter/Makefile.depend25
-rw-r--r--lib/clang/libllvmsupport/Makefile25
-rw-r--r--lib/clang/libllvmsupport/Makefile.depend16
-rw-r--r--lib/clang/libllvmtablegen/Makefile1
-rw-r--r--lib/clang/libllvmtablegen/Makefile.depend16
-rw-r--r--lib/clang/libllvmtarget/Makefile4
-rw-r--r--lib/clang/libllvmtarget/Makefile.depend16
-rw-r--r--lib/clang/libllvmtransformutils/Makefile7
-rw-r--r--lib/clang/libllvmtransformutils/Makefile.depend47
-rw-r--r--lib/clang/libllvmvectorize/Makefile.depend23
-rw-r--r--lib/clang/libllvmx86asmparser/Makefile3
-rw-r--r--lib/clang/libllvmx86asmparser/Makefile.depend25
-rw-r--r--lib/clang/libllvmx86codegen/Makefile4
-rw-r--r--lib/clang/libllvmx86codegen/Makefile.depend141
-rw-r--r--lib/clang/libllvmx86desc/Makefile3
-rw-r--r--lib/clang/libllvmx86desc/Makefile.depend65
-rw-r--r--lib/clang/libllvmx86disassembler/Makefile5
-rw-r--r--lib/clang/libllvmx86disassembler/Makefile.depend21
-rw-r--r--lib/clang/libllvmx86info/Makefile.depend23
-rw-r--r--lib/clang/libllvmx86instprinter/Makefile.depend39
-rw-r--r--lib/clang/libllvmx86utils/Makefile.depend16
-rw-r--r--lib/csu/Makefile5
-rw-r--r--lib/csu/Makefile.inc5
-rw-r--r--lib/csu/aarch64/Makefile44
-rw-r--r--lib/csu/aarch64/crt1.c89
-rw-r--r--lib/csu/amd64/Makefile.depend13
-rw-r--r--lib/csu/arm/Makefile.depend15
-rw-r--r--lib/csu/i386-elf/Makefile (renamed from lib/csu/i386/Makefile)4
-rw-r--r--lib/csu/i386-elf/Makefile.depend13
-rw-r--r--lib/csu/i386-elf/crt1_c.c (renamed from lib/csu/i386/crt1_c.c)0
-rw-r--r--lib/csu/i386-elf/crt1_s.S (renamed from lib/csu/i386/crt1_s.S)0
-rw-r--r--lib/csu/i386-elf/crti.S (renamed from lib/csu/i386/crti.S)0
-rw-r--r--lib/csu/i386-elf/crtn.S (renamed from lib/csu/i386/crtn.S)0
-rw-r--r--lib/csu/mips/Makefile.depend15
-rw-r--r--lib/csu/powerpc/Makefile.depend15
-rw-r--r--lib/csu/powerpc64/Makefile7
-rw-r--r--lib/csu/powerpc64/Makefile.depend15
-rw-r--r--lib/csu/sparc64/Makefile.depend15
-rw-r--r--lib/libalias/libalias/Makefile.depend21
-rw-r--r--lib/libalias/modules/cuseeme/Makefile.depend19
-rw-r--r--lib/libalias/modules/dummy/Makefile.depend19
-rw-r--r--lib/libalias/modules/ftp/Makefile.depend19
-rw-r--r--lib/libalias/modules/irc/Makefile.depend19
-rw-r--r--lib/libalias/modules/nbt/Makefile.depend19
-rw-r--r--lib/libalias/modules/pptp/Makefile.depend19
-rw-r--r--lib/libalias/modules/skinny/Makefile.depend19
-rw-r--r--lib/libalias/modules/smedia/Makefile.depend19
-rw-r--r--lib/libarchive/Makefile22
-rw-r--r--lib/libarchive/Makefile.depend25
-rw-r--r--lib/libarchive/config_freebsd.h7
-rw-r--r--lib/libarchive/test/Makefile3
-rw-r--r--lib/libauditd/Makefile.depend20
-rw-r--r--lib/libbegemot/Makefile.depend21
-rw-r--r--lib/libblocksruntime/Makefile2
-rw-r--r--lib/libblocksruntime/Makefile.depend20
-rw-r--r--lib/libbluetooth/Makefile.depend20
-rw-r--r--lib/libbluetooth/bluetooth.c2
-rw-r--r--lib/libbluetooth/dev.c1
-rw-r--r--lib/libbluetooth/hci.c1
-rw-r--r--lib/libbsm/Makefile.depend21
-rw-r--r--lib/libbsnmp/libbsnmp/Makefile4
-rw-r--r--lib/libbsnmp/libbsnmp/Makefile.depend21
-rw-r--r--lib/libbz2/Makefile.depend20
-rw-r--r--lib/libc++/Makefile12
-rw-r--r--lib/libc++/Makefile.depend39
-rw-r--r--lib/libc/Makefile35
-rw-r--r--lib/libc/Makefile.amd646
-rw-r--r--lib/libc/Makefile.depend169
-rw-r--r--lib/libc/Makefile.i3866
-rw-r--r--lib/libc/aarch64/Makefile.inc9
-rw-r--r--lib/libc/aarch64/SYS.h63
-rw-r--r--lib/libc/aarch64/Symbol.map30
-rw-r--r--lib/libc/aarch64/_fpmath.h58
-rw-r--r--lib/libc/aarch64/arith.h19
-rw-r--r--lib/libc/aarch64/gd_qnan.h21
-rw-r--r--lib/libc/aarch64/gen/Makefile.inc10
-rw-r--r--lib/libc/aarch64/gen/_setjmp.S105
-rw-r--r--lib/libc/aarch64/gen/fabs.S33
-rw-r--r--lib/libc/aarch64/gen/setjmp.S123
-rw-r--r--lib/libc/aarch64/gen/sigsetjmp.S53
-rw-r--r--lib/libc/aarch64/sys/Makefile.inc25
-rw-r--r--lib/libc/aarch64/sys/brk.S93
-rw-r--r--lib/libc/aarch64/sys/cerror.S41
-rw-r--r--lib/libc/aarch64/sys/pipe.S52
-rw-r--r--lib/libc/aarch64/sys/sbrk.S79
-rw-r--r--lib/libc/aarch64/sys/shmat.S35
-rw-r--r--lib/libc/aarch64/sys/syscall.S35
-rw-r--r--lib/libc/aarch64/sys/vfork.S42
-rw-r--r--lib/libc/amd64/sys/Makefile.inc3
-rw-r--r--lib/libc/arm/SYS.h2
-rw-r--r--lib/libc/arm/aeabi/Makefile.inc2
-rw-r--r--lib/libc/arm/aeabi/aeabi_vfp_double.S8
-rw-r--r--lib/libc/arm/aeabi/aeabi_vfp_float.S8
-rw-r--r--lib/libc/arm/gen/Makefile.inc5
-rw-r--r--lib/libc/arm/gen/_setjmp.S17
-rw-r--r--lib/libc/arm/gen/getcontextx.c (renamed from lib/libc/gen/trivial-getcontextx.c)0
-rw-r--r--lib/libc/arm/gen/setjmp.S17
-rw-r--r--lib/libc/arm/string/ffs.S4
-rw-r--r--lib/libc/arm/string/memcmp.S4
-rw-r--r--lib/libc/arm/string/memcpy_arm.S37
-rw-r--r--lib/libc/arm/string/memcpy_xscale.S38
-rw-r--r--lib/libc/arm/string/memmove.S62
-rw-r--r--lib/libc/arm/string/memset.S102
-rw-r--r--lib/libc/arm/string/strlen.S14
-rw-r--r--lib/libc/arm/sys/Makefile.inc5
-rw-r--r--lib/libc/arm/sys/__vdso_gettc.c (renamed from lib/libc/sys/trivial-vdso_tc.c)0
-rw-r--r--lib/libc/arm/sys/brk.S18
-rw-r--r--lib/libc/arm/sys/sbrk.S17
-rw-r--r--lib/libc/compat-43/creat.c13
-rw-r--r--lib/libc/db/hash/hash.c7
-rw-r--r--lib/libc/db/man/dbm.36
-rw-r--r--lib/libc/gen/Makefile.inc1
-rw-r--r--lib/libc/gen/Symbol.map3
-rw-r--r--lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c45
-rw-r--r--lib/libc/gen/_once_stub.c2
-rw-r--r--lib/libc/gen/_spinlock_stub.c41
-rw-r--r--lib/libc/gen/cap_rights_get.32
-rw-r--r--lib/libc/gen/directory.325
-rw-r--r--lib/libc/gen/disklabel.c23
-rw-r--r--lib/libc/gen/dlfcn.c12
-rw-r--r--lib/libc/gen/dlopen.34
-rw-r--r--lib/libc/gen/fstab.c2
-rw-r--r--lib/libc/gen/ftok.34
-rw-r--r--lib/libc/gen/fts.c11
-rw-r--r--lib/libc/gen/ftw.310
-rw-r--r--lib/libc/gen/getcap.35
-rw-r--r--lib/libc/gen/getgrent.c8
-rw-r--r--lib/libc/gen/getpwent.c10
-rw-r--r--lib/libc/gen/getutxent.32
-rw-r--r--lib/libc/gen/nice.336
-rw-r--r--lib/libc/gen/nice.c16
-rw-r--r--lib/libc/gen/nlist.c3
-rw-r--r--lib/libc/gen/pause.c9
-rw-r--r--lib/libc/gen/posix_spawn.312
-rw-r--r--lib/libc/gen/posix_spawn_file_actions_addopen.32
-rw-r--r--lib/libc/gen/posix_spawn_file_actions_init.32
-rw-r--r--lib/libc/gen/posix_spawnattr_getflags.32
-rw-r--r--lib/libc/gen/posix_spawnattr_getpgroup.32
-rw-r--r--lib/libc/gen/posix_spawnattr_getschedparam.32
-rw-r--r--lib/libc/gen/posix_spawnattr_getschedpolicy.32
-rw-r--r--lib/libc/gen/posix_spawnattr_getsigdefault.32
-rw-r--r--lib/libc/gen/posix_spawnattr_getsigmask.32
-rw-r--r--lib/libc/gen/posix_spawnattr_init.32
-rw-r--r--lib/libc/gen/raise.c8
-rw-r--r--lib/libc/gen/readdir.c6
-rw-r--r--lib/libc/gen/rewinddir.c1
-rw-r--r--lib/libc/gen/scandir.36
-rw-r--r--lib/libc/gen/sem_new.c6
-rw-r--r--lib/libc/gen/sem_post.35
-rw-r--r--lib/libc/gen/setmode.317
-rw-r--r--lib/libc/gen/setmode.c92
-rw-r--r--lib/libc/gen/setproctitle.c73
-rw-r--r--lib/libc/gen/sleep.38
-rw-r--r--lib/libc/gen/sleep.c8
-rw-r--r--lib/libc/gen/stringlist.c2
-rw-r--r--lib/libc/gen/swapcontext.c (renamed from lib/libc/sys/swapcontext.c)28
-rw-r--r--lib/libc/gen/syslog.c37
-rw-r--r--lib/libc/gen/telldir.c37
-rw-r--r--lib/libc/gen/telldir.h1
-rw-r--r--lib/libc/gen/termios.c18
-rw-r--r--lib/libc/gen/tls.c5
-rw-r--r--lib/libc/gen/ttyname.c4
-rw-r--r--lib/libc/gen/ulimit.c12
-rw-r--r--lib/libc/gen/usleep.c5
-rw-r--r--lib/libc/gen/wait.c6
-rw-r--r--lib/libc/gen/wait3.c13
-rw-r--r--lib/libc/gen/waitid.c5
-rw-r--r--lib/libc/gen/waitpid.c6
-rw-r--r--lib/libc/gen/wordexp.c5
-rw-r--r--lib/libc/i386/sys/Makefile.inc3
-rw-r--r--lib/libc/iconv/__iconv.c2
-rw-r--r--lib/libc/iconv/bsd_iconv.c4
-rw-r--r--lib/libc/iconv/citrus_iconv.c8
-rw-r--r--lib/libc/iconv/citrus_iconv.h2
-rw-r--r--lib/libc/iconv/citrus_iconv_local.h4
-rw-r--r--lib/libc/iconv/citrus_none.c4
-rw-r--r--lib/libc/iconv/citrus_prop.c4
-rw-r--r--lib/libc/iconv/citrus_stdenc.h2
-rw-r--r--lib/libc/iconv/citrus_stdenc_local.h8
-rw-r--r--lib/libc/iconv/citrus_stdenc_template.h4
-rw-r--r--lib/libc/iconv/iconv-internal.h4
-rw-r--r--lib/libc/iconv/iconv.34
-rw-r--r--lib/libc/iconv/iconv.c2
-rw-r--r--lib/libc/iconv/iconv_compat.c4
-rw-r--r--lib/libc/iconv/iconvlist.34
-rw-r--r--lib/libc/include/compat.h9
-rw-r--r--lib/libc/include/libc_private.h163
-rw-r--r--lib/libc/locale/cXXrtomb_iconv.h3
-rw-r--r--lib/libc/locale/digittoint.32
-rw-r--r--lib/libc/locale/duplocale.32
-rw-r--r--lib/libc/locale/freelocale.32
-rw-r--r--lib/libc/locale/mbrtocXX_iconv.h3
-rw-r--r--lib/libc/locale/newlocale.32
-rw-r--r--lib/libc/locale/none.c2
-rw-r--r--lib/libc/locale/querylocale.32
-rw-r--r--lib/libc/locale/uselocale.32
-rw-r--r--lib/libc/locale/xlocale.32
-rw-r--r--lib/libc/mips/gen/Makefile.inc5
-rw-r--r--lib/libc/mips/gen/_setjmp.S83
-rw-r--r--lib/libc/mips/gen/getcontextx.c (renamed from lib/csu/aarch64/crtn.S)64
-rw-r--r--lib/libc/mips/gen/setjmp.S74
-rw-r--r--lib/libc/mips/gen/sigsetjmp.S2
-rw-r--r--lib/libc/mips/sys/Makefile.inc8
-rw-r--r--lib/libc/mips/sys/__vdso_gettc.c (renamed from lib/libc/aarch64/gen/flt_rounds.c)27
-rw-r--r--lib/libc/net/Symbol.map1
-rw-r--r--lib/libc/net/base64.c27
-rw-r--r--lib/libc/net/eui64.c1
-rw-r--r--lib/libc/net/getaddrinfo.34
-rw-r--r--lib/libc/net/getaddrinfo.c1
-rw-r--r--lib/libc/net/getifaddrs.322
-rw-r--r--lib/libc/net/ip6opt.c2
-rw-r--r--lib/libc/net/name6.c1
-rw-r--r--lib/libc/net/nsdispatch.c25
-rw-r--r--lib/libc/net/recv.c6
-rw-r--r--lib/libc/net/sctp_recvmsg.310
-rw-r--r--lib/libc/net/sctp_send.32
-rw-r--r--lib/libc/net/sctp_sys_calls.c10
-rw-r--r--lib/libc/net/send.c6
-rw-r--r--lib/libc/nls/catopen.32
-rw-r--r--lib/libc/nls/msgcat.c1
-rw-r--r--lib/libc/posix1e/acl_calc_mask.c1
-rw-r--r--lib/libc/posix1e/acl_set_flagset_np.32
-rw-r--r--lib/libc/posix1e/acl_size.c (renamed from lib/libc/aarch64/gen/_set_tp.c)21
-rw-r--r--lib/libc/posix1e/acl_strip.c14
-rw-r--r--lib/libc/powerpc/Makefile.inc2
-rw-r--r--lib/libc/powerpc/gen/Makefile.inc6
-rw-r--r--lib/libc/powerpc/gen/_set_tp.c3
-rw-r--r--lib/libc/powerpc/gen/_setjmp.S42
-rw-r--r--lib/libc/powerpc/gen/getcontextx.c (renamed from lib/csu/aarch64/crti.S)72
-rw-r--r--lib/libc/powerpc/gen/setjmp.S42
-rw-r--r--lib/libc/powerpc/gen/sigsetjmp.S42
-rw-r--r--lib/libc/powerpc/sys/Makefile.inc3
-rw-r--r--lib/libc/powerpc/sys/__vdso_gettc.c (renamed from lib/libc/aarch64/sys/sigreturn.S)29
-rw-r--r--lib/libc/powerpc64/Makefile.inc2
-rw-r--r--lib/libc/powerpc64/gen/Makefile.inc5
-rw-r--r--lib/libc/powerpc64/gen/_set_tp.c3
-rw-r--r--lib/libc/powerpc64/gen/_setjmp.S36
-rw-r--r--lib/libc/powerpc64/gen/getcontextx.c76
-rw-r--r--lib/libc/powerpc64/gen/setjmp.S38
-rw-r--r--lib/libc/powerpc64/gen/sigsetjmp.S36
-rw-r--r--lib/libc/powerpc64/sys/Makefile.inc3
-rw-r--r--lib/libc/powerpc64/sys/__vdso_gettc.c48
-rw-r--r--lib/libc/regex/engine.c4
-rw-r--r--lib/libc/regex/re_format.710
-rw-r--r--lib/libc/regex/regcomp.c29
-rw-r--r--lib/libc/regex/regex.36
-rw-r--r--lib/libc/rpc/clnt_dg.c3
-rw-r--r--lib/libc/rpc/crypt_client.c1
-rw-r--r--lib/libc/rpc/rpc.32
-rw-r--r--lib/libc/rpc/rpc_soc.c2
-rw-r--r--lib/libc/rpc/rpc_svc_reg.32
-rw-r--r--lib/libc/rpc/rpcbind.32
-rw-r--r--lib/libc/rpc/svc_vc.c2
-rw-r--r--lib/libc/sparc64/Makefile.inc2
-rw-r--r--lib/libc/sparc64/gen/Makefile.inc5
-rw-r--r--lib/libc/sparc64/gen/getcontextx.c76
-rw-r--r--lib/libc/sparc64/sys/Makefile.inc5
-rw-r--r--lib/libc/sparc64/sys/__vdso_gettc.c48
-rw-r--r--lib/libc/sparc64/sys/sigaction.S (renamed from lib/libc/sparc64/sys/sigaction1.S)5
-rw-r--r--lib/libc/stdio/fflush.c10
-rw-r--r--lib/libc/stdio/flags.c4
-rw-r--r--lib/libc/stdio/open_memstream.32
-rw-r--r--lib/libc/stdio/open_memstream.c2
-rw-r--r--lib/libc/stdio/open_wmemstream.c2
-rw-r--r--lib/libc/stdio/xprintf_float.c3
-rw-r--r--lib/libc/stdlib/Makefile.inc5
-rw-r--r--lib/libc/stdlib/Symbol.map2
-rw-r--r--lib/libc/stdlib/atexit.34
-rw-r--r--lib/libc/stdlib/exit.32
-rw-r--r--lib/libc/stdlib/jemalloc/Symbol.map1
-rw-r--r--lib/libc/stdlib/qsort.c53
-rw-r--r--lib/libc/stdlib/quick_exit.34
-rw-r--r--lib/libc/stdlib/random.35
-rw-r--r--lib/libc/stdlib/reallocarray.3142
-rw-r--r--lib/libc/stdlib/reallocarray.c42
-rw-r--r--lib/libc/stdlib/system.c15
-rw-r--r--lib/libc/stdlib/tdelete.c9
-rw-r--r--lib/libc/string/strlcat.c48
-rw-r--r--lib/libc/string/strlcpy.c37
-rw-r--r--lib/libc/string/strspn.32
-rw-r--r--lib/libc/sys/Makefile.inc67
-rw-r--r--lib/libc/sys/Symbol.map9
-rw-r--r--lib/libc/sys/__error.c25
-rw-r--r--lib/libc/sys/accept.c50
-rw-r--r--lib/libc/sys/accept4.c50
-rw-r--r--lib/libc/sys/access.22
-rw-r--r--lib/libc/sys/aio_suspend.c51
-rw-r--r--lib/libc/sys/cap_ioctls_limit.26
-rw-r--r--lib/libc/sys/close.c48
-rw-r--r--lib/libc/sys/closefrom.22
-rw-r--r--lib/libc/sys/connect.c50
-rw-r--r--lib/libc/sys/cpuset.23
-rw-r--r--lib/libc/sys/fcntl.c53
-rw-r--r--lib/libc/sys/fork.27
-rw-r--r--lib/libc/sys/fork.c48
-rw-r--r--lib/libc/sys/fsync.c47
-rw-r--r--lib/libc/sys/ftruncate.c55
-rw-r--r--lib/libc/sys/futimens.c97
-rw-r--r--lib/libc/sys/getdirentries.25
-rw-r--r--lib/libc/sys/getrlimit.22
-rw-r--r--lib/libc/sys/interposing_table.c89
-rw-r--r--lib/libc/sys/kevent.c53
-rw-r--r--lib/libc/sys/kqueue.2173
-rw-r--r--lib/libc/sys/lseek.c56
-rw-r--r--lib/libc/sys/mmap.220
-rw-r--r--lib/libc/sys/mmap.c56
-rw-r--r--lib/libc/sys/mount.29
-rw-r--r--lib/libc/sys/msync.c49
-rw-r--r--lib/libc/sys/nanosleep.c49
-rw-r--r--lib/libc/sys/open.26
-rw-r--r--lib/libc/sys/open.c59
-rw-r--r--lib/libc/sys/openat.c62
-rw-r--r--lib/libc/sys/poll.217
-rw-r--r--lib/libc/sys/poll.c49
-rw-r--r--lib/libc/sys/posix_openpt.24
-rw-r--r--lib/libc/sys/ppoll.c51
-rw-r--r--lib/libc/sys/pread.c57
-rw-r--r--lib/libc/sys/procctl.2304
-rw-r--r--lib/libc/sys/pselect.c51
-rw-r--r--lib/libc/sys/pwrite.c56
-rw-r--r--lib/libc/sys/read.c50
-rw-r--r--lib/libc/sys/readv.c50
-rw-r--r--lib/libc/sys/recvfrom.c53
-rw-r--r--lib/libc/sys/recvmsg.c50
-rw-r--r--lib/libc/sys/revoke.24
-rw-r--r--lib/libc/sys/sched_setscheduler.22
-rw-r--r--lib/libc/sys/select.c49
-rw-r--r--lib/libc/sys/sendmsg.c50
-rw-r--r--lib/libc/sys/sendto.c53
-rw-r--r--lib/libc/sys/setcontext.c52
-rw-r--r--lib/libc/sys/setresuid.27
-rw-r--r--lib/libc/sys/sigaction.c49
-rw-r--r--lib/libc/sys/sigprocmask.c49
-rw-r--r--lib/libc/sys/sigsuspend.c49
-rw-r--r--lib/libc/sys/sigtimedwait.c51
-rw-r--r--lib/libc/sys/sigwait.c14
-rw-r--r--lib/libc/sys/sigwaitinfo.22
-rw-r--r--lib/libc/sys/sigwaitinfo.c49
-rw-r--r--lib/libc/sys/socketpair.28
-rw-r--r--lib/libc/sys/truncate.226
-rw-r--r--lib/libc/sys/truncate.c55
-rw-r--r--lib/libc/sys/utimensat.2292
-rw-r--r--lib/libc/sys/utimensat.c109
-rw-r--r--lib/libc/sys/vfork.26
-rw-r--r--lib/libc/sys/wait4.c49
-rw-r--r--lib/libc/sys/wait6.c52
-rw-r--r--lib/libc/sys/write.c50
-rw-r--r--lib/libc/sys/writev.c50
-rw-r--r--lib/libc/tests/c063/Makefile33
-rw-r--r--lib/libc/tests/db/Makefile1
-rw-r--r--lib/libc/tests/hash/Makefile8
-rw-r--r--lib/libc/tests/ssp/Makefile4
-rw-r--r--lib/libc/tests/sys/Makefile2
-rw-r--r--lib/libc/xdr/xdr_float.c3
-rw-r--r--lib/libc_nonshared/Makefile.depend14
-rw-r--r--lib/libcalendar/Makefile.depend19
-rw-r--r--lib/libcam/Makefile3
-rw-r--r--lib/libcam/Makefile.depend21
-rw-r--r--lib/libcapsicum/Makefile3
-rw-r--r--lib/libcapsicum/Makefile.depend21
-rw-r--r--lib/libcapsicum/libcapsicum.318
-rw-r--r--lib/libcapsicum/libcapsicum.c14
-rw-r--r--lib/libcapsicum/libcapsicum.h4
-rw-r--r--lib/libcapsicum/libcapsicum_dns.c44
-rw-r--r--lib/libcapsicum/libcapsicum_grp.c35
-rw-r--r--lib/libcapsicum/libcapsicum_pwd.c22
-rw-r--r--lib/libcapsicum/libcapsicum_random.c2
-rw-r--r--lib/libcapsicum/libcapsicum_service.c2
-rw-r--r--lib/libcapsicum/libcapsicum_sysctl.c2
-rw-r--r--lib/libcasper/Makefile3
-rw-r--r--lib/libcasper/libcasper.c4
-rw-r--r--lib/libclang_rt/Makefile18
-rw-r--r--lib/libclang_rt/Makefile.inc26
-rw-r--r--lib/libclang_rt/asan/Makefile80
-rw-r--r--lib/libclang_rt/asan_cxx/Makefile11
-rw-r--r--lib/libclang_rt/profile/Makefile17
-rw-r--r--lib/libclang_rt/san/Makefile49
-rw-r--r--lib/libclang_rt/ubsan/Makefile17
-rw-r--r--lib/libclang_rt/ubsan_cxx/Makefile14
-rw-r--r--lib/libcom_err/Makefile2
-rw-r--r--lib/libcom_err/Makefile.depend20
-rw-r--r--lib/libcom_err/doc/Makefile7
-rw-r--r--lib/libcom_err/doc/com_err.texinfo615
-rw-r--r--lib/libcompat/4.3/rexec.c8
-rw-r--r--lib/libcompat/Makefile.depend14
-rw-r--r--lib/libcompiler_rt/Makefile48
-rw-r--r--lib/libcompiler_rt/Makefile.depend13
-rw-r--r--lib/libcrypt/Makefile.depend21
-rw-r--r--lib/libcrypt/tests/Makefile3
-rw-r--r--lib/libcrypt/tests/Makefile.depend19
-rw-r--r--lib/libcrypt/tests/crypt_tests.c3
-rw-r--r--lib/libcuse/Makefile4
-rw-r--r--lib/libcuse/Makefile.depend21
-rw-r--r--lib/libcxxrt/Makefile.depend20
-rw-r--r--lib/libdevctl/Makefile8
-rw-r--r--lib/libdevctl/devctl.3295
-rw-r--r--lib/libdevctl/devctl.c124
-rw-r--r--lib/libdevinfo/Makefile.depend20
-rw-r--r--lib/libdevinfo/devinfo.h2
-rw-r--r--lib/libdevstat/Makefile3
-rw-r--r--lib/libdevstat/Makefile.depend21
-rw-r--r--lib/libdevstat/devstat.c24
-rw-r--r--lib/libdpv/Makefile3
-rw-r--r--lib/libdpv/dpv.36
-rw-r--r--lib/libdwarf/Makefile16
-rw-r--r--lib/libdwarf/Makefile.depend54
-rw-r--r--lib/libedit/Makefile18
-rw-r--r--lib/libedit/Makefile.depend61
-rw-r--r--lib/libedit/TEST/rl1.c53
-rw-r--r--lib/libedit/TEST/tc1.c23
-rw-r--r--lib/libedit/TEST/wtc1.c281
-rw-r--r--lib/libedit/chared.c308
-rw-r--r--lib/libedit/chared.h53
-rw-r--r--lib/libedit/chartype.c360
-rw-r--r--lib/libedit/chartype.h27
-rw-r--r--lib/libedit/common.c280
-rw-r--r--lib/libedit/config.h290
-rw-r--r--lib/libedit/edit/readline/Makefile.depend12
-rw-r--r--lib/libedit/edit/readline/readline.h7
-rw-r--r--lib/libedit/editline.3162
-rw-r--r--lib/libedit/editrc.576
-rw-r--r--lib/libedit/el.c258
-rw-r--r--lib/libedit/el.h45
-rw-r--r--lib/libedit/eln.c401
-rw-r--r--lib/libedit/emacs.c158
-rw-r--r--lib/libedit/filecomplete.c305
-rw-r--r--lib/libedit/filecomplete.h9
-rw-r--r--lib/libedit/hist.c85
-rw-r--r--lib/libedit/hist.h30
-rw-r--r--lib/libedit/histedit.h150
-rw-r--r--lib/libedit/history.c459
-rw-r--r--lib/libedit/key.c (renamed from lib/libedit/keymacro.c)419
-rw-r--r--lib/libedit/key.h (renamed from lib/libedit/keymacro.h)60
-rw-r--r--lib/libedit/makelist34
-rw-r--r--lib/libedit/map.c226
-rw-r--r--lib/libedit/map.h19
-rw-r--r--lib/libedit/parse.c137
-rw-r--r--lib/libedit/parse.h11
-rw-r--r--lib/libedit/prompt.c59
-rw-r--r--lib/libedit/prompt.h13
-rw-r--r--lib/libedit/read.c235
-rw-r--r--lib/libedit/read.h5
-rw-r--r--lib/libedit/readline.c625
-rw-r--r--lib/libedit/refresh.c365
-rw-r--r--lib/libedit/refresh.h5
-rw-r--r--lib/libedit/search.c166
-rw-r--r--lib/libedit/search.h15
-rw-r--r--lib/libedit/sig.c14
-rw-r--r--lib/libedit/sig.h3
-rw-r--r--lib/libedit/sys.h99
-rw-r--r--lib/libedit/term.c (renamed from lib/libedit/terminal.c)1022
-rw-r--r--lib/libedit/term.h (renamed from lib/libedit/terminal.h)73
-rw-r--r--lib/libedit/tokenizer.c153
-rw-r--r--lib/libedit/tty.c379
-rw-r--r--lib/libedit/tty.h11
-rw-r--r--lib/libedit/vi.c349
-rw-r--r--lib/libelf/Makefile.depend29
-rw-r--r--lib/libelftc/Makefile30
-rw-r--r--lib/libelftc/elftc_version.c10
-rw-r--r--lib/libevent/Makefile1
-rw-r--r--lib/libevent/Makefile.depend14
-rw-r--r--lib/libexecinfo/Makefile3
-rw-r--r--lib/libexecinfo/Makefile.depend21
-rw-r--r--lib/libexpat/Makefile2
-rw-r--r--lib/libexpat/Makefile.depend20
-rw-r--r--lib/libfetch/Makefile6
-rw-r--r--lib/libfetch/Makefile.depend29
-rw-r--r--lib/libfetch/common.c4
-rw-r--r--lib/libfetch/fetch.38
-rw-r--r--lib/libgeom/Makefile3
-rw-r--r--lib/libgeom/Makefile.depend22
-rw-r--r--lib/libgeom/geom_xml2tree.c16
-rw-r--r--lib/libgpib/Makefile.depend19
-rw-r--r--lib/libgpio/Makefile36
-rw-r--r--lib/libgpio/gpio.3198
-rw-r--r--lib/libgpio/gpio.c278
-rw-r--r--lib/libgpio/libgpio.h110
-rw-r--r--lib/libgssapi/Makefile.depend22
-rw-r--r--lib/libgssapi/gss_acquire_cred.34
-rw-r--r--lib/libgssapi/gss_add_cred.34
-rw-r--r--lib/libgssapi/gss_add_oid_set_member.34
-rw-r--r--lib/libgssapi/gss_create_empty_oid_set.34
-rw-r--r--lib/libgssapi/gss_delete_sec_context.34
-rw-r--r--lib/libgssapi/gss_get_mic.34
-rw-r--r--lib/libgssapi/gss_import_sec_context.34
-rw-r--r--lib/libgssapi/gss_inquire_context.38
-rw-r--r--lib/libgssapi/gss_process_context_token.34
-rw-r--r--lib/libgssapi/gss_test_oid_set_member.32
-rw-r--r--lib/libgssapi/gss_unwrap.34
-rw-r--r--lib/libgssapi/gss_wrap.34
-rw-r--r--lib/libiconv/Makefile25
-rw-r--r--lib/libiconv_modules/BIG5/Makefile.depend20
-rw-r--r--lib/libiconv_modules/BIG5/citrus_big5.c4
-rw-r--r--lib/libiconv_modules/DECHanyu/Makefile.depend20
-rw-r--r--lib/libiconv_modules/DECHanyu/citrus_dechanyu.c4
-rw-r--r--lib/libiconv_modules/EUC/Makefile.depend20
-rw-r--r--lib/libiconv_modules/EUC/citrus_euc.c4
-rw-r--r--lib/libiconv_modules/EUCTW/Makefile.depend20
-rw-r--r--lib/libiconv_modules/EUCTW/citrus_euctw.c4
-rw-r--r--lib/libiconv_modules/GBK2K/Makefile.depend20
-rw-r--r--lib/libiconv_modules/GBK2K/citrus_gbk2k.c4
-rw-r--r--lib/libiconv_modules/HZ/Makefile.depend20
-rw-r--r--lib/libiconv_modules/HZ/citrus_hz.c4
-rw-r--r--lib/libiconv_modules/ISO2022/Makefile.depend20
-rw-r--r--lib/libiconv_modules/ISO2022/citrus_iso2022.c6
-rw-r--r--lib/libiconv_modules/JOHAB/Makefile.depend20
-rw-r--r--lib/libiconv_modules/JOHAB/citrus_johab.c4
-rw-r--r--lib/libiconv_modules/MSKanji/Makefile.depend20
-rw-r--r--lib/libiconv_modules/MSKanji/citrus_mskanji.c4
-rw-r--r--lib/libiconv_modules/UES/Makefile.depend20
-rw-r--r--lib/libiconv_modules/UES/citrus_ues.c4
-rw-r--r--lib/libiconv_modules/UTF1632/Makefile.depend20
-rw-r--r--lib/libiconv_modules/UTF1632/citrus_utf1632.c4
-rw-r--r--lib/libiconv_modules/UTF7/Makefile.depend20
-rw-r--r--lib/libiconv_modules/UTF7/citrus_utf7.c6
-rw-r--r--lib/libiconv_modules/UTF8/Makefile.depend20
-rw-r--r--lib/libiconv_modules/UTF8/citrus_utf8.c4
-rw-r--r--lib/libiconv_modules/VIQR/Makefile.depend20
-rw-r--r--lib/libiconv_modules/VIQR/citrus_viqr.c4
-rw-r--r--lib/libiconv_modules/ZW/Makefile.depend20
-rw-r--r--lib/libiconv_modules/ZW/citrus_zw.c4
-rw-r--r--lib/libiconv_modules/iconv_none/Makefile.depend20
-rw-r--r--lib/libiconv_modules/iconv_none/citrus_iconv_none.c2
-rw-r--r--lib/libiconv_modules/iconv_std/Makefile.depend20
-rw-r--r--lib/libiconv_modules/iconv_std/citrus_iconv_std.c6
-rw-r--r--lib/libiconv_modules/mapper_646/Makefile.depend20
-rw-r--r--lib/libiconv_modules/mapper_none/Makefile.depend20
-rw-r--r--lib/libiconv_modules/mapper_parallel/Makefile.depend20
-rw-r--r--lib/libiconv_modules/mapper_serial/Makefile.depend20
-rw-r--r--lib/libiconv_modules/mapper_std/Makefile.depend20
-rw-r--r--lib/libiconv_modules/mapper_zone/Makefile.depend20
-rw-r--r--lib/libipsec/Makefile.depend30
-rw-r--r--lib/libjail/Makefile.depend21
-rw-r--r--lib/libjail/jail.c4
-rw-r--r--lib/libjail/jail_getid.c10
-rw-r--r--lib/libkiconv/Makefile.depend20
-rw-r--r--lib/libkiconv/xlat16_iconv.c19
-rw-r--r--lib/libkvm/Makefile.depend20
-rw-r--r--lib/libldns/Makefile3
-rw-r--r--lib/libldns/Makefile.depend23
-rw-r--r--lib/liblzma/Makefile42
-rw-r--r--lib/liblzma/Makefile.depend21
-rw-r--r--lib/liblzma/Symbol.map20
-rw-r--r--lib/liblzma/Versions.def4
-rw-r--r--lib/liblzma/config.h429
-rw-r--r--lib/libmagic/Makefile3
-rw-r--r--lib/libmagic/Makefile.depend22
-rw-r--r--lib/libmagic/config.h37
-rw-r--r--lib/libmandoc/Makefile20
-rw-r--r--lib/libmandoc/Makefile.depend14
-rw-r--r--lib/libmd/Makefile8
-rw-r--r--lib/libmd/Makefile.depend42
-rw-r--r--lib/libmd/md4.h28
-rw-r--r--lib/libmd/md4c.c15
-rw-r--r--lib/libmd/md5.h37
-rw-r--r--lib/libmd/md5c.c19
-rw-r--r--lib/libmd/mdXhl.c17
-rw-r--r--lib/libmd/ripemd.h35
-rw-r--r--lib/libmd/rmd160c.c19
-rw-r--r--lib/libmd/sha.h68
-rw-r--r--lib/libmd/sha1c.c30
-rw-r--r--lib/libmd/sha256.h32
-rw-r--r--lib/libmd/sha256c.c15
-rw-r--r--lib/libmd/sha512.h32
-rw-r--r--lib/libmd/sha512c.c15
-rw-r--r--lib/libmd/shadriver.c3
-rw-r--r--lib/libmemstat/Makefile3
-rw-r--r--lib/libmemstat/Makefile.depend21
-rw-r--r--lib/libmilter/Makefile.depend58
-rw-r--r--lib/libmp/Makefile3
-rw-r--r--lib/libmp/Makefile.depend22
-rw-r--r--lib/libmp/tests/Makefile3
-rw-r--r--lib/libmt/Makefile12
-rw-r--r--lib/libmt/mt.3454
-rw-r--r--lib/libmt/mtlib.c773
-rw-r--r--lib/libmt/mtlib.h122
-rw-r--r--lib/libnetbsd/Makefile.depend15
-rw-r--r--lib/libnetgraph/Makefile.depend20
-rw-r--r--lib/libnetgraph/debug.c29
-rw-r--r--lib/libngatm/Makefile.depend21
-rw-r--r--lib/libnv/Makefile184
-rw-r--r--lib/libnv/Makefile.depend20
-rw-r--r--lib/libnv/dnv.h106
-rw-r--r--lib/libnv/dnvlist.c252
-rw-r--r--lib/libnv/nv.397
-rw-r--r--lib/libnv/nv.h275
-rw-r--r--lib/libnv/nv_impl.h134
-rw-r--r--lib/libnv/nvlist.c1848
-rw-r--r--lib/libnv/nvlist_impl.h (renamed from lib/libdevctl/devctl.h)33
-rw-r--r--lib/libnv/nvpair.c1282
-rw-r--r--lib/libnv/nvpair_impl.h92
-rw-r--r--lib/libnv/tests/Makefile9
-rw-r--r--lib/libnv/tests/dnv_tests.cc567
-rw-r--r--lib/libnv/tests/nv_tests.cc1275
-rw-r--r--lib/libnv/tests/nvlist_send_recv_test.c23
-rw-r--r--lib/libohash/Makefile.depend14
-rw-r--r--lib/libopie/Makefile3
-rw-r--r--lib/libopie/Makefile.depend22
-rw-r--r--lib/libpam/Makefile2
-rw-r--r--lib/libpam/libpam/Makefile25
-rw-r--r--lib/libpam/libpam/Makefile.depend20
-rw-r--r--lib/libpam/libpam/tests/Makefile3
-rw-r--r--lib/libpam/modules/Makefile.inc3
-rw-r--r--lib/libpam/modules/modules.inc2
-rw-r--r--lib/libpam/modules/pam_chroot/Makefile.depend20
-rw-r--r--lib/libpam/modules/pam_deny/Makefile.depend19
-rw-r--r--lib/libpam/modules/pam_echo/Makefile.depend20
-rw-r--r--lib/libpam/modules/pam_exec/Makefile.depend20
-rw-r--r--lib/libpam/modules/pam_ftpusers/Makefile.depend20
-rw-r--r--lib/libpam/modules/pam_group/Makefile.depend20
-rw-r--r--lib/libpam/modules/pam_guest/Makefile.depend20
-rw-r--r--lib/libpam/modules/pam_guest/pam_guest.82
-rw-r--r--lib/libpam/modules/pam_krb5/Makefile3
-rw-r--r--lib/libpam/modules/pam_krb5/Makefile.depend28
-rw-r--r--lib/libpam/modules/pam_ksu/Makefile3
-rw-r--r--lib/libpam/modules/pam_ksu/Makefile.depend28
-rw-r--r--lib/libpam/modules/pam_lastlog/Makefile.depend20
-rw-r--r--lib/libpam/modules/pam_login_access/Makefile.depend20
-rw-r--r--lib/libpam/modules/pam_nologin/Makefile3
-rw-r--r--lib/libpam/modules/pam_nologin/Makefile.depend22
-rw-r--r--lib/libpam/modules/pam_opie/Makefile3
-rw-r--r--lib/libpam/modules/pam_opie/Makefile.depend22
-rw-r--r--lib/libpam/modules/pam_opieaccess/Makefile3
-rw-r--r--lib/libpam/modules/pam_opieaccess/Makefile.depend21
-rw-r--r--lib/libpam/modules/pam_passwdqc/Makefile3
-rw-r--r--lib/libpam/modules/pam_passwdqc/Makefile.depend22
-rw-r--r--lib/libpam/modules/pam_permit/Makefile.depend19
-rw-r--r--lib/libpam/modules/pam_radius/Makefile3
-rw-r--r--lib/libpam/modules/pam_radius/Makefile.depend22
-rw-r--r--lib/libpam/modules/pam_radius/pam_radius.c30
-rw-r--r--lib/libpam/modules/pam_rhosts/Makefile.depend20
-rw-r--r--lib/libpam/modules/pam_rootok/Makefile.depend19
-rw-r--r--lib/libpam/modules/pam_securetty/Makefile.depend20
-rw-r--r--lib/libpam/modules/pam_self/Makefile.depend19
-rw-r--r--lib/libpam/modules/pam_ssh/Makefile4
-rw-r--r--lib/libpam/modules/pam_ssh/Makefile.depend26
-rw-r--r--lib/libpam/modules/pam_tacplus/Makefile3
-rw-r--r--lib/libpam/modules/pam_tacplus/Makefile.depend22
-rw-r--r--lib/libpam/modules/pam_unix/Makefile6
-rw-r--r--lib/libpam/modules/pam_unix/Makefile.depend25
-rw-r--r--lib/libpam/static_modules/Makefile72
-rw-r--r--lib/libpam/static_modules/Makefile.depend41
-rw-r--r--lib/libpcap/Makefile3
-rw-r--r--lib/libpcap/Makefile.depend36
-rw-r--r--lib/libpcap/config.h24
-rw-r--r--lib/libpjdlog/Makefile3
-rw-r--r--lib/libpmc/Makefile.depend20
-rw-r--r--lib/libpmc/libpmc.c206
-rw-r--r--lib/libpmc/pmc.31
-rw-r--r--lib/libpmc/pmc.corei7.38
-rw-r--r--lib/libpmc/pmc.corei7uc.38
-rw-r--r--lib/libpmc/pmc.haswell.3153
-rw-r--r--lib/libpmc/pmc.haswellxeon.3956
-rw-r--r--lib/libpmc/pmc.ivybridge.3141
-rw-r--r--lib/libpmc/pmc.ivybridgexeon.3141
-rw-r--r--lib/libpmc/pmc.sandybridge.3100
-rw-r--r--lib/libpmc/pmc.sandybridgexeon.3112
-rw-r--r--lib/libpmc/pmc.soft.38
-rw-r--r--lib/libpmc/pmc.ucf.38
-rw-r--r--lib/libpmc/pmc.westmere.38
-rw-r--r--lib/libpmc/pmc.westmereuc.38
-rw-r--r--lib/libpmc/pmc.xscale.32
-rw-r--r--lib/libpmc/pmc_capabilities.32
-rw-r--r--lib/libproc/Makefile13
-rw-r--r--lib/libproc/Makefile.depend23
-rw-r--r--lib/libproc/proc_bkpt.c3
-rw-r--r--lib/libproc/proc_regs.c8
-rw-r--r--lib/libproc/proc_sym.c42
-rw-r--r--lib/libproc/tests/proc_test.c40
-rw-r--r--lib/libprocstat/Makefile33
-rw-r--r--lib/libprocstat/Makefile.depend25
-rw-r--r--lib/libprocstat/libprocstat.353
-rw-r--r--lib/libprocstat/udf.c1
-rw-r--r--lib/libprocstat/zfs/Makefile.depend16
-rw-r--r--lib/libradius/Makefile10
-rw-r--r--lib/libradius/Makefile.depend22
-rw-r--r--lib/librpcsec_gss/Makefile3
-rw-r--r--lib/librpcsec_gss/Makefile.depend22
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_error.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_mech_info.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_mechanisms.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_principal_name.34
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_versions.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_getcred.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_is_installed.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_max_data_length.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_mech_to_oid.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_oid_to_mech.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_qop_to_num.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_seccreate.36
-rw-r--r--lib/librpcsec_gss/rpc_gss_set_callback.34
-rw-r--r--lib/librpcsec_gss/rpc_gss_set_defaults.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_set_svc_name.34
-rw-r--r--lib/librpcsec_gss/rpc_gss_svc_max_data_length.32
-rw-r--r--lib/librpcsec_gss/rpcsec_gss.38
-rw-r--r--lib/librpcsvc/Makefile.depend64
-rw-r--r--lib/librt/Makefile7
-rw-r--r--lib/librt/Makefile.amd646
-rw-r--r--lib/librt/Makefile.depend21
-rw-r--r--lib/librt/Makefile.i3866
-rw-r--r--lib/librt/tests/Makefile3
-rw-r--r--lib/librtld_db/Makefile.depend23
-rw-r--r--lib/librtld_db/librtld_db.34
-rw-r--r--lib/libsbuf/Makefile.depend21
-rw-r--r--lib/libsdp/Makefile.depend22
-rw-r--r--lib/libsdp/search.c1
-rw-r--r--lib/libsdp/service.c1
-rw-r--r--lib/libsdp/session.c5
-rw-r--r--lib/libsdp/util.c1
-rw-r--r--lib/libsm/Makefile.depend155
-rw-r--r--lib/libsmb/Makefile3
-rw-r--r--lib/libsmb/Makefile.depend22
-rw-r--r--lib/libsmdb/Makefile.depend23
-rw-r--r--lib/libsmutil/Makefile.depend28
-rw-r--r--lib/libsqlite3/Makefile39
-rw-r--r--lib/libstand/Makefile45
-rw-r--r--lib/libstand/Makefile.depend58
-rw-r--r--lib/libstand/cd9660.c15
-rw-r--r--lib/libstand/dosfs.c3
-rw-r--r--lib/libstand/ext2fs.c12
-rw-r--r--lib/libstand/libstand.32
-rw-r--r--lib/libstand/nandfs.c2
-rw-r--r--lib/libstand/nfs.c4
-rw-r--r--lib/libstand/powerpc/_setjmp.S4
-rw-r--r--lib/libstand/powerpc/syncicache.c103
-rw-r--r--lib/libstand/printf.c4
-rw-r--r--lib/libstand/read.c2
-rw-r--r--lib/libstand/stand.h3
-rw-r--r--lib/libstand/tftp.c4
-rw-r--r--lib/libstand/twiddle.c21
-rw-r--r--lib/libstand/ufs.c14
-rw-r--r--lib/libstand/write.c2
-rw-r--r--lib/libstdbuf/Makefile.depend20
-rw-r--r--lib/libstdthreads/Makefile3
-rw-r--r--lib/libstdthreads/Makefile.depend22
-rw-r--r--lib/libstdthreads/mtx.c2
-rw-r--r--lib/libstdthreads/thrd.c3
-rw-r--r--lib/libtacplus/Makefile3
-rw-r--r--lib/libtacplus/Makefile.depend22
-rw-r--r--lib/libtelnet/Makefile3
-rw-r--r--lib/libtelnet/Makefile.depend19
-rw-r--r--lib/libthr/Makefile9
-rw-r--r--lib/libthr/Makefile.amd646
-rw-r--r--lib/libthr/Makefile.depend20
-rw-r--r--lib/libthr/Makefile.i3866
-rw-r--r--lib/libthr/arch/aarch64/Makefile.inc2
-rw-r--r--lib/libthr/arch/aarch64/include/pthread_md.h84
-rw-r--r--lib/libthr/arch/amd64/Makefile.inc2
-rw-r--r--lib/libthr/arch/amd64/amd64/pthread_md.c55
-rw-r--r--lib/libthr/arch/amd64/include/pthread_md.h3
-rw-r--r--lib/libthr/arch/arm/Makefile.inc3
-rw-r--r--lib/libthr/arch/arm/arm/pthread_md.c53
-rw-r--r--lib/libthr/arch/arm/include/pthread_md.h6
-rw-r--r--lib/libthr/arch/i386/Makefile.inc2
-rw-r--r--lib/libthr/arch/i386/i386/pthread_md.c57
-rw-r--r--lib/libthr/arch/i386/include/pthread_md.h6
-rw-r--r--lib/libthr/arch/mips/Makefile.inc3
-rw-r--r--lib/libthr/arch/mips/include/pthread_md.h6
-rw-r--r--lib/libthr/arch/mips/mips/pthread_md.c (renamed from lib/libkvm/kvm_aarch64.c)51
-rw-r--r--lib/libthr/arch/powerpc/Makefile.inc3
-rw-r--r--lib/libthr/arch/powerpc/include/pthread_md.h17
-rw-r--r--lib/libthr/arch/powerpc/powerpc/pthread_md.c54
-rw-r--r--lib/libthr/arch/sparc64/Makefile.inc2
-rw-r--r--lib/libthr/arch/sparc64/include/pthread_md.h6
-rw-r--r--lib/libthr/arch/sparc64/sparc64/pthread_md.c (renamed from lib/libthr/thread/thr_ctrdtr.c)2
-rw-r--r--lib/libthr/libthr.342
-rw-r--r--lib/libthr/pthread.map96
-rw-r--r--lib/libthr/sys/thr_error.c3
-rw-r--r--lib/libthr/tests/Makefile2
-rw-r--r--lib/libthr/thread/Makefile.inc1
-rw-r--r--lib/libthr/thread/thr_barrier.c5
-rw-r--r--lib/libthr/thread/thr_clean.c2
-rw-r--r--lib/libthr/thread/thr_create.c8
-rw-r--r--lib/libthr/thread/thr_fork.c6
-rw-r--r--lib/libthr/thread/thr_init.c10
-rw-r--r--lib/libthr/thread/thr_mutex.c7
-rw-r--r--lib/libthr/thread/thr_printf.c1
-rw-r--r--lib/libthr/thread/thr_private.h29
-rw-r--r--lib/libthr/thread/thr_sig.c180
-rw-r--r--lib/libthr/thread/thr_spec.c201
-rw-r--r--lib/libthr/thread/thr_spinlock.c10
-rw-r--r--lib/libthr/thread/thr_syscalls.c558
-rw-r--r--lib/libthread_db/Makefile.depend21
-rw-r--r--lib/libthread_db/arch/aarch64/libpthread_md.c96
-rw-r--r--lib/libthread_db/arch/i386/libpthread_md.c2
-rw-r--r--lib/libucl/Makefile9
-rw-r--r--lib/libucl/Makefile.depend21
-rw-r--r--lib/libufs/Makefile1
-rw-r--r--lib/libufs/Makefile.depend20
-rw-r--r--lib/libugidfw/Makefile.depend20
-rw-r--r--lib/libulog/Makefile3
-rw-r--r--lib/libulog/Makefile.depend22
-rw-r--r--lib/libunbound/Makefile11
-rw-r--r--lib/libunbound/Makefile.depend36
-rw-r--r--lib/libusb/Makefile3
-rw-r--r--lib/libusb/Makefile.depend21
-rw-r--r--lib/libusb/libusb.34
-rw-r--r--lib/libusb/libusb.h2
-rw-r--r--lib/libusb/libusb20.32
-rw-r--r--lib/libusb/libusb20_desc.h6
-rw-r--r--lib/libusbhid/Makefile.depend20
-rw-r--r--lib/libutil/Makefile.depend21
-rw-r--r--lib/libutil/gr_util.c25
-rw-r--r--lib/libutil/quotafile.34
-rw-r--r--lib/libutil/tests/Makefile3
-rw-r--r--lib/libvgl/Makefile.depend20
-rw-r--r--lib/libvmmapi/Makefile2
-rw-r--r--lib/libvmmapi/Makefile.depend21
-rw-r--r--lib/libvmmapi/vmmapi.c131
-rw-r--r--lib/libvmmapi/vmmapi.h32
-rw-r--r--lib/libwrap/Makefile.depend21
-rw-r--r--lib/libxo/Makefile48
-rw-r--r--lib/libxo/Makefile.depend20
-rw-r--r--lib/liby/Makefile.depend13
-rw-r--r--lib/libypclnt/Makefile.depend55
-rw-r--r--lib/libz/Makefile.depend21
-rw-r--r--lib/msun/Makefile6
-rw-r--r--lib/msun/Makefile.amd646
-rw-r--r--lib/msun/Makefile.depend21
-rw-r--r--lib/msun/Makefile.i3866
-rw-r--r--lib/msun/aarch64/Makefile.inc4
-rw-r--r--lib/msun/aarch64/fenv.c56
-rw-r--r--lib/msun/aarch64/fenv.h246
-rw-r--r--lib/msun/ld128/k_expl.h2
-rw-r--r--lib/msun/ld80/k_expl.h2
-rw-r--r--lib/msun/man/cexp.32
-rw-r--r--lib/msun/man/complex.32
-rw-r--r--lib/msun/man/csqrt.32
-rw-r--r--lib/msun/man/j0.345
-rw-r--r--lib/msun/man/lgamma.33
-rw-r--r--lib/msun/man/nextafter.34
-rw-r--r--lib/msun/man/sin.32
-rw-r--r--lib/msun/src/catrig.c64
-rw-r--r--lib/msun/src/catrigf.c64
-rw-r--r--lib/msun/src/e_j0.c30
-rw-r--r--lib/msun/src/e_j0f.c45
-rw-r--r--lib/msun/src/e_j1.c28
-rw-r--r--lib/msun/src/e_j1f.c43
-rw-r--r--lib/msun/src/e_jn.c10
-rw-r--r--lib/msun/src/e_jnf.c11
-rw-r--r--lib/msun/src/k_exp.c2
-rw-r--r--lib/msun/src/k_expf.c2
-rw-r--r--lib/msun/src/math_private.h18
-rw-r--r--lib/msun/src/s_ccosh.c28
-rw-r--r--lib/msun/src/s_ccoshf.c28
-rw-r--r--lib/msun/src/s_cexp.c12
-rw-r--r--lib/msun/src/s_cexpf.c12
-rw-r--r--lib/msun/src/s_conj.c2
-rw-r--r--lib/msun/src/s_conjf.c2
-rw-r--r--lib/msun/src/s_conjl.c2
-rw-r--r--lib/msun/src/s_cproj.c2
-rw-r--r--lib/msun/src/s_cprojf.c2
-rw-r--r--lib/msun/src/s_cprojl.c2
-rw-r--r--lib/msun/src/s_csinh.c30
-rw-r--r--lib/msun/src/s_csinhf.c30
-rw-r--r--lib/msun/src/s_csqrt.c14
-rw-r--r--lib/msun/src/s_csqrtf.c14
-rw-r--r--lib/msun/src/s_csqrtl.c14
-rw-r--r--lib/msun/src/s_ctanh.c14
-rw-r--r--lib/msun/src/s_ctanhf.c14
-rw-r--r--lib/msun/src/s_scalbln.c40
-rw-r--r--lib/msun/tests/Makefile12
-rw-r--r--lib/ncurses/Makefile7
-rw-r--r--lib/ncurses/form/Makefile3
-rw-r--r--lib/ncurses/form/Makefile.depend140
-rw-r--r--lib/ncurses/formw/Makefile.depend139
-rw-r--r--lib/ncurses/menu/Makefile3
-rw-r--r--lib/ncurses/menu/Makefile.depend101
-rw-r--r--lib/ncurses/menuw/Makefile.depend100
-rw-r--r--lib/ncurses/ncurses/Makefile2
-rw-r--r--lib/ncurses/ncurses/Makefile.depend1801
-rw-r--r--lib/ncurses/ncursesw/Makefile.depend2532
-rw-r--r--lib/ncurses/panel/Makefile3
-rw-r--r--lib/ncurses/panel/Makefile.depend68
-rw-r--r--lib/ncurses/panelw/Makefile.depend67
1055 files changed, 27622 insertions, 21171 deletions
diff --git a/lib/Makefile b/lib/Makefile
index bee05ab..8ca673a 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -8,12 +8,11 @@
# and the main list to avoid needing a SUBDIR_DEPEND line on every library
# naming just these few items.
-SUBDIR_ORDERED= csu \
+SUBDIR_ORDERED= ${_csu} \
.WAIT \
libc \
libc_nonshared \
libcompiler_rt \
- ${_libclang_rt} \
${_libcplusplus} \
${_libcxxrt} \
libelf \
@@ -41,20 +40,18 @@ SUBDIR= ${SUBDIR_ORDERED} \
${_libcom_err} \
libcompat \
libcrypt \
- libdevctl \
libdevinfo \
libdevstat \
libdpv \
libdwarf \
libedit \
- ${_libelftc} \
${_libevent} \
libexecinfo \
libexpat \
libfetch \
libfigpar \
libgeom \
- ${_libgpio} \
+ ${_libgpib} \
${_libgssapi} \
${_librpcsec_gss} \
${_libiconv_modules} \
@@ -64,12 +61,12 @@ SUBDIR= ${SUBDIR_ORDERED} \
libkvm \
${_libldns} \
liblzma \
- ${_libmagic} \
+ libmagic \
+ libmandoc \
libmemstat \
libmd \
${_libmilter} \
${_libmp} \
- libmt \
${_libnandfs} \
libnetbsd \
${_libnetgraph} \
@@ -83,7 +80,7 @@ SUBDIR= ${SUBDIR_ORDERED} \
${_libpmc} \
${_libproc} \
libprocstat \
- ${_libradius} \
+ libradius \
librpcsvc \
librt \
${_librtld_db} \
@@ -93,7 +90,6 @@ SUBDIR= ${SUBDIR_ORDERED} \
${_libsmb} \
${_libsmdb} \
${_libsmutil} \
- libsqlite3 \
libstand \
libstdbuf \
libstdthreads \
@@ -143,7 +139,7 @@ SUBDIR_DEPEND_liblibrpcsec_gss= libgssapi
SUBDIR_DEPEND_libmagic= libz
SUBDIR_DEPEND_libmemstat= libkvm
SUBDIR_DEPEND_libopie= libmd
-SUBDIR_DEPEND_libpam= libcrypt libopie ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
+SUBDIR_DEPEND_libpam= libcrypt libopie libradius librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
SUBDIR_DEPEND_libpjdlog= libutil
SUBDIR_DEPEND_libprocstat= libkvm libutil
SUBDIR_DEPEND_libradius= libmd
@@ -153,7 +149,16 @@ SUBDIR_DEPEND_libstdc++= msun
SUBDIR_DEPEND_libtacplus= libmd
SUBDIR_DEPEND_libulog= libmd
SUBDIR_DEPEND_libunbound= ${_libldns}
-SUBDIR_DEPEND_liblzma= ${_libthr}
+
+.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
+_csu=csu/${MACHINE_ARCH}-elf
+.elif exists(${.CURDIR}/csu/${MACHINE_ARCH})
+_csu=csu/${MACHINE_ARCH}
+.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile)
+_csu=csu/${MACHINE_CPUARCH}
+.else
+_csu=csu
+.endif
# NB: keep these sorted by MK_* knobs
@@ -183,16 +188,8 @@ _clang= clang
_cuse= libcuse
.endif
-.if ${MK_ELFTOOLCHAIN_TOOLS} != "no"
-_libelftc= libelftc
-.endif
-
-.if ${MK_FILE} != "no"
-_libmagic= libmagic
-.endif
-
-.if ${MK_GPIO} != "no"
-_libgpio= libgpio
+.if ${MK_GPIB} != "no"
+_libgpib= libgpib
.endif
.if ${MK_GSSAPI} != "no"
@@ -212,15 +209,6 @@ _libcom_err= libcom_err
_libldns= libldns
.endif
-# The libraries under libclang_rt can only be built by clang, and only make
-# sense to build when clang is enabled at all. Furthermore, they can only be
-# built for certain architectures.
-.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
- (${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \
- (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb"))
-_libclang_rt= libclang_rt
-.endif
-
.if ${MK_LIBCPLUSPLUS} != "no"
_libcxxrt= libcxxrt
_libcplusplus= libc++
@@ -254,10 +242,8 @@ _librtld_db= librtld_db
.endif
.if ${MACHINE_CPUARCH} == "amd64"
-.if ${MK_BHYVE} != "no"
_libvmmapi= libvmmapi
.endif
-.endif
.if ${MACHINE_CPUARCH} == "mips"
_libproc= libproc
@@ -274,12 +260,6 @@ _libsmb= libsmb
_libsmb= libsmb
.endif
-.if ${MACHINE_CPUARCH} == "arm"
-_libsmb= libsmb
-_libproc= libproc
-_librtld_db= librtld_db
-.endif
-
.if ${MK_OPENSSL} != "no"
_libmp= libmp
.endif
@@ -288,10 +268,6 @@ _libmp= libmp
_libpmc= libpmc
.endif
-.if ${MK_RADIUS_SUPPORT} != "no"
-_libradius= libradius
-.endif
-
.if ${MK_SENDMAIL} != "no"
_libmilter= libmilter
_libsm= libsm
diff --git a/lib/atf/libatf-c++/Makefile b/lib/atf/libatf-c++/Makefile
index 13f3fe4..352a8f4 100644
--- a/lib/atf/libatf-c++/Makefile
+++ b/lib/atf/libatf-c++/Makefile
@@ -28,12 +28,13 @@
.include <src.opts.mk>
.include <bsd.init.mk>
-LIB_CXX= atf-c++
+LIB= atf-c++
PRIVATELIB= true
SHLIB_MAJOR= 2
# libatf-c++ depends on the C version of the ATF library to build.
-LIBADD+= atf_c
+DPADD= ${LIBATF_C}
+LDADD= -latf-c
LDFLAGS+= -L${.OBJDIR}/../libatf-c
diff --git a/lib/atf/libatf-c++/Makefile.depend b/lib/atf/libatf-c++/Makefile.depend
new file mode 100644
index 0000000..c93850e
--- /dev/null
+++ b/lib/atf/libatf-c++/Makefile.depend
@@ -0,0 +1,17 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/atf/libatf-c \
+ lib/libc++ \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/atf/libatf-c/Makefile.depend b/lib/atf/libatf-c/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/atf/libatf-c/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/Makefile b/lib/clang/Makefile
index a7513c3..328aa78 100644
--- a/lib/clang/Makefile
+++ b/lib/clang/Makefile
@@ -11,6 +11,11 @@ _libclangstaticanalyzer= \
_libclangarcmigrate= \
libclangarcmigrate
.endif # MK_CLANG_FULL
+.if ${MK_CLANG_FULL} != "no" || ${MK_LLDB} != "no"
+_libclangrewriter= \
+ libclangrewritecore \
+ libclangrewritefrontend
+.endif # (MK_CLANG_FULL || MK_LLDB)
SUBDIR= libclanganalysis \
${_libclangarcmigrate} \
@@ -23,8 +28,7 @@ SUBDIR= libclanganalysis \
libclangfrontendtool \
libclanglex \
libclangparse \
- libclangrewritefrontend \
- libclangrewrite \
+ ${_libclangrewriter} \
libclangsema \
libclangserialization \
${_libclangstaticanalyzer} \
@@ -43,12 +47,10 @@ SUBDIR= libclanganalysis \
libllvmirreader \
libllvmlinker \
libllvmmc \
- libllvmmcdisassembler \
libllvmmcparser \
libllvmobjcarcopts \
libllvmobject \
libllvmoption \
- libllvmprofiledata \
libllvmscalaropts \
libllvmselectiondag \
libllvmsupport \
@@ -57,13 +59,6 @@ SUBDIR= libclanganalysis \
libllvmtransformutils \
libllvmvectorize \
\
- libllvmaarch64asmparser \
- libllvmaarch64codegen \
- libllvmaarch64desc \
- libllvmaarch64disassembler \
- libllvmaarch64info \
- libllvmaarch64instprinter \
- libllvmaarch64utils \
libllvmarmasmparser \
libllvmarmcodegen \
libllvmarmdesc \
@@ -79,7 +74,6 @@ SUBDIR= libclanganalysis \
libllvmpowerpcasmparser \
libllvmpowerpccodegen \
libllvmpowerpcdesc \
- libllvmpowerpcdisassembler \
libllvmpowerpcinfo \
libllvmpowerpcinstprinter \
libllvmsparcasmparser \
@@ -102,6 +96,8 @@ SUBDIR+=libllvmdebuginfo
.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no"
SUBDIR+=libllvmexecutionengine \
libllvminterpreter \
+ libllvmjit \
+ libllvmmcdisassembler \
libllvmmcjit \
libllvmruntimedyld
.endif # MK_CLANG_EXTRAS | LLDB
@@ -117,27 +113,19 @@ SUBDIR+=liblldb \
liblldbExpression \
liblldbHostCommon \
liblldbHostFreeBSD \
- liblldbHostPOSIX \
liblldbInterpreter \
liblldbSymbol \
liblldbTarget \
liblldbUtility \
\
- liblldbPluginABISysV_ppc \
- liblldbPluginABISysV_ppc64 \
liblldbPluginABISysV_x86_64 \
liblldbPluginCXXItaniumABI \
liblldbPluginDisassemblerLLVM \
liblldbPluginDynamicLoaderStatic \
liblldbPluginDynamicLoaderPosixDYLD \
liblldbPluginInstructionARM \
- liblldbPluginInstructionARM64 \
- liblldbPluginInstrumentationRuntimeAddressSanitizer \
- liblldbPluginJITLoaderGDB \
- liblldbPluginMemoryHistoryASan \
liblldbPluginObjectContainerBSDArchive \
liblldbPluginObjectFileELF \
- liblldbPluginObjectFileJIT \
liblldbPluginPlatformFreeBSD \
liblldbPluginPlatformGDB \
liblldbPluginProcessElfCore \
diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk
index a3fae12..0f68178 100644
--- a/lib/clang/clang.build.mk
+++ b/lib/clang/clang.build.mk
@@ -12,6 +12,7 @@ CFLAGS+= -I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \
.if ${MK_CLANG_FULL} != "no"
CFLAGS+= -DCLANG_ENABLE_ARCMT \
+ -DCLANG_ENABLE_REWRITER \
-DCLANG_ENABLE_STATIC_ANALYZER
.endif # MK_CLANG_FULL
@@ -29,16 +30,28 @@ TARGET_ABI= gnueabi
TARGET_ABI= unknown
.endif
-TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/:C/arm64/aarch64/}-${TARGET_ABI}-freebsd11.0
-BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/:C/arm64/aarch64/}-unknown-freebsd11.0
+TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/}-${TARGET_ABI}-freebsd11.0
+BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/}-unknown-freebsd11.0
CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \
-DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \
-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"
-CXXFLAGS+= -std=c++11 -fno-exceptions -fno-rtti
-CXXFLAGS.clang+= -stdlib=libc++
+CXXFLAGS+= -fno-exceptions -fno-rtti
.PATH: ${LLVM_SRCS}/${SRCDIR}
+.if ${MACHINE} == "host" && defined(EARLY_BUILD)
+.if !empty(LEGACY_TOOLS) && exists(${LEGACY_TOOLS}/usr/bin/tblgen)
+TOOLSDIR= ${LEGACY_TOOLS}
+.endif
+.endif
+.if ${MK_STAGING} == "yes"
+TOOLSDIR?= ${STAGE_HOST_OBJTOP}
+.endif
+TOOLSDIR?=
+.if !empty(TOOLSDIR) && exists(${TOOLSDIR}/usr/bin/clang-tblgen)
+TBLGEN= ${TOOLSDIR}/usr/bin/tblgen
+CLANG_TBLGEN= ${TOOLSDIR}/usr/bin/clang-tblgen
+.endif
TBLGEN?= tblgen
CLANG_TBLGEN?= clang-tblgen
@@ -47,7 +60,7 @@ Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td
-I ${LLVM_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${LLVM_SRCS}/include/llvm/IR/Intrinsics.td
.for arch in \
- AArch64/AArch64 ARM/ARM Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86
+ ARM/ARM Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86
. for hdr in \
AsmMatcher/-gen-asm-matcher \
AsmWriter1/-gen-asm-writer,-asmwriternum=1 \
@@ -58,7 +71,7 @@ Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td
DisassemblerTables/-gen-disassembler \
FastISel/-gen-fast-isel \
InstrInfo/-gen-instr-info \
- MCCodeEmitter/-gen-emitter \
+ MCCodeEmitter/-gen-emitter,-mc-emitter \
MCPseudoLowering/-gen-pseudo-lowering \
RegisterInfo/-gen-register-info \
SubtargetInfo/-gen-subtarget
@@ -80,8 +93,8 @@ AttrDump.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
-AttrHasAttributeImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -gen-clang-attr-has-attribute-impl \
+AttrIdentifierArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
+ ${CLANG_TBLGEN} -gen-clang-attr-identifier-arg-list \
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
@@ -90,6 +103,11 @@ AttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
+AttrLateParsed.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
+ ${CLANG_TBLGEN} -gen-clang-attr-late-parsed-list \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
+
AttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
${CLANG_TBLGEN} -gen-clang-attr-list \
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
@@ -110,11 +128,6 @@ AttrParsedAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
-AttrParserStringSwitches.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -gen-clang-attr-parser-string-switches \
- -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
- ${CLANG_SRCS}/include/clang/Basic/Attr.td
-
AttrPCHRead.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
${CLANG_TBLGEN} -gen-clang-attr-pch-read \
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
@@ -125,6 +138,11 @@ AttrPCHWrite.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
+AttrSpellings.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
+ ${CLANG_TBLGEN} -gen-clang-attr-spelling-list \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
+
AttrSpellingListIndex.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
${CLANG_TBLGEN} -gen-clang-attr-spelling-index \
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
@@ -135,8 +153,8 @@ AttrTemplateInstantiate.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
-AttrVisitor.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -gen-clang-attr-ast-visitor \
+AttrTypeArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
+ ${CLANG_TBLGEN} -gen-clang-attr-type-arg-list \
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
@@ -215,6 +233,12 @@ Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td
-d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Driver/Options.td
+CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td
+ ${TBLGEN} -gen-opt-parser-defs \
+ -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td
+
Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td
${CLANG_TBLGEN} -gen-clang-sa-checkers \
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
@@ -227,3 +251,7 @@ Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td
SRCS+= ${TGHDRS:C/$/.inc.h/}
DPSRCS+= ${TGHDRS:C/$/.inc.h/}
CLEANFILES+= ${TGHDRS:C/$/.inc.h/} ${TGHDRS:C/$/.inc.d/}
+
+# if we are not doing explicit 'make depend', there is
+# nothing to cause these to be generated.
+beforebuild: ${SRCS:M*.inc.h}
diff --git a/lib/clang/include/AArch64GenAsmMatcher.inc b/lib/clang/include/AArch64GenAsmMatcher.inc
deleted file mode 100644
index 0b1e0a9..0000000
--- a/lib/clang/include/AArch64GenAsmMatcher.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AArch64GenAsmMatcher.inc.h"
diff --git a/lib/clang/include/AArch64GenAsmWriter.inc b/lib/clang/include/AArch64GenAsmWriter.inc
deleted file mode 100644
index 20b130b..0000000
--- a/lib/clang/include/AArch64GenAsmWriter.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AArch64GenAsmWriter.inc.h"
diff --git a/lib/clang/include/AArch64GenAsmWriter1.inc b/lib/clang/include/AArch64GenAsmWriter1.inc
deleted file mode 100644
index caf7812..0000000
--- a/lib/clang/include/AArch64GenAsmWriter1.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AArch64GenAsmWriter1.inc.h"
diff --git a/lib/clang/include/AArch64GenCallingConv.inc b/lib/clang/include/AArch64GenCallingConv.inc
deleted file mode 100644
index 75bfa38..0000000
--- a/lib/clang/include/AArch64GenCallingConv.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AArch64GenCallingConv.inc.h"
diff --git a/lib/clang/include/AArch64GenDAGISel.inc b/lib/clang/include/AArch64GenDAGISel.inc
deleted file mode 100644
index 39bb084..0000000
--- a/lib/clang/include/AArch64GenDAGISel.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AArch64GenDAGISel.inc.h"
diff --git a/lib/clang/include/AArch64GenDisassemblerTables.inc b/lib/clang/include/AArch64GenDisassemblerTables.inc
deleted file mode 100644
index 3b26336..0000000
--- a/lib/clang/include/AArch64GenDisassemblerTables.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AArch64GenDisassemblerTables.inc.h"
diff --git a/lib/clang/include/AArch64GenFastISel.inc b/lib/clang/include/AArch64GenFastISel.inc
deleted file mode 100644
index ebc2ad2..0000000
--- a/lib/clang/include/AArch64GenFastISel.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AArch64GenFastISel.inc.h"
diff --git a/lib/clang/include/AArch64GenInstrInfo.inc b/lib/clang/include/AArch64GenInstrInfo.inc
deleted file mode 100644
index 12e60a9..0000000
--- a/lib/clang/include/AArch64GenInstrInfo.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AArch64GenInstrInfo.inc.h"
diff --git a/lib/clang/include/AArch64GenMCCodeEmitter.inc b/lib/clang/include/AArch64GenMCCodeEmitter.inc
deleted file mode 100644
index e3515f5..0000000
--- a/lib/clang/include/AArch64GenMCCodeEmitter.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AArch64GenMCCodeEmitter.inc.h"
diff --git a/lib/clang/include/AArch64GenMCPseudoLowering.inc b/lib/clang/include/AArch64GenMCPseudoLowering.inc
deleted file mode 100644
index 93f3f3a..0000000
--- a/lib/clang/include/AArch64GenMCPseudoLowering.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AArch64GenMCPseudoLowering.inc.h"
diff --git a/lib/clang/include/AArch64GenRegisterInfo.inc b/lib/clang/include/AArch64GenRegisterInfo.inc
deleted file mode 100644
index a6a9647..0000000
--- a/lib/clang/include/AArch64GenRegisterInfo.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AArch64GenRegisterInfo.inc.h"
diff --git a/lib/clang/include/AArch64GenSubtargetInfo.inc b/lib/clang/include/AArch64GenSubtargetInfo.inc
deleted file mode 100644
index 8674332..0000000
--- a/lib/clang/include/AArch64GenSubtargetInfo.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AArch64GenSubtargetInfo.inc.h"
diff --git a/lib/clang/include/Makefile b/lib/clang/include/Makefile
index d5db60e..1ffd3e1 100644
--- a/lib/clang/include/Makefile
+++ b/lib/clang/include/Makefile
@@ -8,21 +8,13 @@ LLVM_SRCS= ${.CURDIR}/../../../contrib/llvm
.PATH: ${LLVM_SRCS}/tools/clang/lib/Headers
-INCSDIR=${LIBDIR}/clang/3.6.0/include
+INCSDIR=${INCLUDEDIR}/clang/3.4.1
-INCS= __stddef_max_align_t.h \
- __wmmintrin_aes.h \
+INCS= __wmmintrin_aes.h \
__wmmintrin_pclmul.h \
- adxintrin.h \
altivec.h \
ammintrin.h \
- arm_acle.h \
avx2intrin.h \
- avx512bwintrin.h \
- avx512erintrin.h \
- avx512fintrin.h \
- avx512vlbwintrin.h \
- avx512vlintrin.h \
avxintrin.h \
bmi2intrin.h \
bmiintrin.h \
@@ -31,13 +23,12 @@ INCS= __stddef_max_align_t.h \
f16cintrin.h \
fma4intrin.h \
fmaintrin.h \
- ia32intrin.h \
immintrin.h \
lzcntintrin.h \
mm3dnow.h \
mm_malloc.h \
mmintrin.h \
- module.modulemap \
+ module.map \
nmmintrin.h \
pmmintrin.h \
popcntintrin.h \
@@ -56,4 +47,7 @@ INCS= __stddef_max_align_t.h \
GENINCS= arm_neon.h
CLEANFILES= ${GENINCS}
+# avoid a circular dependency
+GENDIRDEPS_FILTER+= Nusr.bin/clang/clang-tblgen.host
+
.include <bsd.prog.mk>
diff --git a/lib/clang/include/Makefile.depend b/lib/clang/include/Makefile.depend
new file mode 100644
index 0000000..57b7e10
--- /dev/null
+++ b/lib/clang/include/Makefile.depend
@@ -0,0 +1,12 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/include/MipsGenFastISel.inc b/lib/clang/include/MipsGenFastISel.inc
deleted file mode 100644
index a2aaacf..0000000
--- a/lib/clang/include/MipsGenFastISel.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "MipsGenFastISel.inc.h"
diff --git a/lib/clang/include/PPCGenDisassemblerTables.inc b/lib/clang/include/PPCGenDisassemblerTables.inc
deleted file mode 100644
index c581dbe..0000000
--- a/lib/clang/include/PPCGenDisassemblerTables.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "PPCGenDisassemblerTables.inc.h"
diff --git a/lib/clang/include/clang/AST/AttrVisitor.inc b/lib/clang/include/clang/AST/AttrVisitor.inc
deleted file mode 100644
index 8f8bdb0..0000000
--- a/lib/clang/include/clang/AST/AttrVisitor.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AttrVisitor.inc.h"
diff --git a/lib/clang/include/clang/Basic/AttrHasAttributeImpl.inc b/lib/clang/include/clang/Basic/AttrHasAttributeImpl.inc
deleted file mode 100644
index 0e996d2..0000000
--- a/lib/clang/include/clang/Basic/AttrHasAttributeImpl.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AttrHasAttributeImpl.inc.h"
diff --git a/lib/clang/include/clang/Basic/Version.inc b/lib/clang/include/clang/Basic/Version.inc
index c6d4a8e..d2fcc04 100644
--- a/lib/clang/include/clang/Basic/Version.inc
+++ b/lib/clang/include/clang/Basic/Version.inc
@@ -1,11 +1,11 @@
/* $FreeBSD$ */
-#define CLANG_VERSION 3.6.0
+#define CLANG_VERSION 3.4.1
#define CLANG_VERSION_MAJOR 3
-#define CLANG_VERSION_MINOR 6
-#define CLANG_VERSION_PATCHLEVEL 0
+#define CLANG_VERSION_MINOR 4
+#define CLANG_VERSION_PATCHLEVEL 1
#define CLANG_VENDOR "FreeBSD "
-#define CLANG_VENDOR_SUFFIX " 20150225"
+#define CLANG_VENDOR_SUFFIX " 20140512"
-#define SVN_REVISION "230434"
+#define SVN_REVISION "208032"
diff --git a/lib/clang/include/clang/Config/config.h b/lib/clang/include/clang/Config/config.h
index 9c4512d..5c35829 100644
--- a/lib/clang/include/clang/Config/config.h
+++ b/lib/clang/include/clang/Config/config.h
@@ -1,39 +1,26 @@
/* $FreeBSD$ */
/* tools/clang/include/clang/Config/config.h. Generated from config.h.in by configure. */
-/* This generated file is for internal use. Do not include it from headers. */
+/* include/clang/Config/config.h.in. */
-#ifdef CONFIG_H
-#error config.h can only be included once
-#else
+#ifndef CONFIG_H
#define CONFIG_H
/* Bug report URL. */
#define BUG_REPORT_URL "https://bugs.freebsd.org/submit/"
-/* Multilib suffix for libdir. */
-#define CLANG_LIBDIR_SUFFIX ""
-
/* Relative directory for resource files */
#define CLANG_RESOURCE_DIR ""
/* Directories clang will search for headers */
#define C_INCLUDE_DIRS ""
+/* Linker version detected at compile time. */
+/* #undef HOST_LINK_VERSION */
+
/* Default <path> to all compiler invocations for --sysroot=<path>. */
/* #undef DEFAULT_SYSROOT */
/* Directory where gcc is installed. */
#define GCC_INSTALL_PREFIX ""
-/* Define if we have libxml2 */
-/* #undef CLANG_HAVE_LIBXML */
-
-#define PACKAGE_STRING "LLVM 3.6.0"
-
-/* The LLVM product name and version */
-#define BACKEND_PACKAGE_STRING PACKAGE_STRING
-
-/* Linker version detected at compile time. */
-/* #undef HOST_LINK_VERSION */
-
#endif
diff --git a/lib/clang/include/clang/Driver/CC1AsOptions.inc b/lib/clang/include/clang/Driver/CC1AsOptions.inc
new file mode 100644
index 0000000..3d76958
--- /dev/null
+++ b/lib/clang/include/clang/Driver/CC1AsOptions.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "CC1AsOptions.inc.h"
diff --git a/lib/clang/include/clang/Lex/AttrSpellings.inc b/lib/clang/include/clang/Lex/AttrSpellings.inc
new file mode 100644
index 0000000..8859ae3
--- /dev/null
+++ b/lib/clang/include/clang/Lex/AttrSpellings.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AttrSpellings.inc.h"
diff --git a/lib/clang/include/clang/Parse/AttrIdentifierArg.inc b/lib/clang/include/clang/Parse/AttrIdentifierArg.inc
new file mode 100644
index 0000000..2969a50
--- /dev/null
+++ b/lib/clang/include/clang/Parse/AttrIdentifierArg.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AttrIdentifierArg.inc.h"
diff --git a/lib/clang/include/clang/Parse/AttrLateParsed.inc b/lib/clang/include/clang/Parse/AttrLateParsed.inc
new file mode 100644
index 0000000..1282d9e
--- /dev/null
+++ b/lib/clang/include/clang/Parse/AttrLateParsed.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AttrLateParsed.inc.h"
diff --git a/lib/clang/include/clang/Parse/AttrParserStringSwitches.inc b/lib/clang/include/clang/Parse/AttrParserStringSwitches.inc
deleted file mode 100644
index ef8642c..0000000
--- a/lib/clang/include/clang/Parse/AttrParserStringSwitches.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AttrParserStringSwitches.inc.h"
diff --git a/lib/clang/include/clang/Parse/AttrTypeArg.inc b/lib/clang/include/clang/Parse/AttrTypeArg.inc
new file mode 100644
index 0000000..8eb4699
--- /dev/null
+++ b/lib/clang/include/clang/Parse/AttrTypeArg.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AttrTypeArg.inc.h"
diff --git a/lib/clang/include/llvm/Config/AsmParsers.def b/lib/clang/include/llvm/Config/AsmParsers.def
index 3be6e38..e0165f0 100644
--- a/lib/clang/include/llvm/Config/AsmParsers.def
+++ b/lib/clang/include/llvm/Config/AsmParsers.def
@@ -1,6 +1,5 @@
/* $FreeBSD$ */
-LLVM_ASM_PARSER(AArch64)
LLVM_ASM_PARSER(ARM)
LLVM_ASM_PARSER(Mips)
LLVM_ASM_PARSER(PowerPC)
diff --git a/lib/clang/include/llvm/Config/AsmPrinters.def b/lib/clang/include/llvm/Config/AsmPrinters.def
index 9ed0217..97ca952 100644
--- a/lib/clang/include/llvm/Config/AsmPrinters.def
+++ b/lib/clang/include/llvm/Config/AsmPrinters.def
@@ -1,6 +1,5 @@
/* $FreeBSD$ */
-LLVM_ASM_PRINTER(AArch64)
LLVM_ASM_PRINTER(ARM)
LLVM_ASM_PRINTER(Mips)
LLVM_ASM_PRINTER(PowerPC)
diff --git a/lib/clang/include/llvm/Config/Disassemblers.def b/lib/clang/include/llvm/Config/Disassemblers.def
index 44fc7ef..25406a4 100644
--- a/lib/clang/include/llvm/Config/Disassemblers.def
+++ b/lib/clang/include/llvm/Config/Disassemblers.def
@@ -1,9 +1,7 @@
/* $FreeBSD$ */
-LLVM_DISASSEMBLER(AArch64)
LLVM_DISASSEMBLER(ARM)
LLVM_DISASSEMBLER(Mips)
-LLVM_DISASSEMBLER(PowerPC)
LLVM_DISASSEMBLER(Sparc)
LLVM_DISASSEMBLER(X86)
diff --git a/lib/clang/include/llvm/Config/Targets.def b/lib/clang/include/llvm/Config/Targets.def
index 96b60d9..e51e06a 100644
--- a/lib/clang/include/llvm/Config/Targets.def
+++ b/lib/clang/include/llvm/Config/Targets.def
@@ -1,6 +1,5 @@
/* $FreeBSD$ */
-LLVM_TARGET(AArch64)
LLVM_TARGET(ARM)
LLVM_TARGET(Mips)
LLVM_TARGET(PowerPC)
diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h
index 3fc38be..ce32c50 100644
--- a/lib/clang/include/llvm/Config/config.h
+++ b/lib/clang/include/llvm/Config/config.h
@@ -14,9 +14,6 @@
/* Define if we have libxml2 */
/* #undef CLANG_HAVE_LIBXML */
-/* Multilib suffix for libdir. */
-/* #undef CLANG_LIBDIR_SUFFIX */
-
/* Relative directory for resource files */
#define CLANG_RESOURCE_DIR ""
@@ -41,12 +38,39 @@
/* Directory where gcc is installed. */
#define GCC_INSTALL_PREFIX ""
+/* Define to 1 if you have the `arc4random' function. */
+#define HAVE_ARC4RANDOM 1
+
+/* Define to 1 if you have the `argz_append' function. */
+/* #undef HAVE_ARGZ_APPEND */
+
+/* Define to 1 if you have the `argz_create_sep' function. */
+/* #undef HAVE_ARGZ_CREATE_SEP */
+
+/* Define to 1 if you have the <argz.h> header file. */
+/* #undef HAVE_ARGZ_H */
+
+/* Define to 1 if you have the `argz_insert' function. */
+/* #undef HAVE_ARGZ_INSERT */
+
+/* Define to 1 if you have the `argz_next' function. */
+/* #undef HAVE_ARGZ_NEXT */
+
+/* Define to 1 if you have the `argz_stringify' function. */
+/* #undef HAVE_ARGZ_STRINGIFY */
+
/* Define to 1 if you have the `backtrace' function. */
/* #undef HAVE_BACKTRACE */
/* Define to 1 if you have the `ceilf' function. */
#define HAVE_CEILF 1
+/* Define if the neat program is available */
+/* #undef HAVE_CIRCO */
+
+/* Define to 1 if you have the `closedir' function. */
+#define HAVE_CLOSEDIR 1
+
/* Define to 1 if you have the <CrashReporterClient.h> header file. */
/* #undef HAVE_CRASHREPORTERCLIENT_H */
@@ -56,10 +80,6 @@
/* Define to 1 if you have the <cxxabi.h> header file. */
#define HAVE_CXXABI_H 1
-/* Define to 1 if you have the declaration of `arc4random', and to 0 if you
- don't. */
-#define HAVE_DECL_ARC4RANDOM 1
-
/* Define to 1 if you have the declaration of `FE_ALL_EXCEPT', and to 0 if you
don't. */
#define HAVE_DECL_FE_ALL_EXCEPT 1
@@ -76,6 +96,12 @@
*/
#define HAVE_DIRENT_H 1
+/* Define if you have the GNU dld library. */
+/* #undef HAVE_DLD */
+
+/* Define to 1 if you have the `dlerror' function. */
+#define HAVE_DLERROR 1
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
@@ -85,13 +111,20 @@
/* Define if the dot program is available */
/* #undef HAVE_DOT */
+/* Define if the dotty program is available */
+/* #undef HAVE_DOTTY */
+
+/* Define if you have the _dyld_func_lookup function. */
+/* #undef HAVE_DYLD */
+
/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
+/* Define to 1 if the system has the type `error_t'. */
+/* #undef HAVE_ERROR_T */
+
/* Define to 1 if you have the <execinfo.h> header file. */
-#if __FreeBSD_version >= 1000052
-#define HAVE_EXECINFO_H 1
-#endif
+/* #undef HAVE_EXECINFO_H */
/* Define to 1 if you have the `exp' function. */
#define HAVE_EXP 1
@@ -102,6 +135,9 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
+/* Define if the neat program is available */
+/* #undef HAVE_FDP */
+
/* Define to 1 if you have the <fenv.h> header file. */
#define HAVE_FENV_H 1
@@ -124,9 +160,7 @@
#define HAVE_FMODF 1
/* Define to 1 if you have the `futimens' function. */
-#if __FreeBSD_version >= 1100056
-#define HAVE_FUTIMENS 1
-#endif
+/* #undef HAVE_FUTIMENS */
/* Define to 1 if you have the `futimes' function. */
#define HAVE_FUTIMES 1
@@ -146,6 +180,12 @@
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
+/* Define if the Graphviz program is available */
+/* #undef HAVE_GRAPHVIZ */
+
+/* Define if the gv program is available */
+/* #undef HAVE_GV */
+
/* Define to 1 if the system has the type `int64_t'. */
#define HAVE_INT64_T 1
@@ -167,8 +207,8 @@
/* Set to 1 if the isnan function is found in <math.h> */
#define HAVE_ISNAN_IN_MATH_H 1
-/* Define if libedit is available on this platform. */
-#define HAVE_LIBEDIT 1
+/* Define if you have the libdl library or equivalent. */
+#define HAVE_LIBDL 1
/* Define to 1 if you have the `imagehlp' library (-limagehlp). */
/* #undef HAVE_LIBIMAGEHLP */
@@ -185,6 +225,9 @@
/* Define to 1 if you have the `shell32' library (-lshell32). */
/* #undef HAVE_LIBSHELL32 */
+/* Define to 1 if you have the `udis86' library (-ludis86). */
+/* #undef HAVE_LIBUDIS86 */
+
/* Define to 1 if you have the `z' library (-lz). */
#define HAVE_LIBZ 1
@@ -215,6 +258,9 @@
/* Define to 1 if you have the <mach/mach.h> header file. */
/* #undef HAVE_MACH_MACH_H */
+/* Define to 1 if you have the <mach-o/dyld.h> header file. */
+/* #undef HAVE_MACH_O_DYLD_H */
+
/* Define if mallinfo() is available on this platform. */
/* #undef HAVE_MALLINFO */
@@ -255,6 +301,12 @@
/* Define to 1 if you have the `nearbyintf' function. */
#define HAVE_NEARBYINTF 1
+/* Define if the neat program is available */
+/* #undef HAVE_NEATO */
+
+/* Define to 1 if you have the `opendir' function. */
+#define HAVE_OPENDIR 1
+
/* Define to 1 if you have the `posix_spawn' function. */
/* #undef HAVE_POSIX_SPAWN */
@@ -264,6 +316,9 @@
/* Define to 1 if you have the `pread' function. */
#define HAVE_PREAD 1
+/* Define if libtool can extract symbol lists from object files. */
+#define HAVE_PRELOADED_SYMBOLS 1
+
/* Define to have the %a format string */
#define HAVE_PRINTF_A 1
@@ -282,6 +337,9 @@
/* Define to 1 if srand48/lrand48/drand48 exist in <stdlib.h> */
#define HAVE_RAND48 1
+/* Define to 1 if you have the `readdir' function. */
+#define HAVE_READDIR 1
+
/* Define to 1 if you have the `realpath' function. */
#define HAVE_REALPATH 1
@@ -309,6 +367,9 @@
/* Define to 1 if you have the `setrlimit' function. */
#define HAVE_SETRLIMIT 1
+/* Define if you have the shl_load function. */
+/* #undef HAVE_SHL_LOAD */
+
/* Define to 1 if you have the `siglongjmp' function. */
#define HAVE_SIGLONGJMP 1
@@ -395,6 +456,9 @@
/* Define to 1 if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1
+/* Define if the neat program is available */
+/* #undef HAVE_TWOPI */
+
/* Define to 1 if the system has the type `uint64_t'. */
#define HAVE_UINT64_T 1
@@ -413,6 +477,9 @@
/* Define to 1 if you have the `writev' function. */
#define HAVE_WRITEV 1
+/* Define if the xdot program is available */
+/* #undef HAVE_XDOT */
+
/* Define to 1 if you have the <zlib.h> header file. */
#define HAVE_ZLIB_H 1
@@ -536,9 +603,33 @@
/* Define if this is Win32ish platform */
/* #undef LLVM_ON_WIN32 */
+/* Define to path to circo program if found or 'echo circo' otherwise */
+/* #undef LLVM_PATH_CIRCO */
+
/* Define to path to dot program if found or 'echo dot' otherwise */
/* #undef LLVM_PATH_DOT */
+/* Define to path to dotty program if found or 'echo dotty' otherwise */
+/* #undef LLVM_PATH_DOTTY */
+
+/* Define to path to fdp program if found or 'echo fdp' otherwise */
+/* #undef LLVM_PATH_FDP */
+
+/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
+/* #undef LLVM_PATH_GRAPHVIZ */
+
+/* Define to path to gv program if found or 'echo gv' otherwise */
+/* #undef LLVM_PATH_GV */
+
+/* Define to path to neato program if found or 'echo neato' otherwise */
+/* #undef LLVM_PATH_NEATO */
+
+/* Define to path to twopi program if found or 'echo twopi' otherwise */
+/* #undef LLVM_PATH_TWOPI */
+
+/* Define to path to xdot program if found or 'echo xdot' otherwise */
+/* #undef LLVM_PATH_XDOT */
+
/* Installation prefix directory */
#define LLVM_PREFIX "/usr"
@@ -552,35 +643,45 @@
#define LLVM_VERSION_MAJOR 3
/* Minor version of the LLVM API */
-#define LLVM_VERSION_MINOR 6
+#define LLVM_VERSION_MINOR 4
/* Patch version of the LLVM API */
-#define LLVM_VERSION_PATCH 0
+#define LLVM_VERSION_PATCH 1
+
+/* Define if the OS needs help to load dependent libraries for dlopen(). */
+#define LTDL_DLOPEN_DEPLIBS 1
-/* LLVM version string */
-#define LLVM_VERSION_STRING "3.6.0"
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LTDL_OBJDIR ".libs/"
-/* The shared library extension */
+/* Define to the extension used for shared libraries, say, ".so". */
#define LTDL_SHLIB_EXT ".so"
+/* Define to the system default library search path. */
+#define LTDL_SYSSEARCHPATH "/lib:/usr/lib"
+
/* Define if /dev/zero should be used when mapping RWX memory, or undefine if
its not necessary */
/* #undef NEED_DEV_ZERO_FOR_MMAP */
+/* Define if dlsym() requires a leading underscore in symbol names. */
+/* #undef NEED_USCORE */
+
/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "https://bugs.freebsd.org/submit/"
+#define PACKAGE_BUGREPORT "http://llvm.org/bugs/"
/* Define to the full name of this package. */
#define PACKAGE_NAME "LLVM"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "LLVM 3.6.0"
+#define PACKAGE_STRING "LLVM 3.4.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "llvm"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "3.6.0"
+#define PACKAGE_VERSION "3.4.1"
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
@@ -597,9 +698,18 @@
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */
+/* Define if use udis86 library */
+#define USE_UDIS86 0
+
/* Type of 1st arg on ELM Callback */
/* #undef WIN32_ELMCB_PCSTR */
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to a type to use for `error_t' if it is not otherwise available. */
+#define error_t int
+
/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */
diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h
index ba95263..1717863 100644
--- a/lib/clang/include/llvm/Config/llvm-config.h
+++ b/lib/clang/include/llvm/Config/llvm-config.h
@@ -1,6 +1,6 @@
/* $FreeBSD$ */
/* include/llvm/Config/llvm-config.h. Generated from llvm-config.h.in by configure. */
-/*===------- llvm/Config/llvm-config.h - llvm configuration -------*- C -*-===*/
+/*===-- llvm/config/llvm-config.h - llvm configure variable -------*- C -*-===*/
/* */
/* The LLVM Compiler Infrastructure */
/* */
@@ -9,12 +9,14 @@
/* */
/*===----------------------------------------------------------------------===*/
-/* This file enumerates variables from the LLVM configuration so that they
- can be in exported headers and won't override package specific directives.
- This is a C header that can be included in the llvm-c headers. */
+/* This file enumerates all of the llvm variables from configure so that
+ they can be in exported headers and won't override package specific
+ directives. This is a C file so we can include it in the llvm-c headers. */
-#ifndef LLVM_CONFIG_H
-#define LLVM_CONFIG_H
+/* To avoid multiple inclusions of these variables when we include the exported
+ headers and config.h, conditionally include these. */
+/* TODO: This is a bit of a hack. */
+#ifndef CONFIG_H
/* Installation directory for binary executables */
/* #undef LLVM_BINDIR */
@@ -79,6 +81,33 @@
/* Define if this is Win32ish platform */
/* #undef LLVM_ON_WIN32 */
+/* Define to path to circo program if found or 'echo circo' otherwise */
+/* #undef LLVM_PATH_CIRCO */
+
+/* Define to path to dot program if found or 'echo dot' otherwise */
+/* #undef LLVM_PATH_DOT */
+
+/* Define to path to dotty program if found or 'echo dotty' otherwise */
+/* #undef LLVM_PATH_DOTTY */
+
+/* Define to path to fdp program if found or 'echo fdp' otherwise */
+/* #undef LLVM_PATH_FDP */
+
+/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
+/* #undef LLVM_PATH_GRAPHVIZ */
+
+/* Define to path to gv program if found or 'echo gv' otherwise */
+/* #undef LLVM_PATH_GV */
+
+/* Define to path to neato program if found or 'echo neato' otherwise */
+/* #undef LLVM_PATH_NEATO */
+
+/* Define to path to twopi program if found or 'echo twopi' otherwise */
+/* #undef LLVM_PATH_TWOPI */
+
+/* Define to path to xdot.py program if found or 'echo xdot.py' otherwise */
+/* #undef LLVM_PATH_XDOT_PY */
+
/* Installation prefix directory */
#define LLVM_PREFIX "/usr"
@@ -92,12 +121,6 @@
#define LLVM_VERSION_MAJOR 3
/* Minor version of the LLVM API */
-#define LLVM_VERSION_MINOR 6
-
-/* Patch version of the LLVM API */
-#define LLVM_VERSION_PATCH 0
-
-/* LLVM version string */
-#define LLVM_VERSION_STRING "3.6.0"
+#define LLVM_VERSION_MINOR 4
#endif
diff --git a/lib/clang/include/llvm/Support/DataTypes.h b/lib/clang/include/llvm/Support/DataTypes.h
index 6f95bc4..d0fdb7c 100644
--- a/lib/clang/include/llvm/Support/DataTypes.h
+++ b/lib/clang/include/llvm/Support/DataTypes.h
@@ -1,6 +1,6 @@
/* $FreeBSD$ */
/* include/llvm/Support/DataTypes.h. Generated from DataTypes.h.in by configure. */
-/*===-- include/Support/DataTypes.h - Define fixed size types -----*- C -*-===*\
+/*===-- include/System/DataTypes.h - Define fixed size types -----*- C -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
@@ -23,11 +23,10 @@
/* Please leave this file C-compatible. */
-/* Please keep this file in sync with DataTypes.h.cmake */
-
#ifndef SUPPORT_DATATYPES_H
#define SUPPORT_DATATYPES_H
+#define HAVE_SYS_TYPES_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UINT64_T 1
@@ -39,33 +38,31 @@
#include <math.h>
#endif
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#else
-#error "Compiler must provide an implementation of stdint.h"
-#endif
-
-#ifndef _MSC_VER
-
/* Note that this header's correct operation depends on __STDC_LIMIT_MACROS
being defined. We would define it here, but in order to prevent Bad Things
happening when system headers or C++ STL headers include stdint.h before we
define it here, we define it on the g++ command line (in Makefile.rules). */
#if !defined(__STDC_LIMIT_MACROS)
-# error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
+# error "Must #define __STDC_LIMIT_MACROS before #including System/DataTypes.h"
#endif
#if !defined(__STDC_CONSTANT_MACROS)
# error "Must #define __STDC_CONSTANT_MACROS before " \
- "#including Support/DataTypes.h"
+ "#including System/DataTypes.h"
#endif
/* Note that <inttypes.h> includes <stdint.h>, if this is a C99 system. */
+#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
+#endif
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
#ifdef _AIX
#include "llvm/Support/AIXDataTypesFix.h"
@@ -80,33 +77,18 @@ typedef u_int64_t uint64_t;
#endif
#endif
-#else /* _MSC_VER */
-#include <stdlib.h>
-#include <stddef.h>
-#include <sys/types.h>
-#ifdef __cplusplus
-#include <cmath>
-#else
-#include <math.h>
+#ifdef _OpenBSD_
+#define INT8_MAX 127
+#define INT8_MIN -128
+#define UINT8_MAX 255
+#define INT16_MAX 32767
+#define INT16_MIN -32768
+#define UINT16_MAX 65535
+#define INT32_MAX 2147483647
+#define INT32_MIN -2147483648
+#define UINT32_MAX 4294967295U
#endif
-#if defined(_WIN64)
-typedef signed __int64 ssize_t;
-#else
-typedef signed int ssize_t;
-#endif /* _WIN64 */
-
-#ifndef HAVE_INTTYPES_H
-#define PRId64 "I64d"
-#define PRIi64 "I64i"
-#define PRIo64 "I64o"
-#define PRIu64 "I64u"
-#define PRIx64 "I64x"
-#define PRIX64 "I64X"
-#endif /* HAVE_INTTYPES_H */
-
-#endif /* _MSC_VER */
-
/* Set defaults for constants which we cannot find. */
#if !defined(INT64_MAX)
# define INT64_MAX 9223372036854775807LL
@@ -118,6 +100,12 @@ typedef signed int ssize_t;
# define UINT64_MAX 0xffffffffffffffffULL
#endif
+#if __GNUC__ > 3
+#define END_WITH_NULL __attribute__((sentinel))
+#else
+#define END_WITH_NULL
+#endif
+
#ifndef HUGE_VALF
#define HUGE_VALF (float)HUGE_VAL
#endif
diff --git a/lib/clang/libclanganalysis/Makefile b/lib/clang/libclanganalysis/Makefile
index 6a34dca..f71b689 100644
--- a/lib/clang/libclanganalysis/Makefile
+++ b/lib/clang/libclanganalysis/Makefile
@@ -12,7 +12,6 @@ SRCS= AnalysisDeclContext.cpp \
CFGStmtMap.cpp \
CallGraph.cpp \
CocoaConventions.cpp \
- CodeInjector.cpp \
Consumed.cpp \
Dominators.cpp \
FormatString.cpp \
@@ -25,13 +24,9 @@ SRCS= AnalysisDeclContext.cpp \
ReachableCode.cpp \
ScanfFormatString.cpp \
ThreadSafety.cpp \
- ThreadSafetyCommon.cpp \
- ThreadSafetyLogical.cpp \
- ThreadSafetyTIL.cpp \
UninitializedValues.cpp
TGHDRS= AttrList \
- AttrVisitor \
Attrs \
CommentCommandList \
CommentNodes \
diff --git a/lib/clang/libclanganalysis/Makefile.depend b/lib/clang/libclanganalysis/Makefile.depend
new file mode 100644
index 0000000..3e73ed2
--- /dev/null
+++ b/lib/clang/libclanganalysis/Makefile.depend
@@ -0,0 +1,163 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AnalysisDeclContext.o: CommentCommandList.inc.h
+AnalysisDeclContext.o: DeclNodes.inc.h
+AnalysisDeclContext.o: DiagnosticCommonKinds.inc.h
+AnalysisDeclContext.o: StmtNodes.inc.h
+AnalysisDeclContext.po: CommentCommandList.inc.h
+AnalysisDeclContext.po: DeclNodes.inc.h
+AnalysisDeclContext.po: DiagnosticCommonKinds.inc.h
+AnalysisDeclContext.po: StmtNodes.inc.h
+BodyFarm.o: CommentCommandList.inc.h
+BodyFarm.o: DeclNodes.inc.h
+BodyFarm.o: DiagnosticCommonKinds.inc.h
+BodyFarm.o: StmtNodes.inc.h
+BodyFarm.po: CommentCommandList.inc.h
+BodyFarm.po: DeclNodes.inc.h
+BodyFarm.po: DiagnosticCommonKinds.inc.h
+BodyFarm.po: StmtNodes.inc.h
+CFG.o: AttrList.inc.h
+CFG.o: Attrs.inc.h
+CFG.o: CommentCommandList.inc.h
+CFG.o: DeclNodes.inc.h
+CFG.o: DiagnosticCommonKinds.inc.h
+CFG.o: StmtNodes.inc.h
+CFG.po: AttrList.inc.h
+CFG.po: Attrs.inc.h
+CFG.po: CommentCommandList.inc.h
+CFG.po: DeclNodes.inc.h
+CFG.po: DiagnosticCommonKinds.inc.h
+CFG.po: StmtNodes.inc.h
+CFGReachabilityAnalysis.o: StmtNodes.inc.h
+CFGReachabilityAnalysis.po: StmtNodes.inc.h
+CFGStmtMap.o: StmtNodes.inc.h
+CFGStmtMap.po: StmtNodes.inc.h
+CallGraph.o: CommentCommandList.inc.h
+CallGraph.o: DeclNodes.inc.h
+CallGraph.o: DiagnosticCommonKinds.inc.h
+CallGraph.o: StmtNodes.inc.h
+CallGraph.po: CommentCommandList.inc.h
+CallGraph.po: DeclNodes.inc.h
+CallGraph.po: DiagnosticCommonKinds.inc.h
+CallGraph.po: StmtNodes.inc.h
+CocoaConventions.o: DeclNodes.inc.h
+CocoaConventions.o: DiagnosticCommonKinds.inc.h
+CocoaConventions.po: DeclNodes.inc.h
+CocoaConventions.po: DiagnosticCommonKinds.inc.h
+Consumed.o: AttrList.inc.h
+Consumed.o: Attrs.inc.h
+Consumed.o: CommentCommandList.inc.h
+Consumed.o: DeclNodes.inc.h
+Consumed.o: DiagnosticCommonKinds.inc.h
+Consumed.o: StmtNodes.inc.h
+Consumed.po: AttrList.inc.h
+Consumed.po: Attrs.inc.h
+Consumed.po: CommentCommandList.inc.h
+Consumed.po: DeclNodes.inc.h
+Consumed.po: DiagnosticCommonKinds.inc.h
+Consumed.po: StmtNodes.inc.h
+Dominators.o: DeclNodes.inc.h
+Dominators.o: DiagnosticCommonKinds.inc.h
+Dominators.o: StmtNodes.inc.h
+Dominators.po: DeclNodes.inc.h
+Dominators.po: DiagnosticCommonKinds.inc.h
+Dominators.po: StmtNodes.inc.h
+FormatString.o: CommentCommandList.inc.h
+FormatString.o: DeclNodes.inc.h
+FormatString.o: DiagnosticCommonKinds.inc.h
+FormatString.o: StmtNodes.inc.h
+FormatString.po: CommentCommandList.inc.h
+FormatString.po: DeclNodes.inc.h
+FormatString.po: DiagnosticCommonKinds.inc.h
+FormatString.po: StmtNodes.inc.h
+LiveVariables.o: DeclNodes.inc.h
+LiveVariables.o: DiagnosticCommonKinds.inc.h
+LiveVariables.o: StmtNodes.inc.h
+LiveVariables.po: DeclNodes.inc.h
+LiveVariables.po: DiagnosticCommonKinds.inc.h
+LiveVariables.po: StmtNodes.inc.h
+ObjCNoReturn.o: CommentCommandList.inc.h
+ObjCNoReturn.o: DeclNodes.inc.h
+ObjCNoReturn.o: DiagnosticCommonKinds.inc.h
+ObjCNoReturn.o: StmtNodes.inc.h
+ObjCNoReturn.po: CommentCommandList.inc.h
+ObjCNoReturn.po: DeclNodes.inc.h
+ObjCNoReturn.po: DiagnosticCommonKinds.inc.h
+ObjCNoReturn.po: StmtNodes.inc.h
+PostOrderCFGView.o: DeclNodes.inc.h
+PostOrderCFGView.o: DiagnosticCommonKinds.inc.h
+PostOrderCFGView.o: StmtNodes.inc.h
+PostOrderCFGView.po: DeclNodes.inc.h
+PostOrderCFGView.po: DiagnosticCommonKinds.inc.h
+PostOrderCFGView.po: StmtNodes.inc.h
+PrintfFormatString.o: CommentCommandList.inc.h
+PrintfFormatString.o: DeclNodes.inc.h
+PrintfFormatString.o: DiagnosticCommonKinds.inc.h
+PrintfFormatString.o: StmtNodes.inc.h
+PrintfFormatString.po: CommentCommandList.inc.h
+PrintfFormatString.po: DeclNodes.inc.h
+PrintfFormatString.po: DiagnosticCommonKinds.inc.h
+PrintfFormatString.po: StmtNodes.inc.h
+ProgramPoint.o: DeclNodes.inc.h
+ProgramPoint.o: DiagnosticCommonKinds.inc.h
+ProgramPoint.o: StmtNodes.inc.h
+ProgramPoint.po: DeclNodes.inc.h
+ProgramPoint.po: DiagnosticCommonKinds.inc.h
+ProgramPoint.po: StmtNodes.inc.h
+PseudoConstantAnalysis.o: DeclNodes.inc.h
+PseudoConstantAnalysis.o: DiagnosticCommonKinds.inc.h
+PseudoConstantAnalysis.o: StmtNodes.inc.h
+PseudoConstantAnalysis.po: DeclNodes.inc.h
+PseudoConstantAnalysis.po: DiagnosticCommonKinds.inc.h
+PseudoConstantAnalysis.po: StmtNodes.inc.h
+ReachableCode.o: DeclNodes.inc.h
+ReachableCode.o: DiagnosticCommonKinds.inc.h
+ReachableCode.o: StmtNodes.inc.h
+ReachableCode.po: DeclNodes.inc.h
+ReachableCode.po: DiagnosticCommonKinds.inc.h
+ReachableCode.po: StmtNodes.inc.h
+ScanfFormatString.o: CommentCommandList.inc.h
+ScanfFormatString.o: DeclNodes.inc.h
+ScanfFormatString.o: DiagnosticCommonKinds.inc.h
+ScanfFormatString.o: StmtNodes.inc.h
+ScanfFormatString.po: CommentCommandList.inc.h
+ScanfFormatString.po: DeclNodes.inc.h
+ScanfFormatString.po: DiagnosticCommonKinds.inc.h
+ScanfFormatString.po: StmtNodes.inc.h
+ThreadSafety.o: AttrList.inc.h
+ThreadSafety.o: Attrs.inc.h
+ThreadSafety.o: DeclNodes.inc.h
+ThreadSafety.o: DiagnosticCommonKinds.inc.h
+ThreadSafety.o: StmtNodes.inc.h
+ThreadSafety.po: AttrList.inc.h
+ThreadSafety.po: Attrs.inc.h
+ThreadSafety.po: DeclNodes.inc.h
+ThreadSafety.po: DiagnosticCommonKinds.inc.h
+ThreadSafety.po: StmtNodes.inc.h
+UninitializedValues.o: AttrList.inc.h
+UninitializedValues.o: Attrs.inc.h
+UninitializedValues.o: CommentCommandList.inc.h
+UninitializedValues.o: DeclNodes.inc.h
+UninitializedValues.o: DiagnosticCommonKinds.inc.h
+UninitializedValues.o: StmtNodes.inc.h
+UninitializedValues.po: AttrList.inc.h
+UninitializedValues.po: Attrs.inc.h
+UninitializedValues.po: CommentCommandList.inc.h
+UninitializedValues.po: DeclNodes.inc.h
+UninitializedValues.po: DiagnosticCommonKinds.inc.h
+UninitializedValues.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/libclangarcmigrate/Makefile b/lib/clang/libclangarcmigrate/Makefile
index a6b06c4..1604a50 100644
--- a/lib/clang/libclangarcmigrate/Makefile
+++ b/lib/clang/libclangarcmigrate/Makefile
@@ -28,7 +28,6 @@ SRCS= ARCMT.cpp \
TGHDRS= AttrList \
AttrParsedAttrList \
- AttrVisitor \
Attrs \
CommentCommandList \
CommentNodes \
diff --git a/lib/clang/libclangarcmigrate/Makefile.depend b/lib/clang/libclangarcmigrate/Makefile.depend
new file mode 100644
index 0000000..91f16dc
--- /dev/null
+++ b/lib/clang/libclangarcmigrate/Makefile.depend
@@ -0,0 +1,203 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ARCMT.o: AttrParsedAttrList.inc.h
+ARCMT.o: CommentCommandList.inc.h
+ARCMT.o: DeclNodes.inc.h
+ARCMT.o: DiagnosticCommonKinds.inc.h
+ARCMT.o: DiagnosticGroups.inc.h
+ARCMT.o: DiagnosticSemaKinds.inc.h
+ARCMT.o: StmtNodes.inc.h
+ARCMT.po: AttrParsedAttrList.inc.h
+ARCMT.po: CommentCommandList.inc.h
+ARCMT.po: DeclNodes.inc.h
+ARCMT.po: DiagnosticCommonKinds.inc.h
+ARCMT.po: DiagnosticGroups.inc.h
+ARCMT.po: DiagnosticSemaKinds.inc.h
+ARCMT.po: StmtNodes.inc.h
+ARCMTActions.o: DiagnosticCommonKinds.inc.h
+ARCMTActions.po: DiagnosticCommonKinds.inc.h
+FileRemapper.o: DiagnosticCommonKinds.inc.h
+FileRemapper.po: DiagnosticCommonKinds.inc.h
+ObjCMT.o: AttrList.inc.h
+ObjCMT.o: Attrs.inc.h
+ObjCMT.o: CommentCommandList.inc.h
+ObjCMT.o: DeclNodes.inc.h
+ObjCMT.o: DiagnosticCommonKinds.inc.h
+ObjCMT.o: StmtNodes.inc.h
+ObjCMT.po: AttrList.inc.h
+ObjCMT.po: Attrs.inc.h
+ObjCMT.po: CommentCommandList.inc.h
+ObjCMT.po: DeclNodes.inc.h
+ObjCMT.po: DiagnosticCommonKinds.inc.h
+ObjCMT.po: StmtNodes.inc.h
+PlistReporter.o: DiagnosticCommonKinds.inc.h
+PlistReporter.po: DiagnosticCommonKinds.inc.h
+TransAPIUses.o: CommentCommandList.inc.h
+TransAPIUses.o: DeclNodes.inc.h
+TransAPIUses.o: DiagnosticCommonKinds.inc.h
+TransAPIUses.o: DiagnosticSemaKinds.inc.h
+TransAPIUses.o: StmtNodes.inc.h
+TransAPIUses.po: CommentCommandList.inc.h
+TransAPIUses.po: DeclNodes.inc.h
+TransAPIUses.po: DiagnosticCommonKinds.inc.h
+TransAPIUses.po: DiagnosticSemaKinds.inc.h
+TransAPIUses.po: StmtNodes.inc.h
+TransARCAssign.o: CommentCommandList.inc.h
+TransARCAssign.o: DeclNodes.inc.h
+TransARCAssign.o: DiagnosticCommonKinds.inc.h
+TransARCAssign.o: DiagnosticSemaKinds.inc.h
+TransARCAssign.o: StmtNodes.inc.h
+TransARCAssign.po: CommentCommandList.inc.h
+TransARCAssign.po: DeclNodes.inc.h
+TransARCAssign.po: DiagnosticCommonKinds.inc.h
+TransARCAssign.po: DiagnosticSemaKinds.inc.h
+TransARCAssign.po: StmtNodes.inc.h
+TransAutoreleasePool.o: CommentCommandList.inc.h
+TransAutoreleasePool.o: DeclNodes.inc.h
+TransAutoreleasePool.o: DiagnosticCommonKinds.inc.h
+TransAutoreleasePool.o: DiagnosticSemaKinds.inc.h
+TransAutoreleasePool.o: StmtNodes.inc.h
+TransAutoreleasePool.po: CommentCommandList.inc.h
+TransAutoreleasePool.po: DeclNodes.inc.h
+TransAutoreleasePool.po: DiagnosticCommonKinds.inc.h
+TransAutoreleasePool.po: DiagnosticSemaKinds.inc.h
+TransAutoreleasePool.po: StmtNodes.inc.h
+TransBlockObjCVariable.o: AttrList.inc.h
+TransBlockObjCVariable.o: Attrs.inc.h
+TransBlockObjCVariable.o: CommentCommandList.inc.h
+TransBlockObjCVariable.o: DeclNodes.inc.h
+TransBlockObjCVariable.o: DiagnosticCommonKinds.inc.h
+TransBlockObjCVariable.o: StmtNodes.inc.h
+TransBlockObjCVariable.po: AttrList.inc.h
+TransBlockObjCVariable.po: Attrs.inc.h
+TransBlockObjCVariable.po: CommentCommandList.inc.h
+TransBlockObjCVariable.po: DeclNodes.inc.h
+TransBlockObjCVariable.po: DiagnosticCommonKinds.inc.h
+TransBlockObjCVariable.po: StmtNodes.inc.h
+TransEmptyStatementsAndDealloc.o: CommentCommandList.inc.h
+TransEmptyStatementsAndDealloc.o: DeclNodes.inc.h
+TransEmptyStatementsAndDealloc.o: DiagnosticCommonKinds.inc.h
+TransEmptyStatementsAndDealloc.o: StmtNodes.inc.h
+TransEmptyStatementsAndDealloc.po: CommentCommandList.inc.h
+TransEmptyStatementsAndDealloc.po: DeclNodes.inc.h
+TransEmptyStatementsAndDealloc.po: DiagnosticCommonKinds.inc.h
+TransEmptyStatementsAndDealloc.po: StmtNodes.inc.h
+TransGCAttrs.o: CommentCommandList.inc.h
+TransGCAttrs.o: DeclNodes.inc.h
+TransGCAttrs.o: DiagnosticCommonKinds.inc.h
+TransGCAttrs.o: DiagnosticSemaKinds.inc.h
+TransGCAttrs.o: StmtNodes.inc.h
+TransGCAttrs.po: CommentCommandList.inc.h
+TransGCAttrs.po: DeclNodes.inc.h
+TransGCAttrs.po: DiagnosticCommonKinds.inc.h
+TransGCAttrs.po: DiagnosticSemaKinds.inc.h
+TransGCAttrs.po: StmtNodes.inc.h
+TransGCCalls.o: CommentCommandList.inc.h
+TransGCCalls.o: DeclNodes.inc.h
+TransGCCalls.o: DiagnosticCommonKinds.inc.h
+TransGCCalls.o: DiagnosticSemaKinds.inc.h
+TransGCCalls.o: StmtNodes.inc.h
+TransGCCalls.po: CommentCommandList.inc.h
+TransGCCalls.po: DeclNodes.inc.h
+TransGCCalls.po: DiagnosticCommonKinds.inc.h
+TransGCCalls.po: DiagnosticSemaKinds.inc.h
+TransGCCalls.po: StmtNodes.inc.h
+TransProperties.o: DeclNodes.inc.h
+TransProperties.o: DiagnosticCommonKinds.inc.h
+TransProperties.o: DiagnosticSemaKinds.inc.h
+TransProperties.o: StmtNodes.inc.h
+TransProperties.po: DeclNodes.inc.h
+TransProperties.po: DiagnosticCommonKinds.inc.h
+TransProperties.po: DiagnosticSemaKinds.inc.h
+TransProperties.po: StmtNodes.inc.h
+TransProtectedScope.o: CommentCommandList.inc.h
+TransProtectedScope.o: DeclNodes.inc.h
+TransProtectedScope.o: DiagnosticCommonKinds.inc.h
+TransProtectedScope.o: DiagnosticSemaKinds.inc.h
+TransProtectedScope.o: StmtNodes.inc.h
+TransProtectedScope.po: CommentCommandList.inc.h
+TransProtectedScope.po: DeclNodes.inc.h
+TransProtectedScope.po: DiagnosticCommonKinds.inc.h
+TransProtectedScope.po: DiagnosticSemaKinds.inc.h
+TransProtectedScope.po: StmtNodes.inc.h
+TransRetainReleaseDealloc.o: CommentCommandList.inc.h
+TransRetainReleaseDealloc.o: DeclNodes.inc.h
+TransRetainReleaseDealloc.o: DiagnosticCommonKinds.inc.h
+TransRetainReleaseDealloc.o: DiagnosticSemaKinds.inc.h
+TransRetainReleaseDealloc.o: StmtNodes.inc.h
+TransRetainReleaseDealloc.po: CommentCommandList.inc.h
+TransRetainReleaseDealloc.po: DeclNodes.inc.h
+TransRetainReleaseDealloc.po: DiagnosticCommonKinds.inc.h
+TransRetainReleaseDealloc.po: DiagnosticSemaKinds.inc.h
+TransRetainReleaseDealloc.po: StmtNodes.inc.h
+TransUnbridgedCasts.o: AttrList.inc.h
+TransUnbridgedCasts.o: Attrs.inc.h
+TransUnbridgedCasts.o: CommentCommandList.inc.h
+TransUnbridgedCasts.o: DeclNodes.inc.h
+TransUnbridgedCasts.o: DiagnosticCommonKinds.inc.h
+TransUnbridgedCasts.o: DiagnosticSemaKinds.inc.h
+TransUnbridgedCasts.o: StmtNodes.inc.h
+TransUnbridgedCasts.po: AttrList.inc.h
+TransUnbridgedCasts.po: Attrs.inc.h
+TransUnbridgedCasts.po: CommentCommandList.inc.h
+TransUnbridgedCasts.po: DeclNodes.inc.h
+TransUnbridgedCasts.po: DiagnosticCommonKinds.inc.h
+TransUnbridgedCasts.po: DiagnosticSemaKinds.inc.h
+TransUnbridgedCasts.po: StmtNodes.inc.h
+TransUnusedInitDelegate.o: CommentCommandList.inc.h
+TransUnusedInitDelegate.o: DeclNodes.inc.h
+TransUnusedInitDelegate.o: DiagnosticCommonKinds.inc.h
+TransUnusedInitDelegate.o: DiagnosticSemaKinds.inc.h
+TransUnusedInitDelegate.o: StmtNodes.inc.h
+TransUnusedInitDelegate.po: CommentCommandList.inc.h
+TransUnusedInitDelegate.po: DeclNodes.inc.h
+TransUnusedInitDelegate.po: DiagnosticCommonKinds.inc.h
+TransUnusedInitDelegate.po: DiagnosticSemaKinds.inc.h
+TransUnusedInitDelegate.po: StmtNodes.inc.h
+TransZeroOutPropsInDealloc.o: CommentCommandList.inc.h
+TransZeroOutPropsInDealloc.o: DeclNodes.inc.h
+TransZeroOutPropsInDealloc.o: DiagnosticCommonKinds.inc.h
+TransZeroOutPropsInDealloc.o: StmtNodes.inc.h
+TransZeroOutPropsInDealloc.po: CommentCommandList.inc.h
+TransZeroOutPropsInDealloc.po: DeclNodes.inc.h
+TransZeroOutPropsInDealloc.po: DiagnosticCommonKinds.inc.h
+TransZeroOutPropsInDealloc.po: StmtNodes.inc.h
+TransformActions.o: CommentCommandList.inc.h
+TransformActions.o: DeclNodes.inc.h
+TransformActions.o: DiagnosticCommonKinds.inc.h
+TransformActions.o: StmtNodes.inc.h
+TransformActions.po: CommentCommandList.inc.h
+TransformActions.po: DeclNodes.inc.h
+TransformActions.po: DiagnosticCommonKinds.inc.h
+TransformActions.po: StmtNodes.inc.h
+Transforms.o: AttrList.inc.h
+Transforms.o: AttrParsedAttrList.inc.h
+Transforms.o: Attrs.inc.h
+Transforms.o: CommentCommandList.inc.h
+Transforms.o: DeclNodes.inc.h
+Transforms.o: DiagnosticCommonKinds.inc.h
+Transforms.o: DiagnosticSemaKinds.inc.h
+Transforms.o: StmtNodes.inc.h
+Transforms.po: AttrList.inc.h
+Transforms.po: AttrParsedAttrList.inc.h
+Transforms.po: Attrs.inc.h
+Transforms.po: CommentCommandList.inc.h
+Transforms.po: DeclNodes.inc.h
+Transforms.po: DiagnosticCommonKinds.inc.h
+Transforms.po: DiagnosticSemaKinds.inc.h
+Transforms.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/libclangast/Makefile b/lib/clang/libclangast/Makefile
index a3f00aa..71cd684 100644
--- a/lib/clang/libclangast/Makefile
+++ b/lib/clang/libclangast/Makefile
@@ -39,6 +39,7 @@ SRCS= APValue.cpp \
ItaniumCXXABI.cpp \
ItaniumMangle.cpp \
Mangle.cpp \
+ MangleNumberingContext.cpp \
MicrosoftCXXABI.cpp \
MicrosoftMangle.cpp \
NSAPI.cpp \
@@ -64,7 +65,6 @@ SRCS= APValue.cpp \
TGHDRS= AttrDump \
AttrImpl \
AttrList \
- AttrVisitor \
Attrs \
CommentCommandInfo \
CommentCommandList \
@@ -76,7 +76,6 @@ TGHDRS= AttrDump \
DiagnosticASTKinds \
DiagnosticCommentKinds \
DiagnosticCommonKinds \
- DiagnosticFrontendKinds \
DiagnosticSemaKinds \
StmtNodes
diff --git a/lib/clang/libclangast/Makefile.depend b/lib/clang/libclangast/Makefile.depend
new file mode 100644
index 0000000..eccc381
--- /dev/null
+++ b/lib/clang/libclangast/Makefile.depend
@@ -0,0 +1,539 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+APValue.o: CommentCommandList.inc.h
+APValue.o: DeclNodes.inc.h
+APValue.o: DiagnosticCommonKinds.inc.h
+APValue.o: StmtNodes.inc.h
+APValue.po: CommentCommandList.inc.h
+APValue.po: DeclNodes.inc.h
+APValue.po: DiagnosticCommonKinds.inc.h
+APValue.po: StmtNodes.inc.h
+ASTConsumer.o: DeclNodes.inc.h
+ASTConsumer.o: DiagnosticCommonKinds.inc.h
+ASTConsumer.po: DeclNodes.inc.h
+ASTConsumer.po: DiagnosticCommonKinds.inc.h
+ASTContext.o: AttrList.inc.h
+ASTContext.o: Attrs.inc.h
+ASTContext.o: CommentCommandList.inc.h
+ASTContext.o: CommentNodes.inc.h
+ASTContext.o: DeclNodes.inc.h
+ASTContext.o: DiagnosticCommonKinds.inc.h
+ASTContext.o: StmtNodes.inc.h
+ASTContext.po: AttrList.inc.h
+ASTContext.po: Attrs.inc.h
+ASTContext.po: CommentCommandList.inc.h
+ASTContext.po: CommentNodes.inc.h
+ASTContext.po: DeclNodes.inc.h
+ASTContext.po: DiagnosticCommonKinds.inc.h
+ASTContext.po: StmtNodes.inc.h
+ASTDiagnostic.o: CommentCommandList.inc.h
+ASTDiagnostic.o: DeclNodes.inc.h
+ASTDiagnostic.o: DiagnosticASTKinds.inc.h
+ASTDiagnostic.o: DiagnosticCommonKinds.inc.h
+ASTDiagnostic.o: StmtNodes.inc.h
+ASTDiagnostic.po: CommentCommandList.inc.h
+ASTDiagnostic.po: DeclNodes.inc.h
+ASTDiagnostic.po: DiagnosticASTKinds.inc.h
+ASTDiagnostic.po: DiagnosticCommonKinds.inc.h
+ASTDiagnostic.po: StmtNodes.inc.h
+ASTDumper.o: AttrDump.inc.h
+ASTDumper.o: AttrList.inc.h
+ASTDumper.o: Attrs.inc.h
+ASTDumper.o: CommentCommandList.inc.h
+ASTDumper.o: CommentNodes.inc.h
+ASTDumper.o: DeclNodes.inc.h
+ASTDumper.o: DiagnosticCommonKinds.inc.h
+ASTDumper.o: StmtNodes.inc.h
+ASTDumper.po: AttrDump.inc.h
+ASTDumper.po: AttrList.inc.h
+ASTDumper.po: Attrs.inc.h
+ASTDumper.po: CommentCommandList.inc.h
+ASTDumper.po: CommentNodes.inc.h
+ASTDumper.po: DeclNodes.inc.h
+ASTDumper.po: DiagnosticCommonKinds.inc.h
+ASTDumper.po: StmtNodes.inc.h
+ASTImporter.o: CommentCommandList.inc.h
+ASTImporter.o: DeclNodes.inc.h
+ASTImporter.o: DiagnosticASTKinds.inc.h
+ASTImporter.o: DiagnosticCommonKinds.inc.h
+ASTImporter.o: StmtNodes.inc.h
+ASTImporter.po: CommentCommandList.inc.h
+ASTImporter.po: DeclNodes.inc.h
+ASTImporter.po: DiagnosticASTKinds.inc.h
+ASTImporter.po: DiagnosticCommonKinds.inc.h
+ASTImporter.po: StmtNodes.inc.h
+ASTTypeTraits.o: CommentCommandList.inc.h
+ASTTypeTraits.o: DeclNodes.inc.h
+ASTTypeTraits.o: DiagnosticCommonKinds.inc.h
+ASTTypeTraits.o: StmtNodes.inc.h
+ASTTypeTraits.po: CommentCommandList.inc.h
+ASTTypeTraits.po: DeclNodes.inc.h
+ASTTypeTraits.po: DiagnosticCommonKinds.inc.h
+ASTTypeTraits.po: StmtNodes.inc.h
+AttrImpl.o: AttrImpl.inc.h
+AttrImpl.o: AttrList.inc.h
+AttrImpl.o: Attrs.inc.h
+AttrImpl.o: CommentCommandList.inc.h
+AttrImpl.o: DeclNodes.inc.h
+AttrImpl.o: DiagnosticCommonKinds.inc.h
+AttrImpl.o: StmtNodes.inc.h
+AttrImpl.po: AttrImpl.inc.h
+AttrImpl.po: AttrList.inc.h
+AttrImpl.po: Attrs.inc.h
+AttrImpl.po: CommentCommandList.inc.h
+AttrImpl.po: DeclNodes.inc.h
+AttrImpl.po: DiagnosticCommonKinds.inc.h
+AttrImpl.po: StmtNodes.inc.h
+CXXInheritance.o: CommentCommandList.inc.h
+CXXInheritance.o: DeclNodes.inc.h
+CXXInheritance.o: DiagnosticCommonKinds.inc.h
+CXXInheritance.o: StmtNodes.inc.h
+CXXInheritance.po: CommentCommandList.inc.h
+CXXInheritance.po: DeclNodes.inc.h
+CXXInheritance.po: DiagnosticCommonKinds.inc.h
+CXXInheritance.po: StmtNodes.inc.h
+Comment.o: CommentCommandList.inc.h
+Comment.o: CommentNodes.inc.h
+Comment.o: DeclNodes.inc.h
+Comment.o: DiagnosticCommonKinds.inc.h
+Comment.o: StmtNodes.inc.h
+Comment.po: CommentCommandList.inc.h
+Comment.po: CommentNodes.inc.h
+Comment.po: DeclNodes.inc.h
+Comment.po: DiagnosticCommonKinds.inc.h
+Comment.po: StmtNodes.inc.h
+CommentBriefParser.o: CommentCommandList.inc.h
+CommentBriefParser.o: DiagnosticCommonKinds.inc.h
+CommentBriefParser.po: CommentCommandList.inc.h
+CommentBriefParser.po: DiagnosticCommonKinds.inc.h
+CommentCommandTraits.o: CommentCommandInfo.inc.h
+CommentCommandTraits.o: CommentCommandList.inc.h
+CommentCommandTraits.po: CommentCommandInfo.inc.h
+CommentCommandTraits.po: CommentCommandList.inc.h
+CommentLexer.o: CommentCommandList.inc.h
+CommentLexer.o: CommentHTMLNamedCharacterReferences.inc.h
+CommentLexer.o: CommentHTMLTags.inc.h
+CommentLexer.o: DiagnosticCommentKinds.inc.h
+CommentLexer.o: DiagnosticCommonKinds.inc.h
+CommentLexer.po: CommentCommandList.inc.h
+CommentLexer.po: CommentHTMLNamedCharacterReferences.inc.h
+CommentLexer.po: CommentHTMLTags.inc.h
+CommentLexer.po: DiagnosticCommentKinds.inc.h
+CommentLexer.po: DiagnosticCommonKinds.inc.h
+CommentParser.o: CommentCommandList.inc.h
+CommentParser.o: CommentNodes.inc.h
+CommentParser.o: DeclNodes.inc.h
+CommentParser.o: DiagnosticCommentKinds.inc.h
+CommentParser.o: DiagnosticCommonKinds.inc.h
+CommentParser.po: CommentCommandList.inc.h
+CommentParser.po: CommentNodes.inc.h
+CommentParser.po: DeclNodes.inc.h
+CommentParser.po: DiagnosticCommentKinds.inc.h
+CommentParser.po: DiagnosticCommonKinds.inc.h
+CommentSema.o: AttrList.inc.h
+CommentSema.o: Attrs.inc.h
+CommentSema.o: CommentCommandList.inc.h
+CommentSema.o: CommentHTMLTagsProperties.inc.h
+CommentSema.o: CommentNodes.inc.h
+CommentSema.o: DeclNodes.inc.h
+CommentSema.o: DiagnosticCommentKinds.inc.h
+CommentSema.o: DiagnosticCommonKinds.inc.h
+CommentSema.o: StmtNodes.inc.h
+CommentSema.po: AttrList.inc.h
+CommentSema.po: Attrs.inc.h
+CommentSema.po: CommentCommandList.inc.h
+CommentSema.po: CommentHTMLTagsProperties.inc.h
+CommentSema.po: CommentNodes.inc.h
+CommentSema.po: DeclNodes.inc.h
+CommentSema.po: DiagnosticCommentKinds.inc.h
+CommentSema.po: DiagnosticCommonKinds.inc.h
+CommentSema.po: StmtNodes.inc.h
+Decl.o: AttrList.inc.h
+Decl.o: Attrs.inc.h
+Decl.o: CommentCommandList.inc.h
+Decl.o: DeclNodes.inc.h
+Decl.o: DiagnosticCommonKinds.inc.h
+Decl.o: StmtNodes.inc.h
+Decl.po: AttrList.inc.h
+Decl.po: Attrs.inc.h
+Decl.po: CommentCommandList.inc.h
+Decl.po: DeclNodes.inc.h
+Decl.po: DiagnosticCommonKinds.inc.h
+Decl.po: StmtNodes.inc.h
+DeclBase.o: AttrList.inc.h
+DeclBase.o: Attrs.inc.h
+DeclBase.o: CommentCommandList.inc.h
+DeclBase.o: DeclNodes.inc.h
+DeclBase.o: DiagnosticCommonKinds.inc.h
+DeclBase.o: StmtNodes.inc.h
+DeclBase.po: AttrList.inc.h
+DeclBase.po: Attrs.inc.h
+DeclBase.po: CommentCommandList.inc.h
+DeclBase.po: DeclNodes.inc.h
+DeclBase.po: DiagnosticCommonKinds.inc.h
+DeclBase.po: StmtNodes.inc.h
+DeclCXX.o: CommentCommandList.inc.h
+DeclCXX.o: DeclNodes.inc.h
+DeclCXX.o: DiagnosticCommonKinds.inc.h
+DeclCXX.o: StmtNodes.inc.h
+DeclCXX.po: CommentCommandList.inc.h
+DeclCXX.po: DeclNodes.inc.h
+DeclCXX.po: DiagnosticCommonKinds.inc.h
+DeclCXX.po: StmtNodes.inc.h
+DeclFriend.o: CommentCommandList.inc.h
+DeclFriend.o: DeclNodes.inc.h
+DeclFriend.o: DiagnosticCommonKinds.inc.h
+DeclFriend.o: StmtNodes.inc.h
+DeclFriend.po: CommentCommandList.inc.h
+DeclFriend.po: DeclNodes.inc.h
+DeclFriend.po: DiagnosticCommonKinds.inc.h
+DeclFriend.po: StmtNodes.inc.h
+DeclGroup.o: CommentCommandList.inc.h
+DeclGroup.o: DeclNodes.inc.h
+DeclGroup.o: DiagnosticCommonKinds.inc.h
+DeclGroup.o: StmtNodes.inc.h
+DeclGroup.po: CommentCommandList.inc.h
+DeclGroup.po: DeclNodes.inc.h
+DeclGroup.po: DiagnosticCommonKinds.inc.h
+DeclGroup.po: StmtNodes.inc.h
+DeclObjC.o: AttrList.inc.h
+DeclObjC.o: Attrs.inc.h
+DeclObjC.o: CommentCommandList.inc.h
+DeclObjC.o: DeclNodes.inc.h
+DeclObjC.o: DiagnosticCommonKinds.inc.h
+DeclObjC.o: StmtNodes.inc.h
+DeclObjC.po: AttrList.inc.h
+DeclObjC.po: Attrs.inc.h
+DeclObjC.po: CommentCommandList.inc.h
+DeclObjC.po: DeclNodes.inc.h
+DeclObjC.po: DiagnosticCommonKinds.inc.h
+DeclObjC.po: StmtNodes.inc.h
+DeclOpenMP.o: CommentCommandList.inc.h
+DeclOpenMP.o: DeclNodes.inc.h
+DeclOpenMP.o: DiagnosticCommonKinds.inc.h
+DeclOpenMP.o: StmtNodes.inc.h
+DeclOpenMP.po: CommentCommandList.inc.h
+DeclOpenMP.po: DeclNodes.inc.h
+DeclOpenMP.po: DiagnosticCommonKinds.inc.h
+DeclOpenMP.po: StmtNodes.inc.h
+DeclPrinter.o: AttrList.inc.h
+DeclPrinter.o: Attrs.inc.h
+DeclPrinter.o: CommentCommandList.inc.h
+DeclPrinter.o: DeclNodes.inc.h
+DeclPrinter.o: DiagnosticCommonKinds.inc.h
+DeclPrinter.o: StmtNodes.inc.h
+DeclPrinter.po: AttrList.inc.h
+DeclPrinter.po: Attrs.inc.h
+DeclPrinter.po: CommentCommandList.inc.h
+DeclPrinter.po: DeclNodes.inc.h
+DeclPrinter.po: DiagnosticCommonKinds.inc.h
+DeclPrinter.po: StmtNodes.inc.h
+DeclTemplate.o: CommentCommandList.inc.h
+DeclTemplate.o: DeclNodes.inc.h
+DeclTemplate.o: DiagnosticCommonKinds.inc.h
+DeclTemplate.o: StmtNodes.inc.h
+DeclTemplate.po: CommentCommandList.inc.h
+DeclTemplate.po: DeclNodes.inc.h
+DeclTemplate.po: DiagnosticCommonKinds.inc.h
+DeclTemplate.po: StmtNodes.inc.h
+DeclarationName.o: CommentCommandList.inc.h
+DeclarationName.o: DeclNodes.inc.h
+DeclarationName.o: DiagnosticCommonKinds.inc.h
+DeclarationName.o: StmtNodes.inc.h
+DeclarationName.po: CommentCommandList.inc.h
+DeclarationName.po: DeclNodes.inc.h
+DeclarationName.po: DiagnosticCommonKinds.inc.h
+DeclarationName.po: StmtNodes.inc.h
+Expr.o: AttrList.inc.h
+Expr.o: Attrs.inc.h
+Expr.o: CommentCommandList.inc.h
+Expr.o: DeclNodes.inc.h
+Expr.o: DiagnosticCommonKinds.inc.h
+Expr.o: DiagnosticSemaKinds.inc.h
+Expr.o: StmtNodes.inc.h
+Expr.po: AttrList.inc.h
+Expr.po: Attrs.inc.h
+Expr.po: CommentCommandList.inc.h
+Expr.po: DeclNodes.inc.h
+Expr.po: DiagnosticCommonKinds.inc.h
+Expr.po: DiagnosticSemaKinds.inc.h
+Expr.po: StmtNodes.inc.h
+ExprCXX.o: AttrList.inc.h
+ExprCXX.o: Attrs.inc.h
+ExprCXX.o: CommentCommandList.inc.h
+ExprCXX.o: DeclNodes.inc.h
+ExprCXX.o: DiagnosticCommonKinds.inc.h
+ExprCXX.o: StmtNodes.inc.h
+ExprCXX.po: AttrList.inc.h
+ExprCXX.po: Attrs.inc.h
+ExprCXX.po: CommentCommandList.inc.h
+ExprCXX.po: DeclNodes.inc.h
+ExprCXX.po: DiagnosticCommonKinds.inc.h
+ExprCXX.po: StmtNodes.inc.h
+ExprClassification.o: CommentCommandList.inc.h
+ExprClassification.o: DeclNodes.inc.h
+ExprClassification.o: DiagnosticCommonKinds.inc.h
+ExprClassification.o: StmtNodes.inc.h
+ExprClassification.po: CommentCommandList.inc.h
+ExprClassification.po: DeclNodes.inc.h
+ExprClassification.po: DiagnosticCommonKinds.inc.h
+ExprClassification.po: StmtNodes.inc.h
+ExprConstant.o: CommentCommandList.inc.h
+ExprConstant.o: DeclNodes.inc.h
+ExprConstant.o: DiagnosticASTKinds.inc.h
+ExprConstant.o: DiagnosticCommonKinds.inc.h
+ExprConstant.o: StmtNodes.inc.h
+ExprConstant.po: CommentCommandList.inc.h
+ExprConstant.po: DeclNodes.inc.h
+ExprConstant.po: DiagnosticASTKinds.inc.h
+ExprConstant.po: DiagnosticCommonKinds.inc.h
+ExprConstant.po: StmtNodes.inc.h
+ExternalASTSource.o: DeclNodes.inc.h
+ExternalASTSource.o: DiagnosticCommonKinds.inc.h
+ExternalASTSource.po: DeclNodes.inc.h
+ExternalASTSource.po: DiagnosticCommonKinds.inc.h
+InheritViz.o: CommentCommandList.inc.h
+InheritViz.o: DeclNodes.inc.h
+InheritViz.o: DiagnosticCommonKinds.inc.h
+InheritViz.o: StmtNodes.inc.h
+InheritViz.po: CommentCommandList.inc.h
+InheritViz.po: DeclNodes.inc.h
+InheritViz.po: DiagnosticCommonKinds.inc.h
+InheritViz.po: StmtNodes.inc.h
+ItaniumCXXABI.o: CommentCommandList.inc.h
+ItaniumCXXABI.o: DeclNodes.inc.h
+ItaniumCXXABI.o: DiagnosticCommonKinds.inc.h
+ItaniumCXXABI.o: StmtNodes.inc.h
+ItaniumCXXABI.po: CommentCommandList.inc.h
+ItaniumCXXABI.po: DeclNodes.inc.h
+ItaniumCXXABI.po: DiagnosticCommonKinds.inc.h
+ItaniumCXXABI.po: StmtNodes.inc.h
+ItaniumMangle.o: AttrList.inc.h
+ItaniumMangle.o: Attrs.inc.h
+ItaniumMangle.o: CommentCommandList.inc.h
+ItaniumMangle.o: DeclNodes.inc.h
+ItaniumMangle.o: DiagnosticCommonKinds.inc.h
+ItaniumMangle.o: StmtNodes.inc.h
+ItaniumMangle.po: AttrList.inc.h
+ItaniumMangle.po: Attrs.inc.h
+ItaniumMangle.po: CommentCommandList.inc.h
+ItaniumMangle.po: DeclNodes.inc.h
+ItaniumMangle.po: DiagnosticCommonKinds.inc.h
+ItaniumMangle.po: StmtNodes.inc.h
+Mangle.o: AttrList.inc.h
+Mangle.o: Attrs.inc.h
+Mangle.o: CommentCommandList.inc.h
+Mangle.o: DeclNodes.inc.h
+Mangle.o: DiagnosticCommonKinds.inc.h
+Mangle.o: StmtNodes.inc.h
+Mangle.po: AttrList.inc.h
+Mangle.po: Attrs.inc.h
+Mangle.po: CommentCommandList.inc.h
+Mangle.po: DeclNodes.inc.h
+Mangle.po: DiagnosticCommonKinds.inc.h
+Mangle.po: StmtNodes.inc.h
+MangleNumberingContext.o: CommentCommandList.inc.h
+MangleNumberingContext.o: DeclNodes.inc.h
+MangleNumberingContext.o: DiagnosticCommonKinds.inc.h
+MangleNumberingContext.o: StmtNodes.inc.h
+MangleNumberingContext.po: CommentCommandList.inc.h
+MangleNumberingContext.po: DeclNodes.inc.h
+MangleNumberingContext.po: DiagnosticCommonKinds.inc.h
+MangleNumberingContext.po: StmtNodes.inc.h
+MicrosoftCXXABI.o: AttrList.inc.h
+MicrosoftCXXABI.o: Attrs.inc.h
+MicrosoftCXXABI.o: CommentCommandList.inc.h
+MicrosoftCXXABI.o: DeclNodes.inc.h
+MicrosoftCXXABI.o: DiagnosticCommonKinds.inc.h
+MicrosoftCXXABI.o: StmtNodes.inc.h
+MicrosoftCXXABI.po: AttrList.inc.h
+MicrosoftCXXABI.po: Attrs.inc.h
+MicrosoftCXXABI.po: CommentCommandList.inc.h
+MicrosoftCXXABI.po: DeclNodes.inc.h
+MicrosoftCXXABI.po: DiagnosticCommonKinds.inc.h
+MicrosoftCXXABI.po: StmtNodes.inc.h
+MicrosoftMangle.o: AttrList.inc.h
+MicrosoftMangle.o: Attrs.inc.h
+MicrosoftMangle.o: CommentCommandList.inc.h
+MicrosoftMangle.o: DeclNodes.inc.h
+MicrosoftMangle.o: DiagnosticCommonKinds.inc.h
+MicrosoftMangle.o: StmtNodes.inc.h
+MicrosoftMangle.po: AttrList.inc.h
+MicrosoftMangle.po: Attrs.inc.h
+MicrosoftMangle.po: CommentCommandList.inc.h
+MicrosoftMangle.po: DeclNodes.inc.h
+MicrosoftMangle.po: DiagnosticCommonKinds.inc.h
+MicrosoftMangle.po: StmtNodes.inc.h
+NSAPI.o: CommentCommandList.inc.h
+NSAPI.o: DeclNodes.inc.h
+NSAPI.o: DiagnosticCommonKinds.inc.h
+NSAPI.o: StmtNodes.inc.h
+NSAPI.po: CommentCommandList.inc.h
+NSAPI.po: DeclNodes.inc.h
+NSAPI.po: DiagnosticCommonKinds.inc.h
+NSAPI.po: StmtNodes.inc.h
+NestedNameSpecifier.o: CommentCommandList.inc.h
+NestedNameSpecifier.o: DeclNodes.inc.h
+NestedNameSpecifier.o: DiagnosticCommonKinds.inc.h
+NestedNameSpecifier.o: StmtNodes.inc.h
+NestedNameSpecifier.po: CommentCommandList.inc.h
+NestedNameSpecifier.po: DeclNodes.inc.h
+NestedNameSpecifier.po: DiagnosticCommonKinds.inc.h
+NestedNameSpecifier.po: StmtNodes.inc.h
+ParentMap.o: DeclNodes.inc.h
+ParentMap.o: DiagnosticCommonKinds.inc.h
+ParentMap.o: StmtNodes.inc.h
+ParentMap.po: DeclNodes.inc.h
+ParentMap.po: DiagnosticCommonKinds.inc.h
+ParentMap.po: StmtNodes.inc.h
+RawCommentList.o: CommentCommandList.inc.h
+RawCommentList.o: CommentNodes.inc.h
+RawCommentList.o: DeclNodes.inc.h
+RawCommentList.o: DiagnosticCommonKinds.inc.h
+RawCommentList.o: StmtNodes.inc.h
+RawCommentList.po: CommentCommandList.inc.h
+RawCommentList.po: CommentNodes.inc.h
+RawCommentList.po: DeclNodes.inc.h
+RawCommentList.po: DiagnosticCommonKinds.inc.h
+RawCommentList.po: StmtNodes.inc.h
+RecordLayout.o: CommentCommandList.inc.h
+RecordLayout.o: DeclNodes.inc.h
+RecordLayout.o: DiagnosticCommonKinds.inc.h
+RecordLayout.o: StmtNodes.inc.h
+RecordLayout.po: CommentCommandList.inc.h
+RecordLayout.po: DeclNodes.inc.h
+RecordLayout.po: DiagnosticCommonKinds.inc.h
+RecordLayout.po: StmtNodes.inc.h
+RecordLayoutBuilder.o: AttrList.inc.h
+RecordLayoutBuilder.o: Attrs.inc.h
+RecordLayoutBuilder.o: CommentCommandList.inc.h
+RecordLayoutBuilder.o: DeclNodes.inc.h
+RecordLayoutBuilder.o: DiagnosticCommonKinds.inc.h
+RecordLayoutBuilder.o: DiagnosticSemaKinds.inc.h
+RecordLayoutBuilder.o: StmtNodes.inc.h
+RecordLayoutBuilder.po: AttrList.inc.h
+RecordLayoutBuilder.po: Attrs.inc.h
+RecordLayoutBuilder.po: CommentCommandList.inc.h
+RecordLayoutBuilder.po: DeclNodes.inc.h
+RecordLayoutBuilder.po: DiagnosticCommonKinds.inc.h
+RecordLayoutBuilder.po: DiagnosticSemaKinds.inc.h
+RecordLayoutBuilder.po: StmtNodes.inc.h
+SelectorLocationsKind.o: DeclNodes.inc.h
+SelectorLocationsKind.o: DiagnosticCommonKinds.inc.h
+SelectorLocationsKind.o: StmtNodes.inc.h
+SelectorLocationsKind.po: DeclNodes.inc.h
+SelectorLocationsKind.po: DiagnosticCommonKinds.inc.h
+SelectorLocationsKind.po: StmtNodes.inc.h
+Stmt.o: CommentCommandList.inc.h
+Stmt.o: DeclNodes.inc.h
+Stmt.o: DiagnosticASTKinds.inc.h
+Stmt.o: DiagnosticCommonKinds.inc.h
+Stmt.o: StmtNodes.inc.h
+Stmt.po: CommentCommandList.inc.h
+Stmt.po: DeclNodes.inc.h
+Stmt.po: DiagnosticASTKinds.inc.h
+Stmt.po: DiagnosticCommonKinds.inc.h
+Stmt.po: StmtNodes.inc.h
+StmtIterator.o: DeclNodes.inc.h
+StmtIterator.o: DiagnosticCommonKinds.inc.h
+StmtIterator.po: DeclNodes.inc.h
+StmtIterator.po: DiagnosticCommonKinds.inc.h
+StmtPrinter.o: AttrList.inc.h
+StmtPrinter.o: Attrs.inc.h
+StmtPrinter.o: CommentCommandList.inc.h
+StmtPrinter.o: DeclNodes.inc.h
+StmtPrinter.o: DiagnosticCommonKinds.inc.h
+StmtPrinter.o: StmtNodes.inc.h
+StmtPrinter.po: AttrList.inc.h
+StmtPrinter.po: Attrs.inc.h
+StmtPrinter.po: CommentCommandList.inc.h
+StmtPrinter.po: DeclNodes.inc.h
+StmtPrinter.po: DiagnosticCommonKinds.inc.h
+StmtPrinter.po: StmtNodes.inc.h
+StmtProfile.o: CommentCommandList.inc.h
+StmtProfile.o: DeclNodes.inc.h
+StmtProfile.o: DiagnosticCommonKinds.inc.h
+StmtProfile.o: StmtNodes.inc.h
+StmtProfile.po: CommentCommandList.inc.h
+StmtProfile.po: DeclNodes.inc.h
+StmtProfile.po: DiagnosticCommonKinds.inc.h
+StmtProfile.po: StmtNodes.inc.h
+StmtViz.o: DeclNodes.inc.h
+StmtViz.o: DiagnosticCommonKinds.inc.h
+StmtViz.o: StmtNodes.inc.h
+StmtViz.po: DeclNodes.inc.h
+StmtViz.po: DiagnosticCommonKinds.inc.h
+StmtViz.po: StmtNodes.inc.h
+TemplateBase.o: CommentCommandList.inc.h
+TemplateBase.o: DeclNodes.inc.h
+TemplateBase.o: DiagnosticCommonKinds.inc.h
+TemplateBase.o: StmtNodes.inc.h
+TemplateBase.po: CommentCommandList.inc.h
+TemplateBase.po: DeclNodes.inc.h
+TemplateBase.po: DiagnosticCommonKinds.inc.h
+TemplateBase.po: StmtNodes.inc.h
+TemplateName.o: DeclNodes.inc.h
+TemplateName.o: DiagnosticCommonKinds.inc.h
+TemplateName.o: StmtNodes.inc.h
+TemplateName.po: DeclNodes.inc.h
+TemplateName.po: DiagnosticCommonKinds.inc.h
+TemplateName.po: StmtNodes.inc.h
+Type.o: AttrList.inc.h
+Type.o: Attrs.inc.h
+Type.o: CommentCommandList.inc.h
+Type.o: DeclNodes.inc.h
+Type.o: DiagnosticCommonKinds.inc.h
+Type.o: StmtNodes.inc.h
+Type.po: AttrList.inc.h
+Type.po: Attrs.inc.h
+Type.po: CommentCommandList.inc.h
+Type.po: DeclNodes.inc.h
+Type.po: DiagnosticCommonKinds.inc.h
+Type.po: StmtNodes.inc.h
+TypeLoc.o: CommentCommandList.inc.h
+TypeLoc.o: DeclNodes.inc.h
+TypeLoc.o: DiagnosticCommonKinds.inc.h
+TypeLoc.o: StmtNodes.inc.h
+TypeLoc.po: CommentCommandList.inc.h
+TypeLoc.po: DeclNodes.inc.h
+TypeLoc.po: DiagnosticCommonKinds.inc.h
+TypeLoc.po: StmtNodes.inc.h
+TypePrinter.o: CommentCommandList.inc.h
+TypePrinter.o: DeclNodes.inc.h
+TypePrinter.o: DiagnosticCommonKinds.inc.h
+TypePrinter.o: StmtNodes.inc.h
+TypePrinter.po: CommentCommandList.inc.h
+TypePrinter.po: DeclNodes.inc.h
+TypePrinter.po: DiagnosticCommonKinds.inc.h
+TypePrinter.po: StmtNodes.inc.h
+VTTBuilder.o: CommentCommandList.inc.h
+VTTBuilder.o: DeclNodes.inc.h
+VTTBuilder.o: DiagnosticCommonKinds.inc.h
+VTTBuilder.o: StmtNodes.inc.h
+VTTBuilder.po: CommentCommandList.inc.h
+VTTBuilder.po: DeclNodes.inc.h
+VTTBuilder.po: DiagnosticCommonKinds.inc.h
+VTTBuilder.po: StmtNodes.inc.h
+VTableBuilder.o: CommentCommandList.inc.h
+VTableBuilder.o: DeclNodes.inc.h
+VTableBuilder.o: DiagnosticCommonKinds.inc.h
+VTableBuilder.o: StmtNodes.inc.h
+VTableBuilder.po: CommentCommandList.inc.h
+VTableBuilder.po: DeclNodes.inc.h
+VTableBuilder.po: DiagnosticCommonKinds.inc.h
+VTableBuilder.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/libclangbasic/Makefile b/lib/clang/libclangbasic/Makefile
index 6a5791c..16bae4c 100644
--- a/lib/clang/libclangbasic/Makefile
+++ b/lib/clang/libclangbasic/Makefile
@@ -5,8 +5,7 @@
LIB= clangbasic
SRCDIR= tools/clang/lib/Basic
-SRCS= Attributes.cpp \
- Builtins.cpp \
+SRCS= Builtins.cpp \
CharInfo.cpp \
Diagnostic.cpp \
DiagnosticIDs.cpp \
@@ -18,20 +17,15 @@ SRCS= Attributes.cpp \
ObjCRuntime.cpp \
OpenMPKinds.cpp \
OperatorPrecedence.cpp \
- SanitizerBlacklist.cpp \
- Sanitizers.cpp \
SourceLocation.cpp \
SourceManager.cpp \
TargetInfo.cpp \
Targets.cpp \
TokenKinds.cpp \
Version.cpp \
- VersionTuple.cpp \
- VirtualFileSystem.cpp \
- Warnings.cpp
+ VersionTuple.cpp
-TGHDRS= AttrHasAttributeImpl \
- DiagnosticAnalysisKinds \
+TGHDRS= DiagnosticAnalysisKinds \
DiagnosticASTKinds \
DiagnosticCommentKinds \
DiagnosticCommonKinds \
diff --git a/lib/clang/libclangbasic/Makefile.depend b/lib/clang/libclangbasic/Makefile.depend
new file mode 100644
index 0000000..6d3d657
--- /dev/null
+++ b/lib/clang/libclangbasic/Makefile.depend
@@ -0,0 +1,47 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+Diagnostic.o: DiagnosticCommonKinds.inc.h
+Diagnostic.po: DiagnosticCommonKinds.inc.h
+DiagnosticIDs.o: DiagnosticASTKinds.inc.h
+DiagnosticIDs.o: DiagnosticAnalysisKinds.inc.h
+DiagnosticIDs.o: DiagnosticCommentKinds.inc.h
+DiagnosticIDs.o: DiagnosticCommonKinds.inc.h
+DiagnosticIDs.o: DiagnosticDriverKinds.inc.h
+DiagnosticIDs.o: DiagnosticFrontendKinds.inc.h
+DiagnosticIDs.o: DiagnosticGroups.inc.h
+DiagnosticIDs.o: DiagnosticLexKinds.inc.h
+DiagnosticIDs.o: DiagnosticParseKinds.inc.h
+DiagnosticIDs.o: DiagnosticSemaKinds.inc.h
+DiagnosticIDs.o: DiagnosticSerializationKinds.inc.h
+DiagnosticIDs.po: DiagnosticASTKinds.inc.h
+DiagnosticIDs.po: DiagnosticAnalysisKinds.inc.h
+DiagnosticIDs.po: DiagnosticCommentKinds.inc.h
+DiagnosticIDs.po: DiagnosticCommonKinds.inc.h
+DiagnosticIDs.po: DiagnosticDriverKinds.inc.h
+DiagnosticIDs.po: DiagnosticFrontendKinds.inc.h
+DiagnosticIDs.po: DiagnosticGroups.inc.h
+DiagnosticIDs.po: DiagnosticLexKinds.inc.h
+DiagnosticIDs.po: DiagnosticParseKinds.inc.h
+DiagnosticIDs.po: DiagnosticSemaKinds.inc.h
+DiagnosticIDs.po: DiagnosticSerializationKinds.inc.h
+SourceManager.o: DiagnosticCommonKinds.inc.h
+SourceManager.po: DiagnosticCommonKinds.inc.h
+Targets.o: DiagnosticCommonKinds.inc.h
+Targets.o: arm_neon.inc.h
+Targets.po: DiagnosticCommonKinds.inc.h
+Targets.po: arm_neon.inc.h
+.endif
diff --git a/lib/clang/libclangcodegen/Makefile b/lib/clang/libclangcodegen/Makefile
index 521a430..3b45f6b 100644
--- a/lib/clang/libclangcodegen/Makefile
+++ b/lib/clang/libclangcodegen/Makefile
@@ -26,35 +26,29 @@ SRCS= BackendUtil.cpp \
CGExprComplex.cpp \
CGExprConstant.cpp \
CGExprScalar.cpp \
- CGLoopInfo.cpp \
CGObjC.cpp \
CGObjCGNU.cpp \
CGObjCMac.cpp \
CGObjCRuntime.cpp \
CGOpenCLRuntime.cpp \
- CGOpenMPRuntime.cpp \
+ CGRTTI.cpp \
CGRecordLayoutBuilder.cpp \
CGStmt.cpp \
- CGStmtOpenMP.cpp \
CGVTT.cpp \
CGVTables.cpp \
CodeGenABITypes.cpp \
CodeGenAction.cpp \
CodeGenFunction.cpp \
CodeGenModule.cpp \
- CodeGenPGO.cpp \
CodeGenTBAA.cpp \
CodeGenTypes.cpp \
- CoverageMappingGen.cpp \
ItaniumCXXABI.cpp \
MicrosoftCXXABI.cpp \
+ MicrosoftVBTables.cpp \
ModuleBuilder.cpp \
- SanitizerMetadata.cpp \
TargetInfo.cpp
TGHDRS= AttrList \
- AttrParsedAttrList \
- AttrVisitor \
Attrs \
CommentCommandList \
CommentNodes \
diff --git a/lib/clang/libclangcodegen/Makefile.depend b/lib/clang/libclangcodegen/Makefile.depend
new file mode 100644
index 0000000..611aebb
--- /dev/null
+++ b/lib/clang/libclangcodegen/Makefile.depend
@@ -0,0 +1,552 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+BackendUtil.o: DiagnosticCommonKinds.inc.h
+BackendUtil.o: DiagnosticFrontendKinds.inc.h
+BackendUtil.po: DiagnosticCommonKinds.inc.h
+BackendUtil.po: DiagnosticFrontendKinds.inc.h
+CGAtomic.o: AttrList.inc.h
+CGAtomic.o: Attrs.inc.h
+CGAtomic.o: CommentCommandList.inc.h
+CGAtomic.o: DeclNodes.inc.h
+CGAtomic.o: DiagnosticCommonKinds.inc.h
+CGAtomic.o: Intrinsics.inc.h
+CGAtomic.o: StmtNodes.inc.h
+CGAtomic.po: AttrList.inc.h
+CGAtomic.po: Attrs.inc.h
+CGAtomic.po: CommentCommandList.inc.h
+CGAtomic.po: DeclNodes.inc.h
+CGAtomic.po: DiagnosticCommonKinds.inc.h
+CGAtomic.po: Intrinsics.inc.h
+CGAtomic.po: StmtNodes.inc.h
+CGBlocks.o: AttrList.inc.h
+CGBlocks.o: Attrs.inc.h
+CGBlocks.o: CommentCommandList.inc.h
+CGBlocks.o: DeclNodes.inc.h
+CGBlocks.o: DiagnosticCommonKinds.inc.h
+CGBlocks.o: StmtNodes.inc.h
+CGBlocks.po: AttrList.inc.h
+CGBlocks.po: Attrs.inc.h
+CGBlocks.po: CommentCommandList.inc.h
+CGBlocks.po: DeclNodes.inc.h
+CGBlocks.po: DiagnosticCommonKinds.inc.h
+CGBlocks.po: StmtNodes.inc.h
+CGBuiltin.o: AttrList.inc.h
+CGBuiltin.o: Attrs.inc.h
+CGBuiltin.o: CommentCommandList.inc.h
+CGBuiltin.o: DeclNodes.inc.h
+CGBuiltin.o: DiagnosticCommonKinds.inc.h
+CGBuiltin.o: Intrinsics.inc.h
+CGBuiltin.o: StmtNodes.inc.h
+CGBuiltin.o: arm_neon.inc.h
+CGBuiltin.po: AttrList.inc.h
+CGBuiltin.po: Attrs.inc.h
+CGBuiltin.po: CommentCommandList.inc.h
+CGBuiltin.po: DeclNodes.inc.h
+CGBuiltin.po: DiagnosticCommonKinds.inc.h
+CGBuiltin.po: Intrinsics.inc.h
+CGBuiltin.po: StmtNodes.inc.h
+CGBuiltin.po: arm_neon.inc.h
+CGCUDANV.o: AttrList.inc.h
+CGCUDANV.o: Attrs.inc.h
+CGCUDANV.o: CommentCommandList.inc.h
+CGCUDANV.o: DeclNodes.inc.h
+CGCUDANV.o: DiagnosticCommonKinds.inc.h
+CGCUDANV.o: StmtNodes.inc.h
+CGCUDANV.po: AttrList.inc.h
+CGCUDANV.po: Attrs.inc.h
+CGCUDANV.po: CommentCommandList.inc.h
+CGCUDANV.po: DeclNodes.inc.h
+CGCUDANV.po: DiagnosticCommonKinds.inc.h
+CGCUDANV.po: StmtNodes.inc.h
+CGCUDARuntime.o: AttrList.inc.h
+CGCUDARuntime.o: Attrs.inc.h
+CGCUDARuntime.o: CommentCommandList.inc.h
+CGCUDARuntime.o: DeclNodes.inc.h
+CGCUDARuntime.o: DiagnosticCommonKinds.inc.h
+CGCUDARuntime.o: StmtNodes.inc.h
+CGCUDARuntime.po: AttrList.inc.h
+CGCUDARuntime.po: Attrs.inc.h
+CGCUDARuntime.po: CommentCommandList.inc.h
+CGCUDARuntime.po: DeclNodes.inc.h
+CGCUDARuntime.po: DiagnosticCommonKinds.inc.h
+CGCUDARuntime.po: StmtNodes.inc.h
+CGCXX.o: AttrList.inc.h
+CGCXX.o: Attrs.inc.h
+CGCXX.o: CommentCommandList.inc.h
+CGCXX.o: DeclNodes.inc.h
+CGCXX.o: DiagnosticCommonKinds.inc.h
+CGCXX.o: StmtNodes.inc.h
+CGCXX.po: AttrList.inc.h
+CGCXX.po: Attrs.inc.h
+CGCXX.po: CommentCommandList.inc.h
+CGCXX.po: DeclNodes.inc.h
+CGCXX.po: DiagnosticCommonKinds.inc.h
+CGCXX.po: StmtNodes.inc.h
+CGCXXABI.o: AttrList.inc.h
+CGCXXABI.o: Attrs.inc.h
+CGCXXABI.o: CommentCommandList.inc.h
+CGCXXABI.o: DeclNodes.inc.h
+CGCXXABI.o: DiagnosticCommonKinds.inc.h
+CGCXXABI.o: StmtNodes.inc.h
+CGCXXABI.po: AttrList.inc.h
+CGCXXABI.po: Attrs.inc.h
+CGCXXABI.po: CommentCommandList.inc.h
+CGCXXABI.po: DeclNodes.inc.h
+CGCXXABI.po: DiagnosticCommonKinds.inc.h
+CGCXXABI.po: StmtNodes.inc.h
+CGCall.o: AttrList.inc.h
+CGCall.o: Attrs.inc.h
+CGCall.o: CommentCommandList.inc.h
+CGCall.o: DeclNodes.inc.h
+CGCall.o: DiagnosticCommonKinds.inc.h
+CGCall.o: StmtNodes.inc.h
+CGCall.po: AttrList.inc.h
+CGCall.po: Attrs.inc.h
+CGCall.po: CommentCommandList.inc.h
+CGCall.po: DeclNodes.inc.h
+CGCall.po: DiagnosticCommonKinds.inc.h
+CGCall.po: StmtNodes.inc.h
+CGClass.o: AttrList.inc.h
+CGClass.o: Attrs.inc.h
+CGClass.o: CommentCommandList.inc.h
+CGClass.o: DeclNodes.inc.h
+CGClass.o: DiagnosticCommonKinds.inc.h
+CGClass.o: StmtNodes.inc.h
+CGClass.o: arm_neon.inc.h
+CGClass.po: AttrList.inc.h
+CGClass.po: Attrs.inc.h
+CGClass.po: CommentCommandList.inc.h
+CGClass.po: DeclNodes.inc.h
+CGClass.po: DiagnosticCommonKinds.inc.h
+CGClass.po: StmtNodes.inc.h
+CGClass.po: arm_neon.inc.h
+CGCleanup.o: AttrList.inc.h
+CGCleanup.o: Attrs.inc.h
+CGCleanup.o: CommentCommandList.inc.h
+CGCleanup.o: DeclNodes.inc.h
+CGCleanup.o: DiagnosticCommonKinds.inc.h
+CGCleanup.o: StmtNodes.inc.h
+CGCleanup.po: AttrList.inc.h
+CGCleanup.po: Attrs.inc.h
+CGCleanup.po: CommentCommandList.inc.h
+CGCleanup.po: DeclNodes.inc.h
+CGCleanup.po: DiagnosticCommonKinds.inc.h
+CGCleanup.po: StmtNodes.inc.h
+CGDebugInfo.o: AttrList.inc.h
+CGDebugInfo.o: Attrs.inc.h
+CGDebugInfo.o: CommentCommandList.inc.h
+CGDebugInfo.o: DeclNodes.inc.h
+CGDebugInfo.o: DiagnosticCommonKinds.inc.h
+CGDebugInfo.o: Intrinsics.inc.h
+CGDebugInfo.o: StmtNodes.inc.h
+CGDebugInfo.po: AttrList.inc.h
+CGDebugInfo.po: Attrs.inc.h
+CGDebugInfo.po: CommentCommandList.inc.h
+CGDebugInfo.po: DeclNodes.inc.h
+CGDebugInfo.po: DiagnosticCommonKinds.inc.h
+CGDebugInfo.po: Intrinsics.inc.h
+CGDebugInfo.po: StmtNodes.inc.h
+CGDecl.o: AttrList.inc.h
+CGDecl.o: Attrs.inc.h
+CGDecl.o: CommentCommandList.inc.h
+CGDecl.o: DeclNodes.inc.h
+CGDecl.o: DiagnosticCommonKinds.inc.h
+CGDecl.o: Intrinsics.inc.h
+CGDecl.o: StmtNodes.inc.h
+CGDecl.po: AttrList.inc.h
+CGDecl.po: Attrs.inc.h
+CGDecl.po: CommentCommandList.inc.h
+CGDecl.po: DeclNodes.inc.h
+CGDecl.po: DiagnosticCommonKinds.inc.h
+CGDecl.po: Intrinsics.inc.h
+CGDecl.po: StmtNodes.inc.h
+CGDeclCXX.o: AttrList.inc.h
+CGDeclCXX.o: Attrs.inc.h
+CGDeclCXX.o: CommentCommandList.inc.h
+CGDeclCXX.o: DeclNodes.inc.h
+CGDeclCXX.o: DiagnosticCommonKinds.inc.h
+CGDeclCXX.o: Intrinsics.inc.h
+CGDeclCXX.o: StmtNodes.inc.h
+CGDeclCXX.po: AttrList.inc.h
+CGDeclCXX.po: Attrs.inc.h
+CGDeclCXX.po: CommentCommandList.inc.h
+CGDeclCXX.po: DeclNodes.inc.h
+CGDeclCXX.po: DiagnosticCommonKinds.inc.h
+CGDeclCXX.po: Intrinsics.inc.h
+CGDeclCXX.po: StmtNodes.inc.h
+CGException.o: AttrList.inc.h
+CGException.o: Attrs.inc.h
+CGException.o: CommentCommandList.inc.h
+CGException.o: DeclNodes.inc.h
+CGException.o: DiagnosticCommonKinds.inc.h
+CGException.o: Intrinsics.inc.h
+CGException.o: StmtNodes.inc.h
+CGException.po: AttrList.inc.h
+CGException.po: Attrs.inc.h
+CGException.po: CommentCommandList.inc.h
+CGException.po: DeclNodes.inc.h
+CGException.po: DiagnosticCommonKinds.inc.h
+CGException.po: Intrinsics.inc.h
+CGException.po: StmtNodes.inc.h
+CGExpr.o: AttrList.inc.h
+CGExpr.o: Attrs.inc.h
+CGExpr.o: CommentCommandList.inc.h
+CGExpr.o: DeclNodes.inc.h
+CGExpr.o: DiagnosticCommonKinds.inc.h
+CGExpr.o: Intrinsics.inc.h
+CGExpr.o: StmtNodes.inc.h
+CGExpr.po: AttrList.inc.h
+CGExpr.po: Attrs.inc.h
+CGExpr.po: CommentCommandList.inc.h
+CGExpr.po: DeclNodes.inc.h
+CGExpr.po: DiagnosticCommonKinds.inc.h
+CGExpr.po: Intrinsics.inc.h
+CGExpr.po: StmtNodes.inc.h
+CGExprAgg.o: AttrList.inc.h
+CGExprAgg.o: Attrs.inc.h
+CGExprAgg.o: CommentCommandList.inc.h
+CGExprAgg.o: DeclNodes.inc.h
+CGExprAgg.o: DiagnosticCommonKinds.inc.h
+CGExprAgg.o: Intrinsics.inc.h
+CGExprAgg.o: StmtNodes.inc.h
+CGExprAgg.po: AttrList.inc.h
+CGExprAgg.po: Attrs.inc.h
+CGExprAgg.po: CommentCommandList.inc.h
+CGExprAgg.po: DeclNodes.inc.h
+CGExprAgg.po: DiagnosticCommonKinds.inc.h
+CGExprAgg.po: Intrinsics.inc.h
+CGExprAgg.po: StmtNodes.inc.h
+CGExprCXX.o: AttrList.inc.h
+CGExprCXX.o: Attrs.inc.h
+CGExprCXX.o: CommentCommandList.inc.h
+CGExprCXX.o: DeclNodes.inc.h
+CGExprCXX.o: DiagnosticCommonKinds.inc.h
+CGExprCXX.o: Intrinsics.inc.h
+CGExprCXX.o: StmtNodes.inc.h
+CGExprCXX.po: AttrList.inc.h
+CGExprCXX.po: Attrs.inc.h
+CGExprCXX.po: CommentCommandList.inc.h
+CGExprCXX.po: DeclNodes.inc.h
+CGExprCXX.po: DiagnosticCommonKinds.inc.h
+CGExprCXX.po: Intrinsics.inc.h
+CGExprCXX.po: StmtNodes.inc.h
+CGExprComplex.o: AttrList.inc.h
+CGExprComplex.o: Attrs.inc.h
+CGExprComplex.o: CommentCommandList.inc.h
+CGExprComplex.o: DeclNodes.inc.h
+CGExprComplex.o: DiagnosticCommonKinds.inc.h
+CGExprComplex.o: StmtNodes.inc.h
+CGExprComplex.po: AttrList.inc.h
+CGExprComplex.po: Attrs.inc.h
+CGExprComplex.po: CommentCommandList.inc.h
+CGExprComplex.po: DeclNodes.inc.h
+CGExprComplex.po: DiagnosticCommonKinds.inc.h
+CGExprComplex.po: StmtNodes.inc.h
+CGExprConstant.o: AttrList.inc.h
+CGExprConstant.o: Attrs.inc.h
+CGExprConstant.o: CommentCommandList.inc.h
+CGExprConstant.o: DeclNodes.inc.h
+CGExprConstant.o: DiagnosticCommonKinds.inc.h
+CGExprConstant.o: StmtNodes.inc.h
+CGExprConstant.po: AttrList.inc.h
+CGExprConstant.po: Attrs.inc.h
+CGExprConstant.po: CommentCommandList.inc.h
+CGExprConstant.po: DeclNodes.inc.h
+CGExprConstant.po: DiagnosticCommonKinds.inc.h
+CGExprConstant.po: StmtNodes.inc.h
+CGExprScalar.o: AttrList.inc.h
+CGExprScalar.o: Attrs.inc.h
+CGExprScalar.o: CommentCommandList.inc.h
+CGExprScalar.o: DeclNodes.inc.h
+CGExprScalar.o: DiagnosticCommonKinds.inc.h
+CGExprScalar.o: Intrinsics.inc.h
+CGExprScalar.o: StmtNodes.inc.h
+CGExprScalar.po: AttrList.inc.h
+CGExprScalar.po: Attrs.inc.h
+CGExprScalar.po: CommentCommandList.inc.h
+CGExprScalar.po: DeclNodes.inc.h
+CGExprScalar.po: DiagnosticCommonKinds.inc.h
+CGExprScalar.po: Intrinsics.inc.h
+CGExprScalar.po: StmtNodes.inc.h
+CGObjC.o: AttrList.inc.h
+CGObjC.o: Attrs.inc.h
+CGObjC.o: CommentCommandList.inc.h
+CGObjC.o: DeclNodes.inc.h
+CGObjC.o: DiagnosticCommonKinds.inc.h
+CGObjC.o: StmtNodes.inc.h
+CGObjC.po: AttrList.inc.h
+CGObjC.po: Attrs.inc.h
+CGObjC.po: CommentCommandList.inc.h
+CGObjC.po: DeclNodes.inc.h
+CGObjC.po: DiagnosticCommonKinds.inc.h
+CGObjC.po: StmtNodes.inc.h
+CGObjCGNU.o: AttrList.inc.h
+CGObjCGNU.o: Attrs.inc.h
+CGObjCGNU.o: CommentCommandList.inc.h
+CGObjCGNU.o: DeclNodes.inc.h
+CGObjCGNU.o: DiagnosticCommonKinds.inc.h
+CGObjCGNU.o: Intrinsics.inc.h
+CGObjCGNU.o: StmtNodes.inc.h
+CGObjCGNU.po: AttrList.inc.h
+CGObjCGNU.po: Attrs.inc.h
+CGObjCGNU.po: CommentCommandList.inc.h
+CGObjCGNU.po: DeclNodes.inc.h
+CGObjCGNU.po: DiagnosticCommonKinds.inc.h
+CGObjCGNU.po: Intrinsics.inc.h
+CGObjCGNU.po: StmtNodes.inc.h
+CGObjCMac.o: AttrList.inc.h
+CGObjCMac.o: Attrs.inc.h
+CGObjCMac.o: CommentCommandList.inc.h
+CGObjCMac.o: DeclNodes.inc.h
+CGObjCMac.o: DiagnosticCommonKinds.inc.h
+CGObjCMac.o: Intrinsics.inc.h
+CGObjCMac.o: StmtNodes.inc.h
+CGObjCMac.po: AttrList.inc.h
+CGObjCMac.po: Attrs.inc.h
+CGObjCMac.po: CommentCommandList.inc.h
+CGObjCMac.po: DeclNodes.inc.h
+CGObjCMac.po: DiagnosticCommonKinds.inc.h
+CGObjCMac.po: Intrinsics.inc.h
+CGObjCMac.po: StmtNodes.inc.h
+CGObjCRuntime.o: AttrList.inc.h
+CGObjCRuntime.o: Attrs.inc.h
+CGObjCRuntime.o: CommentCommandList.inc.h
+CGObjCRuntime.o: DeclNodes.inc.h
+CGObjCRuntime.o: DiagnosticCommonKinds.inc.h
+CGObjCRuntime.o: StmtNodes.inc.h
+CGObjCRuntime.po: AttrList.inc.h
+CGObjCRuntime.po: Attrs.inc.h
+CGObjCRuntime.po: CommentCommandList.inc.h
+CGObjCRuntime.po: DeclNodes.inc.h
+CGObjCRuntime.po: DiagnosticCommonKinds.inc.h
+CGObjCRuntime.po: StmtNodes.inc.h
+CGOpenCLRuntime.o: AttrList.inc.h
+CGOpenCLRuntime.o: Attrs.inc.h
+CGOpenCLRuntime.o: CommentCommandList.inc.h
+CGOpenCLRuntime.o: DeclNodes.inc.h
+CGOpenCLRuntime.o: DiagnosticCommonKinds.inc.h
+CGOpenCLRuntime.o: StmtNodes.inc.h
+CGOpenCLRuntime.po: AttrList.inc.h
+CGOpenCLRuntime.po: Attrs.inc.h
+CGOpenCLRuntime.po: CommentCommandList.inc.h
+CGOpenCLRuntime.po: DeclNodes.inc.h
+CGOpenCLRuntime.po: DiagnosticCommonKinds.inc.h
+CGOpenCLRuntime.po: StmtNodes.inc.h
+CGRTTI.o: AttrList.inc.h
+CGRTTI.o: Attrs.inc.h
+CGRTTI.o: CommentCommandList.inc.h
+CGRTTI.o: DeclNodes.inc.h
+CGRTTI.o: DiagnosticCommonKinds.inc.h
+CGRTTI.o: StmtNodes.inc.h
+CGRTTI.po: AttrList.inc.h
+CGRTTI.po: Attrs.inc.h
+CGRTTI.po: CommentCommandList.inc.h
+CGRTTI.po: DeclNodes.inc.h
+CGRTTI.po: DiagnosticCommonKinds.inc.h
+CGRTTI.po: StmtNodes.inc.h
+CGRecordLayoutBuilder.o: AttrList.inc.h
+CGRecordLayoutBuilder.o: Attrs.inc.h
+CGRecordLayoutBuilder.o: CommentCommandList.inc.h
+CGRecordLayoutBuilder.o: DeclNodes.inc.h
+CGRecordLayoutBuilder.o: DiagnosticCommonKinds.inc.h
+CGRecordLayoutBuilder.o: StmtNodes.inc.h
+CGRecordLayoutBuilder.po: AttrList.inc.h
+CGRecordLayoutBuilder.po: Attrs.inc.h
+CGRecordLayoutBuilder.po: CommentCommandList.inc.h
+CGRecordLayoutBuilder.po: DeclNodes.inc.h
+CGRecordLayoutBuilder.po: DiagnosticCommonKinds.inc.h
+CGRecordLayoutBuilder.po: StmtNodes.inc.h
+CGStmt.o: AttrList.inc.h
+CGStmt.o: Attrs.inc.h
+CGStmt.o: CommentCommandList.inc.h
+CGStmt.o: DeclNodes.inc.h
+CGStmt.o: DiagnosticCommonKinds.inc.h
+CGStmt.o: DiagnosticSemaKinds.inc.h
+CGStmt.o: Intrinsics.inc.h
+CGStmt.o: StmtNodes.inc.h
+CGStmt.po: AttrList.inc.h
+CGStmt.po: Attrs.inc.h
+CGStmt.po: CommentCommandList.inc.h
+CGStmt.po: DeclNodes.inc.h
+CGStmt.po: DiagnosticCommonKinds.inc.h
+CGStmt.po: DiagnosticSemaKinds.inc.h
+CGStmt.po: Intrinsics.inc.h
+CGStmt.po: StmtNodes.inc.h
+CGVTT.o: AttrList.inc.h
+CGVTT.o: Attrs.inc.h
+CGVTT.o: CommentCommandList.inc.h
+CGVTT.o: DeclNodes.inc.h
+CGVTT.o: DiagnosticCommonKinds.inc.h
+CGVTT.o: StmtNodes.inc.h
+CGVTT.po: AttrList.inc.h
+CGVTT.po: Attrs.inc.h
+CGVTT.po: CommentCommandList.inc.h
+CGVTT.po: DeclNodes.inc.h
+CGVTT.po: DiagnosticCommonKinds.inc.h
+CGVTT.po: StmtNodes.inc.h
+CGVTables.o: AttrList.inc.h
+CGVTables.o: Attrs.inc.h
+CGVTables.o: CommentCommandList.inc.h
+CGVTables.o: DeclNodes.inc.h
+CGVTables.o: DiagnosticCommonKinds.inc.h
+CGVTables.o: StmtNodes.inc.h
+CGVTables.po: AttrList.inc.h
+CGVTables.po: Attrs.inc.h
+CGVTables.po: CommentCommandList.inc.h
+CGVTables.po: DeclNodes.inc.h
+CGVTables.po: DiagnosticCommonKinds.inc.h
+CGVTables.po: StmtNodes.inc.h
+CodeGenABITypes.o: AttrList.inc.h
+CodeGenABITypes.o: Attrs.inc.h
+CodeGenABITypes.o: CommentCommandList.inc.h
+CodeGenABITypes.o: DeclNodes.inc.h
+CodeGenABITypes.o: DiagnosticCommonKinds.inc.h
+CodeGenABITypes.o: StmtNodes.inc.h
+CodeGenABITypes.po: AttrList.inc.h
+CodeGenABITypes.po: Attrs.inc.h
+CodeGenABITypes.po: CommentCommandList.inc.h
+CodeGenABITypes.po: DeclNodes.inc.h
+CodeGenABITypes.po: DiagnosticCommonKinds.inc.h
+CodeGenABITypes.po: StmtNodes.inc.h
+CodeGenAction.o: CommentCommandList.inc.h
+CodeGenAction.o: DeclNodes.inc.h
+CodeGenAction.o: DiagnosticCommonKinds.inc.h
+CodeGenAction.o: DiagnosticFrontendKinds.inc.h
+CodeGenAction.o: StmtNodes.inc.h
+CodeGenAction.po: CommentCommandList.inc.h
+CodeGenAction.po: DeclNodes.inc.h
+CodeGenAction.po: DiagnosticCommonKinds.inc.h
+CodeGenAction.po: DiagnosticFrontendKinds.inc.h
+CodeGenAction.po: StmtNodes.inc.h
+CodeGenFunction.o: AttrList.inc.h
+CodeGenFunction.o: Attrs.inc.h
+CodeGenFunction.o: CommentCommandList.inc.h
+CodeGenFunction.o: DeclNodes.inc.h
+CodeGenFunction.o: DiagnosticCommonKinds.inc.h
+CodeGenFunction.o: Intrinsics.inc.h
+CodeGenFunction.o: StmtNodes.inc.h
+CodeGenFunction.po: AttrList.inc.h
+CodeGenFunction.po: Attrs.inc.h
+CodeGenFunction.po: CommentCommandList.inc.h
+CodeGenFunction.po: DeclNodes.inc.h
+CodeGenFunction.po: DiagnosticCommonKinds.inc.h
+CodeGenFunction.po: Intrinsics.inc.h
+CodeGenFunction.po: StmtNodes.inc.h
+CodeGenModule.o: AttrList.inc.h
+CodeGenModule.o: Attrs.inc.h
+CodeGenModule.o: CommentCommandList.inc.h
+CodeGenModule.o: DeclNodes.inc.h
+CodeGenModule.o: DiagnosticCommonKinds.inc.h
+CodeGenModule.o: DiagnosticSemaKinds.inc.h
+CodeGenModule.o: Intrinsics.inc.h
+CodeGenModule.o: StmtNodes.inc.h
+CodeGenModule.po: AttrList.inc.h
+CodeGenModule.po: Attrs.inc.h
+CodeGenModule.po: CommentCommandList.inc.h
+CodeGenModule.po: DeclNodes.inc.h
+CodeGenModule.po: DiagnosticCommonKinds.inc.h
+CodeGenModule.po: DiagnosticSemaKinds.inc.h
+CodeGenModule.po: Intrinsics.inc.h
+CodeGenModule.po: StmtNodes.inc.h
+CodeGenTBAA.o: AttrList.inc.h
+CodeGenTBAA.o: Attrs.inc.h
+CodeGenTBAA.o: CommentCommandList.inc.h
+CodeGenTBAA.o: DeclNodes.inc.h
+CodeGenTBAA.o: DiagnosticCommonKinds.inc.h
+CodeGenTBAA.o: StmtNodes.inc.h
+CodeGenTBAA.po: AttrList.inc.h
+CodeGenTBAA.po: Attrs.inc.h
+CodeGenTBAA.po: CommentCommandList.inc.h
+CodeGenTBAA.po: DeclNodes.inc.h
+CodeGenTBAA.po: DiagnosticCommonKinds.inc.h
+CodeGenTBAA.po: StmtNodes.inc.h
+CodeGenTypes.o: AttrList.inc.h
+CodeGenTypes.o: Attrs.inc.h
+CodeGenTypes.o: CommentCommandList.inc.h
+CodeGenTypes.o: DeclNodes.inc.h
+CodeGenTypes.o: DiagnosticCommonKinds.inc.h
+CodeGenTypes.o: StmtNodes.inc.h
+CodeGenTypes.po: AttrList.inc.h
+CodeGenTypes.po: Attrs.inc.h
+CodeGenTypes.po: CommentCommandList.inc.h
+CodeGenTypes.po: DeclNodes.inc.h
+CodeGenTypes.po: DiagnosticCommonKinds.inc.h
+CodeGenTypes.po: StmtNodes.inc.h
+ItaniumCXXABI.o: AttrList.inc.h
+ItaniumCXXABI.o: Attrs.inc.h
+ItaniumCXXABI.o: CommentCommandList.inc.h
+ItaniumCXXABI.o: DeclNodes.inc.h
+ItaniumCXXABI.o: DiagnosticCommonKinds.inc.h
+ItaniumCXXABI.o: Intrinsics.inc.h
+ItaniumCXXABI.o: StmtNodes.inc.h
+ItaniumCXXABI.po: AttrList.inc.h
+ItaniumCXXABI.po: Attrs.inc.h
+ItaniumCXXABI.po: CommentCommandList.inc.h
+ItaniumCXXABI.po: DeclNodes.inc.h
+ItaniumCXXABI.po: DiagnosticCommonKinds.inc.h
+ItaniumCXXABI.po: Intrinsics.inc.h
+ItaniumCXXABI.po: StmtNodes.inc.h
+MicrosoftCXXABI.o: AttrList.inc.h
+MicrosoftCXXABI.o: Attrs.inc.h
+MicrosoftCXXABI.o: CommentCommandList.inc.h
+MicrosoftCXXABI.o: DeclNodes.inc.h
+MicrosoftCXXABI.o: DiagnosticCommonKinds.inc.h
+MicrosoftCXXABI.o: StmtNodes.inc.h
+MicrosoftCXXABI.po: AttrList.inc.h
+MicrosoftCXXABI.po: Attrs.inc.h
+MicrosoftCXXABI.po: CommentCommandList.inc.h
+MicrosoftCXXABI.po: DeclNodes.inc.h
+MicrosoftCXXABI.po: DiagnosticCommonKinds.inc.h
+MicrosoftCXXABI.po: StmtNodes.inc.h
+MicrosoftVBTables.o: AttrList.inc.h
+MicrosoftVBTables.o: Attrs.inc.h
+MicrosoftVBTables.o: CommentCommandList.inc.h
+MicrosoftVBTables.o: DeclNodes.inc.h
+MicrosoftVBTables.o: DiagnosticCommonKinds.inc.h
+MicrosoftVBTables.o: StmtNodes.inc.h
+MicrosoftVBTables.po: AttrList.inc.h
+MicrosoftVBTables.po: Attrs.inc.h
+MicrosoftVBTables.po: CommentCommandList.inc.h
+MicrosoftVBTables.po: DeclNodes.inc.h
+MicrosoftVBTables.po: DiagnosticCommonKinds.inc.h
+MicrosoftVBTables.po: StmtNodes.inc.h
+ModuleBuilder.o: AttrList.inc.h
+ModuleBuilder.o: Attrs.inc.h
+ModuleBuilder.o: CommentCommandList.inc.h
+ModuleBuilder.o: DeclNodes.inc.h
+ModuleBuilder.o: DiagnosticCommonKinds.inc.h
+ModuleBuilder.o: StmtNodes.inc.h
+ModuleBuilder.po: AttrList.inc.h
+ModuleBuilder.po: Attrs.inc.h
+ModuleBuilder.po: CommentCommandList.inc.h
+ModuleBuilder.po: DeclNodes.inc.h
+ModuleBuilder.po: DiagnosticCommonKinds.inc.h
+ModuleBuilder.po: StmtNodes.inc.h
+TargetInfo.o: AttrList.inc.h
+TargetInfo.o: Attrs.inc.h
+TargetInfo.o: CommentCommandList.inc.h
+TargetInfo.o: DeclNodes.inc.h
+TargetInfo.o: DiagnosticCommonKinds.inc.h
+TargetInfo.o: StmtNodes.inc.h
+TargetInfo.po: AttrList.inc.h
+TargetInfo.po: Attrs.inc.h
+TargetInfo.po: CommentCommandList.inc.h
+TargetInfo.po: DeclNodes.inc.h
+TargetInfo.po: DiagnosticCommonKinds.inc.h
+TargetInfo.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/libclangdriver/Makefile b/lib/clang/libclangdriver/Makefile
index aa51384..91a8f61 100644
--- a/lib/clang/libclangdriver/Makefile
+++ b/lib/clang/libclangdriver/Makefile
@@ -6,22 +6,22 @@ LIB= clangdriver
SRCDIR= tools/clang/lib/Driver
SRCS= Action.cpp \
+ CC1AsOptions.cpp \
Compilation.cpp \
- CrossWindowsToolChain.cpp \
Driver.cpp \
DriverOptions.cpp \
Job.cpp \
- MSVCToolChain.cpp \
- Multilib.cpp \
Phases.cpp \
SanitizerArgs.cpp \
Tool.cpp \
ToolChain.cpp \
ToolChains.cpp \
Tools.cpp \
- Types.cpp
+ Types.cpp \
+ WindowsToolChain.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= CC1AsOptions \
+ DiagnosticCommonKinds \
DiagnosticDriverKinds \
DiagnosticSemaKinds \
Options
diff --git a/lib/clang/libclangdriver/Makefile.depend b/lib/clang/libclangdriver/Makefile.depend
new file mode 100644
index 0000000..6c6cde5
--- /dev/null
+++ b/lib/clang/libclangdriver/Makefile.depend
@@ -0,0 +1,66 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+CC1AsOptions.o: CC1AsOptions.inc.h
+CC1AsOptions.po: CC1AsOptions.inc.h
+Compilation.o: DiagnosticCommonKinds.inc.h
+Compilation.o: DiagnosticDriverKinds.inc.h
+Compilation.o: Options.inc.h
+Compilation.po: DiagnosticCommonKinds.inc.h
+Compilation.po: DiagnosticDriverKinds.inc.h
+Compilation.po: Options.inc.h
+Driver.o: DiagnosticCommonKinds.inc.h
+Driver.o: DiagnosticDriverKinds.inc.h
+Driver.o: Options.inc.h
+Driver.po: DiagnosticCommonKinds.inc.h
+Driver.po: DiagnosticDriverKinds.inc.h
+Driver.po: Options.inc.h
+DriverOptions.o: Options.inc.h
+DriverOptions.po: Options.inc.h
+SanitizerArgs.o: DiagnosticCommonKinds.inc.h
+SanitizerArgs.o: DiagnosticDriverKinds.inc.h
+SanitizerArgs.o: Options.inc.h
+SanitizerArgs.po: DiagnosticCommonKinds.inc.h
+SanitizerArgs.po: DiagnosticDriverKinds.inc.h
+SanitizerArgs.po: Options.inc.h
+ToolChain.o: DiagnosticCommonKinds.inc.h
+ToolChain.o: DiagnosticDriverKinds.inc.h
+ToolChain.o: Options.inc.h
+ToolChain.po: DiagnosticCommonKinds.inc.h
+ToolChain.po: DiagnosticDriverKinds.inc.h
+ToolChain.po: Options.inc.h
+ToolChains.o: DiagnosticCommonKinds.inc.h
+ToolChains.o: DiagnosticDriverKinds.inc.h
+ToolChains.o: Options.inc.h
+ToolChains.po: DiagnosticCommonKinds.inc.h
+ToolChains.po: DiagnosticDriverKinds.inc.h
+ToolChains.po: Options.inc.h
+Tools.o: DiagnosticCommonKinds.inc.h
+Tools.o: DiagnosticDriverKinds.inc.h
+Tools.o: DiagnosticSemaKinds.inc.h
+Tools.o: Options.inc.h
+Tools.po: DiagnosticCommonKinds.inc.h
+Tools.po: DiagnosticDriverKinds.inc.h
+Tools.po: DiagnosticSemaKinds.inc.h
+Tools.po: Options.inc.h
+WindowsToolChain.o: DiagnosticCommonKinds.inc.h
+WindowsToolChain.o: DiagnosticDriverKinds.inc.h
+WindowsToolChain.o: Options.inc.h
+WindowsToolChain.po: DiagnosticCommonKinds.inc.h
+WindowsToolChain.po: DiagnosticDriverKinds.inc.h
+WindowsToolChain.po: Options.inc.h
+.endif
diff --git a/lib/clang/libclangedit/Makefile.depend b/lib/clang/libclangedit/Makefile.depend
new file mode 100644
index 0000000..05b479b
--- /dev/null
+++ b/lib/clang/libclangedit/Makefile.depend
@@ -0,0 +1,27 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+Commit.o: DiagnosticCommonKinds.inc.h
+Commit.po: DiagnosticCommonKinds.inc.h
+RewriteObjCFoundationAPI.o: CommentCommandList.inc.h
+RewriteObjCFoundationAPI.o: DeclNodes.inc.h
+RewriteObjCFoundationAPI.o: DiagnosticCommonKinds.inc.h
+RewriteObjCFoundationAPI.o: StmtNodes.inc.h
+RewriteObjCFoundationAPI.po: CommentCommandList.inc.h
+RewriteObjCFoundationAPI.po: DeclNodes.inc.h
+RewriteObjCFoundationAPI.po: DiagnosticCommonKinds.inc.h
+RewriteObjCFoundationAPI.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/libclangfrontend/Makefile b/lib/clang/libclangfrontend/Makefile
index 95b8fc8..4ea3556 100644
--- a/lib/clang/libclangfrontend/Makefile
+++ b/lib/clang/libclangfrontend/Makefile
@@ -11,7 +11,6 @@ SRCS= ASTConsumers.cpp \
CacheTokens.cpp \
ChainedDiagnosticConsumer.cpp \
ChainedIncludesSource.cpp \
- CodeGenOptions.cpp \
CompilerInstance.cpp \
CompilerInvocation.cpp \
CreateInvocationFromCommandLine.cpp \
@@ -27,19 +26,17 @@ SRCS= ASTConsumers.cpp \
LangStandards.cpp \
LayoutOverrideSource.cpp \
LogDiagnosticPrinter.cpp \
- ModuleDependencyCollector.cpp \
MultiplexConsumer.cpp \
PrintPreprocessedOutput.cpp \
SerializedDiagnosticPrinter.cpp \
- SerializedDiagnosticReader.cpp \
TextDiagnostic.cpp \
TextDiagnosticBuffer.cpp \
TextDiagnosticPrinter.cpp \
- VerifyDiagnosticConsumer.cpp
+ VerifyDiagnosticConsumer.cpp \
+ Warnings.cpp
TGHDRS= AttrList \
AttrParsedAttrList \
- AttrVisitor \
Attrs \
CommentCommandList \
CommentNodes \
diff --git a/lib/clang/libclangfrontend/Makefile.depend b/lib/clang/libclangfrontend/Makefile.depend
new file mode 100644
index 0000000..870ea10
--- /dev/null
+++ b/lib/clang/libclangfrontend/Makefile.depend
@@ -0,0 +1,186 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ASTConsumers.o: CommentCommandList.inc.h
+ASTConsumers.o: DeclNodes.inc.h
+ASTConsumers.o: DiagnosticCommonKinds.inc.h
+ASTConsumers.o: StmtNodes.inc.h
+ASTConsumers.po: CommentCommandList.inc.h
+ASTConsumers.po: DeclNodes.inc.h
+ASTConsumers.po: DiagnosticCommonKinds.inc.h
+ASTConsumers.po: StmtNodes.inc.h
+ASTMerge.o: CommentCommandList.inc.h
+ASTMerge.o: DeclNodes.inc.h
+ASTMerge.o: DiagnosticASTKinds.inc.h
+ASTMerge.o: DiagnosticCommonKinds.inc.h
+ASTMerge.o: StmtNodes.inc.h
+ASTMerge.po: CommentCommandList.inc.h
+ASTMerge.po: DeclNodes.inc.h
+ASTMerge.po: DiagnosticASTKinds.inc.h
+ASTMerge.po: DiagnosticCommonKinds.inc.h
+ASTMerge.po: StmtNodes.inc.h
+ASTUnit.o: AttrList.inc.h
+ASTUnit.o: AttrParsedAttrList.inc.h
+ASTUnit.o: Attrs.inc.h
+ASTUnit.o: CommentCommandList.inc.h
+ASTUnit.o: DeclNodes.inc.h
+ASTUnit.o: DiagnosticCommonKinds.inc.h
+ASTUnit.o: DiagnosticFrontendKinds.inc.h
+ASTUnit.o: StmtNodes.inc.h
+ASTUnit.po: AttrList.inc.h
+ASTUnit.po: AttrParsedAttrList.inc.h
+ASTUnit.po: Attrs.inc.h
+ASTUnit.po: CommentCommandList.inc.h
+ASTUnit.po: DeclNodes.inc.h
+ASTUnit.po: DiagnosticCommonKinds.inc.h
+ASTUnit.po: DiagnosticFrontendKinds.inc.h
+ASTUnit.po: StmtNodes.inc.h
+CacheTokens.o: DiagnosticCommonKinds.inc.h
+CacheTokens.po: DiagnosticCommonKinds.inc.h
+ChainedDiagnosticConsumer.o: DiagnosticCommonKinds.inc.h
+ChainedDiagnosticConsumer.po: DiagnosticCommonKinds.inc.h
+ChainedIncludesSource.o: AttrParsedAttrList.inc.h
+ChainedIncludesSource.o: CommentCommandList.inc.h
+ChainedIncludesSource.o: DeclNodes.inc.h
+ChainedIncludesSource.o: DiagnosticCommonKinds.inc.h
+ChainedIncludesSource.o: StmtNodes.inc.h
+ChainedIncludesSource.po: AttrParsedAttrList.inc.h
+ChainedIncludesSource.po: CommentCommandList.inc.h
+ChainedIncludesSource.po: DeclNodes.inc.h
+ChainedIncludesSource.po: DiagnosticCommonKinds.inc.h
+ChainedIncludesSource.po: StmtNodes.inc.h
+CompilerInstance.o: AttrList.inc.h
+CompilerInstance.o: AttrParsedAttrList.inc.h
+CompilerInstance.o: Attrs.inc.h
+CompilerInstance.o: CommentCommandList.inc.h
+CompilerInstance.o: DeclNodes.inc.h
+CompilerInstance.o: DiagnosticCommonKinds.inc.h
+CompilerInstance.o: DiagnosticFrontendKinds.inc.h
+CompilerInstance.o: StmtNodes.inc.h
+CompilerInstance.po: AttrList.inc.h
+CompilerInstance.po: AttrParsedAttrList.inc.h
+CompilerInstance.po: Attrs.inc.h
+CompilerInstance.po: CommentCommandList.inc.h
+CompilerInstance.po: DeclNodes.inc.h
+CompilerInstance.po: DiagnosticCommonKinds.inc.h
+CompilerInstance.po: DiagnosticFrontendKinds.inc.h
+CompilerInstance.po: StmtNodes.inc.h
+CompilerInvocation.o: AttrParsedAttrList.inc.h
+CompilerInvocation.o: DeclNodes.inc.h
+CompilerInvocation.o: DiagnosticCommonKinds.inc.h
+CompilerInvocation.o: DiagnosticDriverKinds.inc.h
+CompilerInvocation.o: Options.inc.h
+CompilerInvocation.o: StmtNodes.inc.h
+CompilerInvocation.po: AttrParsedAttrList.inc.h
+CompilerInvocation.po: DeclNodes.inc.h
+CompilerInvocation.po: DiagnosticCommonKinds.inc.h
+CompilerInvocation.po: DiagnosticDriverKinds.inc.h
+CompilerInvocation.po: Options.inc.h
+CompilerInvocation.po: StmtNodes.inc.h
+CreateInvocationFromCommandLine.o: DiagnosticCommonKinds.inc.h
+CreateInvocationFromCommandLine.o: DiagnosticFrontendKinds.inc.h
+CreateInvocationFromCommandLine.o: Options.inc.h
+CreateInvocationFromCommandLine.po: DiagnosticCommonKinds.inc.h
+CreateInvocationFromCommandLine.po: DiagnosticFrontendKinds.inc.h
+CreateInvocationFromCommandLine.po: Options.inc.h
+DependencyFile.o: DiagnosticCommonKinds.inc.h
+DependencyFile.o: DiagnosticFrontendKinds.inc.h
+DependencyFile.o: DiagnosticLexKinds.inc.h
+DependencyFile.po: DiagnosticCommonKinds.inc.h
+DependencyFile.po: DiagnosticFrontendKinds.inc.h
+DependencyFile.po: DiagnosticLexKinds.inc.h
+DependencyGraph.o: DiagnosticCommonKinds.inc.h
+DependencyGraph.o: DiagnosticFrontendKinds.inc.h
+DependencyGraph.po: DiagnosticCommonKinds.inc.h
+DependencyGraph.po: DiagnosticFrontendKinds.inc.h
+DiagnosticRenderer.o: DiagnosticCommonKinds.inc.h
+DiagnosticRenderer.po: DiagnosticCommonKinds.inc.h
+FrontendAction.o: AttrParsedAttrList.inc.h
+FrontendAction.o: CommentCommandList.inc.h
+FrontendAction.o: DeclNodes.inc.h
+FrontendAction.o: DiagnosticCommonKinds.inc.h
+FrontendAction.o: DiagnosticFrontendKinds.inc.h
+FrontendAction.o: StmtNodes.inc.h
+FrontendAction.po: AttrParsedAttrList.inc.h
+FrontendAction.po: CommentCommandList.inc.h
+FrontendAction.po: DeclNodes.inc.h
+FrontendAction.po: DiagnosticCommonKinds.inc.h
+FrontendAction.po: DiagnosticFrontendKinds.inc.h
+FrontendAction.po: StmtNodes.inc.h
+FrontendActions.o: AttrList.inc.h
+FrontendActions.o: AttrParsedAttrList.inc.h
+FrontendActions.o: Attrs.inc.h
+FrontendActions.o: CommentCommandList.inc.h
+FrontendActions.o: DeclNodes.inc.h
+FrontendActions.o: DiagnosticCommonKinds.inc.h
+FrontendActions.o: DiagnosticFrontendKinds.inc.h
+FrontendActions.o: StmtNodes.inc.h
+FrontendActions.po: AttrList.inc.h
+FrontendActions.po: AttrParsedAttrList.inc.h
+FrontendActions.po: Attrs.inc.h
+FrontendActions.po: CommentCommandList.inc.h
+FrontendActions.po: DeclNodes.inc.h
+FrontendActions.po: DiagnosticCommonKinds.inc.h
+FrontendActions.po: DiagnosticFrontendKinds.inc.h
+FrontendActions.po: StmtNodes.inc.h
+HeaderIncludeGen.o: DiagnosticCommonKinds.inc.h
+HeaderIncludeGen.o: DiagnosticFrontendKinds.inc.h
+HeaderIncludeGen.po: DiagnosticCommonKinds.inc.h
+HeaderIncludeGen.po: DiagnosticFrontendKinds.inc.h
+InitHeaderSearch.o: DiagnosticCommonKinds.inc.h
+InitHeaderSearch.po: DiagnosticCommonKinds.inc.h
+InitPreprocessor.o: AttrParsedAttrList.inc.h
+InitPreprocessor.o: DeclNodes.inc.h
+InitPreprocessor.o: DiagnosticCommonKinds.inc.h
+InitPreprocessor.o: DiagnosticFrontendKinds.inc.h
+InitPreprocessor.o: StmtNodes.inc.h
+InitPreprocessor.po: AttrParsedAttrList.inc.h
+InitPreprocessor.po: DeclNodes.inc.h
+InitPreprocessor.po: DiagnosticCommonKinds.inc.h
+InitPreprocessor.po: DiagnosticFrontendKinds.inc.h
+InitPreprocessor.po: StmtNodes.inc.h
+LayoutOverrideSource.o: DeclNodes.inc.h
+LayoutOverrideSource.o: DiagnosticCommonKinds.inc.h
+LayoutOverrideSource.po: DeclNodes.inc.h
+LayoutOverrideSource.po: DiagnosticCommonKinds.inc.h
+LogDiagnosticPrinter.o: DiagnosticCommonKinds.inc.h
+LogDiagnosticPrinter.po: DiagnosticCommonKinds.inc.h
+MultiplexConsumer.o: DiagnosticCommonKinds.inc.h
+MultiplexConsumer.po: DiagnosticCommonKinds.inc.h
+PrintPreprocessedOutput.o: DiagnosticCommonKinds.inc.h
+PrintPreprocessedOutput.po: DiagnosticCommonKinds.inc.h
+SerializedDiagnosticPrinter.o: DiagnosticCommonKinds.inc.h
+SerializedDiagnosticPrinter.po: DiagnosticCommonKinds.inc.h
+TextDiagnostic.o: DiagnosticCommonKinds.inc.h
+TextDiagnostic.po: DiagnosticCommonKinds.inc.h
+TextDiagnosticBuffer.o: DiagnosticCommonKinds.inc.h
+TextDiagnosticBuffer.po: DiagnosticCommonKinds.inc.h
+TextDiagnosticPrinter.o: DiagnosticCommonKinds.inc.h
+TextDiagnosticPrinter.po: DiagnosticCommonKinds.inc.h
+VerifyDiagnosticConsumer.o: DiagnosticCommonKinds.inc.h
+VerifyDiagnosticConsumer.o: DiagnosticFrontendKinds.inc.h
+VerifyDiagnosticConsumer.po: DiagnosticCommonKinds.inc.h
+VerifyDiagnosticConsumer.po: DiagnosticFrontendKinds.inc.h
+Warnings.o: DiagnosticCommonKinds.inc.h
+Warnings.o: DiagnosticFrontendKinds.inc.h
+Warnings.o: DiagnosticLexKinds.inc.h
+Warnings.o: DiagnosticSemaKinds.inc.h
+Warnings.po: DiagnosticCommonKinds.inc.h
+Warnings.po: DiagnosticFrontendKinds.inc.h
+Warnings.po: DiagnosticLexKinds.inc.h
+Warnings.po: DiagnosticSemaKinds.inc.h
+.endif
diff --git a/lib/clang/libclangfrontendtool/Makefile b/lib/clang/libclangfrontendtool/Makefile
index 0d71d55..f20aa35 100644
--- a/lib/clang/libclangfrontendtool/Makefile
+++ b/lib/clang/libclangfrontendtool/Makefile
@@ -7,11 +7,8 @@ LIB= clangfrontendtool
SRCDIR= tools/clang/lib/FrontendTool
SRCS= ExecuteCompilerInvocation.cpp
-TGHDRS= CommentCommandList \
- DeclNodes \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DiagnosticFrontendKinds \
- Options \
- StmtNodes
+ Options
.include "../clang.lib.mk"
diff --git a/lib/clang/libclangfrontendtool/Makefile.depend b/lib/clang/libclangfrontendtool/Makefile.depend
new file mode 100644
index 0000000..b3f9b2b
--- /dev/null
+++ b/lib/clang/libclangfrontendtool/Makefile.depend
@@ -0,0 +1,24 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ExecuteCompilerInvocation.o: DiagnosticCommonKinds.inc.h
+ExecuteCompilerInvocation.o: DiagnosticFrontendKinds.inc.h
+ExecuteCompilerInvocation.o: Options.inc.h
+ExecuteCompilerInvocation.po: DiagnosticCommonKinds.inc.h
+ExecuteCompilerInvocation.po: DiagnosticFrontendKinds.inc.h
+ExecuteCompilerInvocation.po: Options.inc.h
+.endif
diff --git a/lib/clang/libclanglex/Makefile b/lib/clang/libclanglex/Makefile
index 90b1fca..3a2873f 100644
--- a/lib/clang/libclanglex/Makefile
+++ b/lib/clang/libclanglex/Makefile
@@ -28,7 +28,7 @@ SRCS= HeaderMap.cpp \
TokenConcatenation.cpp \
TokenLexer.cpp
-TGHDRS= AttrSpellingListIndex \
+TGHDRS= AttrSpellings \
DiagnosticCommonKinds \
DiagnosticLexKinds
diff --git a/lib/clang/libclanglex/Makefile.depend b/lib/clang/libclanglex/Makefile.depend
new file mode 100644
index 0000000..362b138
--- /dev/null
+++ b/lib/clang/libclanglex/Makefile.depend
@@ -0,0 +1,85 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+HeaderSearch.o: DiagnosticCommonKinds.inc.h
+HeaderSearch.po: DiagnosticCommonKinds.inc.h
+Lexer.o: DiagnosticCommonKinds.inc.h
+Lexer.o: DiagnosticLexKinds.inc.h
+Lexer.po: DiagnosticCommonKinds.inc.h
+Lexer.po: DiagnosticLexKinds.inc.h
+LiteralSupport.o: DiagnosticCommonKinds.inc.h
+LiteralSupport.o: DiagnosticLexKinds.inc.h
+LiteralSupport.po: DiagnosticCommonKinds.inc.h
+LiteralSupport.po: DiagnosticLexKinds.inc.h
+MacroArgs.o: DiagnosticCommonKinds.inc.h
+MacroArgs.o: DiagnosticLexKinds.inc.h
+MacroArgs.po: DiagnosticCommonKinds.inc.h
+MacroArgs.po: DiagnosticLexKinds.inc.h
+MacroInfo.o: DiagnosticCommonKinds.inc.h
+MacroInfo.po: DiagnosticCommonKinds.inc.h
+ModuleMap.o: DiagnosticCommonKinds.inc.h
+ModuleMap.o: DiagnosticLexKinds.inc.h
+ModuleMap.po: DiagnosticCommonKinds.inc.h
+ModuleMap.po: DiagnosticLexKinds.inc.h
+PPCaching.o: DiagnosticCommonKinds.inc.h
+PPCaching.po: DiagnosticCommonKinds.inc.h
+PPCallbacks.o: DiagnosticCommonKinds.inc.h
+PPCallbacks.po: DiagnosticCommonKinds.inc.h
+PPConditionalDirectiveRecord.o: DiagnosticCommonKinds.inc.h
+PPConditionalDirectiveRecord.po: DiagnosticCommonKinds.inc.h
+PPDirectives.o: DiagnosticCommonKinds.inc.h
+PPDirectives.o: DiagnosticLexKinds.inc.h
+PPDirectives.po: DiagnosticCommonKinds.inc.h
+PPDirectives.po: DiagnosticLexKinds.inc.h
+PPExpressions.o: DiagnosticCommonKinds.inc.h
+PPExpressions.o: DiagnosticLexKinds.inc.h
+PPExpressions.po: DiagnosticCommonKinds.inc.h
+PPExpressions.po: DiagnosticLexKinds.inc.h
+PPLexerChange.o: DiagnosticCommonKinds.inc.h
+PPLexerChange.o: DiagnosticLexKinds.inc.h
+PPLexerChange.po: DiagnosticCommonKinds.inc.h
+PPLexerChange.po: DiagnosticLexKinds.inc.h
+PPMacroExpansion.o: AttrSpellings.inc.h
+PPMacroExpansion.o: DiagnosticCommonKinds.inc.h
+PPMacroExpansion.o: DiagnosticLexKinds.inc.h
+PPMacroExpansion.po: AttrSpellings.inc.h
+PPMacroExpansion.po: DiagnosticCommonKinds.inc.h
+PPMacroExpansion.po: DiagnosticLexKinds.inc.h
+PTHLexer.o: DiagnosticCommonKinds.inc.h
+PTHLexer.o: DiagnosticLexKinds.inc.h
+PTHLexer.po: DiagnosticCommonKinds.inc.h
+PTHLexer.po: DiagnosticLexKinds.inc.h
+Pragma.o: DiagnosticCommonKinds.inc.h
+Pragma.o: DiagnosticLexKinds.inc.h
+Pragma.po: DiagnosticCommonKinds.inc.h
+Pragma.po: DiagnosticLexKinds.inc.h
+PreprocessingRecord.o: DiagnosticCommonKinds.inc.h
+PreprocessingRecord.po: DiagnosticCommonKinds.inc.h
+Preprocessor.o: DiagnosticCommonKinds.inc.h
+Preprocessor.o: DiagnosticLexKinds.inc.h
+Preprocessor.po: DiagnosticCommonKinds.inc.h
+Preprocessor.po: DiagnosticLexKinds.inc.h
+PreprocessorLexer.o: DiagnosticCommonKinds.inc.h
+PreprocessorLexer.o: DiagnosticLexKinds.inc.h
+PreprocessorLexer.po: DiagnosticCommonKinds.inc.h
+PreprocessorLexer.po: DiagnosticLexKinds.inc.h
+TokenConcatenation.o: DiagnosticCommonKinds.inc.h
+TokenConcatenation.po: DiagnosticCommonKinds.inc.h
+TokenLexer.o: DiagnosticCommonKinds.inc.h
+TokenLexer.o: DiagnosticLexKinds.inc.h
+TokenLexer.po: DiagnosticCommonKinds.inc.h
+TokenLexer.po: DiagnosticLexKinds.inc.h
+.endif
diff --git a/lib/clang/libclangparse/Makefile b/lib/clang/libclangparse/Makefile
index e690d66..b204d87 100644
--- a/lib/clang/libclangparse/Makefile
+++ b/lib/clang/libclangparse/Makefile
@@ -16,14 +16,15 @@ SRCS= ParseAST.cpp \
ParseOpenMP.cpp \
ParsePragma.cpp \
ParseStmt.cpp \
- ParseStmtAsm.cpp \
ParseTemplate.cpp \
ParseTentative.cpp \
Parser.cpp
-TGHDRS= AttrList \
+TGHDRS= AttrIdentifierArg \
+ AttrLateParsed \
+ AttrList \
AttrParsedAttrList \
- AttrParserStringSwitches \
+ AttrTypeArg \
Attrs \
CommentCommandList \
CommentNodes \
diff --git a/lib/clang/libclangparse/Makefile.depend b/lib/clang/libclangparse/Makefile.depend
new file mode 100644
index 0000000..263adfc
--- /dev/null
+++ b/lib/clang/libclangparse/Makefile.depend
@@ -0,0 +1,225 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ParseAST.o: AttrList.inc.h
+ParseAST.o: AttrParsedAttrList.inc.h
+ParseAST.o: Attrs.inc.h
+ParseAST.o: CommentCommandList.inc.h
+ParseAST.o: DeclNodes.inc.h
+ParseAST.o: DiagnosticCommonKinds.inc.h
+ParseAST.o: DiagnosticParseKinds.inc.h
+ParseAST.o: StmtNodes.inc.h
+ParseAST.po: AttrList.inc.h
+ParseAST.po: AttrParsedAttrList.inc.h
+ParseAST.po: Attrs.inc.h
+ParseAST.po: CommentCommandList.inc.h
+ParseAST.po: DeclNodes.inc.h
+ParseAST.po: DiagnosticCommonKinds.inc.h
+ParseAST.po: DiagnosticParseKinds.inc.h
+ParseAST.po: StmtNodes.inc.h
+ParseCXXInlineMethods.o: AttrList.inc.h
+ParseCXXInlineMethods.o: AttrParsedAttrList.inc.h
+ParseCXXInlineMethods.o: Attrs.inc.h
+ParseCXXInlineMethods.o: DeclNodes.inc.h
+ParseCXXInlineMethods.o: DiagnosticCommonKinds.inc.h
+ParseCXXInlineMethods.o: DiagnosticParseKinds.inc.h
+ParseCXXInlineMethods.o: StmtNodes.inc.h
+ParseCXXInlineMethods.po: AttrList.inc.h
+ParseCXXInlineMethods.po: AttrParsedAttrList.inc.h
+ParseCXXInlineMethods.po: Attrs.inc.h
+ParseCXXInlineMethods.po: DeclNodes.inc.h
+ParseCXXInlineMethods.po: DiagnosticCommonKinds.inc.h
+ParseCXXInlineMethods.po: DiagnosticParseKinds.inc.h
+ParseCXXInlineMethods.po: StmtNodes.inc.h
+ParseDecl.o: AttrIdentifierArg.inc.h
+ParseDecl.o: AttrLateParsed.inc.h
+ParseDecl.o: AttrList.inc.h
+ParseDecl.o: AttrParsedAttrList.inc.h
+ParseDecl.o: AttrTypeArg.inc.h
+ParseDecl.o: Attrs.inc.h
+ParseDecl.o: DeclNodes.inc.h
+ParseDecl.o: DiagnosticCommonKinds.inc.h
+ParseDecl.o: DiagnosticParseKinds.inc.h
+ParseDecl.o: StmtNodes.inc.h
+ParseDecl.po: AttrIdentifierArg.inc.h
+ParseDecl.po: AttrLateParsed.inc.h
+ParseDecl.po: AttrList.inc.h
+ParseDecl.po: AttrParsedAttrList.inc.h
+ParseDecl.po: AttrTypeArg.inc.h
+ParseDecl.po: Attrs.inc.h
+ParseDecl.po: DeclNodes.inc.h
+ParseDecl.po: DiagnosticCommonKinds.inc.h
+ParseDecl.po: DiagnosticParseKinds.inc.h
+ParseDecl.po: StmtNodes.inc.h
+ParseDeclCXX.o: AttrList.inc.h
+ParseDeclCXX.o: AttrParsedAttrList.inc.h
+ParseDeclCXX.o: Attrs.inc.h
+ParseDeclCXX.o: DeclNodes.inc.h
+ParseDeclCXX.o: DiagnosticCommonKinds.inc.h
+ParseDeclCXX.o: DiagnosticParseKinds.inc.h
+ParseDeclCXX.o: DiagnosticSemaKinds.inc.h
+ParseDeclCXX.o: StmtNodes.inc.h
+ParseDeclCXX.po: AttrList.inc.h
+ParseDeclCXX.po: AttrParsedAttrList.inc.h
+ParseDeclCXX.po: Attrs.inc.h
+ParseDeclCXX.po: DeclNodes.inc.h
+ParseDeclCXX.po: DiagnosticCommonKinds.inc.h
+ParseDeclCXX.po: DiagnosticParseKinds.inc.h
+ParseDeclCXX.po: DiagnosticSemaKinds.inc.h
+ParseDeclCXX.po: StmtNodes.inc.h
+ParseExpr.o: AttrList.inc.h
+ParseExpr.o: AttrParsedAttrList.inc.h
+ParseExpr.o: Attrs.inc.h
+ParseExpr.o: DeclNodes.inc.h
+ParseExpr.o: DiagnosticCommonKinds.inc.h
+ParseExpr.o: DiagnosticParseKinds.inc.h
+ParseExpr.o: StmtNodes.inc.h
+ParseExpr.po: AttrList.inc.h
+ParseExpr.po: AttrParsedAttrList.inc.h
+ParseExpr.po: Attrs.inc.h
+ParseExpr.po: DeclNodes.inc.h
+ParseExpr.po: DiagnosticCommonKinds.inc.h
+ParseExpr.po: DiagnosticParseKinds.inc.h
+ParseExpr.po: StmtNodes.inc.h
+ParseExprCXX.o: AttrList.inc.h
+ParseExprCXX.o: AttrParsedAttrList.inc.h
+ParseExprCXX.o: Attrs.inc.h
+ParseExprCXX.o: DeclNodes.inc.h
+ParseExprCXX.o: DiagnosticCommonKinds.inc.h
+ParseExprCXX.o: DiagnosticParseKinds.inc.h
+ParseExprCXX.o: StmtNodes.inc.h
+ParseExprCXX.po: AttrList.inc.h
+ParseExprCXX.po: AttrParsedAttrList.inc.h
+ParseExprCXX.po: Attrs.inc.h
+ParseExprCXX.po: DeclNodes.inc.h
+ParseExprCXX.po: DiagnosticCommonKinds.inc.h
+ParseExprCXX.po: DiagnosticParseKinds.inc.h
+ParseExprCXX.po: StmtNodes.inc.h
+ParseInit.o: AttrList.inc.h
+ParseInit.o: AttrParsedAttrList.inc.h
+ParseInit.o: Attrs.inc.h
+ParseInit.o: DeclNodes.inc.h
+ParseInit.o: DiagnosticCommonKinds.inc.h
+ParseInit.o: DiagnosticParseKinds.inc.h
+ParseInit.o: StmtNodes.inc.h
+ParseInit.po: AttrList.inc.h
+ParseInit.po: AttrParsedAttrList.inc.h
+ParseInit.po: Attrs.inc.h
+ParseInit.po: DeclNodes.inc.h
+ParseInit.po: DiagnosticCommonKinds.inc.h
+ParseInit.po: DiagnosticParseKinds.inc.h
+ParseInit.po: StmtNodes.inc.h
+ParseObjc.o: AttrList.inc.h
+ParseObjc.o: AttrParsedAttrList.inc.h
+ParseObjc.o: Attrs.inc.h
+ParseObjc.o: DeclNodes.inc.h
+ParseObjc.o: DiagnosticCommonKinds.inc.h
+ParseObjc.o: DiagnosticParseKinds.inc.h
+ParseObjc.o: StmtNodes.inc.h
+ParseObjc.po: AttrList.inc.h
+ParseObjc.po: AttrParsedAttrList.inc.h
+ParseObjc.po: Attrs.inc.h
+ParseObjc.po: DeclNodes.inc.h
+ParseObjc.po: DiagnosticCommonKinds.inc.h
+ParseObjc.po: DiagnosticParseKinds.inc.h
+ParseObjc.po: StmtNodes.inc.h
+ParseOpenMP.o: AttrList.inc.h
+ParseOpenMP.o: AttrParsedAttrList.inc.h
+ParseOpenMP.o: Attrs.inc.h
+ParseOpenMP.o: DeclNodes.inc.h
+ParseOpenMP.o: DiagnosticCommonKinds.inc.h
+ParseOpenMP.o: DiagnosticParseKinds.inc.h
+ParseOpenMP.o: StmtNodes.inc.h
+ParseOpenMP.po: AttrList.inc.h
+ParseOpenMP.po: AttrParsedAttrList.inc.h
+ParseOpenMP.po: Attrs.inc.h
+ParseOpenMP.po: DeclNodes.inc.h
+ParseOpenMP.po: DiagnosticCommonKinds.inc.h
+ParseOpenMP.po: DiagnosticParseKinds.inc.h
+ParseOpenMP.po: StmtNodes.inc.h
+ParsePragma.o: AttrList.inc.h
+ParsePragma.o: AttrParsedAttrList.inc.h
+ParsePragma.o: Attrs.inc.h
+ParsePragma.o: DeclNodes.inc.h
+ParsePragma.o: DiagnosticCommonKinds.inc.h
+ParsePragma.o: DiagnosticParseKinds.inc.h
+ParsePragma.o: StmtNodes.inc.h
+ParsePragma.po: AttrList.inc.h
+ParsePragma.po: AttrParsedAttrList.inc.h
+ParsePragma.po: Attrs.inc.h
+ParsePragma.po: DeclNodes.inc.h
+ParsePragma.po: DiagnosticCommonKinds.inc.h
+ParsePragma.po: DiagnosticParseKinds.inc.h
+ParsePragma.po: StmtNodes.inc.h
+ParseStmt.o: AttrList.inc.h
+ParseStmt.o: AttrParsedAttrList.inc.h
+ParseStmt.o: Attrs.inc.h
+ParseStmt.o: CommentCommandList.inc.h
+ParseStmt.o: DeclNodes.inc.h
+ParseStmt.o: DiagnosticCommonKinds.inc.h
+ParseStmt.o: DiagnosticParseKinds.inc.h
+ParseStmt.o: StmtNodes.inc.h
+ParseStmt.po: AttrList.inc.h
+ParseStmt.po: AttrParsedAttrList.inc.h
+ParseStmt.po: Attrs.inc.h
+ParseStmt.po: CommentCommandList.inc.h
+ParseStmt.po: DeclNodes.inc.h
+ParseStmt.po: DiagnosticCommonKinds.inc.h
+ParseStmt.po: DiagnosticParseKinds.inc.h
+ParseStmt.po: StmtNodes.inc.h
+ParseTemplate.o: AttrList.inc.h
+ParseTemplate.o: AttrParsedAttrList.inc.h
+ParseTemplate.o: Attrs.inc.h
+ParseTemplate.o: DeclNodes.inc.h
+ParseTemplate.o: DiagnosticCommonKinds.inc.h
+ParseTemplate.o: DiagnosticParseKinds.inc.h
+ParseTemplate.o: StmtNodes.inc.h
+ParseTemplate.po: AttrList.inc.h
+ParseTemplate.po: AttrParsedAttrList.inc.h
+ParseTemplate.po: Attrs.inc.h
+ParseTemplate.po: DeclNodes.inc.h
+ParseTemplate.po: DiagnosticCommonKinds.inc.h
+ParseTemplate.po: DiagnosticParseKinds.inc.h
+ParseTemplate.po: StmtNodes.inc.h
+ParseTentative.o: AttrList.inc.h
+ParseTentative.o: AttrParsedAttrList.inc.h
+ParseTentative.o: Attrs.inc.h
+ParseTentative.o: DeclNodes.inc.h
+ParseTentative.o: DiagnosticCommonKinds.inc.h
+ParseTentative.o: DiagnosticParseKinds.inc.h
+ParseTentative.o: StmtNodes.inc.h
+ParseTentative.po: AttrList.inc.h
+ParseTentative.po: AttrParsedAttrList.inc.h
+ParseTentative.po: Attrs.inc.h
+ParseTentative.po: DeclNodes.inc.h
+ParseTentative.po: DiagnosticCommonKinds.inc.h
+ParseTentative.po: DiagnosticParseKinds.inc.h
+ParseTentative.po: StmtNodes.inc.h
+Parser.o: AttrList.inc.h
+Parser.o: AttrParsedAttrList.inc.h
+Parser.o: Attrs.inc.h
+Parser.o: DeclNodes.inc.h
+Parser.o: DiagnosticCommonKinds.inc.h
+Parser.o: DiagnosticParseKinds.inc.h
+Parser.o: StmtNodes.inc.h
+Parser.po: AttrList.inc.h
+Parser.po: AttrParsedAttrList.inc.h
+Parser.po: Attrs.inc.h
+Parser.po: DeclNodes.inc.h
+Parser.po: DiagnosticCommonKinds.inc.h
+Parser.po: DiagnosticParseKinds.inc.h
+Parser.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/libclangrewrite/Makefile b/lib/clang/libclangrewritecore/Makefile
index ec770c3..80115ee 100644
--- a/lib/clang/libclangrewrite/Makefile
+++ b/lib/clang/libclangrewritecore/Makefile
@@ -2,9 +2,9 @@
.include <bsd.own.mk>
-LIB= clangrewrite
+LIB= clangrewritecore
-SRCDIR= tools/clang/lib/Rewrite
+SRCDIR= tools/clang/lib/Rewrite/Core
SRCS= DeltaTree.cpp \
HTMLRewrite.cpp \
RewriteRope.cpp \
diff --git a/lib/clang/libclangrewritecore/Makefile.depend b/lib/clang/libclangrewritecore/Makefile.depend
new file mode 100644
index 0000000..a211b19
--- /dev/null
+++ b/lib/clang/libclangrewritecore/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+HTMLRewrite.o: DiagnosticCommonKinds.inc.h
+HTMLRewrite.po: DiagnosticCommonKinds.inc.h
+Rewriter.o: DeclNodes.inc.h
+Rewriter.o: DiagnosticCommonKinds.inc.h
+Rewriter.o: StmtNodes.inc.h
+Rewriter.po: DeclNodes.inc.h
+Rewriter.po: DiagnosticCommonKinds.inc.h
+Rewriter.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/libclangrewritefrontend/Makefile b/lib/clang/libclangrewritefrontend/Makefile
index 2f614fb..8c41669 100644
--- a/lib/clang/libclangrewritefrontend/Makefile
+++ b/lib/clang/libclangrewritefrontend/Makefile
@@ -4,12 +4,14 @@
LIB= clangrewritefrontend
-SRCDIR= tools/clang/lib/Frontend/Rewrite
+SRCDIR= tools/clang/lib/Rewrite/Frontend
SRCS= FixItRewriter.cpp \
FrontendActions.cpp \
HTMLPrint.cpp \
InclusionRewriter.cpp \
RewriteMacros.cpp \
+ RewriteModernObjC.cpp \
+ RewriteObjC.cpp \
RewriteTest.cpp
TGHDRS= AttrList \
diff --git a/lib/clang/libclangrewritefrontend/Makefile.depend b/lib/clang/libclangrewritefrontend/Makefile.depend
new file mode 100644
index 0000000..8fbe823
--- /dev/null
+++ b/lib/clang/libclangrewritefrontend/Makefile.depend
@@ -0,0 +1,73 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+FixItRewriter.o: DiagnosticCommonKinds.inc.h
+FixItRewriter.o: DiagnosticFrontendKinds.inc.h
+FixItRewriter.po: DiagnosticCommonKinds.inc.h
+FixItRewriter.po: DiagnosticFrontendKinds.inc.h
+FrontendActions.o: AttrList.inc.h
+FrontendActions.o: AttrParsedAttrList.inc.h
+FrontendActions.o: Attrs.inc.h
+FrontendActions.o: DeclNodes.inc.h
+FrontendActions.o: DiagnosticCommonKinds.inc.h
+FrontendActions.o: DiagnosticFrontendKinds.inc.h
+FrontendActions.o: StmtNodes.inc.h
+FrontendActions.po: AttrList.inc.h
+FrontendActions.po: AttrParsedAttrList.inc.h
+FrontendActions.po: Attrs.inc.h
+FrontendActions.po: DeclNodes.inc.h
+FrontendActions.po: DiagnosticCommonKinds.inc.h
+FrontendActions.po: DiagnosticFrontendKinds.inc.h
+FrontendActions.po: StmtNodes.inc.h
+HTMLPrint.o: CommentCommandList.inc.h
+HTMLPrint.o: DeclNodes.inc.h
+HTMLPrint.o: DiagnosticCommonKinds.inc.h
+HTMLPrint.o: StmtNodes.inc.h
+HTMLPrint.po: CommentCommandList.inc.h
+HTMLPrint.po: DeclNodes.inc.h
+HTMLPrint.po: DiagnosticCommonKinds.inc.h
+HTMLPrint.po: StmtNodes.inc.h
+InclusionRewriter.o: DiagnosticCommonKinds.inc.h
+InclusionRewriter.po: DiagnosticCommonKinds.inc.h
+RewriteMacros.o: DiagnosticCommonKinds.inc.h
+RewriteMacros.po: DiagnosticCommonKinds.inc.h
+RewriteModernObjC.o: AttrList.inc.h
+RewriteModernObjC.o: Attrs.inc.h
+RewriteModernObjC.o: CommentCommandList.inc.h
+RewriteModernObjC.o: DeclNodes.inc.h
+RewriteModernObjC.o: DiagnosticCommonKinds.inc.h
+RewriteModernObjC.o: StmtNodes.inc.h
+RewriteModernObjC.po: AttrList.inc.h
+RewriteModernObjC.po: Attrs.inc.h
+RewriteModernObjC.po: CommentCommandList.inc.h
+RewriteModernObjC.po: DeclNodes.inc.h
+RewriteModernObjC.po: DiagnosticCommonKinds.inc.h
+RewriteModernObjC.po: StmtNodes.inc.h
+RewriteObjC.o: AttrList.inc.h
+RewriteObjC.o: Attrs.inc.h
+RewriteObjC.o: CommentCommandList.inc.h
+RewriteObjC.o: DeclNodes.inc.h
+RewriteObjC.o: DiagnosticCommonKinds.inc.h
+RewriteObjC.o: StmtNodes.inc.h
+RewriteObjC.po: AttrList.inc.h
+RewriteObjC.po: Attrs.inc.h
+RewriteObjC.po: CommentCommandList.inc.h
+RewriteObjC.po: DeclNodes.inc.h
+RewriteObjC.po: DiagnosticCommonKinds.inc.h
+RewriteObjC.po: StmtNodes.inc.h
+RewriteTest.o: DiagnosticCommonKinds.inc.h
+RewriteTest.po: DiagnosticCommonKinds.inc.h
+.endif
diff --git a/lib/clang/libclangsema/Makefile b/lib/clang/libclangsema/Makefile
index 08c120a..9157b46 100644
--- a/lib/clang/libclangsema/Makefile
+++ b/lib/clang/libclangsema/Makefile
@@ -18,7 +18,6 @@ SRCS= AnalysisBasedWarnings.cpp \
Sema.cpp \
SemaAccess.cpp \
SemaAttr.cpp \
- SemaCUDA.cpp \
SemaCXXScopeSpec.cpp \
SemaCast.cpp \
SemaChecking.cpp \
@@ -50,6 +49,7 @@ SRCS= AnalysisBasedWarnings.cpp \
SemaTemplateInstantiateDecl.cpp \
SemaTemplateVariadic.cpp \
SemaType.cpp \
+ TargetAttributesSema.cpp \
TypeLocBuilder.cpp
TGHDRS= AttrList \
@@ -58,7 +58,6 @@ TGHDRS= AttrList \
AttrParsedAttrList \
AttrSpellingListIndex \
AttrTemplateInstantiate \
- AttrVisitor \
Attrs \
CommentCommandList \
CommentNodes \
diff --git a/lib/clang/libclangsema/Makefile.depend b/lib/clang/libclangsema/Makefile.depend
new file mode 100644
index 0000000..8e45ce4
--- /dev/null
+++ b/lib/clang/libclangsema/Makefile.depend
@@ -0,0 +1,695 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AnalysisBasedWarnings.o: AttrList.inc.h
+AnalysisBasedWarnings.o: AttrParsedAttrList.inc.h
+AnalysisBasedWarnings.o: Attrs.inc.h
+AnalysisBasedWarnings.o: CommentCommandList.inc.h
+AnalysisBasedWarnings.o: DeclNodes.inc.h
+AnalysisBasedWarnings.o: DiagnosticCommonKinds.inc.h
+AnalysisBasedWarnings.o: DiagnosticSemaKinds.inc.h
+AnalysisBasedWarnings.o: StmtNodes.inc.h
+AnalysisBasedWarnings.po: AttrList.inc.h
+AnalysisBasedWarnings.po: AttrParsedAttrList.inc.h
+AnalysisBasedWarnings.po: Attrs.inc.h
+AnalysisBasedWarnings.po: CommentCommandList.inc.h
+AnalysisBasedWarnings.po: DeclNodes.inc.h
+AnalysisBasedWarnings.po: DiagnosticCommonKinds.inc.h
+AnalysisBasedWarnings.po: DiagnosticSemaKinds.inc.h
+AnalysisBasedWarnings.po: StmtNodes.inc.h
+AttributeList.o: AttrParsedAttrImpl.inc.h
+AttributeList.o: AttrParsedAttrKinds.inc.h
+AttributeList.o: AttrParsedAttrList.inc.h
+AttributeList.o: AttrSpellingListIndex.inc.h
+AttributeList.o: CommentCommandList.inc.h
+AttributeList.o: DeclNodes.inc.h
+AttributeList.o: DiagnosticCommonKinds.inc.h
+AttributeList.o: StmtNodes.inc.h
+AttributeList.po: AttrParsedAttrImpl.inc.h
+AttributeList.po: AttrParsedAttrKinds.inc.h
+AttributeList.po: AttrParsedAttrList.inc.h
+AttributeList.po: AttrSpellingListIndex.inc.h
+AttributeList.po: CommentCommandList.inc.h
+AttributeList.po: DeclNodes.inc.h
+AttributeList.po: DiagnosticCommonKinds.inc.h
+AttributeList.po: StmtNodes.inc.h
+CodeCompleteConsumer.o: AttrList.inc.h
+CodeCompleteConsumer.o: AttrParsedAttrList.inc.h
+CodeCompleteConsumer.o: Attrs.inc.h
+CodeCompleteConsumer.o: DeclNodes.inc.h
+CodeCompleteConsumer.o: DiagnosticCommonKinds.inc.h
+CodeCompleteConsumer.o: StmtNodes.inc.h
+CodeCompleteConsumer.po: AttrList.inc.h
+CodeCompleteConsumer.po: AttrParsedAttrList.inc.h
+CodeCompleteConsumer.po: Attrs.inc.h
+CodeCompleteConsumer.po: DeclNodes.inc.h
+CodeCompleteConsumer.po: DiagnosticCommonKinds.inc.h
+CodeCompleteConsumer.po: StmtNodes.inc.h
+DeclSpec.o: AttrList.inc.h
+DeclSpec.o: AttrParsedAttrList.inc.h
+DeclSpec.o: Attrs.inc.h
+DeclSpec.o: CommentCommandList.inc.h
+DeclSpec.o: DeclNodes.inc.h
+DeclSpec.o: DiagnosticCommonKinds.inc.h
+DeclSpec.o: DiagnosticParseKinds.inc.h
+DeclSpec.o: DiagnosticSemaKinds.inc.h
+DeclSpec.o: StmtNodes.inc.h
+DeclSpec.po: AttrList.inc.h
+DeclSpec.po: AttrParsedAttrList.inc.h
+DeclSpec.po: Attrs.inc.h
+DeclSpec.po: CommentCommandList.inc.h
+DeclSpec.po: DeclNodes.inc.h
+DeclSpec.po: DiagnosticCommonKinds.inc.h
+DeclSpec.po: DiagnosticParseKinds.inc.h
+DeclSpec.po: DiagnosticSemaKinds.inc.h
+DeclSpec.po: StmtNodes.inc.h
+DelayedDiagnostic.o: AttrList.inc.h
+DelayedDiagnostic.o: AttrParsedAttrList.inc.h
+DelayedDiagnostic.o: Attrs.inc.h
+DelayedDiagnostic.o: DeclNodes.inc.h
+DelayedDiagnostic.o: DiagnosticCommonKinds.inc.h
+DelayedDiagnostic.o: StmtNodes.inc.h
+DelayedDiagnostic.po: AttrList.inc.h
+DelayedDiagnostic.po: AttrParsedAttrList.inc.h
+DelayedDiagnostic.po: Attrs.inc.h
+DelayedDiagnostic.po: DeclNodes.inc.h
+DelayedDiagnostic.po: DiagnosticCommonKinds.inc.h
+DelayedDiagnostic.po: StmtNodes.inc.h
+IdentifierResolver.o: DeclNodes.inc.h
+IdentifierResolver.o: DiagnosticCommonKinds.inc.h
+IdentifierResolver.po: DeclNodes.inc.h
+IdentifierResolver.po: DiagnosticCommonKinds.inc.h
+JumpDiagnostics.o: AttrList.inc.h
+JumpDiagnostics.o: AttrParsedAttrList.inc.h
+JumpDiagnostics.o: Attrs.inc.h
+JumpDiagnostics.o: CommentCommandList.inc.h
+JumpDiagnostics.o: DeclNodes.inc.h
+JumpDiagnostics.o: DiagnosticCommonKinds.inc.h
+JumpDiagnostics.o: DiagnosticSemaKinds.inc.h
+JumpDiagnostics.o: StmtNodes.inc.h
+JumpDiagnostics.po: AttrList.inc.h
+JumpDiagnostics.po: AttrParsedAttrList.inc.h
+JumpDiagnostics.po: Attrs.inc.h
+JumpDiagnostics.po: CommentCommandList.inc.h
+JumpDiagnostics.po: DeclNodes.inc.h
+JumpDiagnostics.po: DiagnosticCommonKinds.inc.h
+JumpDiagnostics.po: DiagnosticSemaKinds.inc.h
+JumpDiagnostics.po: StmtNodes.inc.h
+MultiplexExternalSemaSource.o: AttrList.inc.h
+MultiplexExternalSemaSource.o: AttrParsedAttrList.inc.h
+MultiplexExternalSemaSource.o: Attrs.inc.h
+MultiplexExternalSemaSource.o: DeclNodes.inc.h
+MultiplexExternalSemaSource.o: DiagnosticCommonKinds.inc.h
+MultiplexExternalSemaSource.o: StmtNodes.inc.h
+MultiplexExternalSemaSource.po: AttrList.inc.h
+MultiplexExternalSemaSource.po: AttrParsedAttrList.inc.h
+MultiplexExternalSemaSource.po: Attrs.inc.h
+MultiplexExternalSemaSource.po: DeclNodes.inc.h
+MultiplexExternalSemaSource.po: DiagnosticCommonKinds.inc.h
+MultiplexExternalSemaSource.po: StmtNodes.inc.h
+Scope.o: DiagnosticCommonKinds.inc.h
+Scope.po: DiagnosticCommonKinds.inc.h
+ScopeInfo.o: DeclNodes.inc.h
+ScopeInfo.o: DiagnosticCommonKinds.inc.h
+ScopeInfo.o: StmtNodes.inc.h
+ScopeInfo.po: DeclNodes.inc.h
+ScopeInfo.po: DiagnosticCommonKinds.inc.h
+ScopeInfo.po: StmtNodes.inc.h
+Sema.o: AttrList.inc.h
+Sema.o: AttrParsedAttrList.inc.h
+Sema.o: Attrs.inc.h
+Sema.o: CommentCommandList.inc.h
+Sema.o: DeclNodes.inc.h
+Sema.o: DiagnosticASTKinds.inc.h
+Sema.o: DiagnosticCommonKinds.inc.h
+Sema.o: DiagnosticSemaKinds.inc.h
+Sema.o: StmtNodes.inc.h
+Sema.po: AttrList.inc.h
+Sema.po: AttrParsedAttrList.inc.h
+Sema.po: Attrs.inc.h
+Sema.po: CommentCommandList.inc.h
+Sema.po: DeclNodes.inc.h
+Sema.po: DiagnosticASTKinds.inc.h
+Sema.po: DiagnosticCommonKinds.inc.h
+Sema.po: DiagnosticSemaKinds.inc.h
+Sema.po: StmtNodes.inc.h
+SemaAccess.o: AttrList.inc.h
+SemaAccess.o: AttrParsedAttrList.inc.h
+SemaAccess.o: Attrs.inc.h
+SemaAccess.o: CommentCommandList.inc.h
+SemaAccess.o: DeclNodes.inc.h
+SemaAccess.o: DiagnosticCommonKinds.inc.h
+SemaAccess.o: DiagnosticSemaKinds.inc.h
+SemaAccess.o: StmtNodes.inc.h
+SemaAccess.po: AttrList.inc.h
+SemaAccess.po: AttrParsedAttrList.inc.h
+SemaAccess.po: Attrs.inc.h
+SemaAccess.po: CommentCommandList.inc.h
+SemaAccess.po: DeclNodes.inc.h
+SemaAccess.po: DiagnosticCommonKinds.inc.h
+SemaAccess.po: DiagnosticSemaKinds.inc.h
+SemaAccess.po: StmtNodes.inc.h
+SemaAttr.o: AttrList.inc.h
+SemaAttr.o: AttrParsedAttrList.inc.h
+SemaAttr.o: Attrs.inc.h
+SemaAttr.o: CommentCommandList.inc.h
+SemaAttr.o: DeclNodes.inc.h
+SemaAttr.o: DiagnosticCommonKinds.inc.h
+SemaAttr.o: DiagnosticSemaKinds.inc.h
+SemaAttr.o: StmtNodes.inc.h
+SemaAttr.po: AttrList.inc.h
+SemaAttr.po: AttrParsedAttrList.inc.h
+SemaAttr.po: Attrs.inc.h
+SemaAttr.po: CommentCommandList.inc.h
+SemaAttr.po: DeclNodes.inc.h
+SemaAttr.po: DiagnosticCommonKinds.inc.h
+SemaAttr.po: DiagnosticSemaKinds.inc.h
+SemaAttr.po: StmtNodes.inc.h
+SemaCXXScopeSpec.o: AttrList.inc.h
+SemaCXXScopeSpec.o: AttrParsedAttrList.inc.h
+SemaCXXScopeSpec.o: Attrs.inc.h
+SemaCXXScopeSpec.o: CommentCommandList.inc.h
+SemaCXXScopeSpec.o: DeclNodes.inc.h
+SemaCXXScopeSpec.o: DiagnosticCommonKinds.inc.h
+SemaCXXScopeSpec.o: DiagnosticSemaKinds.inc.h
+SemaCXXScopeSpec.o: StmtNodes.inc.h
+SemaCXXScopeSpec.po: AttrList.inc.h
+SemaCXXScopeSpec.po: AttrParsedAttrList.inc.h
+SemaCXXScopeSpec.po: Attrs.inc.h
+SemaCXXScopeSpec.po: CommentCommandList.inc.h
+SemaCXXScopeSpec.po: DeclNodes.inc.h
+SemaCXXScopeSpec.po: DiagnosticCommonKinds.inc.h
+SemaCXXScopeSpec.po: DiagnosticSemaKinds.inc.h
+SemaCXXScopeSpec.po: StmtNodes.inc.h
+SemaCast.o: AttrList.inc.h
+SemaCast.o: AttrParsedAttrList.inc.h
+SemaCast.o: Attrs.inc.h
+SemaCast.o: CommentCommandList.inc.h
+SemaCast.o: DeclNodes.inc.h
+SemaCast.o: DiagnosticCommonKinds.inc.h
+SemaCast.o: DiagnosticSemaKinds.inc.h
+SemaCast.o: StmtNodes.inc.h
+SemaCast.po: AttrList.inc.h
+SemaCast.po: AttrParsedAttrList.inc.h
+SemaCast.po: Attrs.inc.h
+SemaCast.po: CommentCommandList.inc.h
+SemaCast.po: DeclNodes.inc.h
+SemaCast.po: DiagnosticCommonKinds.inc.h
+SemaCast.po: DiagnosticSemaKinds.inc.h
+SemaCast.po: StmtNodes.inc.h
+SemaChecking.o: AttrList.inc.h
+SemaChecking.o: AttrParsedAttrList.inc.h
+SemaChecking.o: Attrs.inc.h
+SemaChecking.o: CommentCommandList.inc.h
+SemaChecking.o: DeclNodes.inc.h
+SemaChecking.o: DiagnosticCommonKinds.inc.h
+SemaChecking.o: DiagnosticSemaKinds.inc.h
+SemaChecking.o: StmtNodes.inc.h
+SemaChecking.o: arm_neon.inc.h
+SemaChecking.po: AttrList.inc.h
+SemaChecking.po: AttrParsedAttrList.inc.h
+SemaChecking.po: Attrs.inc.h
+SemaChecking.po: CommentCommandList.inc.h
+SemaChecking.po: DeclNodes.inc.h
+SemaChecking.po: DiagnosticCommonKinds.inc.h
+SemaChecking.po: DiagnosticSemaKinds.inc.h
+SemaChecking.po: StmtNodes.inc.h
+SemaChecking.po: arm_neon.inc.h
+SemaCodeComplete.o: AttrList.inc.h
+SemaCodeComplete.o: AttrParsedAttrList.inc.h
+SemaCodeComplete.o: Attrs.inc.h
+SemaCodeComplete.o: CommentCommandList.inc.h
+SemaCodeComplete.o: DeclNodes.inc.h
+SemaCodeComplete.o: DiagnosticCommonKinds.inc.h
+SemaCodeComplete.o: DiagnosticSemaKinds.inc.h
+SemaCodeComplete.o: StmtNodes.inc.h
+SemaCodeComplete.po: AttrList.inc.h
+SemaCodeComplete.po: AttrParsedAttrList.inc.h
+SemaCodeComplete.po: Attrs.inc.h
+SemaCodeComplete.po: CommentCommandList.inc.h
+SemaCodeComplete.po: DeclNodes.inc.h
+SemaCodeComplete.po: DiagnosticCommonKinds.inc.h
+SemaCodeComplete.po: DiagnosticSemaKinds.inc.h
+SemaCodeComplete.po: StmtNodes.inc.h
+SemaDecl.o: AttrList.inc.h
+SemaDecl.o: AttrParsedAttrList.inc.h
+SemaDecl.o: Attrs.inc.h
+SemaDecl.o: CommentCommandList.inc.h
+SemaDecl.o: DeclNodes.inc.h
+SemaDecl.o: DiagnosticCommentKinds.inc.h
+SemaDecl.o: DiagnosticCommonKinds.inc.h
+SemaDecl.o: DiagnosticParseKinds.inc.h
+SemaDecl.o: DiagnosticSemaKinds.inc.h
+SemaDecl.o: StmtNodes.inc.h
+SemaDecl.po: AttrList.inc.h
+SemaDecl.po: AttrParsedAttrList.inc.h
+SemaDecl.po: Attrs.inc.h
+SemaDecl.po: CommentCommandList.inc.h
+SemaDecl.po: DeclNodes.inc.h
+SemaDecl.po: DiagnosticCommentKinds.inc.h
+SemaDecl.po: DiagnosticCommonKinds.inc.h
+SemaDecl.po: DiagnosticParseKinds.inc.h
+SemaDecl.po: DiagnosticSemaKinds.inc.h
+SemaDecl.po: StmtNodes.inc.h
+SemaDeclAttr.o: AttrList.inc.h
+SemaDeclAttr.o: AttrParsedAttrList.inc.h
+SemaDeclAttr.o: Attrs.inc.h
+SemaDeclAttr.o: CommentCommandList.inc.h
+SemaDeclAttr.o: DeclNodes.inc.h
+SemaDeclAttr.o: DiagnosticCommonKinds.inc.h
+SemaDeclAttr.o: DiagnosticSemaKinds.inc.h
+SemaDeclAttr.o: StmtNodes.inc.h
+SemaDeclAttr.po: AttrList.inc.h
+SemaDeclAttr.po: AttrParsedAttrList.inc.h
+SemaDeclAttr.po: Attrs.inc.h
+SemaDeclAttr.po: CommentCommandList.inc.h
+SemaDeclAttr.po: DeclNodes.inc.h
+SemaDeclAttr.po: DiagnosticCommonKinds.inc.h
+SemaDeclAttr.po: DiagnosticSemaKinds.inc.h
+SemaDeclAttr.po: StmtNodes.inc.h
+SemaDeclCXX.o: AttrList.inc.h
+SemaDeclCXX.o: AttrParsedAttrList.inc.h
+SemaDeclCXX.o: Attrs.inc.h
+SemaDeclCXX.o: CommentCommandList.inc.h
+SemaDeclCXX.o: DeclNodes.inc.h
+SemaDeclCXX.o: DiagnosticCommonKinds.inc.h
+SemaDeclCXX.o: DiagnosticSemaKinds.inc.h
+SemaDeclCXX.o: StmtNodes.inc.h
+SemaDeclCXX.po: AttrList.inc.h
+SemaDeclCXX.po: AttrParsedAttrList.inc.h
+SemaDeclCXX.po: Attrs.inc.h
+SemaDeclCXX.po: CommentCommandList.inc.h
+SemaDeclCXX.po: DeclNodes.inc.h
+SemaDeclCXX.po: DiagnosticCommonKinds.inc.h
+SemaDeclCXX.po: DiagnosticSemaKinds.inc.h
+SemaDeclCXX.po: StmtNodes.inc.h
+SemaDeclObjC.o: AttrList.inc.h
+SemaDeclObjC.o: AttrParsedAttrList.inc.h
+SemaDeclObjC.o: Attrs.inc.h
+SemaDeclObjC.o: CommentCommandList.inc.h
+SemaDeclObjC.o: DeclNodes.inc.h
+SemaDeclObjC.o: DiagnosticCommonKinds.inc.h
+SemaDeclObjC.o: DiagnosticSemaKinds.inc.h
+SemaDeclObjC.o: StmtNodes.inc.h
+SemaDeclObjC.po: AttrList.inc.h
+SemaDeclObjC.po: AttrParsedAttrList.inc.h
+SemaDeclObjC.po: Attrs.inc.h
+SemaDeclObjC.po: CommentCommandList.inc.h
+SemaDeclObjC.po: DeclNodes.inc.h
+SemaDeclObjC.po: DiagnosticCommonKinds.inc.h
+SemaDeclObjC.po: DiagnosticSemaKinds.inc.h
+SemaDeclObjC.po: StmtNodes.inc.h
+SemaExceptionSpec.o: AttrList.inc.h
+SemaExceptionSpec.o: AttrParsedAttrList.inc.h
+SemaExceptionSpec.o: Attrs.inc.h
+SemaExceptionSpec.o: CommentCommandList.inc.h
+SemaExceptionSpec.o: DeclNodes.inc.h
+SemaExceptionSpec.o: DiagnosticCommonKinds.inc.h
+SemaExceptionSpec.o: DiagnosticSemaKinds.inc.h
+SemaExceptionSpec.o: StmtNodes.inc.h
+SemaExceptionSpec.po: AttrList.inc.h
+SemaExceptionSpec.po: AttrParsedAttrList.inc.h
+SemaExceptionSpec.po: Attrs.inc.h
+SemaExceptionSpec.po: CommentCommandList.inc.h
+SemaExceptionSpec.po: DeclNodes.inc.h
+SemaExceptionSpec.po: DiagnosticCommonKinds.inc.h
+SemaExceptionSpec.po: DiagnosticSemaKinds.inc.h
+SemaExceptionSpec.po: StmtNodes.inc.h
+SemaExpr.o: AttrList.inc.h
+SemaExpr.o: AttrParsedAttrList.inc.h
+SemaExpr.o: Attrs.inc.h
+SemaExpr.o: CommentCommandList.inc.h
+SemaExpr.o: DeclNodes.inc.h
+SemaExpr.o: DiagnosticCommonKinds.inc.h
+SemaExpr.o: DiagnosticSemaKinds.inc.h
+SemaExpr.o: StmtNodes.inc.h
+SemaExpr.po: AttrList.inc.h
+SemaExpr.po: AttrParsedAttrList.inc.h
+SemaExpr.po: Attrs.inc.h
+SemaExpr.po: CommentCommandList.inc.h
+SemaExpr.po: DeclNodes.inc.h
+SemaExpr.po: DiagnosticCommonKinds.inc.h
+SemaExpr.po: DiagnosticSemaKinds.inc.h
+SemaExpr.po: StmtNodes.inc.h
+SemaExprCXX.o: AttrList.inc.h
+SemaExprCXX.o: AttrParsedAttrList.inc.h
+SemaExprCXX.o: Attrs.inc.h
+SemaExprCXX.o: CommentCommandList.inc.h
+SemaExprCXX.o: DeclNodes.inc.h
+SemaExprCXX.o: DiagnosticCommonKinds.inc.h
+SemaExprCXX.o: DiagnosticSemaKinds.inc.h
+SemaExprCXX.o: StmtNodes.inc.h
+SemaExprCXX.po: AttrList.inc.h
+SemaExprCXX.po: AttrParsedAttrList.inc.h
+SemaExprCXX.po: Attrs.inc.h
+SemaExprCXX.po: CommentCommandList.inc.h
+SemaExprCXX.po: DeclNodes.inc.h
+SemaExprCXX.po: DiagnosticCommonKinds.inc.h
+SemaExprCXX.po: DiagnosticSemaKinds.inc.h
+SemaExprCXX.po: StmtNodes.inc.h
+SemaExprMember.o: AttrList.inc.h
+SemaExprMember.o: AttrParsedAttrList.inc.h
+SemaExprMember.o: Attrs.inc.h
+SemaExprMember.o: CommentCommandList.inc.h
+SemaExprMember.o: DeclNodes.inc.h
+SemaExprMember.o: DiagnosticCommonKinds.inc.h
+SemaExprMember.o: DiagnosticSemaKinds.inc.h
+SemaExprMember.o: StmtNodes.inc.h
+SemaExprMember.po: AttrList.inc.h
+SemaExprMember.po: AttrParsedAttrList.inc.h
+SemaExprMember.po: Attrs.inc.h
+SemaExprMember.po: CommentCommandList.inc.h
+SemaExprMember.po: DeclNodes.inc.h
+SemaExprMember.po: DiagnosticCommonKinds.inc.h
+SemaExprMember.po: DiagnosticSemaKinds.inc.h
+SemaExprMember.po: StmtNodes.inc.h
+SemaExprObjC.o: AttrList.inc.h
+SemaExprObjC.o: AttrParsedAttrList.inc.h
+SemaExprObjC.o: Attrs.inc.h
+SemaExprObjC.o: CommentCommandList.inc.h
+SemaExprObjC.o: DeclNodes.inc.h
+SemaExprObjC.o: DiagnosticCommonKinds.inc.h
+SemaExprObjC.o: DiagnosticSemaKinds.inc.h
+SemaExprObjC.o: StmtNodes.inc.h
+SemaExprObjC.po: AttrList.inc.h
+SemaExprObjC.po: AttrParsedAttrList.inc.h
+SemaExprObjC.po: Attrs.inc.h
+SemaExprObjC.po: CommentCommandList.inc.h
+SemaExprObjC.po: DeclNodes.inc.h
+SemaExprObjC.po: DiagnosticCommonKinds.inc.h
+SemaExprObjC.po: DiagnosticSemaKinds.inc.h
+SemaExprObjC.po: StmtNodes.inc.h
+SemaFixItUtils.o: AttrList.inc.h
+SemaFixItUtils.o: AttrParsedAttrList.inc.h
+SemaFixItUtils.o: Attrs.inc.h
+SemaFixItUtils.o: CommentCommandList.inc.h
+SemaFixItUtils.o: DeclNodes.inc.h
+SemaFixItUtils.o: DiagnosticCommonKinds.inc.h
+SemaFixItUtils.o: StmtNodes.inc.h
+SemaFixItUtils.po: AttrList.inc.h
+SemaFixItUtils.po: AttrParsedAttrList.inc.h
+SemaFixItUtils.po: Attrs.inc.h
+SemaFixItUtils.po: CommentCommandList.inc.h
+SemaFixItUtils.po: DeclNodes.inc.h
+SemaFixItUtils.po: DiagnosticCommonKinds.inc.h
+SemaFixItUtils.po: StmtNodes.inc.h
+SemaInit.o: AttrList.inc.h
+SemaInit.o: AttrParsedAttrList.inc.h
+SemaInit.o: Attrs.inc.h
+SemaInit.o: CommentCommandList.inc.h
+SemaInit.o: DeclNodes.inc.h
+SemaInit.o: DiagnosticCommonKinds.inc.h
+SemaInit.o: DiagnosticSemaKinds.inc.h
+SemaInit.o: StmtNodes.inc.h
+SemaInit.po: AttrList.inc.h
+SemaInit.po: AttrParsedAttrList.inc.h
+SemaInit.po: Attrs.inc.h
+SemaInit.po: CommentCommandList.inc.h
+SemaInit.po: DeclNodes.inc.h
+SemaInit.po: DiagnosticCommonKinds.inc.h
+SemaInit.po: DiagnosticSemaKinds.inc.h
+SemaInit.po: StmtNodes.inc.h
+SemaLambda.o: AttrList.inc.h
+SemaLambda.o: AttrParsedAttrList.inc.h
+SemaLambda.o: Attrs.inc.h
+SemaLambda.o: CommentCommandList.inc.h
+SemaLambda.o: DeclNodes.inc.h
+SemaLambda.o: DiagnosticCommonKinds.inc.h
+SemaLambda.o: DiagnosticSemaKinds.inc.h
+SemaLambda.o: StmtNodes.inc.h
+SemaLambda.po: AttrList.inc.h
+SemaLambda.po: AttrParsedAttrList.inc.h
+SemaLambda.po: Attrs.inc.h
+SemaLambda.po: CommentCommandList.inc.h
+SemaLambda.po: DeclNodes.inc.h
+SemaLambda.po: DiagnosticCommonKinds.inc.h
+SemaLambda.po: DiagnosticSemaKinds.inc.h
+SemaLambda.po: StmtNodes.inc.h
+SemaLookup.o: AttrList.inc.h
+SemaLookup.o: AttrParsedAttrList.inc.h
+SemaLookup.o: Attrs.inc.h
+SemaLookup.o: CommentCommandList.inc.h
+SemaLookup.o: DeclNodes.inc.h
+SemaLookup.o: DiagnosticCommonKinds.inc.h
+SemaLookup.o: DiagnosticSemaKinds.inc.h
+SemaLookup.o: StmtNodes.inc.h
+SemaLookup.po: AttrList.inc.h
+SemaLookup.po: AttrParsedAttrList.inc.h
+SemaLookup.po: Attrs.inc.h
+SemaLookup.po: CommentCommandList.inc.h
+SemaLookup.po: DeclNodes.inc.h
+SemaLookup.po: DiagnosticCommonKinds.inc.h
+SemaLookup.po: DiagnosticSemaKinds.inc.h
+SemaLookup.po: StmtNodes.inc.h
+SemaObjCProperty.o: AttrList.inc.h
+SemaObjCProperty.o: AttrParsedAttrList.inc.h
+SemaObjCProperty.o: Attrs.inc.h
+SemaObjCProperty.o: CommentCommandList.inc.h
+SemaObjCProperty.o: DeclNodes.inc.h
+SemaObjCProperty.o: DiagnosticCommonKinds.inc.h
+SemaObjCProperty.o: DiagnosticSemaKinds.inc.h
+SemaObjCProperty.o: StmtNodes.inc.h
+SemaObjCProperty.po: AttrList.inc.h
+SemaObjCProperty.po: AttrParsedAttrList.inc.h
+SemaObjCProperty.po: Attrs.inc.h
+SemaObjCProperty.po: CommentCommandList.inc.h
+SemaObjCProperty.po: DeclNodes.inc.h
+SemaObjCProperty.po: DiagnosticCommonKinds.inc.h
+SemaObjCProperty.po: DiagnosticSemaKinds.inc.h
+SemaObjCProperty.po: StmtNodes.inc.h
+SemaOpenMP.o: AttrList.inc.h
+SemaOpenMP.o: AttrParsedAttrList.inc.h
+SemaOpenMP.o: Attrs.inc.h
+SemaOpenMP.o: CommentCommandList.inc.h
+SemaOpenMP.o: DeclNodes.inc.h
+SemaOpenMP.o: DiagnosticCommonKinds.inc.h
+SemaOpenMP.o: DiagnosticSemaKinds.inc.h
+SemaOpenMP.o: StmtNodes.inc.h
+SemaOpenMP.po: AttrList.inc.h
+SemaOpenMP.po: AttrParsedAttrList.inc.h
+SemaOpenMP.po: Attrs.inc.h
+SemaOpenMP.po: CommentCommandList.inc.h
+SemaOpenMP.po: DeclNodes.inc.h
+SemaOpenMP.po: DiagnosticCommonKinds.inc.h
+SemaOpenMP.po: DiagnosticSemaKinds.inc.h
+SemaOpenMP.po: StmtNodes.inc.h
+SemaOverload.o: AttrList.inc.h
+SemaOverload.o: AttrParsedAttrList.inc.h
+SemaOverload.o: Attrs.inc.h
+SemaOverload.o: CommentCommandList.inc.h
+SemaOverload.o: DeclNodes.inc.h
+SemaOverload.o: DiagnosticCommonKinds.inc.h
+SemaOverload.o: DiagnosticSemaKinds.inc.h
+SemaOverload.o: StmtNodes.inc.h
+SemaOverload.po: AttrList.inc.h
+SemaOverload.po: AttrParsedAttrList.inc.h
+SemaOverload.po: Attrs.inc.h
+SemaOverload.po: CommentCommandList.inc.h
+SemaOverload.po: DeclNodes.inc.h
+SemaOverload.po: DiagnosticCommonKinds.inc.h
+SemaOverload.po: DiagnosticSemaKinds.inc.h
+SemaOverload.po: StmtNodes.inc.h
+SemaPseudoObject.o: AttrList.inc.h
+SemaPseudoObject.o: AttrParsedAttrList.inc.h
+SemaPseudoObject.o: Attrs.inc.h
+SemaPseudoObject.o: CommentCommandList.inc.h
+SemaPseudoObject.o: DeclNodes.inc.h
+SemaPseudoObject.o: DiagnosticCommonKinds.inc.h
+SemaPseudoObject.o: DiagnosticSemaKinds.inc.h
+SemaPseudoObject.o: StmtNodes.inc.h
+SemaPseudoObject.po: AttrList.inc.h
+SemaPseudoObject.po: AttrParsedAttrList.inc.h
+SemaPseudoObject.po: Attrs.inc.h
+SemaPseudoObject.po: CommentCommandList.inc.h
+SemaPseudoObject.po: DeclNodes.inc.h
+SemaPseudoObject.po: DiagnosticCommonKinds.inc.h
+SemaPseudoObject.po: DiagnosticSemaKinds.inc.h
+SemaPseudoObject.po: StmtNodes.inc.h
+SemaStmt.o: AttrList.inc.h
+SemaStmt.o: AttrParsedAttrList.inc.h
+SemaStmt.o: Attrs.inc.h
+SemaStmt.o: CommentCommandList.inc.h
+SemaStmt.o: DeclNodes.inc.h
+SemaStmt.o: DiagnosticASTKinds.inc.h
+SemaStmt.o: DiagnosticCommonKinds.inc.h
+SemaStmt.o: DiagnosticSemaKinds.inc.h
+SemaStmt.o: StmtNodes.inc.h
+SemaStmt.po: AttrList.inc.h
+SemaStmt.po: AttrParsedAttrList.inc.h
+SemaStmt.po: Attrs.inc.h
+SemaStmt.po: CommentCommandList.inc.h
+SemaStmt.po: DeclNodes.inc.h
+SemaStmt.po: DiagnosticASTKinds.inc.h
+SemaStmt.po: DiagnosticCommonKinds.inc.h
+SemaStmt.po: DiagnosticSemaKinds.inc.h
+SemaStmt.po: StmtNodes.inc.h
+SemaStmtAsm.o: AttrList.inc.h
+SemaStmtAsm.o: AttrParsedAttrList.inc.h
+SemaStmtAsm.o: Attrs.inc.h
+SemaStmtAsm.o: CommentCommandList.inc.h
+SemaStmtAsm.o: DeclNodes.inc.h
+SemaStmtAsm.o: DiagnosticCommonKinds.inc.h
+SemaStmtAsm.o: DiagnosticSemaKinds.inc.h
+SemaStmtAsm.o: StmtNodes.inc.h
+SemaStmtAsm.po: AttrList.inc.h
+SemaStmtAsm.po: AttrParsedAttrList.inc.h
+SemaStmtAsm.po: Attrs.inc.h
+SemaStmtAsm.po: CommentCommandList.inc.h
+SemaStmtAsm.po: DeclNodes.inc.h
+SemaStmtAsm.po: DiagnosticCommonKinds.inc.h
+SemaStmtAsm.po: DiagnosticSemaKinds.inc.h
+SemaStmtAsm.po: StmtNodes.inc.h
+SemaStmtAttr.o: AttrList.inc.h
+SemaStmtAttr.o: AttrParsedAttrList.inc.h
+SemaStmtAttr.o: Attrs.inc.h
+SemaStmtAttr.o: CommentCommandList.inc.h
+SemaStmtAttr.o: DeclNodes.inc.h
+SemaStmtAttr.o: DiagnosticCommonKinds.inc.h
+SemaStmtAttr.o: DiagnosticSemaKinds.inc.h
+SemaStmtAttr.o: StmtNodes.inc.h
+SemaStmtAttr.po: AttrList.inc.h
+SemaStmtAttr.po: AttrParsedAttrList.inc.h
+SemaStmtAttr.po: Attrs.inc.h
+SemaStmtAttr.po: CommentCommandList.inc.h
+SemaStmtAttr.po: DeclNodes.inc.h
+SemaStmtAttr.po: DiagnosticCommonKinds.inc.h
+SemaStmtAttr.po: DiagnosticSemaKinds.inc.h
+SemaStmtAttr.po: StmtNodes.inc.h
+SemaTemplate.o: AttrList.inc.h
+SemaTemplate.o: AttrParsedAttrList.inc.h
+SemaTemplate.o: Attrs.inc.h
+SemaTemplate.o: CommentCommandList.inc.h
+SemaTemplate.o: DeclNodes.inc.h
+SemaTemplate.o: DiagnosticCommonKinds.inc.h
+SemaTemplate.o: DiagnosticSemaKinds.inc.h
+SemaTemplate.o: StmtNodes.inc.h
+SemaTemplate.po: AttrList.inc.h
+SemaTemplate.po: AttrParsedAttrList.inc.h
+SemaTemplate.po: Attrs.inc.h
+SemaTemplate.po: CommentCommandList.inc.h
+SemaTemplate.po: DeclNodes.inc.h
+SemaTemplate.po: DiagnosticCommonKinds.inc.h
+SemaTemplate.po: DiagnosticSemaKinds.inc.h
+SemaTemplate.po: StmtNodes.inc.h
+SemaTemplateDeduction.o: AttrList.inc.h
+SemaTemplateDeduction.o: AttrParsedAttrList.inc.h
+SemaTemplateDeduction.o: Attrs.inc.h
+SemaTemplateDeduction.o: CommentCommandList.inc.h
+SemaTemplateDeduction.o: DeclNodes.inc.h
+SemaTemplateDeduction.o: DiagnosticCommonKinds.inc.h
+SemaTemplateDeduction.o: DiagnosticSemaKinds.inc.h
+SemaTemplateDeduction.o: StmtNodes.inc.h
+SemaTemplateDeduction.po: AttrList.inc.h
+SemaTemplateDeduction.po: AttrParsedAttrList.inc.h
+SemaTemplateDeduction.po: Attrs.inc.h
+SemaTemplateDeduction.po: CommentCommandList.inc.h
+SemaTemplateDeduction.po: DeclNodes.inc.h
+SemaTemplateDeduction.po: DiagnosticCommonKinds.inc.h
+SemaTemplateDeduction.po: DiagnosticSemaKinds.inc.h
+SemaTemplateDeduction.po: StmtNodes.inc.h
+SemaTemplateInstantiate.o: AttrList.inc.h
+SemaTemplateInstantiate.o: AttrParsedAttrList.inc.h
+SemaTemplateInstantiate.o: Attrs.inc.h
+SemaTemplateInstantiate.o: CommentCommandList.inc.h
+SemaTemplateInstantiate.o: DeclNodes.inc.h
+SemaTemplateInstantiate.o: DiagnosticCommonKinds.inc.h
+SemaTemplateInstantiate.o: DiagnosticSemaKinds.inc.h
+SemaTemplateInstantiate.o: StmtNodes.inc.h
+SemaTemplateInstantiate.po: AttrList.inc.h
+SemaTemplateInstantiate.po: AttrParsedAttrList.inc.h
+SemaTemplateInstantiate.po: Attrs.inc.h
+SemaTemplateInstantiate.po: CommentCommandList.inc.h
+SemaTemplateInstantiate.po: DeclNodes.inc.h
+SemaTemplateInstantiate.po: DiagnosticCommonKinds.inc.h
+SemaTemplateInstantiate.po: DiagnosticSemaKinds.inc.h
+SemaTemplateInstantiate.po: StmtNodes.inc.h
+SemaTemplateInstantiateDecl.o: AttrList.inc.h
+SemaTemplateInstantiateDecl.o: AttrParsedAttrList.inc.h
+SemaTemplateInstantiateDecl.o: AttrTemplateInstantiate.inc.h
+SemaTemplateInstantiateDecl.o: Attrs.inc.h
+SemaTemplateInstantiateDecl.o: CommentCommandList.inc.h
+SemaTemplateInstantiateDecl.o: DeclNodes.inc.h
+SemaTemplateInstantiateDecl.o: DiagnosticCommonKinds.inc.h
+SemaTemplateInstantiateDecl.o: DiagnosticSemaKinds.inc.h
+SemaTemplateInstantiateDecl.o: StmtNodes.inc.h
+SemaTemplateInstantiateDecl.po: AttrList.inc.h
+SemaTemplateInstantiateDecl.po: AttrParsedAttrList.inc.h
+SemaTemplateInstantiateDecl.po: AttrTemplateInstantiate.inc.h
+SemaTemplateInstantiateDecl.po: Attrs.inc.h
+SemaTemplateInstantiateDecl.po: CommentCommandList.inc.h
+SemaTemplateInstantiateDecl.po: DeclNodes.inc.h
+SemaTemplateInstantiateDecl.po: DiagnosticCommonKinds.inc.h
+SemaTemplateInstantiateDecl.po: DiagnosticSemaKinds.inc.h
+SemaTemplateInstantiateDecl.po: StmtNodes.inc.h
+SemaTemplateVariadic.o: AttrList.inc.h
+SemaTemplateVariadic.o: AttrParsedAttrList.inc.h
+SemaTemplateVariadic.o: Attrs.inc.h
+SemaTemplateVariadic.o: CommentCommandList.inc.h
+SemaTemplateVariadic.o: DeclNodes.inc.h
+SemaTemplateVariadic.o: DiagnosticCommonKinds.inc.h
+SemaTemplateVariadic.o: DiagnosticSemaKinds.inc.h
+SemaTemplateVariadic.o: StmtNodes.inc.h
+SemaTemplateVariadic.po: AttrList.inc.h
+SemaTemplateVariadic.po: AttrParsedAttrList.inc.h
+SemaTemplateVariadic.po: Attrs.inc.h
+SemaTemplateVariadic.po: CommentCommandList.inc.h
+SemaTemplateVariadic.po: DeclNodes.inc.h
+SemaTemplateVariadic.po: DiagnosticCommonKinds.inc.h
+SemaTemplateVariadic.po: DiagnosticSemaKinds.inc.h
+SemaTemplateVariadic.po: StmtNodes.inc.h
+SemaType.o: AttrList.inc.h
+SemaType.o: AttrParsedAttrList.inc.h
+SemaType.o: Attrs.inc.h
+SemaType.o: CommentCommandList.inc.h
+SemaType.o: DeclNodes.inc.h
+SemaType.o: DiagnosticCommonKinds.inc.h
+SemaType.o: DiagnosticParseKinds.inc.h
+SemaType.o: DiagnosticSemaKinds.inc.h
+SemaType.o: StmtNodes.inc.h
+SemaType.po: AttrList.inc.h
+SemaType.po: AttrParsedAttrList.inc.h
+SemaType.po: Attrs.inc.h
+SemaType.po: CommentCommandList.inc.h
+SemaType.po: DeclNodes.inc.h
+SemaType.po: DiagnosticCommonKinds.inc.h
+SemaType.po: DiagnosticParseKinds.inc.h
+SemaType.po: DiagnosticSemaKinds.inc.h
+SemaType.po: StmtNodes.inc.h
+TargetAttributesSema.o: AttrList.inc.h
+TargetAttributesSema.o: AttrParsedAttrList.inc.h
+TargetAttributesSema.o: Attrs.inc.h
+TargetAttributesSema.o: CommentCommandList.inc.h
+TargetAttributesSema.o: DeclNodes.inc.h
+TargetAttributesSema.o: DiagnosticCommonKinds.inc.h
+TargetAttributesSema.o: DiagnosticSemaKinds.inc.h
+TargetAttributesSema.o: StmtNodes.inc.h
+TargetAttributesSema.po: AttrList.inc.h
+TargetAttributesSema.po: AttrParsedAttrList.inc.h
+TargetAttributesSema.po: Attrs.inc.h
+TargetAttributesSema.po: CommentCommandList.inc.h
+TargetAttributesSema.po: DeclNodes.inc.h
+TargetAttributesSema.po: DiagnosticCommonKinds.inc.h
+TargetAttributesSema.po: DiagnosticSemaKinds.inc.h
+TargetAttributesSema.po: StmtNodes.inc.h
+TypeLocBuilder.o: CommentCommandList.inc.h
+TypeLocBuilder.o: DeclNodes.inc.h
+TypeLocBuilder.o: DiagnosticCommonKinds.inc.h
+TypeLocBuilder.o: StmtNodes.inc.h
+TypeLocBuilder.po: CommentCommandList.inc.h
+TypeLocBuilder.po: DeclNodes.inc.h
+TypeLocBuilder.po: DiagnosticCommonKinds.inc.h
+TypeLocBuilder.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/libclangserialization/Makefile.depend b/lib/clang/libclangserialization/Makefile.depend
new file mode 100644
index 0000000..7d04136
--- /dev/null
+++ b/lib/clang/libclangserialization/Makefile.depend
@@ -0,0 +1,117 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ASTCommon.o: CommentCommandList.inc.h
+ASTCommon.o: DeclNodes.inc.h
+ASTCommon.o: DiagnosticCommonKinds.inc.h
+ASTCommon.o: StmtNodes.inc.h
+ASTCommon.po: CommentCommandList.inc.h
+ASTCommon.po: DeclNodes.inc.h
+ASTCommon.po: DiagnosticCommonKinds.inc.h
+ASTCommon.po: StmtNodes.inc.h
+ASTReader.o: AttrList.inc.h
+ASTReader.o: AttrParsedAttrList.inc.h
+ASTReader.o: Attrs.inc.h
+ASTReader.o: CommentCommandList.inc.h
+ASTReader.o: DeclNodes.inc.h
+ASTReader.o: DiagnosticCommonKinds.inc.h
+ASTReader.o: DiagnosticSerializationKinds.inc.h
+ASTReader.o: StmtNodes.inc.h
+ASTReader.po: AttrList.inc.h
+ASTReader.po: AttrParsedAttrList.inc.h
+ASTReader.po: Attrs.inc.h
+ASTReader.po: CommentCommandList.inc.h
+ASTReader.po: DeclNodes.inc.h
+ASTReader.po: DiagnosticCommonKinds.inc.h
+ASTReader.po: DiagnosticSerializationKinds.inc.h
+ASTReader.po: StmtNodes.inc.h
+ASTReaderDecl.o: AttrList.inc.h
+ASTReaderDecl.o: AttrPCHRead.inc.h
+ASTReaderDecl.o: AttrParsedAttrList.inc.h
+ASTReaderDecl.o: Attrs.inc.h
+ASTReaderDecl.o: CommentCommandList.inc.h
+ASTReaderDecl.o: DeclNodes.inc.h
+ASTReaderDecl.o: DiagnosticCommonKinds.inc.h
+ASTReaderDecl.o: DiagnosticSemaKinds.inc.h
+ASTReaderDecl.o: StmtNodes.inc.h
+ASTReaderDecl.po: AttrList.inc.h
+ASTReaderDecl.po: AttrPCHRead.inc.h
+ASTReaderDecl.po: AttrParsedAttrList.inc.h
+ASTReaderDecl.po: Attrs.inc.h
+ASTReaderDecl.po: CommentCommandList.inc.h
+ASTReaderDecl.po: DeclNodes.inc.h
+ASTReaderDecl.po: DiagnosticCommonKinds.inc.h
+ASTReaderDecl.po: DiagnosticSemaKinds.inc.h
+ASTReaderDecl.po: StmtNodes.inc.h
+ASTReaderStmt.o: AttrParsedAttrList.inc.h
+ASTReaderStmt.o: CommentCommandList.inc.h
+ASTReaderStmt.o: DeclNodes.inc.h
+ASTReaderStmt.o: DiagnosticCommonKinds.inc.h
+ASTReaderStmt.o: StmtNodes.inc.h
+ASTReaderStmt.po: AttrParsedAttrList.inc.h
+ASTReaderStmt.po: CommentCommandList.inc.h
+ASTReaderStmt.po: DeclNodes.inc.h
+ASTReaderStmt.po: DiagnosticCommonKinds.inc.h
+ASTReaderStmt.po: StmtNodes.inc.h
+ASTWriter.o: AttrList.inc.h
+ASTWriter.o: AttrPCHWrite.inc.h
+ASTWriter.o: AttrParsedAttrList.inc.h
+ASTWriter.o: Attrs.inc.h
+ASTWriter.o: CommentCommandList.inc.h
+ASTWriter.o: DeclNodes.inc.h
+ASTWriter.o: DiagnosticCommonKinds.inc.h
+ASTWriter.o: StmtNodes.inc.h
+ASTWriter.po: AttrList.inc.h
+ASTWriter.po: AttrPCHWrite.inc.h
+ASTWriter.po: AttrParsedAttrList.inc.h
+ASTWriter.po: Attrs.inc.h
+ASTWriter.po: CommentCommandList.inc.h
+ASTWriter.po: DeclNodes.inc.h
+ASTWriter.po: DiagnosticCommonKinds.inc.h
+ASTWriter.po: StmtNodes.inc.h
+ASTWriterDecl.o: AttrParsedAttrList.inc.h
+ASTWriterDecl.o: CommentCommandList.inc.h
+ASTWriterDecl.o: DeclNodes.inc.h
+ASTWriterDecl.o: DiagnosticCommonKinds.inc.h
+ASTWriterDecl.o: StmtNodes.inc.h
+ASTWriterDecl.po: AttrParsedAttrList.inc.h
+ASTWriterDecl.po: CommentCommandList.inc.h
+ASTWriterDecl.po: DeclNodes.inc.h
+ASTWriterDecl.po: DiagnosticCommonKinds.inc.h
+ASTWriterDecl.po: StmtNodes.inc.h
+ASTWriterStmt.o: CommentCommandList.inc.h
+ASTWriterStmt.o: DeclNodes.inc.h
+ASTWriterStmt.o: DiagnosticCommonKinds.inc.h
+ASTWriterStmt.o: StmtNodes.inc.h
+ASTWriterStmt.po: CommentCommandList.inc.h
+ASTWriterStmt.po: DeclNodes.inc.h
+ASTWriterStmt.po: DiagnosticCommonKinds.inc.h
+ASTWriterStmt.po: StmtNodes.inc.h
+GeneratePCH.o: CommentCommandList.inc.h
+GeneratePCH.o: DeclNodes.inc.h
+GeneratePCH.o: DiagnosticCommonKinds.inc.h
+GeneratePCH.o: StmtNodes.inc.h
+GeneratePCH.po: CommentCommandList.inc.h
+GeneratePCH.po: DeclNodes.inc.h
+GeneratePCH.po: DiagnosticCommonKinds.inc.h
+GeneratePCH.po: StmtNodes.inc.h
+GlobalModuleIndex.o: DiagnosticCommonKinds.inc.h
+GlobalModuleIndex.po: DiagnosticCommonKinds.inc.h
+Module.o: DiagnosticCommonKinds.inc.h
+Module.po: DiagnosticCommonKinds.inc.h
+ModuleManager.o: DiagnosticCommonKinds.inc.h
+ModuleManager.po: DiagnosticCommonKinds.inc.h
+.endif
diff --git a/lib/clang/libclangstaticanalyzercheckers/Makefile b/lib/clang/libclangstaticanalyzercheckers/Makefile
index 5fb1035..db27182 100644
--- a/lib/clang/libclangstaticanalyzercheckers/Makefile
+++ b/lib/clang/libclangstaticanalyzercheckers/Makefile
@@ -33,6 +33,7 @@ SRCS= AllocationDiagnostics.cpp \
ExprInspectionChecker.cpp \
FixedAddressChecker.cpp \
GenericTaintChecker.cpp \
+ IdempotentOperationChecker.cpp \
IdenticalExprChecker.cpp \
IvarInvalidationChecker.cpp \
LLVMConventionsChecker.cpp \
@@ -61,7 +62,6 @@ SRCS= AllocationDiagnostics.cpp \
StackAddrEscapeChecker.cpp \
StreamChecker.cpp \
TaintTesterChecker.cpp \
- TestAfterDivZeroChecker.cpp \
TraversalChecker.cpp \
UndefBranchChecker.cpp \
UndefCapturedBlockVarChecker.cpp \
@@ -74,7 +74,6 @@ SRCS= AllocationDiagnostics.cpp \
VirtualCallChecker.cpp
TGHDRS= AttrList \
- AttrVisitor \
Attrs \
Checkers \
CommentCommandList \
diff --git a/lib/clang/libclangstaticanalyzercheckers/Makefile.depend b/lib/clang/libclangstaticanalyzercheckers/Makefile.depend
new file mode 100644
index 0000000..68d1e50
--- /dev/null
+++ b/lib/clang/libclangstaticanalyzercheckers/Makefile.depend
@@ -0,0 +1,721 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AnalyzerStatsChecker.o: Checkers.inc.h
+AnalyzerStatsChecker.o: CommentCommandList.inc.h
+AnalyzerStatsChecker.o: DeclNodes.inc.h
+AnalyzerStatsChecker.o: DiagnosticCommonKinds.inc.h
+AnalyzerStatsChecker.o: StmtNodes.inc.h
+AnalyzerStatsChecker.po: Checkers.inc.h
+AnalyzerStatsChecker.po: CommentCommandList.inc.h
+AnalyzerStatsChecker.po: DeclNodes.inc.h
+AnalyzerStatsChecker.po: DiagnosticCommonKinds.inc.h
+AnalyzerStatsChecker.po: StmtNodes.inc.h
+ArrayBoundChecker.o: Checkers.inc.h
+ArrayBoundChecker.o: CommentCommandList.inc.h
+ArrayBoundChecker.o: DeclNodes.inc.h
+ArrayBoundChecker.o: DiagnosticCommonKinds.inc.h
+ArrayBoundChecker.o: StmtNodes.inc.h
+ArrayBoundChecker.po: Checkers.inc.h
+ArrayBoundChecker.po: CommentCommandList.inc.h
+ArrayBoundChecker.po: DeclNodes.inc.h
+ArrayBoundChecker.po: DiagnosticCommonKinds.inc.h
+ArrayBoundChecker.po: StmtNodes.inc.h
+ArrayBoundCheckerV2.o: Checkers.inc.h
+ArrayBoundCheckerV2.o: CommentCommandList.inc.h
+ArrayBoundCheckerV2.o: DeclNodes.inc.h
+ArrayBoundCheckerV2.o: DiagnosticCommonKinds.inc.h
+ArrayBoundCheckerV2.o: StmtNodes.inc.h
+ArrayBoundCheckerV2.po: Checkers.inc.h
+ArrayBoundCheckerV2.po: CommentCommandList.inc.h
+ArrayBoundCheckerV2.po: DeclNodes.inc.h
+ArrayBoundCheckerV2.po: DiagnosticCommonKinds.inc.h
+ArrayBoundCheckerV2.po: StmtNodes.inc.h
+BasicObjCFoundationChecks.o: Checkers.inc.h
+BasicObjCFoundationChecks.o: CommentCommandList.inc.h
+BasicObjCFoundationChecks.o: DeclNodes.inc.h
+BasicObjCFoundationChecks.o: DiagnosticCommonKinds.inc.h
+BasicObjCFoundationChecks.o: StmtNodes.inc.h
+BasicObjCFoundationChecks.po: Checkers.inc.h
+BasicObjCFoundationChecks.po: CommentCommandList.inc.h
+BasicObjCFoundationChecks.po: DeclNodes.inc.h
+BasicObjCFoundationChecks.po: DiagnosticCommonKinds.inc.h
+BasicObjCFoundationChecks.po: StmtNodes.inc.h
+BoolAssignmentChecker.o: Checkers.inc.h
+BoolAssignmentChecker.o: CommentCommandList.inc.h
+BoolAssignmentChecker.o: DeclNodes.inc.h
+BoolAssignmentChecker.o: DiagnosticCommonKinds.inc.h
+BoolAssignmentChecker.o: StmtNodes.inc.h
+BoolAssignmentChecker.po: Checkers.inc.h
+BoolAssignmentChecker.po: CommentCommandList.inc.h
+BoolAssignmentChecker.po: DeclNodes.inc.h
+BoolAssignmentChecker.po: DiagnosticCommonKinds.inc.h
+BoolAssignmentChecker.po: StmtNodes.inc.h
+BuiltinFunctionChecker.o: Checkers.inc.h
+BuiltinFunctionChecker.o: CommentCommandList.inc.h
+BuiltinFunctionChecker.o: DeclNodes.inc.h
+BuiltinFunctionChecker.o: DiagnosticCommonKinds.inc.h
+BuiltinFunctionChecker.o: StmtNodes.inc.h
+BuiltinFunctionChecker.po: Checkers.inc.h
+BuiltinFunctionChecker.po: CommentCommandList.inc.h
+BuiltinFunctionChecker.po: DeclNodes.inc.h
+BuiltinFunctionChecker.po: DiagnosticCommonKinds.inc.h
+BuiltinFunctionChecker.po: StmtNodes.inc.h
+CStringChecker.o: Checkers.inc.h
+CStringChecker.o: CommentCommandList.inc.h
+CStringChecker.o: DeclNodes.inc.h
+CStringChecker.o: DiagnosticCommonKinds.inc.h
+CStringChecker.o: StmtNodes.inc.h
+CStringChecker.po: Checkers.inc.h
+CStringChecker.po: CommentCommandList.inc.h
+CStringChecker.po: DeclNodes.inc.h
+CStringChecker.po: DiagnosticCommonKinds.inc.h
+CStringChecker.po: StmtNodes.inc.h
+CStringSyntaxChecker.o: Checkers.inc.h
+CStringSyntaxChecker.o: CommentCommandList.inc.h
+CStringSyntaxChecker.o: DeclNodes.inc.h
+CStringSyntaxChecker.o: DiagnosticCommonKinds.inc.h
+CStringSyntaxChecker.o: StmtNodes.inc.h
+CStringSyntaxChecker.po: Checkers.inc.h
+CStringSyntaxChecker.po: CommentCommandList.inc.h
+CStringSyntaxChecker.po: DeclNodes.inc.h
+CStringSyntaxChecker.po: DiagnosticCommonKinds.inc.h
+CStringSyntaxChecker.po: StmtNodes.inc.h
+CallAndMessageChecker.o: Checkers.inc.h
+CallAndMessageChecker.o: CommentCommandList.inc.h
+CallAndMessageChecker.o: DeclNodes.inc.h
+CallAndMessageChecker.o: DiagnosticCommonKinds.inc.h
+CallAndMessageChecker.o: StmtNodes.inc.h
+CallAndMessageChecker.po: Checkers.inc.h
+CallAndMessageChecker.po: CommentCommandList.inc.h
+CallAndMessageChecker.po: DeclNodes.inc.h
+CallAndMessageChecker.po: DiagnosticCommonKinds.inc.h
+CallAndMessageChecker.po: StmtNodes.inc.h
+CastSizeChecker.o: Checkers.inc.h
+CastSizeChecker.o: CommentCommandList.inc.h
+CastSizeChecker.o: DeclNodes.inc.h
+CastSizeChecker.o: DiagnosticCommonKinds.inc.h
+CastSizeChecker.o: StmtNodes.inc.h
+CastSizeChecker.po: Checkers.inc.h
+CastSizeChecker.po: CommentCommandList.inc.h
+CastSizeChecker.po: DeclNodes.inc.h
+CastSizeChecker.po: DiagnosticCommonKinds.inc.h
+CastSizeChecker.po: StmtNodes.inc.h
+CastToStructChecker.o: Checkers.inc.h
+CastToStructChecker.o: CommentCommandList.inc.h
+CastToStructChecker.o: DeclNodes.inc.h
+CastToStructChecker.o: DiagnosticCommonKinds.inc.h
+CastToStructChecker.o: StmtNodes.inc.h
+CastToStructChecker.po: Checkers.inc.h
+CastToStructChecker.po: CommentCommandList.inc.h
+CastToStructChecker.po: DeclNodes.inc.h
+CastToStructChecker.po: DiagnosticCommonKinds.inc.h
+CastToStructChecker.po: StmtNodes.inc.h
+CheckObjCDealloc.o: AttrList.inc.h
+CheckObjCDealloc.o: Attrs.inc.h
+CheckObjCDealloc.o: Checkers.inc.h
+CheckObjCDealloc.o: CommentCommandList.inc.h
+CheckObjCDealloc.o: DeclNodes.inc.h
+CheckObjCDealloc.o: DiagnosticCommonKinds.inc.h
+CheckObjCDealloc.o: StmtNodes.inc.h
+CheckObjCDealloc.po: AttrList.inc.h
+CheckObjCDealloc.po: Attrs.inc.h
+CheckObjCDealloc.po: Checkers.inc.h
+CheckObjCDealloc.po: CommentCommandList.inc.h
+CheckObjCDealloc.po: DeclNodes.inc.h
+CheckObjCDealloc.po: DiagnosticCommonKinds.inc.h
+CheckObjCDealloc.po: StmtNodes.inc.h
+CheckObjCInstMethSignature.o: Checkers.inc.h
+CheckObjCInstMethSignature.o: CommentCommandList.inc.h
+CheckObjCInstMethSignature.o: DeclNodes.inc.h
+CheckObjCInstMethSignature.o: DiagnosticCommonKinds.inc.h
+CheckObjCInstMethSignature.o: StmtNodes.inc.h
+CheckObjCInstMethSignature.po: Checkers.inc.h
+CheckObjCInstMethSignature.po: CommentCommandList.inc.h
+CheckObjCInstMethSignature.po: DeclNodes.inc.h
+CheckObjCInstMethSignature.po: DiagnosticCommonKinds.inc.h
+CheckObjCInstMethSignature.po: StmtNodes.inc.h
+CheckSecuritySyntaxOnly.o: Checkers.inc.h
+CheckSecuritySyntaxOnly.o: CommentCommandList.inc.h
+CheckSecuritySyntaxOnly.o: DeclNodes.inc.h
+CheckSecuritySyntaxOnly.o: DiagnosticCommonKinds.inc.h
+CheckSecuritySyntaxOnly.o: StmtNodes.inc.h
+CheckSecuritySyntaxOnly.po: Checkers.inc.h
+CheckSecuritySyntaxOnly.po: CommentCommandList.inc.h
+CheckSecuritySyntaxOnly.po: DeclNodes.inc.h
+CheckSecuritySyntaxOnly.po: DiagnosticCommonKinds.inc.h
+CheckSecuritySyntaxOnly.po: StmtNodes.inc.h
+CheckSizeofPointer.o: Checkers.inc.h
+CheckSizeofPointer.o: CommentCommandList.inc.h
+CheckSizeofPointer.o: DeclNodes.inc.h
+CheckSizeofPointer.o: DiagnosticCommonKinds.inc.h
+CheckSizeofPointer.o: StmtNodes.inc.h
+CheckSizeofPointer.po: Checkers.inc.h
+CheckSizeofPointer.po: CommentCommandList.inc.h
+CheckSizeofPointer.po: DeclNodes.inc.h
+CheckSizeofPointer.po: DiagnosticCommonKinds.inc.h
+CheckSizeofPointer.po: StmtNodes.inc.h
+CheckerDocumentation.o: Checkers.inc.h
+CheckerDocumentation.o: CommentCommandList.inc.h
+CheckerDocumentation.o: DeclNodes.inc.h
+CheckerDocumentation.o: DiagnosticCommonKinds.inc.h
+CheckerDocumentation.o: StmtNodes.inc.h
+CheckerDocumentation.po: Checkers.inc.h
+CheckerDocumentation.po: CommentCommandList.inc.h
+CheckerDocumentation.po: DeclNodes.inc.h
+CheckerDocumentation.po: DiagnosticCommonKinds.inc.h
+CheckerDocumentation.po: StmtNodes.inc.h
+ChrootChecker.o: Checkers.inc.h
+ChrootChecker.o: CommentCommandList.inc.h
+ChrootChecker.o: DeclNodes.inc.h
+ChrootChecker.o: DiagnosticCommonKinds.inc.h
+ChrootChecker.o: StmtNodes.inc.h
+ChrootChecker.po: Checkers.inc.h
+ChrootChecker.po: CommentCommandList.inc.h
+ChrootChecker.po: DeclNodes.inc.h
+ChrootChecker.po: DiagnosticCommonKinds.inc.h
+ChrootChecker.po: StmtNodes.inc.h
+ClangCheckers.o: Checkers.inc.h
+ClangCheckers.o: CommentCommandList.inc.h
+ClangCheckers.o: DeclNodes.inc.h
+ClangCheckers.o: DiagnosticCommonKinds.inc.h
+ClangCheckers.o: StmtNodes.inc.h
+ClangCheckers.po: Checkers.inc.h
+ClangCheckers.po: CommentCommandList.inc.h
+ClangCheckers.po: DeclNodes.inc.h
+ClangCheckers.po: DiagnosticCommonKinds.inc.h
+ClangCheckers.po: StmtNodes.inc.h
+DeadStoresChecker.o: AttrList.inc.h
+DeadStoresChecker.o: Attrs.inc.h
+DeadStoresChecker.o: Checkers.inc.h
+DeadStoresChecker.o: CommentCommandList.inc.h
+DeadStoresChecker.o: DeclNodes.inc.h
+DeadStoresChecker.o: DiagnosticCommonKinds.inc.h
+DeadStoresChecker.o: StmtNodes.inc.h
+DeadStoresChecker.po: AttrList.inc.h
+DeadStoresChecker.po: Attrs.inc.h
+DeadStoresChecker.po: Checkers.inc.h
+DeadStoresChecker.po: CommentCommandList.inc.h
+DeadStoresChecker.po: DeclNodes.inc.h
+DeadStoresChecker.po: DiagnosticCommonKinds.inc.h
+DeadStoresChecker.po: StmtNodes.inc.h
+DebugCheckers.o: Checkers.inc.h
+DebugCheckers.o: CommentCommandList.inc.h
+DebugCheckers.o: DeclNodes.inc.h
+DebugCheckers.o: DiagnosticCommonKinds.inc.h
+DebugCheckers.o: StmtNodes.inc.h
+DebugCheckers.po: Checkers.inc.h
+DebugCheckers.po: CommentCommandList.inc.h
+DebugCheckers.po: DeclNodes.inc.h
+DebugCheckers.po: DiagnosticCommonKinds.inc.h
+DebugCheckers.po: StmtNodes.inc.h
+DereferenceChecker.o: Checkers.inc.h
+DereferenceChecker.o: CommentCommandList.inc.h
+DereferenceChecker.o: DeclNodes.inc.h
+DereferenceChecker.o: DiagnosticCommonKinds.inc.h
+DereferenceChecker.o: StmtNodes.inc.h
+DereferenceChecker.po: Checkers.inc.h
+DereferenceChecker.po: CommentCommandList.inc.h
+DereferenceChecker.po: DeclNodes.inc.h
+DereferenceChecker.po: DiagnosticCommonKinds.inc.h
+DereferenceChecker.po: StmtNodes.inc.h
+DirectIvarAssignment.o: AttrList.inc.h
+DirectIvarAssignment.o: Attrs.inc.h
+DirectIvarAssignment.o: Checkers.inc.h
+DirectIvarAssignment.o: CommentCommandList.inc.h
+DirectIvarAssignment.o: DeclNodes.inc.h
+DirectIvarAssignment.o: DiagnosticCommonKinds.inc.h
+DirectIvarAssignment.o: StmtNodes.inc.h
+DirectIvarAssignment.po: AttrList.inc.h
+DirectIvarAssignment.po: Attrs.inc.h
+DirectIvarAssignment.po: Checkers.inc.h
+DirectIvarAssignment.po: CommentCommandList.inc.h
+DirectIvarAssignment.po: DeclNodes.inc.h
+DirectIvarAssignment.po: DiagnosticCommonKinds.inc.h
+DirectIvarAssignment.po: StmtNodes.inc.h
+DivZeroChecker.o: Checkers.inc.h
+DivZeroChecker.o: CommentCommandList.inc.h
+DivZeroChecker.o: DeclNodes.inc.h
+DivZeroChecker.o: DiagnosticCommonKinds.inc.h
+DivZeroChecker.o: StmtNodes.inc.h
+DivZeroChecker.po: Checkers.inc.h
+DivZeroChecker.po: CommentCommandList.inc.h
+DivZeroChecker.po: DeclNodes.inc.h
+DivZeroChecker.po: DiagnosticCommonKinds.inc.h
+DivZeroChecker.po: StmtNodes.inc.h
+DynamicTypePropagation.o: Checkers.inc.h
+DynamicTypePropagation.o: CommentCommandList.inc.h
+DynamicTypePropagation.o: DeclNodes.inc.h
+DynamicTypePropagation.o: DiagnosticCommonKinds.inc.h
+DynamicTypePropagation.o: StmtNodes.inc.h
+DynamicTypePropagation.po: Checkers.inc.h
+DynamicTypePropagation.po: CommentCommandList.inc.h
+DynamicTypePropagation.po: DeclNodes.inc.h
+DynamicTypePropagation.po: DiagnosticCommonKinds.inc.h
+DynamicTypePropagation.po: StmtNodes.inc.h
+ExprInspectionChecker.o: Checkers.inc.h
+ExprInspectionChecker.o: CommentCommandList.inc.h
+ExprInspectionChecker.o: DeclNodes.inc.h
+ExprInspectionChecker.o: DiagnosticCommonKinds.inc.h
+ExprInspectionChecker.o: StmtNodes.inc.h
+ExprInspectionChecker.po: Checkers.inc.h
+ExprInspectionChecker.po: CommentCommandList.inc.h
+ExprInspectionChecker.po: DeclNodes.inc.h
+ExprInspectionChecker.po: DiagnosticCommonKinds.inc.h
+ExprInspectionChecker.po: StmtNodes.inc.h
+FixedAddressChecker.o: Checkers.inc.h
+FixedAddressChecker.o: CommentCommandList.inc.h
+FixedAddressChecker.o: DeclNodes.inc.h
+FixedAddressChecker.o: DiagnosticCommonKinds.inc.h
+FixedAddressChecker.o: StmtNodes.inc.h
+FixedAddressChecker.po: Checkers.inc.h
+FixedAddressChecker.po: CommentCommandList.inc.h
+FixedAddressChecker.po: DeclNodes.inc.h
+FixedAddressChecker.po: DiagnosticCommonKinds.inc.h
+FixedAddressChecker.po: StmtNodes.inc.h
+GenericTaintChecker.o: AttrList.inc.h
+GenericTaintChecker.o: Attrs.inc.h
+GenericTaintChecker.o: Checkers.inc.h
+GenericTaintChecker.o: CommentCommandList.inc.h
+GenericTaintChecker.o: DeclNodes.inc.h
+GenericTaintChecker.o: DiagnosticCommonKinds.inc.h
+GenericTaintChecker.o: StmtNodes.inc.h
+GenericTaintChecker.po: AttrList.inc.h
+GenericTaintChecker.po: Attrs.inc.h
+GenericTaintChecker.po: Checkers.inc.h
+GenericTaintChecker.po: CommentCommandList.inc.h
+GenericTaintChecker.po: DeclNodes.inc.h
+GenericTaintChecker.po: DiagnosticCommonKinds.inc.h
+GenericTaintChecker.po: StmtNodes.inc.h
+IdempotentOperationChecker.o: Checkers.inc.h
+IdempotentOperationChecker.o: CommentCommandList.inc.h
+IdempotentOperationChecker.o: DeclNodes.inc.h
+IdempotentOperationChecker.o: DiagnosticCommonKinds.inc.h
+IdempotentOperationChecker.o: StmtNodes.inc.h
+IdempotentOperationChecker.po: Checkers.inc.h
+IdempotentOperationChecker.po: CommentCommandList.inc.h
+IdempotentOperationChecker.po: DeclNodes.inc.h
+IdempotentOperationChecker.po: DiagnosticCommonKinds.inc.h
+IdempotentOperationChecker.po: StmtNodes.inc.h
+IdenticalExprChecker.o: Checkers.inc.h
+IdenticalExprChecker.o: CommentCommandList.inc.h
+IdenticalExprChecker.o: DeclNodes.inc.h
+IdenticalExprChecker.o: DiagnosticCommonKinds.inc.h
+IdenticalExprChecker.o: StmtNodes.inc.h
+IdenticalExprChecker.po: Checkers.inc.h
+IdenticalExprChecker.po: CommentCommandList.inc.h
+IdenticalExprChecker.po: DeclNodes.inc.h
+IdenticalExprChecker.po: DiagnosticCommonKinds.inc.h
+IdenticalExprChecker.po: StmtNodes.inc.h
+IvarInvalidationChecker.o: AttrList.inc.h
+IvarInvalidationChecker.o: Attrs.inc.h
+IvarInvalidationChecker.o: Checkers.inc.h
+IvarInvalidationChecker.o: CommentCommandList.inc.h
+IvarInvalidationChecker.o: DeclNodes.inc.h
+IvarInvalidationChecker.o: DiagnosticCommonKinds.inc.h
+IvarInvalidationChecker.o: StmtNodes.inc.h
+IvarInvalidationChecker.po: AttrList.inc.h
+IvarInvalidationChecker.po: Attrs.inc.h
+IvarInvalidationChecker.po: Checkers.inc.h
+IvarInvalidationChecker.po: CommentCommandList.inc.h
+IvarInvalidationChecker.po: DeclNodes.inc.h
+IvarInvalidationChecker.po: DiagnosticCommonKinds.inc.h
+IvarInvalidationChecker.po: StmtNodes.inc.h
+LLVMConventionsChecker.o: Checkers.inc.h
+LLVMConventionsChecker.o: CommentCommandList.inc.h
+LLVMConventionsChecker.o: DeclNodes.inc.h
+LLVMConventionsChecker.o: DiagnosticCommonKinds.inc.h
+LLVMConventionsChecker.o: StmtNodes.inc.h
+LLVMConventionsChecker.po: Checkers.inc.h
+LLVMConventionsChecker.po: CommentCommandList.inc.h
+LLVMConventionsChecker.po: DeclNodes.inc.h
+LLVMConventionsChecker.po: DiagnosticCommonKinds.inc.h
+LLVMConventionsChecker.po: StmtNodes.inc.h
+MacOSKeychainAPIChecker.o: Checkers.inc.h
+MacOSKeychainAPIChecker.o: CommentCommandList.inc.h
+MacOSKeychainAPIChecker.o: DeclNodes.inc.h
+MacOSKeychainAPIChecker.o: DiagnosticCommonKinds.inc.h
+MacOSKeychainAPIChecker.o: StmtNodes.inc.h
+MacOSKeychainAPIChecker.po: Checkers.inc.h
+MacOSKeychainAPIChecker.po: CommentCommandList.inc.h
+MacOSKeychainAPIChecker.po: DeclNodes.inc.h
+MacOSKeychainAPIChecker.po: DiagnosticCommonKinds.inc.h
+MacOSKeychainAPIChecker.po: StmtNodes.inc.h
+MacOSXAPIChecker.o: Checkers.inc.h
+MacOSXAPIChecker.o: CommentCommandList.inc.h
+MacOSXAPIChecker.o: DeclNodes.inc.h
+MacOSXAPIChecker.o: DiagnosticCommonKinds.inc.h
+MacOSXAPIChecker.o: StmtNodes.inc.h
+MacOSXAPIChecker.po: Checkers.inc.h
+MacOSXAPIChecker.po: CommentCommandList.inc.h
+MacOSXAPIChecker.po: DeclNodes.inc.h
+MacOSXAPIChecker.po: DiagnosticCommonKinds.inc.h
+MacOSXAPIChecker.po: StmtNodes.inc.h
+MallocChecker.o: AttrList.inc.h
+MallocChecker.o: Attrs.inc.h
+MallocChecker.o: Checkers.inc.h
+MallocChecker.o: CommentCommandList.inc.h
+MallocChecker.o: DeclNodes.inc.h
+MallocChecker.o: DiagnosticCommonKinds.inc.h
+MallocChecker.o: StmtNodes.inc.h
+MallocChecker.po: AttrList.inc.h
+MallocChecker.po: Attrs.inc.h
+MallocChecker.po: Checkers.inc.h
+MallocChecker.po: CommentCommandList.inc.h
+MallocChecker.po: DeclNodes.inc.h
+MallocChecker.po: DiagnosticCommonKinds.inc.h
+MallocChecker.po: StmtNodes.inc.h
+MallocOverflowSecurityChecker.o: Checkers.inc.h
+MallocOverflowSecurityChecker.o: CommentCommandList.inc.h
+MallocOverflowSecurityChecker.o: DeclNodes.inc.h
+MallocOverflowSecurityChecker.o: DiagnosticCommonKinds.inc.h
+MallocOverflowSecurityChecker.o: StmtNodes.inc.h
+MallocOverflowSecurityChecker.po: Checkers.inc.h
+MallocOverflowSecurityChecker.po: CommentCommandList.inc.h
+MallocOverflowSecurityChecker.po: DeclNodes.inc.h
+MallocOverflowSecurityChecker.po: DiagnosticCommonKinds.inc.h
+MallocOverflowSecurityChecker.po: StmtNodes.inc.h
+MallocSizeofChecker.o: Checkers.inc.h
+MallocSizeofChecker.o: CommentCommandList.inc.h
+MallocSizeofChecker.o: DeclNodes.inc.h
+MallocSizeofChecker.o: DiagnosticCommonKinds.inc.h
+MallocSizeofChecker.o: StmtNodes.inc.h
+MallocSizeofChecker.po: Checkers.inc.h
+MallocSizeofChecker.po: CommentCommandList.inc.h
+MallocSizeofChecker.po: DeclNodes.inc.h
+MallocSizeofChecker.po: DiagnosticCommonKinds.inc.h
+MallocSizeofChecker.po: StmtNodes.inc.h
+NSAutoreleasePoolChecker.o: Checkers.inc.h
+NSAutoreleasePoolChecker.o: CommentCommandList.inc.h
+NSAutoreleasePoolChecker.o: DeclNodes.inc.h
+NSAutoreleasePoolChecker.o: DiagnosticCommonKinds.inc.h
+NSAutoreleasePoolChecker.o: StmtNodes.inc.h
+NSAutoreleasePoolChecker.po: Checkers.inc.h
+NSAutoreleasePoolChecker.po: CommentCommandList.inc.h
+NSAutoreleasePoolChecker.po: DeclNodes.inc.h
+NSAutoreleasePoolChecker.po: DiagnosticCommonKinds.inc.h
+NSAutoreleasePoolChecker.po: StmtNodes.inc.h
+NSErrorChecker.o: Checkers.inc.h
+NSErrorChecker.o: CommentCommandList.inc.h
+NSErrorChecker.o: DeclNodes.inc.h
+NSErrorChecker.o: DiagnosticCommonKinds.inc.h
+NSErrorChecker.o: StmtNodes.inc.h
+NSErrorChecker.po: Checkers.inc.h
+NSErrorChecker.po: CommentCommandList.inc.h
+NSErrorChecker.po: DeclNodes.inc.h
+NSErrorChecker.po: DiagnosticCommonKinds.inc.h
+NSErrorChecker.po: StmtNodes.inc.h
+NoReturnFunctionChecker.o: AttrList.inc.h
+NoReturnFunctionChecker.o: Attrs.inc.h
+NoReturnFunctionChecker.o: Checkers.inc.h
+NoReturnFunctionChecker.o: CommentCommandList.inc.h
+NoReturnFunctionChecker.o: DeclNodes.inc.h
+NoReturnFunctionChecker.o: DiagnosticCommonKinds.inc.h
+NoReturnFunctionChecker.o: StmtNodes.inc.h
+NoReturnFunctionChecker.po: AttrList.inc.h
+NoReturnFunctionChecker.po: Attrs.inc.h
+NoReturnFunctionChecker.po: Checkers.inc.h
+NoReturnFunctionChecker.po: CommentCommandList.inc.h
+NoReturnFunctionChecker.po: DeclNodes.inc.h
+NoReturnFunctionChecker.po: DiagnosticCommonKinds.inc.h
+NoReturnFunctionChecker.po: StmtNodes.inc.h
+NonNullParamChecker.o: AttrList.inc.h
+NonNullParamChecker.o: Attrs.inc.h
+NonNullParamChecker.o: Checkers.inc.h
+NonNullParamChecker.o: CommentCommandList.inc.h
+NonNullParamChecker.o: DeclNodes.inc.h
+NonNullParamChecker.o: DiagnosticCommonKinds.inc.h
+NonNullParamChecker.o: StmtNodes.inc.h
+NonNullParamChecker.po: AttrList.inc.h
+NonNullParamChecker.po: Attrs.inc.h
+NonNullParamChecker.po: Checkers.inc.h
+NonNullParamChecker.po: CommentCommandList.inc.h
+NonNullParamChecker.po: DeclNodes.inc.h
+NonNullParamChecker.po: DiagnosticCommonKinds.inc.h
+NonNullParamChecker.po: StmtNodes.inc.h
+ObjCAtSyncChecker.o: Checkers.inc.h
+ObjCAtSyncChecker.o: CommentCommandList.inc.h
+ObjCAtSyncChecker.o: DeclNodes.inc.h
+ObjCAtSyncChecker.o: DiagnosticCommonKinds.inc.h
+ObjCAtSyncChecker.o: StmtNodes.inc.h
+ObjCAtSyncChecker.po: Checkers.inc.h
+ObjCAtSyncChecker.po: CommentCommandList.inc.h
+ObjCAtSyncChecker.po: DeclNodes.inc.h
+ObjCAtSyncChecker.po: DiagnosticCommonKinds.inc.h
+ObjCAtSyncChecker.po: StmtNodes.inc.h
+ObjCContainersASTChecker.o: Checkers.inc.h
+ObjCContainersASTChecker.o: CommentCommandList.inc.h
+ObjCContainersASTChecker.o: DeclNodes.inc.h
+ObjCContainersASTChecker.o: DiagnosticCommonKinds.inc.h
+ObjCContainersASTChecker.o: StmtNodes.inc.h
+ObjCContainersASTChecker.po: Checkers.inc.h
+ObjCContainersASTChecker.po: CommentCommandList.inc.h
+ObjCContainersASTChecker.po: DeclNodes.inc.h
+ObjCContainersASTChecker.po: DiagnosticCommonKinds.inc.h
+ObjCContainersASTChecker.po: StmtNodes.inc.h
+ObjCContainersChecker.o: Checkers.inc.h
+ObjCContainersChecker.o: CommentCommandList.inc.h
+ObjCContainersChecker.o: DeclNodes.inc.h
+ObjCContainersChecker.o: DiagnosticCommonKinds.inc.h
+ObjCContainersChecker.o: StmtNodes.inc.h
+ObjCContainersChecker.po: Checkers.inc.h
+ObjCContainersChecker.po: CommentCommandList.inc.h
+ObjCContainersChecker.po: DeclNodes.inc.h
+ObjCContainersChecker.po: DiagnosticCommonKinds.inc.h
+ObjCContainersChecker.po: StmtNodes.inc.h
+ObjCMissingSuperCallChecker.o: Checkers.inc.h
+ObjCMissingSuperCallChecker.o: CommentCommandList.inc.h
+ObjCMissingSuperCallChecker.o: DeclNodes.inc.h
+ObjCMissingSuperCallChecker.o: DiagnosticCommonKinds.inc.h
+ObjCMissingSuperCallChecker.o: StmtNodes.inc.h
+ObjCMissingSuperCallChecker.po: Checkers.inc.h
+ObjCMissingSuperCallChecker.po: CommentCommandList.inc.h
+ObjCMissingSuperCallChecker.po: DeclNodes.inc.h
+ObjCMissingSuperCallChecker.po: DiagnosticCommonKinds.inc.h
+ObjCMissingSuperCallChecker.po: StmtNodes.inc.h
+ObjCSelfInitChecker.o: Checkers.inc.h
+ObjCSelfInitChecker.o: CommentCommandList.inc.h
+ObjCSelfInitChecker.o: DeclNodes.inc.h
+ObjCSelfInitChecker.o: DiagnosticCommonKinds.inc.h
+ObjCSelfInitChecker.o: StmtNodes.inc.h
+ObjCSelfInitChecker.po: Checkers.inc.h
+ObjCSelfInitChecker.po: CommentCommandList.inc.h
+ObjCSelfInitChecker.po: DeclNodes.inc.h
+ObjCSelfInitChecker.po: DiagnosticCommonKinds.inc.h
+ObjCSelfInitChecker.po: StmtNodes.inc.h
+ObjCUnusedIVarsChecker.o: AttrList.inc.h
+ObjCUnusedIVarsChecker.o: Attrs.inc.h
+ObjCUnusedIVarsChecker.o: Checkers.inc.h
+ObjCUnusedIVarsChecker.o: CommentCommandList.inc.h
+ObjCUnusedIVarsChecker.o: DeclNodes.inc.h
+ObjCUnusedIVarsChecker.o: DiagnosticCommonKinds.inc.h
+ObjCUnusedIVarsChecker.o: StmtNodes.inc.h
+ObjCUnusedIVarsChecker.po: AttrList.inc.h
+ObjCUnusedIVarsChecker.po: Attrs.inc.h
+ObjCUnusedIVarsChecker.po: Checkers.inc.h
+ObjCUnusedIVarsChecker.po: CommentCommandList.inc.h
+ObjCUnusedIVarsChecker.po: DeclNodes.inc.h
+ObjCUnusedIVarsChecker.po: DiagnosticCommonKinds.inc.h
+ObjCUnusedIVarsChecker.po: StmtNodes.inc.h
+PointerArithChecker.o: Checkers.inc.h
+PointerArithChecker.o: CommentCommandList.inc.h
+PointerArithChecker.o: DeclNodes.inc.h
+PointerArithChecker.o: DiagnosticCommonKinds.inc.h
+PointerArithChecker.o: StmtNodes.inc.h
+PointerArithChecker.po: Checkers.inc.h
+PointerArithChecker.po: CommentCommandList.inc.h
+PointerArithChecker.po: DeclNodes.inc.h
+PointerArithChecker.po: DiagnosticCommonKinds.inc.h
+PointerArithChecker.po: StmtNodes.inc.h
+PointerSubChecker.o: Checkers.inc.h
+PointerSubChecker.o: CommentCommandList.inc.h
+PointerSubChecker.o: DeclNodes.inc.h
+PointerSubChecker.o: DiagnosticCommonKinds.inc.h
+PointerSubChecker.o: StmtNodes.inc.h
+PointerSubChecker.po: Checkers.inc.h
+PointerSubChecker.po: CommentCommandList.inc.h
+PointerSubChecker.po: DeclNodes.inc.h
+PointerSubChecker.po: DiagnosticCommonKinds.inc.h
+PointerSubChecker.po: StmtNodes.inc.h
+PthreadLockChecker.o: Checkers.inc.h
+PthreadLockChecker.o: CommentCommandList.inc.h
+PthreadLockChecker.o: DeclNodes.inc.h
+PthreadLockChecker.o: DiagnosticCommonKinds.inc.h
+PthreadLockChecker.o: StmtNodes.inc.h
+PthreadLockChecker.po: Checkers.inc.h
+PthreadLockChecker.po: CommentCommandList.inc.h
+PthreadLockChecker.po: DeclNodes.inc.h
+PthreadLockChecker.po: DiagnosticCommonKinds.inc.h
+PthreadLockChecker.po: StmtNodes.inc.h
+RetainCountChecker.o: AttrList.inc.h
+RetainCountChecker.o: Attrs.inc.h
+RetainCountChecker.o: Checkers.inc.h
+RetainCountChecker.o: CommentCommandList.inc.h
+RetainCountChecker.o: DeclNodes.inc.h
+RetainCountChecker.o: DiagnosticCommonKinds.inc.h
+RetainCountChecker.o: StmtNodes.inc.h
+RetainCountChecker.po: AttrList.inc.h
+RetainCountChecker.po: Attrs.inc.h
+RetainCountChecker.po: Checkers.inc.h
+RetainCountChecker.po: CommentCommandList.inc.h
+RetainCountChecker.po: DeclNodes.inc.h
+RetainCountChecker.po: DiagnosticCommonKinds.inc.h
+RetainCountChecker.po: StmtNodes.inc.h
+ReturnPointerRangeChecker.o: Checkers.inc.h
+ReturnPointerRangeChecker.o: CommentCommandList.inc.h
+ReturnPointerRangeChecker.o: DeclNodes.inc.h
+ReturnPointerRangeChecker.o: DiagnosticCommonKinds.inc.h
+ReturnPointerRangeChecker.o: StmtNodes.inc.h
+ReturnPointerRangeChecker.po: Checkers.inc.h
+ReturnPointerRangeChecker.po: CommentCommandList.inc.h
+ReturnPointerRangeChecker.po: DeclNodes.inc.h
+ReturnPointerRangeChecker.po: DiagnosticCommonKinds.inc.h
+ReturnPointerRangeChecker.po: StmtNodes.inc.h
+ReturnUndefChecker.o: Checkers.inc.h
+ReturnUndefChecker.o: CommentCommandList.inc.h
+ReturnUndefChecker.o: DeclNodes.inc.h
+ReturnUndefChecker.o: DiagnosticCommonKinds.inc.h
+ReturnUndefChecker.o: StmtNodes.inc.h
+ReturnUndefChecker.po: Checkers.inc.h
+ReturnUndefChecker.po: CommentCommandList.inc.h
+ReturnUndefChecker.po: DeclNodes.inc.h
+ReturnUndefChecker.po: DiagnosticCommonKinds.inc.h
+ReturnUndefChecker.po: StmtNodes.inc.h
+SimpleStreamChecker.o: Checkers.inc.h
+SimpleStreamChecker.o: CommentCommandList.inc.h
+SimpleStreamChecker.o: DeclNodes.inc.h
+SimpleStreamChecker.o: DiagnosticCommonKinds.inc.h
+SimpleStreamChecker.o: StmtNodes.inc.h
+SimpleStreamChecker.po: Checkers.inc.h
+SimpleStreamChecker.po: CommentCommandList.inc.h
+SimpleStreamChecker.po: DeclNodes.inc.h
+SimpleStreamChecker.po: DiagnosticCommonKinds.inc.h
+SimpleStreamChecker.po: StmtNodes.inc.h
+StackAddrEscapeChecker.o: Checkers.inc.h
+StackAddrEscapeChecker.o: CommentCommandList.inc.h
+StackAddrEscapeChecker.o: DeclNodes.inc.h
+StackAddrEscapeChecker.o: DiagnosticCommonKinds.inc.h
+StackAddrEscapeChecker.o: StmtNodes.inc.h
+StackAddrEscapeChecker.po: Checkers.inc.h
+StackAddrEscapeChecker.po: CommentCommandList.inc.h
+StackAddrEscapeChecker.po: DeclNodes.inc.h
+StackAddrEscapeChecker.po: DiagnosticCommonKinds.inc.h
+StackAddrEscapeChecker.po: StmtNodes.inc.h
+StreamChecker.o: Checkers.inc.h
+StreamChecker.o: CommentCommandList.inc.h
+StreamChecker.o: DeclNodes.inc.h
+StreamChecker.o: DiagnosticCommonKinds.inc.h
+StreamChecker.o: StmtNodes.inc.h
+StreamChecker.po: Checkers.inc.h
+StreamChecker.po: CommentCommandList.inc.h
+StreamChecker.po: DeclNodes.inc.h
+StreamChecker.po: DiagnosticCommonKinds.inc.h
+StreamChecker.po: StmtNodes.inc.h
+TaintTesterChecker.o: Checkers.inc.h
+TaintTesterChecker.o: CommentCommandList.inc.h
+TaintTesterChecker.o: DeclNodes.inc.h
+TaintTesterChecker.o: DiagnosticCommonKinds.inc.h
+TaintTesterChecker.o: StmtNodes.inc.h
+TaintTesterChecker.po: Checkers.inc.h
+TaintTesterChecker.po: CommentCommandList.inc.h
+TaintTesterChecker.po: DeclNodes.inc.h
+TaintTesterChecker.po: DiagnosticCommonKinds.inc.h
+TaintTesterChecker.po: StmtNodes.inc.h
+TraversalChecker.o: Checkers.inc.h
+TraversalChecker.o: CommentCommandList.inc.h
+TraversalChecker.o: DeclNodes.inc.h
+TraversalChecker.o: DiagnosticCommonKinds.inc.h
+TraversalChecker.o: StmtNodes.inc.h
+TraversalChecker.po: Checkers.inc.h
+TraversalChecker.po: CommentCommandList.inc.h
+TraversalChecker.po: DeclNodes.inc.h
+TraversalChecker.po: DiagnosticCommonKinds.inc.h
+TraversalChecker.po: StmtNodes.inc.h
+UndefBranchChecker.o: Checkers.inc.h
+UndefBranchChecker.o: CommentCommandList.inc.h
+UndefBranchChecker.o: DeclNodes.inc.h
+UndefBranchChecker.o: DiagnosticCommonKinds.inc.h
+UndefBranchChecker.o: StmtNodes.inc.h
+UndefBranchChecker.po: Checkers.inc.h
+UndefBranchChecker.po: CommentCommandList.inc.h
+UndefBranchChecker.po: DeclNodes.inc.h
+UndefBranchChecker.po: DiagnosticCommonKinds.inc.h
+UndefBranchChecker.po: StmtNodes.inc.h
+UndefCapturedBlockVarChecker.o: AttrList.inc.h
+UndefCapturedBlockVarChecker.o: Attrs.inc.h
+UndefCapturedBlockVarChecker.o: Checkers.inc.h
+UndefCapturedBlockVarChecker.o: CommentCommandList.inc.h
+UndefCapturedBlockVarChecker.o: DeclNodes.inc.h
+UndefCapturedBlockVarChecker.o: DiagnosticCommonKinds.inc.h
+UndefCapturedBlockVarChecker.o: StmtNodes.inc.h
+UndefCapturedBlockVarChecker.po: AttrList.inc.h
+UndefCapturedBlockVarChecker.po: Attrs.inc.h
+UndefCapturedBlockVarChecker.po: Checkers.inc.h
+UndefCapturedBlockVarChecker.po: CommentCommandList.inc.h
+UndefCapturedBlockVarChecker.po: DeclNodes.inc.h
+UndefCapturedBlockVarChecker.po: DiagnosticCommonKinds.inc.h
+UndefCapturedBlockVarChecker.po: StmtNodes.inc.h
+UndefResultChecker.o: Checkers.inc.h
+UndefResultChecker.o: CommentCommandList.inc.h
+UndefResultChecker.o: DeclNodes.inc.h
+UndefResultChecker.o: DiagnosticCommonKinds.inc.h
+UndefResultChecker.o: StmtNodes.inc.h
+UndefResultChecker.po: Checkers.inc.h
+UndefResultChecker.po: CommentCommandList.inc.h
+UndefResultChecker.po: DeclNodes.inc.h
+UndefResultChecker.po: DiagnosticCommonKinds.inc.h
+UndefResultChecker.po: StmtNodes.inc.h
+UndefinedArraySubscriptChecker.o: Checkers.inc.h
+UndefinedArraySubscriptChecker.o: CommentCommandList.inc.h
+UndefinedArraySubscriptChecker.o: DeclNodes.inc.h
+UndefinedArraySubscriptChecker.o: DiagnosticCommonKinds.inc.h
+UndefinedArraySubscriptChecker.o: StmtNodes.inc.h
+UndefinedArraySubscriptChecker.po: Checkers.inc.h
+UndefinedArraySubscriptChecker.po: CommentCommandList.inc.h
+UndefinedArraySubscriptChecker.po: DeclNodes.inc.h
+UndefinedArraySubscriptChecker.po: DiagnosticCommonKinds.inc.h
+UndefinedArraySubscriptChecker.po: StmtNodes.inc.h
+UndefinedAssignmentChecker.o: Checkers.inc.h
+UndefinedAssignmentChecker.o: CommentCommandList.inc.h
+UndefinedAssignmentChecker.o: DeclNodes.inc.h
+UndefinedAssignmentChecker.o: DiagnosticCommonKinds.inc.h
+UndefinedAssignmentChecker.o: StmtNodes.inc.h
+UndefinedAssignmentChecker.po: Checkers.inc.h
+UndefinedAssignmentChecker.po: CommentCommandList.inc.h
+UndefinedAssignmentChecker.po: DeclNodes.inc.h
+UndefinedAssignmentChecker.po: DiagnosticCommonKinds.inc.h
+UndefinedAssignmentChecker.po: StmtNodes.inc.h
+UnixAPIChecker.o: Checkers.inc.h
+UnixAPIChecker.o: CommentCommandList.inc.h
+UnixAPIChecker.o: DeclNodes.inc.h
+UnixAPIChecker.o: DiagnosticCommonKinds.inc.h
+UnixAPIChecker.o: StmtNodes.inc.h
+UnixAPIChecker.po: Checkers.inc.h
+UnixAPIChecker.po: CommentCommandList.inc.h
+UnixAPIChecker.po: DeclNodes.inc.h
+UnixAPIChecker.po: DiagnosticCommonKinds.inc.h
+UnixAPIChecker.po: StmtNodes.inc.h
+UnreachableCodeChecker.o: Checkers.inc.h
+UnreachableCodeChecker.o: CommentCommandList.inc.h
+UnreachableCodeChecker.o: DeclNodes.inc.h
+UnreachableCodeChecker.o: DiagnosticCommonKinds.inc.h
+UnreachableCodeChecker.o: StmtNodes.inc.h
+UnreachableCodeChecker.po: Checkers.inc.h
+UnreachableCodeChecker.po: CommentCommandList.inc.h
+UnreachableCodeChecker.po: DeclNodes.inc.h
+UnreachableCodeChecker.po: DiagnosticCommonKinds.inc.h
+UnreachableCodeChecker.po: StmtNodes.inc.h
+VLASizeChecker.o: Checkers.inc.h
+VLASizeChecker.o: CommentCommandList.inc.h
+VLASizeChecker.o: DeclNodes.inc.h
+VLASizeChecker.o: DiagnosticCommonKinds.inc.h
+VLASizeChecker.o: StmtNodes.inc.h
+VLASizeChecker.po: Checkers.inc.h
+VLASizeChecker.po: CommentCommandList.inc.h
+VLASizeChecker.po: DeclNodes.inc.h
+VLASizeChecker.po: DiagnosticCommonKinds.inc.h
+VLASizeChecker.po: StmtNodes.inc.h
+VirtualCallChecker.o: Checkers.inc.h
+VirtualCallChecker.o: CommentCommandList.inc.h
+VirtualCallChecker.o: DeclNodes.inc.h
+VirtualCallChecker.o: DiagnosticCommonKinds.inc.h
+VirtualCallChecker.o: StmtNodes.inc.h
+VirtualCallChecker.po: Checkers.inc.h
+VirtualCallChecker.po: CommentCommandList.inc.h
+VirtualCallChecker.po: DeclNodes.inc.h
+VirtualCallChecker.po: DiagnosticCommonKinds.inc.h
+VirtualCallChecker.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/libclangstaticanalyzercore/Makefile.depend b/lib/clang/libclangstaticanalyzercore/Makefile.depend
new file mode 100644
index 0000000..41d7e38
--- /dev/null
+++ b/lib/clang/libclangstaticanalyzercore/Makefile.depend
@@ -0,0 +1,285 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AnalysisManager.o: CommentCommandList.inc.h
+AnalysisManager.o: DeclNodes.inc.h
+AnalysisManager.o: DiagnosticCommonKinds.inc.h
+AnalysisManager.o: StmtNodes.inc.h
+AnalysisManager.po: CommentCommandList.inc.h
+AnalysisManager.po: DeclNodes.inc.h
+AnalysisManager.po: DiagnosticCommonKinds.inc.h
+AnalysisManager.po: StmtNodes.inc.h
+BasicValueFactory.o: CommentCommandList.inc.h
+BasicValueFactory.o: DeclNodes.inc.h
+BasicValueFactory.o: DiagnosticCommonKinds.inc.h
+BasicValueFactory.o: StmtNodes.inc.h
+BasicValueFactory.po: CommentCommandList.inc.h
+BasicValueFactory.po: DeclNodes.inc.h
+BasicValueFactory.po: DiagnosticCommonKinds.inc.h
+BasicValueFactory.po: StmtNodes.inc.h
+BugReporter.o: CommentCommandList.inc.h
+BugReporter.o: DeclNodes.inc.h
+BugReporter.o: DiagnosticCommonKinds.inc.h
+BugReporter.o: StmtNodes.inc.h
+BugReporter.po: CommentCommandList.inc.h
+BugReporter.po: DeclNodes.inc.h
+BugReporter.po: DiagnosticCommonKinds.inc.h
+BugReporter.po: StmtNodes.inc.h
+BugReporterVisitors.o: CommentCommandList.inc.h
+BugReporterVisitors.o: DeclNodes.inc.h
+BugReporterVisitors.o: DiagnosticCommonKinds.inc.h
+BugReporterVisitors.o: StmtNodes.inc.h
+BugReporterVisitors.po: CommentCommandList.inc.h
+BugReporterVisitors.po: DeclNodes.inc.h
+BugReporterVisitors.po: DiagnosticCommonKinds.inc.h
+BugReporterVisitors.po: StmtNodes.inc.h
+CallEvent.o: CommentCommandList.inc.h
+CallEvent.o: DeclNodes.inc.h
+CallEvent.o: DiagnosticCommonKinds.inc.h
+CallEvent.o: StmtNodes.inc.h
+CallEvent.po: CommentCommandList.inc.h
+CallEvent.po: DeclNodes.inc.h
+CallEvent.po: DiagnosticCommonKinds.inc.h
+CallEvent.po: StmtNodes.inc.h
+Checker.o: CommentCommandList.inc.h
+Checker.o: DeclNodes.inc.h
+Checker.o: DiagnosticCommonKinds.inc.h
+Checker.o: StmtNodes.inc.h
+Checker.po: CommentCommandList.inc.h
+Checker.po: DeclNodes.inc.h
+Checker.po: DiagnosticCommonKinds.inc.h
+Checker.po: StmtNodes.inc.h
+CheckerContext.o: CommentCommandList.inc.h
+CheckerContext.o: DeclNodes.inc.h
+CheckerContext.o: DiagnosticCommonKinds.inc.h
+CheckerContext.o: StmtNodes.inc.h
+CheckerContext.po: CommentCommandList.inc.h
+CheckerContext.po: DeclNodes.inc.h
+CheckerContext.po: DiagnosticCommonKinds.inc.h
+CheckerContext.po: StmtNodes.inc.h
+CheckerHelpers.o: DeclNodes.inc.h
+CheckerHelpers.o: DiagnosticCommonKinds.inc.h
+CheckerHelpers.o: StmtNodes.inc.h
+CheckerHelpers.po: DeclNodes.inc.h
+CheckerHelpers.po: DiagnosticCommonKinds.inc.h
+CheckerHelpers.po: StmtNodes.inc.h
+CheckerManager.o: CommentCommandList.inc.h
+CheckerManager.o: DeclNodes.inc.h
+CheckerManager.o: DiagnosticCommonKinds.inc.h
+CheckerManager.o: StmtNodes.inc.h
+CheckerManager.po: CommentCommandList.inc.h
+CheckerManager.po: DeclNodes.inc.h
+CheckerManager.po: DiagnosticCommonKinds.inc.h
+CheckerManager.po: StmtNodes.inc.h
+CheckerRegistry.o: CommentCommandList.inc.h
+CheckerRegistry.o: DeclNodes.inc.h
+CheckerRegistry.o: DiagnosticCommonKinds.inc.h
+CheckerRegistry.o: StmtNodes.inc.h
+CheckerRegistry.po: CommentCommandList.inc.h
+CheckerRegistry.po: DeclNodes.inc.h
+CheckerRegistry.po: DiagnosticCommonKinds.inc.h
+CheckerRegistry.po: StmtNodes.inc.h
+ConstraintManager.o: CommentCommandList.inc.h
+ConstraintManager.o: DeclNodes.inc.h
+ConstraintManager.o: DiagnosticCommonKinds.inc.h
+ConstraintManager.o: StmtNodes.inc.h
+ConstraintManager.po: CommentCommandList.inc.h
+ConstraintManager.po: DeclNodes.inc.h
+ConstraintManager.po: DiagnosticCommonKinds.inc.h
+ConstraintManager.po: StmtNodes.inc.h
+CoreEngine.o: CommentCommandList.inc.h
+CoreEngine.o: DeclNodes.inc.h
+CoreEngine.o: DiagnosticCommonKinds.inc.h
+CoreEngine.o: StmtNodes.inc.h
+CoreEngine.po: CommentCommandList.inc.h
+CoreEngine.po: DeclNodes.inc.h
+CoreEngine.po: DiagnosticCommonKinds.inc.h
+CoreEngine.po: StmtNodes.inc.h
+Environment.o: CommentCommandList.inc.h
+Environment.o: DeclNodes.inc.h
+Environment.o: DiagnosticCommonKinds.inc.h
+Environment.o: StmtNodes.inc.h
+Environment.po: CommentCommandList.inc.h
+Environment.po: DeclNodes.inc.h
+Environment.po: DiagnosticCommonKinds.inc.h
+Environment.po: StmtNodes.inc.h
+ExplodedGraph.o: CommentCommandList.inc.h
+ExplodedGraph.o: DeclNodes.inc.h
+ExplodedGraph.o: DiagnosticCommonKinds.inc.h
+ExplodedGraph.o: StmtNodes.inc.h
+ExplodedGraph.po: CommentCommandList.inc.h
+ExplodedGraph.po: DeclNodes.inc.h
+ExplodedGraph.po: DiagnosticCommonKinds.inc.h
+ExplodedGraph.po: StmtNodes.inc.h
+ExprEngine.o: CommentCommandList.inc.h
+ExprEngine.o: DeclNodes.inc.h
+ExprEngine.o: DiagnosticCommonKinds.inc.h
+ExprEngine.o: StmtNodes.inc.h
+ExprEngine.po: CommentCommandList.inc.h
+ExprEngine.po: DeclNodes.inc.h
+ExprEngine.po: DiagnosticCommonKinds.inc.h
+ExprEngine.po: StmtNodes.inc.h
+ExprEngineC.o: CommentCommandList.inc.h
+ExprEngineC.o: DeclNodes.inc.h
+ExprEngineC.o: DiagnosticCommonKinds.inc.h
+ExprEngineC.o: StmtNodes.inc.h
+ExprEngineC.po: CommentCommandList.inc.h
+ExprEngineC.po: DeclNodes.inc.h
+ExprEngineC.po: DiagnosticCommonKinds.inc.h
+ExprEngineC.po: StmtNodes.inc.h
+ExprEngineCXX.o: CommentCommandList.inc.h
+ExprEngineCXX.o: DeclNodes.inc.h
+ExprEngineCXX.o: DiagnosticCommonKinds.inc.h
+ExprEngineCXX.o: StmtNodes.inc.h
+ExprEngineCXX.po: CommentCommandList.inc.h
+ExprEngineCXX.po: DeclNodes.inc.h
+ExprEngineCXX.po: DiagnosticCommonKinds.inc.h
+ExprEngineCXX.po: StmtNodes.inc.h
+ExprEngineCallAndReturn.o: CommentCommandList.inc.h
+ExprEngineCallAndReturn.o: DeclNodes.inc.h
+ExprEngineCallAndReturn.o: DiagnosticCommonKinds.inc.h
+ExprEngineCallAndReturn.o: StmtNodes.inc.h
+ExprEngineCallAndReturn.po: CommentCommandList.inc.h
+ExprEngineCallAndReturn.po: DeclNodes.inc.h
+ExprEngineCallAndReturn.po: DiagnosticCommonKinds.inc.h
+ExprEngineCallAndReturn.po: StmtNodes.inc.h
+ExprEngineObjC.o: CommentCommandList.inc.h
+ExprEngineObjC.o: DeclNodes.inc.h
+ExprEngineObjC.o: DiagnosticCommonKinds.inc.h
+ExprEngineObjC.o: StmtNodes.inc.h
+ExprEngineObjC.po: CommentCommandList.inc.h
+ExprEngineObjC.po: DeclNodes.inc.h
+ExprEngineObjC.po: DiagnosticCommonKinds.inc.h
+ExprEngineObjC.po: StmtNodes.inc.h
+HTMLDiagnostics.o: CommentCommandList.inc.h
+HTMLDiagnostics.o: DeclNodes.inc.h
+HTMLDiagnostics.o: DiagnosticCommonKinds.inc.h
+HTMLDiagnostics.o: StmtNodes.inc.h
+HTMLDiagnostics.po: CommentCommandList.inc.h
+HTMLDiagnostics.po: DeclNodes.inc.h
+HTMLDiagnostics.po: DiagnosticCommonKinds.inc.h
+HTMLDiagnostics.po: StmtNodes.inc.h
+MemRegion.o: AttrList.inc.h
+MemRegion.o: Attrs.inc.h
+MemRegion.o: CommentCommandList.inc.h
+MemRegion.o: DeclNodes.inc.h
+MemRegion.o: DiagnosticCommonKinds.inc.h
+MemRegion.o: StmtNodes.inc.h
+MemRegion.po: AttrList.inc.h
+MemRegion.po: Attrs.inc.h
+MemRegion.po: CommentCommandList.inc.h
+MemRegion.po: DeclNodes.inc.h
+MemRegion.po: DiagnosticCommonKinds.inc.h
+MemRegion.po: StmtNodes.inc.h
+PathDiagnostic.o: CommentCommandList.inc.h
+PathDiagnostic.o: DeclNodes.inc.h
+PathDiagnostic.o: DiagnosticCommonKinds.inc.h
+PathDiagnostic.o: StmtNodes.inc.h
+PathDiagnostic.po: CommentCommandList.inc.h
+PathDiagnostic.po: DeclNodes.inc.h
+PathDiagnostic.po: DiagnosticCommonKinds.inc.h
+PathDiagnostic.po: StmtNodes.inc.h
+PlistDiagnostics.o: DeclNodes.inc.h
+PlistDiagnostics.o: DiagnosticCommonKinds.inc.h
+PlistDiagnostics.o: StmtNodes.inc.h
+PlistDiagnostics.po: DeclNodes.inc.h
+PlistDiagnostics.po: DiagnosticCommonKinds.inc.h
+PlistDiagnostics.po: StmtNodes.inc.h
+ProgramState.o: CommentCommandList.inc.h
+ProgramState.o: DeclNodes.inc.h
+ProgramState.o: DiagnosticCommonKinds.inc.h
+ProgramState.o: StmtNodes.inc.h
+ProgramState.po: CommentCommandList.inc.h
+ProgramState.po: DeclNodes.inc.h
+ProgramState.po: DiagnosticCommonKinds.inc.h
+ProgramState.po: StmtNodes.inc.h
+RangeConstraintManager.o: CommentCommandList.inc.h
+RangeConstraintManager.o: DeclNodes.inc.h
+RangeConstraintManager.o: DiagnosticCommonKinds.inc.h
+RangeConstraintManager.o: StmtNodes.inc.h
+RangeConstraintManager.po: CommentCommandList.inc.h
+RangeConstraintManager.po: DeclNodes.inc.h
+RangeConstraintManager.po: DiagnosticCommonKinds.inc.h
+RangeConstraintManager.po: StmtNodes.inc.h
+RegionStore.o: AttrList.inc.h
+RegionStore.o: Attrs.inc.h
+RegionStore.o: CommentCommandList.inc.h
+RegionStore.o: DeclNodes.inc.h
+RegionStore.o: DiagnosticCommonKinds.inc.h
+RegionStore.o: StmtNodes.inc.h
+RegionStore.po: AttrList.inc.h
+RegionStore.po: Attrs.inc.h
+RegionStore.po: CommentCommandList.inc.h
+RegionStore.po: DeclNodes.inc.h
+RegionStore.po: DiagnosticCommonKinds.inc.h
+RegionStore.po: StmtNodes.inc.h
+SValBuilder.o: CommentCommandList.inc.h
+SValBuilder.o: DeclNodes.inc.h
+SValBuilder.o: DiagnosticCommonKinds.inc.h
+SValBuilder.o: StmtNodes.inc.h
+SValBuilder.po: CommentCommandList.inc.h
+SValBuilder.po: DeclNodes.inc.h
+SValBuilder.po: DiagnosticCommonKinds.inc.h
+SValBuilder.po: StmtNodes.inc.h
+SVals.o: CommentCommandList.inc.h
+SVals.o: DeclNodes.inc.h
+SVals.o: DiagnosticCommonKinds.inc.h
+SVals.o: StmtNodes.inc.h
+SVals.po: CommentCommandList.inc.h
+SVals.po: DeclNodes.inc.h
+SVals.po: DiagnosticCommonKinds.inc.h
+SVals.po: StmtNodes.inc.h
+SimpleConstraintManager.o: CommentCommandList.inc.h
+SimpleConstraintManager.o: DeclNodes.inc.h
+SimpleConstraintManager.o: DiagnosticCommonKinds.inc.h
+SimpleConstraintManager.o: StmtNodes.inc.h
+SimpleConstraintManager.po: CommentCommandList.inc.h
+SimpleConstraintManager.po: DeclNodes.inc.h
+SimpleConstraintManager.po: DiagnosticCommonKinds.inc.h
+SimpleConstraintManager.po: StmtNodes.inc.h
+SimpleSValBuilder.o: CommentCommandList.inc.h
+SimpleSValBuilder.o: DeclNodes.inc.h
+SimpleSValBuilder.o: DiagnosticCommonKinds.inc.h
+SimpleSValBuilder.o: StmtNodes.inc.h
+SimpleSValBuilder.po: CommentCommandList.inc.h
+SimpleSValBuilder.po: DeclNodes.inc.h
+SimpleSValBuilder.po: DiagnosticCommonKinds.inc.h
+SimpleSValBuilder.po: StmtNodes.inc.h
+Store.o: CommentCommandList.inc.h
+Store.o: DeclNodes.inc.h
+Store.o: DiagnosticCommonKinds.inc.h
+Store.o: StmtNodes.inc.h
+Store.po: CommentCommandList.inc.h
+Store.po: DeclNodes.inc.h
+Store.po: DiagnosticCommonKinds.inc.h
+Store.po: StmtNodes.inc.h
+SubEngine.o: CommentCommandList.inc.h
+SubEngine.o: DeclNodes.inc.h
+SubEngine.o: DiagnosticCommonKinds.inc.h
+SubEngine.o: StmtNodes.inc.h
+SubEngine.po: CommentCommandList.inc.h
+SubEngine.po: DeclNodes.inc.h
+SubEngine.po: DiagnosticCommonKinds.inc.h
+SubEngine.po: StmtNodes.inc.h
+SymbolManager.o: CommentCommandList.inc.h
+SymbolManager.o: DeclNodes.inc.h
+SymbolManager.o: DiagnosticCommonKinds.inc.h
+SymbolManager.o: StmtNodes.inc.h
+SymbolManager.po: CommentCommandList.inc.h
+SymbolManager.po: DeclNodes.inc.h
+SymbolManager.po: DiagnosticCommonKinds.inc.h
+SymbolManager.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/libclangstaticanalyzerfrontend/Makefile b/lib/clang/libclangstaticanalyzerfrontend/Makefile
index 3975509..de7b326 100644
--- a/lib/clang/libclangstaticanalyzerfrontend/Makefile
+++ b/lib/clang/libclangstaticanalyzerfrontend/Makefile
@@ -7,13 +7,9 @@ LIB= clangstaticanalyzerfrontend
SRCDIR= tools/clang/lib/StaticAnalyzer/Frontend
SRCS= AnalysisConsumer.cpp \
CheckerRegistration.cpp \
- ModelConsumer.cpp \
- FrontendActions.cpp \
- ModelInjector.cpp
+ FrontendActions.cpp
TGHDRS= AttrList \
- AttrParsedAttrList \
- AttrVisitor \
Attrs \
Checkers \
CommentCommandList \
diff --git a/lib/clang/libclangstaticanalyzerfrontend/Makefile.depend b/lib/clang/libclangstaticanalyzerfrontend/Makefile.depend
new file mode 100644
index 0000000..7a70a37
--- /dev/null
+++ b/lib/clang/libclangstaticanalyzerfrontend/Makefile.depend
@@ -0,0 +1,37 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AnalysisConsumer.o: CommentCommandList.inc.h
+AnalysisConsumer.o: DeclNodes.inc.h
+AnalysisConsumer.o: DiagnosticCommonKinds.inc.h
+AnalysisConsumer.o: StmtNodes.inc.h
+AnalysisConsumer.po: CommentCommandList.inc.h
+AnalysisConsumer.po: DeclNodes.inc.h
+AnalysisConsumer.po: DiagnosticCommonKinds.inc.h
+AnalysisConsumer.po: StmtNodes.inc.h
+CheckerRegistration.o: CommentCommandList.inc.h
+CheckerRegistration.o: DeclNodes.inc.h
+CheckerRegistration.o: DiagnosticCommonKinds.inc.h
+CheckerRegistration.o: DiagnosticFrontendKinds.inc.h
+CheckerRegistration.o: StmtNodes.inc.h
+CheckerRegistration.po: CommentCommandList.inc.h
+CheckerRegistration.po: DeclNodes.inc.h
+CheckerRegistration.po: DiagnosticCommonKinds.inc.h
+CheckerRegistration.po: DiagnosticFrontendKinds.inc.h
+CheckerRegistration.po: StmtNodes.inc.h
+FrontendActions.o: DiagnosticCommonKinds.inc.h
+FrontendActions.po: DiagnosticCommonKinds.inc.h
+.endif
diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile
index 1306cdf..cba14e7 100644
--- a/lib/clang/liblldb/Makefile
+++ b/lib/clang/liblldb/Makefile
@@ -10,9 +10,7 @@ SRCDIR= tools/lldb/source
SRCS= lldb.cpp \
lldb-log.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbAPI/Makefile b/lib/clang/liblldbAPI/Makefile
index 44addca..d041d09 100644
--- a/lib/clang/liblldbAPI/Makefile
+++ b/lib/clang/liblldbAPI/Makefile
@@ -19,7 +19,6 @@ SRCS= SBAddress.cpp \
SBDeclaration.cpp \
SBError.cpp \
SBEvent.cpp \
- SBExecutionContext.cpp \
SBExpressionOptions.cpp \
SBFileSpec.cpp \
SBFileSpecList.cpp \
@@ -44,25 +43,19 @@ SRCS= SBAddress.cpp \
SBSymbolContext.cpp \
SBSymbolContextList.cpp \
SBTarget.cpp \
- SBThreadCollection.cpp \
- SBThreadPlan.cpp \
SBThread.cpp \
SBType.cpp \
SBTypeCategory.cpp \
- SBTypeEnumMember.cpp \
SBTypeFilter.cpp \
SBTypeFormat.cpp \
SBTypeNameSpecifier.cpp \
SBTypeSummary.cpp \
SBTypeSynthetic.cpp \
- SBUnixSignals.cpp \
SBValue.cpp \
SBValueList.cpp \
SBWatchpoint.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbBreakpoint/Makefile b/lib/clang/liblldbBreakpoint/Makefile
index b6885d8..396b0aa 100644
--- a/lib/clang/liblldbBreakpoint/Makefile
+++ b/lib/clang/liblldbBreakpoint/Makefile
@@ -27,9 +27,7 @@ SRCS= Breakpoint.cpp \
WatchpointList.cpp \
WatchpointOptions.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbCommands/Makefile b/lib/clang/liblldbCommands/Makefile
index 833c8a8..f7baf83 100644
--- a/lib/clang/liblldbCommands/Makefile
+++ b/lib/clang/liblldbCommands/Makefile
@@ -34,9 +34,7 @@ SRCS= CommandCompletions.cpp \
CommandObjectWatchpoint.cpp \
CommandObjectWatchpointCommand.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbCore/Makefile b/lib/clang/liblldbCore/Makefile
index 7d9e86b..e0335f4 100644
--- a/lib/clang/liblldbCore/Makefile
+++ b/lib/clang/liblldbCore/Makefile
@@ -15,6 +15,7 @@ SRCS= Address.cpp \
Broadcaster.cpp \
Communication.cpp \
Connection.cpp \
+ ConnectionFileDescriptor.cpp \
ConnectionMachPort.cpp \
ConnectionSharedMemory.cpp \
ConstString.cpp \
@@ -28,7 +29,6 @@ SRCS= Address.cpp \
EmulateInstruction.cpp \
Error.cpp \
Event.cpp \
- FastDemangle.cpp \
FileLineResolver.cpp \
FileSpecList.cpp \
History.cpp \
@@ -56,7 +56,6 @@ SRCS= Address.cpp \
StreamGDBRemote.cpp \
StreamString.cpp \
StringList.cpp \
- StructuredData.cpp \
Timer.cpp \
UserID.cpp \
UserSettingsController.cpp \
@@ -76,9 +75,7 @@ SRCS= Address.cpp \
ValueObjectVariable.cpp \
VMRange.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbDataFormatters/Makefile b/lib/clang/liblldbDataFormatters/Makefile
index df34f00..b224215 100644
--- a/lib/clang/liblldbDataFormatters/Makefile
+++ b/lib/clang/liblldbDataFormatters/Makefile
@@ -13,28 +13,21 @@ SRCS= CF.cpp \
FormatClasses.cpp \
FormatManager.cpp \
LibCxx.cpp \
- LibCxxInitializerList.cpp \
LibCxxList.cpp \
LibCxxMap.cpp \
LibCxxUnorderedMap.cpp \
- LibCxxVector.cpp \
LibStdcpp.cpp \
NSArray.cpp \
NSDictionary.cpp \
- NSIndexPath.cpp \
NSSet.cpp \
- StringPrinter.cpp \
TypeCategory.cpp \
TypeCategoryMap.cpp \
TypeFormat.cpp \
TypeSummary.cpp \
TypeSynthetic.cpp \
- TypeValidator.cpp \
ValueObjectPrinter.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbExpression/Makefile b/lib/clang/liblldbExpression/Makefile
index d2d822b..120add5 100644
--- a/lib/clang/liblldbExpression/Makefile
+++ b/lib/clang/liblldbExpression/Makefile
@@ -13,7 +13,6 @@ SRCS= ASTDumper.cpp \
ClangExpressionParser.cpp \
ClangExpressionVariable.cpp \
ClangFunction.cpp \
- ClangModulesDeclVendor.cpp \
ClangPersistentVariables.cpp \
ClangUserExpression.cpp \
ClangUtilityFunction.cpp \
diff --git a/lib/clang/liblldbHostCommon/Makefile b/lib/clang/liblldbHostCommon/Makefile
index af3c053..f2022bb 100644
--- a/lib/clang/liblldbHostCommon/Makefile
+++ b/lib/clang/liblldbHostCommon/Makefile
@@ -6,32 +6,20 @@ LIB= lldbHostCommon
SRCDIR= tools/lldb/source/Host/common
SRCS= Condition.cpp \
+ DynamicLibrary.cpp \
Editline.cpp \
File.cpp \
FileSpec.cpp \
Host.cpp \
- HostInfoBase.cpp \
- HostNativeThreadBase.cpp \
- HostProcess.cpp \
- HostThread.cpp \
- IOObject.cpp \
- MonitoringProcessLauncher.cpp \
Mutex.cpp \
OptionParser.cpp \
- PipeBase.cpp \
ProcessRunLock.cpp \
- Socket.cpp \
SocketAddress.cpp \
- SoftwareBreakpoint.cpp \
Symbols.cpp \
Terminal.cpp \
- ThisThread.cpp \
- ThreadLauncher.cpp \
TimeValue.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbHostFreeBSD/Makefile b/lib/clang/liblldbHostFreeBSD/Makefile
index 6ebc9b4..e07f8ed 100644
--- a/lib/clang/liblldbHostFreeBSD/Makefile
+++ b/lib/clang/liblldbHostFreeBSD/Makefile
@@ -5,10 +5,7 @@
LIB= lldbHostFreeBSD
SRCDIR= tools/lldb/source/Host/freebsd
-SRCS= Host.cpp \
- HostInfoFreeBSD.cpp \
- HostThreadFreeBSD.cpp \
- ThisThread.cpp
+SRCS= Host.cpp
TGHDRS= DiagnosticCommonKinds \
DeclNodes \
diff --git a/lib/clang/liblldbHostPOSIX/Makefile b/lib/clang/liblldbHostPOSIX/Makefile
deleted file mode 100644
index 6fe660a..0000000
--- a/lib/clang/liblldbHostPOSIX/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= lldbHostPOSIX
-
-SRCDIR= tools/lldb/source/Host/posix
-SRCS= ConnectionFileDescriptorPosix.cpp \
- FileSystem.cpp \
- HostInfoPosix.cpp \
- HostProcessPosix.cpp \
- HostThreadPosix.cpp \
- PipePosix.cpp \
- ProcessLauncherPosix.cpp
-
-.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbInterpreter/Makefile b/lib/clang/liblldbInterpreter/Makefile
index f707d9b..c560adf 100644
--- a/lib/clang/liblldbInterpreter/Makefile
+++ b/lib/clang/liblldbInterpreter/Makefile
@@ -11,7 +11,6 @@ SRCS= Args.cpp \
CommandObject.cpp \
CommandObjectRegexCommand.cpp \
CommandObjectScript.cpp \
- CommandOptionValidators.cpp \
CommandReturnObject.cpp \
OptionGroupArchitecture.cpp \
OptionGroupBoolean.cpp \
@@ -28,7 +27,6 @@ SRCS= Args.cpp \
OptionValueArgs.cpp \
OptionValueArray.cpp \
OptionValueBoolean.cpp \
- OptionValueChar.cpp \
OptionValueDictionary.cpp \
OptionValueEnumeration.cpp \
OptionValueFileSpec.cpp \
@@ -50,9 +48,7 @@ SRCS= Args.cpp \
ScriptInterpreterNone.cpp \
ScriptInterpreterPython.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbPluginABISysV_ppc/Makefile b/lib/clang/liblldbPluginABISysV_ppc/Makefile
deleted file mode 100644
index 4cbbc02..0000000
--- a/lib/clang/liblldbPluginABISysV_ppc/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= lldbPluginABISysV_ppc
-
-SRCDIR= tools/lldb/source/Plugins/ABI/SysV-ppc
-SRCS= ABISysV_ppc.cpp
-
-TGHDRS= DiagnosticCommonKinds \
- DeclNodes \
- StmtNodes \
- CommentCommandList
-
-.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginABISysV_ppc64/Makefile b/lib/clang/liblldbPluginABISysV_ppc64/Makefile
deleted file mode 100644
index fe72ab5..0000000
--- a/lib/clang/liblldbPluginABISysV_ppc64/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= lldbPluginABISysV_ppc64
-
-SRCDIR= tools/lldb/source/Plugins/ABI/SysV-ppc64
-SRCS= ABISysV_ppc64.cpp
-
-TGHDRS= DiagnosticCommonKinds \
- DeclNodes \
- StmtNodes \
- CommentCommandList
-
-.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginInstructionARM64/Makefile b/lib/clang/liblldbPluginInstructionARM64/Makefile
deleted file mode 100644
index 92d976e..0000000
--- a/lib/clang/liblldbPluginInstructionARM64/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= lldbPluginInstructionARM64
-
-SRCDIR= tools/lldb/source/Plugins/Instruction/ARM64
-SRCS= EmulateInstructionARM64.cpp
-
-.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile b/lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile
deleted file mode 100644
index bb02244..0000000
--- a/lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= lldbPluginInstrumentationRuntimeAddressSanitizer
-
-SRCDIR= tools/lldb/source/Plugins/InstrumentationRuntime/AddressSanitizer
-SRCS= AddressSanitizerRuntime.cpp
-
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
- DeclNodes \
- StmtNodes \
- CommentCommandList
-
-.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginJITLoaderGDB/Makefile b/lib/clang/liblldbPluginJITLoaderGDB/Makefile
deleted file mode 100644
index 80e84df..0000000
--- a/lib/clang/liblldbPluginJITLoaderGDB/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= lldbPluginJITLoaderGDB
-
-SRCDIR= tools/lldb/source/Plugins/JITLoader/GDB
-SRCS= JITLoaderGDB.cpp
-
-TGHDRS= DiagnosticCommonKinds \
- DeclNodes \
- StmtNodes \
- CommentCommandList
-
-.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginMemoryHistoryASan/Makefile b/lib/clang/liblldbPluginMemoryHistoryASan/Makefile
deleted file mode 100644
index ac57d6a..0000000
--- a/lib/clang/liblldbPluginMemoryHistoryASan/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= lldbPluginMemoryHistoryASan
-
-SRCDIR= tools/lldb/source/Plugins/MemoryHistory/asan
-SRCS= MemoryHistoryASan.cpp
-
-TGHDRS= DiagnosticCommonKinds \
- DeclNodes \
- StmtNodes \
- CommentCommandList
-
-.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginObjectFileJIT/Makefile b/lib/clang/liblldbPluginObjectFileJIT/Makefile
deleted file mode 100644
index 2640350..0000000
--- a/lib/clang/liblldbPluginObjectFileJIT/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= lldbPluginObjectFileJIT
-
-SRCDIR= tools/lldb/source/Plugins/ObjectFile/JIT
-SRCS= ObjectFileJIT.cpp
-
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
- DeclNodes \
- StmtNodes \
- CommentCommandList
-
-.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginPlatformFreeBSD/Makefile b/lib/clang/liblldbPluginPlatformFreeBSD/Makefile
index c2eee8a..9be7af3 100644
--- a/lib/clang/liblldbPluginPlatformFreeBSD/Makefile
+++ b/lib/clang/liblldbPluginPlatformFreeBSD/Makefile
@@ -7,9 +7,7 @@ LIB= lldbPluginPlatformFreeBSD
SRCDIR= tools/lldb/source/Plugins/Platform/FreeBSD
SRCS= PlatformFreeBSD.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbPluginPlatformGDB/Makefile b/lib/clang/liblldbPluginPlatformGDB/Makefile
index 714a311..1d8a994 100644
--- a/lib/clang/liblldbPluginPlatformGDB/Makefile
+++ b/lib/clang/liblldbPluginPlatformGDB/Makefile
@@ -7,9 +7,7 @@ LIB= lldbPluginPlatformGDB
SRCDIR= tools/lldb/source/Plugins/Platform/gdb-server
SRCS= PlatformRemoteGDBServer.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbPluginProcessElfCore/Makefile b/lib/clang/liblldbPluginProcessElfCore/Makefile
index 66852dd..30198b5 100644
--- a/lib/clang/liblldbPluginProcessElfCore/Makefile
+++ b/lib/clang/liblldbPluginProcessElfCore/Makefile
@@ -11,7 +11,6 @@ SRCDIR= tools/lldb/source/Plugins/Process/elf-core
SRCS= ProcessElfCore.cpp \
ThreadElfCore.cpp \
RegisterContextPOSIXCore_mips64.cpp \
- RegisterContextPOSIXCore_powerpc.cpp \
RegisterContextPOSIXCore_x86_64.cpp
TGHDRS= DiagnosticCommonKinds \
diff --git a/lib/clang/liblldbPluginProcessGDBRemote/Makefile b/lib/clang/liblldbPluginProcessGDBRemote/Makefile
index 5bbb40f..c76fe8a 100644
--- a/lib/clang/liblldbPluginProcessGDBRemote/Makefile
+++ b/lib/clang/liblldbPluginProcessGDBRemote/Makefile
@@ -13,9 +13,7 @@ SRCS= GDBRemoteCommunication.cpp \
ProcessGDBRemoteLog.cpp \
ThreadGDBRemote.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbPluginProcessPOSIX/Makefile b/lib/clang/liblldbPluginProcessPOSIX/Makefile
index ddd902a..f681fd3 100644
--- a/lib/clang/liblldbPluginProcessPOSIX/Makefile
+++ b/lib/clang/liblldbPluginProcessPOSIX/Makefile
@@ -15,14 +15,17 @@ SRCS= POSIXStopInfo.cpp \
ProcessMessage.cpp \
ProcessPOSIX.cpp \
ProcessPOSIXLog.cpp \
- RegisterContextPOSIXProcessMonitor_arm64.cpp \
+ RegisterContextFreeBSD_i386.cpp \
+ RegisterContextFreeBSD_mips64.cpp \
+ RegisterContextFreeBSD_x86_64.cpp \
+ RegisterContextLinux_i386.cpp \
+ RegisterContextLinux_x86_64.cpp \
RegisterContextPOSIXProcessMonitor_mips64.cpp \
- RegisterContextPOSIXProcessMonitor_powerpc.cpp \
- RegisterContextPOSIXProcessMonitor_x86.cpp
+ RegisterContextPOSIXProcessMonitor_x86.cpp \
+ RegisterContextPOSIX_mips64.cpp \
+ RegisterContextPOSIX_x86.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbPluginProcessUtility/Makefile b/lib/clang/liblldbPluginProcessUtility/Makefile
index d43396f..1459254 100644
--- a/lib/clang/liblldbPluginProcessUtility/Makefile
+++ b/lib/clang/liblldbPluginProcessUtility/Makefile
@@ -6,43 +6,27 @@ LIB= lldbPluginProcessUtility
SRCDIR= tools/lldb/source/Plugins/Process/Utility
SRCS= DynamicRegisterInfo.cpp \
- FreeBSDSignals.cpp \
HistoryThread.cpp \
HistoryUnwind.cpp \
InferiorCallPOSIX.cpp \
- LinuxSignals.cpp \
RegisterContextDarwin_arm.cpp \
- RegisterContextDarwin_arm64.cpp \
RegisterContextDarwin_i386.cpp \
RegisterContextDarwin_x86_64.cpp \
RegisterContextDummy.cpp \
- RegisterContextFreeBSD_i386.cpp \
- RegisterContextFreeBSD_mips64.cpp \
- RegisterContextFreeBSD_powerpc.cpp \
- RegisterContextFreeBSD_x86_64.cpp \
RegisterContextHistory.cpp \
- RegisterContextLinux_arm64.cpp \
- RegisterContextLinux_i386.cpp \
- RegisterContextLinux_x86_64.cpp \
RegisterContextLLDB.cpp \
RegisterContextMach_arm.cpp \
RegisterContextMach_i386.cpp \
RegisterContextMach_x86_64.cpp \
RegisterContextMacOSXFrameBackchain.cpp \
RegisterContextMemory.cpp \
- RegisterContextPOSIX_arm64.cpp \
- RegisterContextPOSIX_mips64.cpp \
- RegisterContextPOSIX_powerpc.cpp \
- RegisterContextPOSIX_x86.cpp \
RegisterContextThreadMemory.cpp \
StopInfoMachException.cpp \
ThreadMemory.cpp \
UnwindLLDB.cpp \
UnwindMacOSXFrameBackchain.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbPluginSymbolFileDWARF/Makefile b/lib/clang/liblldbPluginSymbolFileDWARF/Makefile
index 5b8dbfd..ac23199 100644
--- a/lib/clang/liblldbPluginSymbolFileDWARF/Makefile
+++ b/lib/clang/liblldbPluginSymbolFileDWARF/Makefile
@@ -31,9 +31,7 @@ SRCS= DWARFAbbreviationDeclaration.cpp \
SymbolFileDWARFDebugMap.cpp \
UniqueDWARFASTType.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList \
diff --git a/lib/clang/liblldbSymbol/Makefile b/lib/clang/liblldbSymbol/Makefile
index 82c11ff..ed22ec3 100644
--- a/lib/clang/liblldbSymbol/Makefile
+++ b/lib/clang/liblldbSymbol/Makefile
@@ -12,7 +12,6 @@ SRCS= Block.cpp \
ClangExternalASTSourceCallbacks.cpp \
ClangExternalASTSourceCommon.cpp \
ClangNamespaceDecl.cpp \
- CompactUnwindInfo.cpp \
CompileUnit.cpp \
Declaration.cpp \
DWARFCallFrameInfo.cpp \
diff --git a/lib/clang/liblldbTarget/Makefile b/lib/clang/liblldbTarget/Makefile
index 95ced8d..2e0226d 100644
--- a/lib/clang/liblldbTarget/Makefile
+++ b/lib/clang/liblldbTarget/Makefile
@@ -10,23 +10,13 @@ SRCDIR= tools/lldb/source/Target
SRCS= ABI.cpp \
CPPLanguageRuntime.cpp \
ExecutionContext.cpp \
- FileAction.cpp \
- InstrumentationRuntime.cpp \
- InstrumentationRuntimeStopInfo.cpp \
- JITLoader.cpp \
- JITLoaderList.cpp \
LanguageRuntime.cpp \
Memory.cpp \
- MemoryHistory.cpp \
- NativeRegisterContext.cpp \
- NativeRegisterContextRegisterInfo.cpp \
ObjCLanguageRuntime.cpp \
OperatingSystem.cpp \
PathMappingList.cpp \
Platform.cpp \
Process.cpp \
- ProcessInfo.cpp \
- ProcessLaunchInfo.cpp \
Queue.cpp \
QueueItem.cpp \
QueueList.cpp \
@@ -41,13 +31,11 @@ SRCS= ABI.cpp \
Target.cpp \
TargetList.cpp \
Thread.cpp \
- ThreadCollection.cpp \
ThreadList.cpp \
ThreadPlan.cpp \
ThreadPlanBase.cpp \
ThreadPlanCallFunction.cpp \
ThreadPlanCallUserExpression.cpp \
- ThreadPlanPython.cpp \
ThreadPlanRunToAddress.cpp \
ThreadPlanShouldStopHere.cpp \
ThreadPlanStepInRange.cpp \
@@ -63,9 +51,7 @@ SRCS= ABI.cpp \
UnixSignals.cpp \
UnwindAssembly.cpp
-TGHDRS= AttrList \
- Attrs \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbUtility/Makefile b/lib/clang/liblldbUtility/Makefile
index 13ed72d..e5723b2 100644
--- a/lib/clang/liblldbUtility/Makefile
+++ b/lib/clang/liblldbUtility/Makefile
@@ -5,17 +5,13 @@
LIB= lldbUtility
SRCDIR= tools/lldb/source/Utility
-SRCS= ARM64_DWARF_Registers.cpp \
- ARM_DWARF_Registers.cpp \
+SRCS= ARM_DWARF_Registers.cpp \
KQueue.cpp \
PseudoTerminal.cpp \
Range.cpp \
- RegisterNumber.cpp \
SharingPtr.cpp \
StringExtractor.cpp \
StringExtractorGDBRemote.cpp \
- StringLexer.cpp \
- TimeSpecTimeout.cpp \
- UriParser.cpp
+ TimeSpecTimeout.cpp
.include "../lldb.lib.mk"
diff --git a/lib/clang/libllvmaarch64asmparser/Makefile b/lib/clang/libllvmaarch64asmparser/Makefile
deleted file mode 100644
index d93fb9a..0000000
--- a/lib/clang/libllvmaarch64asmparser/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= llvmaarch64asmparser
-
-SRCDIR= lib/Target/AArch64/AsmParser
-INCDIR= lib/Target/AArch64
-SRCS= AArch64AsmParser.cpp
-
-TGHDRS= AArch64GenAsmMatcher \
- AArch64GenInstrInfo \
- AArch64GenRegisterInfo \
- AArch64GenSubtargetInfo
-
-.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmaarch64codegen/Makefile b/lib/clang/libllvmaarch64codegen/Makefile
deleted file mode 100644
index db0023f..0000000
--- a/lib/clang/libllvmaarch64codegen/Makefile
+++ /dev/null
@@ -1,46 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= llvmaarch64codegen
-
-SRCDIR= lib/Target/AArch64
-SRCS= AArch64A53Fix835769.cpp \
- AArch64A57FPLoadBalancing.cpp \
- AArch64AddressTypePromotion.cpp \
- AArch64AdvSIMDScalarPass.cpp \
- AArch64AsmPrinter.cpp \
- AArch64BranchRelaxation.cpp \
- AArch64CleanupLocalDynamicTLSPass.cpp \
- AArch64CollectLOH.cpp \
- AArch64ConditionOptimizer.cpp \
- AArch64ConditionalCompares.cpp \
- AArch64DeadRegisterDefinitionsPass.cpp \
- AArch64ExpandPseudoInsts.cpp \
- AArch64FastISel.cpp \
- AArch64FrameLowering.cpp \
- AArch64ISelDAGToDAG.cpp \
- AArch64ISelLowering.cpp \
- AArch64InstrInfo.cpp \
- AArch64LoadStoreOptimizer.cpp \
- AArch64MCInstLower.cpp \
- AArch64PBQPRegAlloc.cpp \
- AArch64PromoteConstant.cpp \
- AArch64RegisterInfo.cpp \
- AArch64SelectionDAGInfo.cpp \
- AArch64StorePairSuppress.cpp \
- AArch64Subtarget.cpp \
- AArch64TargetMachine.cpp \
- AArch64TargetObjectFile.cpp \
- AArch64TargetTransformInfo.cpp
-
-TGHDRS= AArch64GenCallingConv \
- AArch64GenDAGISel \
- AArch64GenFastISel \
- AArch64GenInstrInfo \
- AArch64GenMCPseudoLowering \
- AArch64GenRegisterInfo \
- AArch64GenSubtargetInfo \
- Intrinsics
-
-.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmaarch64desc/Makefile b/lib/clang/libllvmaarch64desc/Makefile
deleted file mode 100644
index 041fbf2..0000000
--- a/lib/clang/libllvmaarch64desc/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= llvmaarch64desc
-
-SRCDIR= lib/Target/AArch64/MCTargetDesc
-SRCS= AArch64AsmBackend.cpp \
- AArch64ELFObjectWriter.cpp \
- AArch64ELFStreamer.cpp \
- AArch64MCAsmInfo.cpp \
- AArch64MCCodeEmitter.cpp \
- AArch64MCExpr.cpp \
- AArch64MCTargetDesc.cpp \
- AArch64MachObjectWriter.cpp \
- AArch64TargetStreamer.cpp
-CFLAGS+= -I${LLVM_SRCS}/${SRCDIR}/..
-
-TGHDRS= AArch64GenInstrInfo \
- AArch64GenMCCodeEmitter \
- AArch64GenRegisterInfo \
- AArch64GenSubtargetInfo
-
-.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmaarch64disassembler/Makefile b/lib/clang/libllvmaarch64disassembler/Makefile
deleted file mode 100644
index 0cf9658..0000000
--- a/lib/clang/libllvmaarch64disassembler/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# $FreeBSD$
-
-.include <src.opts.mk>
-
-LIB= llvmaarch64disassembler
-
-SRCDIR= lib/Target/AArch64/Disassembler
-INCDIR= lib/Target/AArch64
-SRCS= AArch64Disassembler.cpp
-
-.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no"
-SRCS+= AArch64ExternalSymbolizer.cpp
-.endif
-
-TGHDRS= AArch64GenDisassemblerTables \
- AArch64GenInstrInfo \
- AArch64GenRegisterInfo \
- AArch64GenSubtargetInfo
-
-.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmaarch64info/Makefile b/lib/clang/libllvmaarch64info/Makefile
deleted file mode 100644
index c62a6e1..0000000
--- a/lib/clang/libllvmaarch64info/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= llvmaarch64info
-
-SRCDIR= lib/Target/AArch64/TargetInfo
-INCDIR= lib/Target/AArch64
-SRCS= AArch64TargetInfo.cpp
-
-TGHDRS= AArch64GenInstrInfo \
- AArch64GenRegisterInfo \
- AArch64GenSubtargetInfo
-
-.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmaarch64instprinter/Makefile b/lib/clang/libllvmaarch64instprinter/Makefile
deleted file mode 100644
index c037dc8..0000000
--- a/lib/clang/libllvmaarch64instprinter/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= llvmaarch64instprinter
-
-SRCDIR= lib/Target/AArch64/InstPrinter
-INCDIR= lib/Target/AArch64
-SRCS= AArch64InstPrinter.cpp
-
-TGHDRS= AArch64GenAsmWriter \
- AArch64GenAsmWriter1 \
- AArch64GenInstrInfo \
- AArch64GenRegisterInfo \
- AArch64GenSubtargetInfo
-
-.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmaarch64utils/Makefile b/lib/clang/libllvmaarch64utils/Makefile
deleted file mode 100644
index d945927..0000000
--- a/lib/clang/libllvmaarch64utils/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= llvmaarch64utils
-
-SRCDIR= lib/Target/AArch64/Utils
-INCDIR= lib/Target/AArch64
-SRCS= AArch64BaseInfo.cpp
-
-TGHDRS= AArch64GenInstrInfo \
- AArch64GenRegisterInfo \
- AArch64GenSubtargetInfo
-
-.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmanalysis/Makefile b/lib/clang/libllvmanalysis/Makefile
index 7c81c5b..ea2a718 100644
--- a/lib/clang/libllvmanalysis/Makefile
+++ b/lib/clang/libllvmanalysis/Makefile
@@ -11,15 +11,10 @@ SRCS= AliasAnalysis.cpp \
AliasDebugger.cpp \
AliasSetTracker.cpp \
Analysis.cpp \
- AssumptionCache.cpp \
BasicAliasAnalysis.cpp \
- BlockFrequencyInfo.cpp \
- BlockFrequencyInfoImpl.cpp \
BranchProbabilityInfo.cpp \
CFG.cpp \
CFGPrinter.cpp \
- CFLAliasAnalysis.cpp \
- CGSCCPassManager.cpp \
CaptureTracking.cpp \
CodeMetrics.cpp \
ConstantFolding.cpp \
@@ -28,14 +23,11 @@ SRCS= AliasAnalysis.cpp \
DependenceAnalysis.cpp \
DomPrinter.cpp \
DominanceFrontier.cpp \
- FunctionTargetTransformInfo.cpp \
IVUsers.cpp \
InstCount.cpp \
InstructionSimplify.cpp \
Interval.cpp \
IntervalPartition.cpp \
- JumpInstrTableInfo.cpp \
- LazyCallGraph.cpp \
LazyValueInfo.cpp \
LibCallAliasAnalysis.cpp \
LibCallSemantics.cpp \
@@ -58,13 +50,16 @@ SRCS= AliasAnalysis.cpp \
ScalarEvolutionAliasAnalysis.cpp \
ScalarEvolutionExpander.cpp \
ScalarEvolutionNormalization.cpp \
- ScopedNoAliasAA.cpp \
SparsePropagation.cpp \
TargetTransformInfo.cpp \
Trace.cpp \
TypeBasedAliasAnalysis.cpp \
ValueTracking.cpp
+.if ${MK_CLANG_EXTRAS} != "no"
+SRCS+= BlockFrequencyInfo.cpp
+.endif
+
TGHDRS= Intrinsics
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmanalysis/Makefile.depend b/lib/clang/libllvmanalysis/Makefile.depend
new file mode 100644
index 0000000..ab902c2
--- /dev/null
+++ b/lib/clang/libllvmanalysis/Makefile.depend
@@ -0,0 +1,51 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AliasAnalysis.o: Intrinsics.inc.h
+AliasAnalysis.po: Intrinsics.inc.h
+AliasSetTracker.o: Intrinsics.inc.h
+AliasSetTracker.po: Intrinsics.inc.h
+BasicAliasAnalysis.o: Intrinsics.inc.h
+BasicAliasAnalysis.po: Intrinsics.inc.h
+CodeMetrics.o: Intrinsics.inc.h
+CodeMetrics.po: Intrinsics.inc.h
+ConstantFolding.o: Intrinsics.inc.h
+ConstantFolding.po: Intrinsics.inc.h
+CostModel.o: Intrinsics.inc.h
+CostModel.po: Intrinsics.inc.h
+InstCount.o: Intrinsics.inc.h
+InstCount.po: Intrinsics.inc.h
+InstructionSimplify.o: Intrinsics.inc.h
+InstructionSimplify.po: Intrinsics.inc.h
+LazyValueInfo.o: Intrinsics.inc.h
+LazyValueInfo.po: Intrinsics.inc.h
+Lint.o: Intrinsics.inc.h
+Lint.po: Intrinsics.inc.h
+Loads.o: Intrinsics.inc.h
+Loads.po: Intrinsics.inc.h
+MemoryBuiltins.o: Intrinsics.inc.h
+MemoryBuiltins.po: Intrinsics.inc.h
+MemoryDependenceAnalysis.o: Intrinsics.inc.h
+MemoryDependenceAnalysis.po: Intrinsics.inc.h
+PtrUseVisitor.o: Intrinsics.inc.h
+PtrUseVisitor.po: Intrinsics.inc.h
+ScalarEvolutionExpander.o: Intrinsics.inc.h
+ScalarEvolutionExpander.po: Intrinsics.inc.h
+TargetTransformInfo.o: Intrinsics.inc.h
+TargetTransformInfo.po: Intrinsics.inc.h
+ValueTracking.o: Intrinsics.inc.h
+ValueTracking.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmarmasmparser/Makefile.depend b/lib/clang/libllvmarmasmparser/Makefile.depend
new file mode 100644
index 0000000..3b15bee
--- /dev/null
+++ b/lib/clang/libllvmarmasmparser/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ARMAsmParser.o: ARMGenAsmMatcher.inc.h
+ARMAsmParser.o: ARMGenInstrInfo.inc.h
+ARMAsmParser.o: ARMGenRegisterInfo.inc.h
+ARMAsmParser.o: ARMGenSubtargetInfo.inc.h
+ARMAsmParser.po: ARMGenAsmMatcher.inc.h
+ARMAsmParser.po: ARMGenInstrInfo.inc.h
+ARMAsmParser.po: ARMGenRegisterInfo.inc.h
+ARMAsmParser.po: ARMGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmarmcodegen/Makefile b/lib/clang/libllvmarmcodegen/Makefile
index dc951e3..db57418 100644
--- a/lib/clang/libllvmarmcodegen/Makefile
+++ b/lib/clang/libllvmarmcodegen/Makefile
@@ -9,6 +9,7 @@ SRCS= A15SDOptimizer.cpp \
ARMAsmPrinter.cpp \
ARMBaseInstrInfo.cpp \
ARMBaseRegisterInfo.cpp \
+ ARMCodeEmitter.cpp \
ARMConstantIslandPass.cpp \
ARMConstantPoolValue.cpp \
ARMExpandPseudoInsts.cpp \
@@ -18,11 +19,11 @@ SRCS= A15SDOptimizer.cpp \
ARMISelDAGToDAG.cpp \
ARMISelLowering.cpp \
ARMInstrInfo.cpp \
+ ARMJITInfo.cpp \
ARMLoadStoreOptimizer.cpp \
ARMMCInstLower.cpp \
ARMMachineFunctionInfo.cpp \
ARMRegisterInfo.cpp \
- ARMOptimizeBarriersPass.cpp \
ARMSelectionDAGInfo.cpp \
ARMSubtarget.cpp \
ARMTargetMachine.cpp \
diff --git a/lib/clang/libllvmarmcodegen/Makefile.depend b/lib/clang/libllvmarmcodegen/Makefile.depend
new file mode 100644
index 0000000..5a85191
--- /dev/null
+++ b/lib/clang/libllvmarmcodegen/Makefile.depend
@@ -0,0 +1,223 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+A15SDOptimizer.o: ARMGenInstrInfo.inc.h
+A15SDOptimizer.o: ARMGenRegisterInfo.inc.h
+A15SDOptimizer.o: ARMGenSubtargetInfo.inc.h
+A15SDOptimizer.po: ARMGenInstrInfo.inc.h
+A15SDOptimizer.po: ARMGenRegisterInfo.inc.h
+A15SDOptimizer.po: ARMGenSubtargetInfo.inc.h
+ARMAsmPrinter.o: ARMGenInstrInfo.inc.h
+ARMAsmPrinter.o: ARMGenMCPseudoLowering.inc.h
+ARMAsmPrinter.o: ARMGenRegisterInfo.inc.h
+ARMAsmPrinter.o: ARMGenSubtargetInfo.inc.h
+ARMAsmPrinter.po: ARMGenInstrInfo.inc.h
+ARMAsmPrinter.po: ARMGenMCPseudoLowering.inc.h
+ARMAsmPrinter.po: ARMGenRegisterInfo.inc.h
+ARMAsmPrinter.po: ARMGenSubtargetInfo.inc.h
+ARMBaseInstrInfo.o: ARMGenInstrInfo.inc.h
+ARMBaseInstrInfo.o: ARMGenRegisterInfo.inc.h
+ARMBaseInstrInfo.o: ARMGenSubtargetInfo.inc.h
+ARMBaseInstrInfo.po: ARMGenInstrInfo.inc.h
+ARMBaseInstrInfo.po: ARMGenRegisterInfo.inc.h
+ARMBaseInstrInfo.po: ARMGenSubtargetInfo.inc.h
+ARMBaseRegisterInfo.o: ARMGenInstrInfo.inc.h
+ARMBaseRegisterInfo.o: ARMGenRegisterInfo.inc.h
+ARMBaseRegisterInfo.o: ARMGenSubtargetInfo.inc.h
+ARMBaseRegisterInfo.po: ARMGenInstrInfo.inc.h
+ARMBaseRegisterInfo.po: ARMGenRegisterInfo.inc.h
+ARMBaseRegisterInfo.po: ARMGenSubtargetInfo.inc.h
+ARMCodeEmitter.o: ARMGenCodeEmitter.inc.h
+ARMCodeEmitter.o: ARMGenInstrInfo.inc.h
+ARMCodeEmitter.o: ARMGenRegisterInfo.inc.h
+ARMCodeEmitter.o: ARMGenSubtargetInfo.inc.h
+ARMCodeEmitter.po: ARMGenCodeEmitter.inc.h
+ARMCodeEmitter.po: ARMGenInstrInfo.inc.h
+ARMCodeEmitter.po: ARMGenRegisterInfo.inc.h
+ARMCodeEmitter.po: ARMGenSubtargetInfo.inc.h
+ARMConstantIslandPass.o: ARMGenInstrInfo.inc.h
+ARMConstantIslandPass.o: ARMGenRegisterInfo.inc.h
+ARMConstantIslandPass.o: ARMGenSubtargetInfo.inc.h
+ARMConstantIslandPass.po: ARMGenInstrInfo.inc.h
+ARMConstantIslandPass.po: ARMGenRegisterInfo.inc.h
+ARMConstantIslandPass.po: ARMGenSubtargetInfo.inc.h
+ARMExpandPseudoInsts.o: ARMGenInstrInfo.inc.h
+ARMExpandPseudoInsts.o: ARMGenRegisterInfo.inc.h
+ARMExpandPseudoInsts.o: ARMGenSubtargetInfo.inc.h
+ARMExpandPseudoInsts.po: ARMGenInstrInfo.inc.h
+ARMExpandPseudoInsts.po: ARMGenRegisterInfo.inc.h
+ARMExpandPseudoInsts.po: ARMGenSubtargetInfo.inc.h
+ARMFastISel.o: ARMGenCallingConv.inc.h
+ARMFastISel.o: ARMGenFastISel.inc.h
+ARMFastISel.o: ARMGenInstrInfo.inc.h
+ARMFastISel.o: ARMGenRegisterInfo.inc.h
+ARMFastISel.o: ARMGenSubtargetInfo.inc.h
+ARMFastISel.o: Intrinsics.inc.h
+ARMFastISel.po: ARMGenCallingConv.inc.h
+ARMFastISel.po: ARMGenFastISel.inc.h
+ARMFastISel.po: ARMGenInstrInfo.inc.h
+ARMFastISel.po: ARMGenRegisterInfo.inc.h
+ARMFastISel.po: ARMGenSubtargetInfo.inc.h
+ARMFastISel.po: Intrinsics.inc.h
+ARMFrameLowering.o: ARMGenInstrInfo.inc.h
+ARMFrameLowering.o: ARMGenRegisterInfo.inc.h
+ARMFrameLowering.o: ARMGenSubtargetInfo.inc.h
+ARMFrameLowering.po: ARMGenInstrInfo.inc.h
+ARMFrameLowering.po: ARMGenRegisterInfo.inc.h
+ARMFrameLowering.po: ARMGenSubtargetInfo.inc.h
+ARMHazardRecognizer.o: ARMGenInstrInfo.inc.h
+ARMHazardRecognizer.o: ARMGenRegisterInfo.inc.h
+ARMHazardRecognizer.o: ARMGenSubtargetInfo.inc.h
+ARMHazardRecognizer.po: ARMGenInstrInfo.inc.h
+ARMHazardRecognizer.po: ARMGenRegisterInfo.inc.h
+ARMHazardRecognizer.po: ARMGenSubtargetInfo.inc.h
+ARMISelDAGToDAG.o: ARMGenDAGISel.inc.h
+ARMISelDAGToDAG.o: ARMGenInstrInfo.inc.h
+ARMISelDAGToDAG.o: ARMGenRegisterInfo.inc.h
+ARMISelDAGToDAG.o: ARMGenSubtargetInfo.inc.h
+ARMISelDAGToDAG.o: Intrinsics.inc.h
+ARMISelDAGToDAG.po: ARMGenDAGISel.inc.h
+ARMISelDAGToDAG.po: ARMGenInstrInfo.inc.h
+ARMISelDAGToDAG.po: ARMGenRegisterInfo.inc.h
+ARMISelDAGToDAG.po: ARMGenSubtargetInfo.inc.h
+ARMISelDAGToDAG.po: Intrinsics.inc.h
+ARMISelLowering.o: ARMGenCallingConv.inc.h
+ARMISelLowering.o: ARMGenInstrInfo.inc.h
+ARMISelLowering.o: ARMGenRegisterInfo.inc.h
+ARMISelLowering.o: ARMGenSubtargetInfo.inc.h
+ARMISelLowering.o: Intrinsics.inc.h
+ARMISelLowering.po: ARMGenCallingConv.inc.h
+ARMISelLowering.po: ARMGenInstrInfo.inc.h
+ARMISelLowering.po: ARMGenRegisterInfo.inc.h
+ARMISelLowering.po: ARMGenSubtargetInfo.inc.h
+ARMISelLowering.po: Intrinsics.inc.h
+ARMInstrInfo.o: ARMGenInstrInfo.inc.h
+ARMInstrInfo.o: ARMGenRegisterInfo.inc.h
+ARMInstrInfo.o: ARMGenSubtargetInfo.inc.h
+ARMInstrInfo.po: ARMGenInstrInfo.inc.h
+ARMInstrInfo.po: ARMGenRegisterInfo.inc.h
+ARMInstrInfo.po: ARMGenSubtargetInfo.inc.h
+ARMJITInfo.o: ARMGenInstrInfo.inc.h
+ARMJITInfo.o: ARMGenRegisterInfo.inc.h
+ARMJITInfo.o: ARMGenSubtargetInfo.inc.h
+ARMJITInfo.po: ARMGenInstrInfo.inc.h
+ARMJITInfo.po: ARMGenRegisterInfo.inc.h
+ARMJITInfo.po: ARMGenSubtargetInfo.inc.h
+ARMLoadStoreOptimizer.o: ARMGenInstrInfo.inc.h
+ARMLoadStoreOptimizer.o: ARMGenRegisterInfo.inc.h
+ARMLoadStoreOptimizer.o: ARMGenSubtargetInfo.inc.h
+ARMLoadStoreOptimizer.po: ARMGenInstrInfo.inc.h
+ARMLoadStoreOptimizer.po: ARMGenRegisterInfo.inc.h
+ARMLoadStoreOptimizer.po: ARMGenSubtargetInfo.inc.h
+ARMMCInstLower.o: ARMGenInstrInfo.inc.h
+ARMMCInstLower.o: ARMGenRegisterInfo.inc.h
+ARMMCInstLower.o: ARMGenSubtargetInfo.inc.h
+ARMMCInstLower.po: ARMGenInstrInfo.inc.h
+ARMMCInstLower.po: ARMGenRegisterInfo.inc.h
+ARMMCInstLower.po: ARMGenSubtargetInfo.inc.h
+ARMMachineFunctionInfo.o: ARMGenInstrInfo.inc.h
+ARMMachineFunctionInfo.o: ARMGenRegisterInfo.inc.h
+ARMMachineFunctionInfo.o: ARMGenSubtargetInfo.inc.h
+ARMMachineFunctionInfo.po: ARMGenInstrInfo.inc.h
+ARMMachineFunctionInfo.po: ARMGenRegisterInfo.inc.h
+ARMMachineFunctionInfo.po: ARMGenSubtargetInfo.inc.h
+ARMRegisterInfo.o: ARMGenInstrInfo.inc.h
+ARMRegisterInfo.o: ARMGenRegisterInfo.inc.h
+ARMRegisterInfo.o: ARMGenSubtargetInfo.inc.h
+ARMRegisterInfo.po: ARMGenInstrInfo.inc.h
+ARMRegisterInfo.po: ARMGenRegisterInfo.inc.h
+ARMRegisterInfo.po: ARMGenSubtargetInfo.inc.h
+ARMSelectionDAGInfo.o: ARMGenInstrInfo.inc.h
+ARMSelectionDAGInfo.o: ARMGenRegisterInfo.inc.h
+ARMSelectionDAGInfo.o: ARMGenSubtargetInfo.inc.h
+ARMSelectionDAGInfo.po: ARMGenInstrInfo.inc.h
+ARMSelectionDAGInfo.po: ARMGenRegisterInfo.inc.h
+ARMSelectionDAGInfo.po: ARMGenSubtargetInfo.inc.h
+ARMSubtarget.o: ARMGenInstrInfo.inc.h
+ARMSubtarget.o: ARMGenRegisterInfo.inc.h
+ARMSubtarget.o: ARMGenSubtargetInfo.inc.h
+ARMSubtarget.po: ARMGenInstrInfo.inc.h
+ARMSubtarget.po: ARMGenRegisterInfo.inc.h
+ARMSubtarget.po: ARMGenSubtargetInfo.inc.h
+ARMTargetMachine.o: ARMGenInstrInfo.inc.h
+ARMTargetMachine.o: ARMGenRegisterInfo.inc.h
+ARMTargetMachine.o: ARMGenSubtargetInfo.inc.h
+ARMTargetMachine.po: ARMGenInstrInfo.inc.h
+ARMTargetMachine.po: ARMGenRegisterInfo.inc.h
+ARMTargetMachine.po: ARMGenSubtargetInfo.inc.h
+ARMTargetObjectFile.o: ARMGenInstrInfo.inc.h
+ARMTargetObjectFile.o: ARMGenRegisterInfo.inc.h
+ARMTargetObjectFile.o: ARMGenSubtargetInfo.inc.h
+ARMTargetObjectFile.po: ARMGenInstrInfo.inc.h
+ARMTargetObjectFile.po: ARMGenRegisterInfo.inc.h
+ARMTargetObjectFile.po: ARMGenSubtargetInfo.inc.h
+ARMTargetTransformInfo.o: ARMGenInstrInfo.inc.h
+ARMTargetTransformInfo.o: ARMGenRegisterInfo.inc.h
+ARMTargetTransformInfo.o: ARMGenSubtargetInfo.inc.h
+ARMTargetTransformInfo.o: Intrinsics.inc.h
+ARMTargetTransformInfo.po: ARMGenInstrInfo.inc.h
+ARMTargetTransformInfo.po: ARMGenRegisterInfo.inc.h
+ARMTargetTransformInfo.po: ARMGenSubtargetInfo.inc.h
+ARMTargetTransformInfo.po: Intrinsics.inc.h
+MLxExpansionPass.o: ARMGenInstrInfo.inc.h
+MLxExpansionPass.o: ARMGenRegisterInfo.inc.h
+MLxExpansionPass.o: ARMGenSubtargetInfo.inc.h
+MLxExpansionPass.po: ARMGenInstrInfo.inc.h
+MLxExpansionPass.po: ARMGenRegisterInfo.inc.h
+MLxExpansionPass.po: ARMGenSubtargetInfo.inc.h
+Thumb1FrameLowering.o: ARMGenInstrInfo.inc.h
+Thumb1FrameLowering.o: ARMGenRegisterInfo.inc.h
+Thumb1FrameLowering.o: ARMGenSubtargetInfo.inc.h
+Thumb1FrameLowering.po: ARMGenInstrInfo.inc.h
+Thumb1FrameLowering.po: ARMGenRegisterInfo.inc.h
+Thumb1FrameLowering.po: ARMGenSubtargetInfo.inc.h
+Thumb1InstrInfo.o: ARMGenInstrInfo.inc.h
+Thumb1InstrInfo.o: ARMGenRegisterInfo.inc.h
+Thumb1InstrInfo.o: ARMGenSubtargetInfo.inc.h
+Thumb1InstrInfo.po: ARMGenInstrInfo.inc.h
+Thumb1InstrInfo.po: ARMGenRegisterInfo.inc.h
+Thumb1InstrInfo.po: ARMGenSubtargetInfo.inc.h
+Thumb1RegisterInfo.o: ARMGenInstrInfo.inc.h
+Thumb1RegisterInfo.o: ARMGenRegisterInfo.inc.h
+Thumb1RegisterInfo.o: ARMGenSubtargetInfo.inc.h
+Thumb1RegisterInfo.po: ARMGenInstrInfo.inc.h
+Thumb1RegisterInfo.po: ARMGenRegisterInfo.inc.h
+Thumb1RegisterInfo.po: ARMGenSubtargetInfo.inc.h
+Thumb2ITBlockPass.o: ARMGenInstrInfo.inc.h
+Thumb2ITBlockPass.o: ARMGenRegisterInfo.inc.h
+Thumb2ITBlockPass.o: ARMGenSubtargetInfo.inc.h
+Thumb2ITBlockPass.po: ARMGenInstrInfo.inc.h
+Thumb2ITBlockPass.po: ARMGenRegisterInfo.inc.h
+Thumb2ITBlockPass.po: ARMGenSubtargetInfo.inc.h
+Thumb2InstrInfo.o: ARMGenInstrInfo.inc.h
+Thumb2InstrInfo.o: ARMGenRegisterInfo.inc.h
+Thumb2InstrInfo.o: ARMGenSubtargetInfo.inc.h
+Thumb2InstrInfo.po: ARMGenInstrInfo.inc.h
+Thumb2InstrInfo.po: ARMGenRegisterInfo.inc.h
+Thumb2InstrInfo.po: ARMGenSubtargetInfo.inc.h
+Thumb2RegisterInfo.o: ARMGenInstrInfo.inc.h
+Thumb2RegisterInfo.o: ARMGenRegisterInfo.inc.h
+Thumb2RegisterInfo.o: ARMGenSubtargetInfo.inc.h
+Thumb2RegisterInfo.po: ARMGenInstrInfo.inc.h
+Thumb2RegisterInfo.po: ARMGenRegisterInfo.inc.h
+Thumb2RegisterInfo.po: ARMGenSubtargetInfo.inc.h
+Thumb2SizeReduction.o: ARMGenInstrInfo.inc.h
+Thumb2SizeReduction.o: ARMGenRegisterInfo.inc.h
+Thumb2SizeReduction.o: ARMGenSubtargetInfo.inc.h
+Thumb2SizeReduction.po: ARMGenInstrInfo.inc.h
+Thumb2SizeReduction.po: ARMGenRegisterInfo.inc.h
+Thumb2SizeReduction.po: ARMGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmarmdesc/Makefile b/lib/clang/libllvmarmdesc/Makefile
index 42c3f5c..73999ad 100644
--- a/lib/clang/libllvmarmdesc/Makefile
+++ b/lib/clang/libllvmarmdesc/Makefile
@@ -7,7 +7,6 @@ LIB= llvmarmdesc
SRCDIR= lib/Target/ARM/MCTargetDesc
SRCS= ARMAsmBackend.cpp \
ARMELFObjectWriter.cpp \
- ARMELFObjectWriter.cpp \
ARMELFStreamer.cpp \
ARMMCAsmInfo.cpp \
ARMMCCodeEmitter.cpp \
@@ -15,10 +14,7 @@ SRCS= ARMAsmBackend.cpp \
ARMMCTargetDesc.cpp \
ARMMachORelocationInfo.cpp \
ARMMachObjectWriter.cpp \
- ARMTargetStreamer.cpp \
- ARMUnwindOpAsm.cpp \
- ARMWinCOFFObjectWriter.cpp \
- ARMWinCOFFStreamer.cpp
+ ARMUnwindOpAsm.cpp
CFLAGS+= -I${LLVM_SRCS}/${SRCDIR}/..
TGHDRS= ARMGenInstrInfo \
diff --git a/lib/clang/libllvmarmdesc/Makefile.depend b/lib/clang/libllvmarmdesc/Makefile.depend
new file mode 100644
index 0000000..a3c2760
--- /dev/null
+++ b/lib/clang/libllvmarmdesc/Makefile.depend
@@ -0,0 +1,61 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ARMAsmBackend.o: ARMGenInstrInfo.inc.h
+ARMAsmBackend.o: ARMGenRegisterInfo.inc.h
+ARMAsmBackend.o: ARMGenSubtargetInfo.inc.h
+ARMAsmBackend.po: ARMGenInstrInfo.inc.h
+ARMAsmBackend.po: ARMGenRegisterInfo.inc.h
+ARMAsmBackend.po: ARMGenSubtargetInfo.inc.h
+ARMELFObjectWriter.o: ARMGenInstrInfo.inc.h
+ARMELFObjectWriter.o: ARMGenRegisterInfo.inc.h
+ARMELFObjectWriter.o: ARMGenSubtargetInfo.inc.h
+ARMELFObjectWriter.po: ARMGenInstrInfo.inc.h
+ARMELFObjectWriter.po: ARMGenRegisterInfo.inc.h
+ARMELFObjectWriter.po: ARMGenSubtargetInfo.inc.h
+ARMELFStreamer.o: ARMGenInstrInfo.inc.h
+ARMELFStreamer.o: ARMGenRegisterInfo.inc.h
+ARMELFStreamer.o: ARMGenSubtargetInfo.inc.h
+ARMELFStreamer.po: ARMGenInstrInfo.inc.h
+ARMELFStreamer.po: ARMGenRegisterInfo.inc.h
+ARMELFStreamer.po: ARMGenSubtargetInfo.inc.h
+ARMMCCodeEmitter.o: ARMGenInstrInfo.inc.h
+ARMMCCodeEmitter.o: ARMGenMCCodeEmitter.inc.h
+ARMMCCodeEmitter.o: ARMGenRegisterInfo.inc.h
+ARMMCCodeEmitter.o: ARMGenSubtargetInfo.inc.h
+ARMMCCodeEmitter.po: ARMGenInstrInfo.inc.h
+ARMMCCodeEmitter.po: ARMGenMCCodeEmitter.inc.h
+ARMMCCodeEmitter.po: ARMGenRegisterInfo.inc.h
+ARMMCCodeEmitter.po: ARMGenSubtargetInfo.inc.h
+ARMMCTargetDesc.o: ARMGenInstrInfo.inc.h
+ARMMCTargetDesc.o: ARMGenRegisterInfo.inc.h
+ARMMCTargetDesc.o: ARMGenSubtargetInfo.inc.h
+ARMMCTargetDesc.po: ARMGenInstrInfo.inc.h
+ARMMCTargetDesc.po: ARMGenRegisterInfo.inc.h
+ARMMCTargetDesc.po: ARMGenSubtargetInfo.inc.h
+ARMMachORelocationInfo.o: ARMGenInstrInfo.inc.h
+ARMMachORelocationInfo.o: ARMGenRegisterInfo.inc.h
+ARMMachORelocationInfo.o: ARMGenSubtargetInfo.inc.h
+ARMMachORelocationInfo.po: ARMGenInstrInfo.inc.h
+ARMMachORelocationInfo.po: ARMGenRegisterInfo.inc.h
+ARMMachORelocationInfo.po: ARMGenSubtargetInfo.inc.h
+ARMMachObjectWriter.o: ARMGenInstrInfo.inc.h
+ARMMachObjectWriter.o: ARMGenRegisterInfo.inc.h
+ARMMachObjectWriter.o: ARMGenSubtargetInfo.inc.h
+ARMMachObjectWriter.po: ARMGenInstrInfo.inc.h
+ARMMachObjectWriter.po: ARMGenRegisterInfo.inc.h
+ARMMachObjectWriter.po: ARMGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmarmdisassembler/Makefile.depend b/lib/clang/libllvmarmdisassembler/Makefile.depend
new file mode 100644
index 0000000..38ea1cb
--- /dev/null
+++ b/lib/clang/libllvmarmdisassembler/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ARMDisassembler.o: ARMGenDisassemblerTables.inc.h
+ARMDisassembler.o: ARMGenInstrInfo.inc.h
+ARMDisassembler.o: ARMGenRegisterInfo.inc.h
+ARMDisassembler.o: ARMGenSubtargetInfo.inc.h
+ARMDisassembler.po: ARMGenDisassemblerTables.inc.h
+ARMDisassembler.po: ARMGenInstrInfo.inc.h
+ARMDisassembler.po: ARMGenRegisterInfo.inc.h
+ARMDisassembler.po: ARMGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmarminfo/Makefile.depend b/lib/clang/libllvmarminfo/Makefile.depend
new file mode 100644
index 0000000..794d0ae
--- /dev/null
+++ b/lib/clang/libllvmarminfo/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ARMTargetInfo.o: ARMGenInstrInfo.inc.h
+ARMTargetInfo.o: ARMGenRegisterInfo.inc.h
+ARMTargetInfo.o: ARMGenSubtargetInfo.inc.h
+ARMTargetInfo.po: ARMGenInstrInfo.inc.h
+ARMTargetInfo.po: ARMGenRegisterInfo.inc.h
+ARMTargetInfo.po: ARMGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmarminstprinter/Makefile.depend b/lib/clang/libllvmarminstprinter/Makefile.depend
new file mode 100644
index 0000000..87d7ea9
--- /dev/null
+++ b/lib/clang/libllvmarminstprinter/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ARMInstPrinter.o: ARMGenAsmWriter.inc.h
+ARMInstPrinter.o: ARMGenInstrInfo.inc.h
+ARMInstPrinter.o: ARMGenRegisterInfo.inc.h
+ARMInstPrinter.o: ARMGenSubtargetInfo.inc.h
+ARMInstPrinter.po: ARMGenAsmWriter.inc.h
+ARMInstPrinter.po: ARMGenInstrInfo.inc.h
+ARMInstPrinter.po: ARMGenRegisterInfo.inc.h
+ARMInstPrinter.po: ARMGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmasmparser/Makefile.depend b/lib/clang/libllvmasmparser/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmasmparser/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmasmprinter/Makefile b/lib/clang/libllvmasmprinter/Makefile
index 4ff6f22..afb0ecf 100644
--- a/lib/clang/libllvmasmprinter/Makefile
+++ b/lib/clang/libllvmasmprinter/Makefile
@@ -6,26 +6,19 @@ LIB= llvmasmprinter
SRCDIR= lib/CodeGen/AsmPrinter
SRCS= ARMException.cpp \
- AddressPool.cpp \
AsmPrinter.cpp \
AsmPrinterDwarf.cpp \
AsmPrinterInlineAsm.cpp \
DIE.cpp \
DIEHash.cpp \
- DbgValueHistoryCalculator.cpp \
DwarfAccelTable.cpp \
DwarfCFIException.cpp \
DwarfCompileUnit.cpp \
DwarfDebug.cpp \
- DwarfExpression.cpp \
- DwarfFile.cpp \
- DwarfStringPool.cpp \
- DwarfUnit.cpp \
- EHStreamer.cpp \
+ DwarfException.cpp \
ErlangGCPrinter.cpp \
OcamlGCPrinter.cpp \
- Win64Exception.cpp \
- WinCodeViewLineTables.cpp
+ Win64Exception.cpp
TGHDRS= Intrinsics
diff --git a/lib/clang/libllvmasmprinter/Makefile.depend b/lib/clang/libllvmasmprinter/Makefile.depend
new file mode 100644
index 0000000..33dfbf9
--- /dev/null
+++ b/lib/clang/libllvmasmprinter/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ErlangGCPrinter.o: Intrinsics.inc.h
+ErlangGCPrinter.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmbitreader/Makefile.depend b/lib/clang/libllvmbitreader/Makefile.depend
new file mode 100644
index 0000000..edbadfd
--- /dev/null
+++ b/lib/clang/libllvmbitreader/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+BitcodeReader.o: Intrinsics.inc.h
+BitcodeReader.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmbitwriter/Makefile.depend b/lib/clang/libllvmbitwriter/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmbitwriter/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmcodegen/Makefile b/lib/clang/libllvmcodegen/Makefile
index d5d8e43..e43f39d 100644
--- a/lib/clang/libllvmcodegen/Makefile
+++ b/lib/clang/libllvmcodegen/Makefile
@@ -8,13 +8,11 @@ SRCDIR= lib/CodeGen
SRCS= AggressiveAntiDepBreaker.cpp \
AllocationOrder.cpp \
Analysis.cpp \
- AtomicExpandPass.cpp \
BasicTargetTransformInfo.cpp \
BranchFolding.cpp \
CalcSpillWeights.cpp \
CallingConvLower.cpp \
CodeGen.cpp \
- CodeGenPrepare.cpp \
CriticalAntiDepBreaker.cpp \
DFAPacketizer.cpp \
DeadMachineInstructionElim.cpp \
@@ -25,16 +23,14 @@ SRCS= AggressiveAntiDepBreaker.cpp \
ExecutionDepsFix.cpp \
ExpandISelPseudos.cpp \
ExpandPostRAPseudos.cpp \
- ForwardControlFlowIntegrity.cpp \
GCMetadata.cpp \
GCMetadataPrinter.cpp \
GCStrategy.cpp \
- GlobalMerge.cpp \
IfConversion.cpp \
InlineSpiller.cpp \
InterferenceCache.cpp \
IntrinsicLowering.cpp \
- JumpInstrTables.cpp \
+ JITCodeEmitter.cpp \
LLVMTargetMachine.cpp \
LatencyPriorityQueue.cpp \
LexicalScopes.cpp \
@@ -42,10 +38,10 @@ SRCS= AggressiveAntiDepBreaker.cpp \
LiveInterval.cpp \
LiveIntervalAnalysis.cpp \
LiveIntervalUnion.cpp \
- LivePhysRegs.cpp \
LiveRangeCalc.cpp \
LiveRangeEdit.cpp \
LiveRegMatrix.cpp \
+ LiveRegUnits.cpp \
LiveStackAnalysis.cpp \
LiveVariables.cpp \
LocalStackSlotAllocation.cpp \
@@ -54,9 +50,8 @@ SRCS= AggressiveAntiDepBreaker.cpp \
MachineBlockPlacement.cpp \
MachineBranchProbabilityInfo.cpp \
MachineCSE.cpp \
- MachineCombiner.cpp \
+ MachineCodeEmitter.cpp \
MachineCopyPropagation.cpp \
- MachineDominanceFrontier.cpp \
MachineDominators.cpp \
MachineFunction.cpp \
MachineFunctionAnalysis.cpp \
@@ -70,7 +65,6 @@ SRCS= AggressiveAntiDepBreaker.cpp \
MachineModuleInfoImpls.cpp \
MachinePassRegistry.cpp \
MachinePostDominators.cpp \
- MachineRegionInfo.cpp \
MachineRegisterInfo.cpp \
MachineSSAUpdater.cpp \
MachineScheduler.cpp \
@@ -104,13 +98,12 @@ SRCS= AggressiveAntiDepBreaker.cpp \
SjLjEHPrepare.cpp \
SlotIndexes.cpp \
SpillPlacement.cpp \
+ Spiller.cpp \
SplitKit.cpp \
StackColoring.cpp \
- StackMapLivenessAnalysis.cpp \
StackMaps.cpp \
StackProtector.cpp \
StackSlotColoring.cpp \
- StatepointExampleGC.cpp \
TailDuplication.cpp \
TargetFrameLoweringImpl.cpp \
TargetInstrInfo.cpp \
diff --git a/lib/clang/libllvmcodegen/Makefile.depend b/lib/clang/libllvmcodegen/Makefile.depend
new file mode 100644
index 0000000..0dda0fd
--- /dev/null
+++ b/lib/clang/libllvmcodegen/Makefile.depend
@@ -0,0 +1,35 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+Analysis.o: Intrinsics.inc.h
+Analysis.po: Intrinsics.inc.h
+BasicTargetTransformInfo.o: Intrinsics.inc.h
+BasicTargetTransformInfo.po: Intrinsics.inc.h
+DwarfEHPrepare.o: Intrinsics.inc.h
+DwarfEHPrepare.po: Intrinsics.inc.h
+GCStrategy.o: Intrinsics.inc.h
+GCStrategy.po: Intrinsics.inc.h
+IntrinsicLowering.o: Intrinsics.inc.h
+IntrinsicLowering.po: Intrinsics.inc.h
+LocalStackSlotAllocation.o: Intrinsics.inc.h
+LocalStackSlotAllocation.po: Intrinsics.inc.h
+ShadowStackGC.o: Intrinsics.inc.h
+ShadowStackGC.po: Intrinsics.inc.h
+SjLjEHPrepare.o: Intrinsics.inc.h
+SjLjEHPrepare.po: Intrinsics.inc.h
+StackProtector.o: Intrinsics.inc.h
+StackProtector.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmcore/Makefile b/lib/clang/libllvmcore/Makefile
index 921d0be..137b1c3 100644
--- a/lib/clang/libllvmcore/Makefile
+++ b/lib/clang/libllvmcore/Makefile
@@ -9,44 +9,36 @@ SRCS= AsmWriter.cpp \
Attributes.cpp \
AutoUpgrade.cpp \
BasicBlock.cpp \
- Comdat.cpp \
ConstantFold.cpp \
- ConstantRange.cpp \
Constants.cpp \
Core.cpp \
DIBuilder.cpp \
DataLayout.cpp \
DebugInfo.cpp \
DebugLoc.cpp \
- DiagnosticInfo.cpp \
- DiagnosticPrinter.cpp \
Dominators.cpp \
Function.cpp \
GCOV.cpp \
GVMaterializer.cpp \
Globals.cpp \
IRBuilder.cpp \
- IRPrintingPasses.cpp \
InlineAsm.cpp \
Instruction.cpp \
Instructions.cpp \
IntrinsicInst.cpp \
LLVMContext.cpp \
LLVMContextImpl.cpp \
+ LeakDetector.cpp \
LegacyPassManager.cpp \
- MDBuilder.cpp \
- Mangler.cpp \
Metadata.cpp \
- MetadataTracking.cpp \
Module.cpp \
Pass.cpp \
PassManager.cpp \
PassRegistry.cpp \
- Statepoint.cpp \
+ PrintModulePass.cpp \
Type.cpp \
TypeFinder.cpp \
Use.cpp \
- UseListOrder.cpp \
User.cpp \
Value.cpp \
ValueSymbolTable.cpp \
diff --git a/lib/clang/libllvmcore/Makefile.depend b/lib/clang/libllvmcore/Makefile.depend
new file mode 100644
index 0000000..0b232ec
--- /dev/null
+++ b/lib/clang/libllvmcore/Makefile.depend
@@ -0,0 +1,37 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AsmWriter.o: Intrinsics.inc.h
+AsmWriter.po: Intrinsics.inc.h
+AutoUpgrade.o: Intrinsics.inc.h
+AutoUpgrade.po: Intrinsics.inc.h
+BasicBlock.o: Intrinsics.inc.h
+BasicBlock.po: Intrinsics.inc.h
+Core.o: Intrinsics.inc.h
+Core.po: Intrinsics.inc.h
+DIBuilder.o: Intrinsics.inc.h
+DIBuilder.po: Intrinsics.inc.h
+DebugInfo.o: Intrinsics.inc.h
+DebugInfo.po: Intrinsics.inc.h
+Function.o: Intrinsics.inc.h
+Function.po: Intrinsics.inc.h
+IRBuilder.o: Intrinsics.inc.h
+IRBuilder.po: Intrinsics.inc.h
+IntrinsicInst.o: Intrinsics.inc.h
+IntrinsicInst.po: Intrinsics.inc.h
+Verifier.o: Intrinsics.inc.h
+Verifier.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmdebuginfo/Makefile b/lib/clang/libllvmdebuginfo/Makefile
index 3cee40e..c8039dc 100644
--- a/lib/clang/libllvmdebuginfo/Makefile
+++ b/lib/clang/libllvmdebuginfo/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <src.opts.mk>
+.include <bsd.own.mk>
LIB= llvmdebuginfo
@@ -21,9 +21,4 @@ SRCS= DIContext.cpp \
DWARFTypeUnit.cpp \
DWARFUnit.cpp
-.if ${MK_CLANG_EXTRAS} != "no"
-SRCS+= DWARFAcceleratorTable.cpp \
- SyntaxHighlighting.cpp
-.endif
-
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmdebuginfo/Makefile.depend b/lib/clang/libllvmdebuginfo/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmdebuginfo/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmexecutionengine/Makefile b/lib/clang/libllvmexecutionengine/Makefile
index 5a7e6c3..382dd88 100644
--- a/lib/clang/libllvmexecutionengine/Makefile
+++ b/lib/clang/libllvmexecutionengine/Makefile
@@ -7,7 +7,7 @@ LIB= llvmexecutionengine
SRCDIR= lib/ExecutionEngine
SRCS= ExecutionEngine.cpp \
ExecutionEngineBindings.cpp \
- GDBRegistrationListener.cpp \
+ RTDyldMemoryManager.cpp \
TargetSelect.cpp
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmexecutionengine/Makefile.depend b/lib/clang/libllvmexecutionengine/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmexecutionengine/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvminstcombine/Makefile.depend b/lib/clang/libllvminstcombine/Makefile.depend
new file mode 100644
index 0000000..2910d05
--- /dev/null
+++ b/lib/clang/libllvminstcombine/Makefile.depend
@@ -0,0 +1,43 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+InstCombineAddSub.o: Intrinsics.inc.h
+InstCombineAddSub.po: Intrinsics.inc.h
+InstCombineAndOrXor.o: Intrinsics.inc.h
+InstCombineAndOrXor.po: Intrinsics.inc.h
+InstCombineCalls.o: Intrinsics.inc.h
+InstCombineCalls.po: Intrinsics.inc.h
+InstCombineCasts.o: Intrinsics.inc.h
+InstCombineCasts.po: Intrinsics.inc.h
+InstCombineCompares.o: Intrinsics.inc.h
+InstCombineCompares.po: Intrinsics.inc.h
+InstCombineLoadStoreAlloca.o: Intrinsics.inc.h
+InstCombineLoadStoreAlloca.po: Intrinsics.inc.h
+InstCombineMulDivRem.o: Intrinsics.inc.h
+InstCombineMulDivRem.po: Intrinsics.inc.h
+InstCombinePHI.o: Intrinsics.inc.h
+InstCombinePHI.po: Intrinsics.inc.h
+InstCombineSelect.o: Intrinsics.inc.h
+InstCombineSelect.po: Intrinsics.inc.h
+InstCombineShifts.o: Intrinsics.inc.h
+InstCombineShifts.po: Intrinsics.inc.h
+InstCombineSimplifyDemanded.o: Intrinsics.inc.h
+InstCombineSimplifyDemanded.po: Intrinsics.inc.h
+InstCombineVectorOps.o: Intrinsics.inc.h
+InstCombineVectorOps.po: Intrinsics.inc.h
+InstructionCombining.o: Intrinsics.inc.h
+InstructionCombining.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvminstrumentation/Makefile b/lib/clang/libllvminstrumentation/Makefile
index 963b638..faba349 100644
--- a/lib/clang/libllvminstrumentation/Makefile
+++ b/lib/clang/libllvminstrumentation/Makefile
@@ -8,11 +8,10 @@ SRCDIR= lib/Transforms/Instrumentation
SRCS= AddressSanitizer.cpp \
BoundsChecking.cpp \
DataFlowSanitizer.cpp \
+ DebugIR.cpp \
GCOVProfiling.cpp \
MemorySanitizer.cpp \
Instrumentation.cpp \
- InstrProfiling.cpp \
- SanitizerCoverage.cpp \
ThreadSanitizer.cpp
TGHDRS= Intrinsics
diff --git a/lib/clang/libllvminstrumentation/Makefile.depend b/lib/clang/libllvminstrumentation/Makefile.depend
new file mode 100644
index 0000000..8e825e0
--- /dev/null
+++ b/lib/clang/libllvminstrumentation/Makefile.depend
@@ -0,0 +1,29 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AddressSanitizer.o: Intrinsics.inc.h
+AddressSanitizer.po: Intrinsics.inc.h
+BoundsChecking.o: Intrinsics.inc.h
+BoundsChecking.po: Intrinsics.inc.h
+DataFlowSanitizer.o: Intrinsics.inc.h
+DataFlowSanitizer.po: Intrinsics.inc.h
+DebugIR.o: Intrinsics.inc.h
+DebugIR.po: Intrinsics.inc.h
+MemorySanitizer.o: Intrinsics.inc.h
+MemorySanitizer.po: Intrinsics.inc.h
+ThreadSanitizer.o: Intrinsics.inc.h
+ThreadSanitizer.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvminterpreter/Makefile.depend b/lib/clang/libllvminterpreter/Makefile.depend
new file mode 100644
index 0000000..6f6ff77
--- /dev/null
+++ b/lib/clang/libllvminterpreter/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+Execution.o: Intrinsics.inc.h
+Execution.po: Intrinsics.inc.h
+ExternalFunctions.o: Intrinsics.inc.h
+ExternalFunctions.po: Intrinsics.inc.h
+Interpreter.o: Intrinsics.inc.h
+Interpreter.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmipa/Makefile b/lib/clang/libllvmipa/Makefile
index 3380cf3..c866ca0 100644
--- a/lib/clang/libllvmipa/Makefile
+++ b/lib/clang/libllvmipa/Makefile
@@ -8,6 +8,7 @@ SRCDIR= lib/Analysis/IPA
SRCS= CallGraph.cpp \
CallGraphSCCPass.cpp \
CallPrinter.cpp \
+ FindUsedTypes.cpp \
GlobalsModRef.cpp \
InlineCost.cpp
diff --git a/lib/clang/libllvmipa/Makefile.depend b/lib/clang/libllvmipa/Makefile.depend
new file mode 100644
index 0000000..916056a
--- /dev/null
+++ b/lib/clang/libllvmipa/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+CallGraph.o: Intrinsics.inc.h
+CallGraph.po: Intrinsics.inc.h
+CallGraphSCCPass.o: Intrinsics.inc.h
+CallGraphSCCPass.po: Intrinsics.inc.h
+GlobalsModRef.o: Intrinsics.inc.h
+GlobalsModRef.po: Intrinsics.inc.h
+InlineCost.o: Intrinsics.inc.h
+InlineCost.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmipo/Makefile.depend b/lib/clang/libllvmipo/Makefile.depend
new file mode 100644
index 0000000..151c976
--- /dev/null
+++ b/lib/clang/libllvmipo/Makefile.depend
@@ -0,0 +1,31 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+DeadArgumentElimination.o: Intrinsics.inc.h
+DeadArgumentElimination.po: Intrinsics.inc.h
+FunctionAttrs.o: Intrinsics.inc.h
+FunctionAttrs.po: Intrinsics.inc.h
+GlobalOpt.o: Intrinsics.inc.h
+GlobalOpt.po: Intrinsics.inc.h
+InlineAlways.o: Intrinsics.inc.h
+InlineAlways.po: Intrinsics.inc.h
+InlineSimple.o: Intrinsics.inc.h
+InlineSimple.po: Intrinsics.inc.h
+Inliner.o: Intrinsics.inc.h
+Inliner.po: Intrinsics.inc.h
+PruneEH.o: Intrinsics.inc.h
+PruneEH.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmirreader/Makefile.depend b/lib/clang/libllvmirreader/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmirreader/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmjit/Makefile b/lib/clang/libllvmjit/Makefile
new file mode 100644
index 0000000..a04eeb6
--- /dev/null
+++ b/lib/clang/libllvmjit/Makefile
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= llvmjit
+
+SRCDIR= lib/ExecutionEngine/JIT
+SRCS= JIT.cpp \
+ JITEmitter.cpp \
+ JITMemoryManager.cpp
+
+.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmjit/Makefile.depend b/lib/clang/libllvmjit/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmjit/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmlinker/Makefile.depend b/lib/clang/libllvmlinker/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmlinker/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmmc/Makefile b/lib/clang/libllvmmc/Makefile
index f4582c2..84ba618 100644
--- a/lib/clang/libllvmmc/Makefile
+++ b/lib/clang/libllvmmc/Makefile
@@ -5,8 +5,7 @@
LIB= llvmmc
SRCDIR= lib/MC
-SRCS= ConstantPools.cpp \
- ELFObjectWriter.cpp \
+SRCS= ELFObjectWriter.cpp \
MCAsmBackend.cpp \
MCAsmInfo.cpp \
MCAsmInfoCOFF.cpp \
@@ -14,6 +13,7 @@ SRCS= ConstantPools.cpp \
MCAsmInfoELF.cpp \
MCAsmStreamer.cpp \
MCAssembler.cpp \
+ MCAtom.cpp \
MCCodeEmitter.cpp \
MCCodeGenInfo.cpp \
MCContext.cpp \
@@ -22,18 +22,25 @@ SRCS= ConstantPools.cpp \
MCELFObjectTargetWriter.cpp \
MCELFStreamer.cpp \
MCExpr.cpp \
+ MCExternalSymbolizer.cpp \
+ MCFunction.cpp \
MCInst.cpp \
MCInstPrinter.cpp \
MCInstrAnalysis.cpp \
MCLabel.cpp \
- MCLinkerOptimizationHint.cpp \
MCMachOStreamer.cpp \
MCMachObjectTargetWriter.cpp \
+ MCModule.cpp \
+ MCModuleYAML.cpp \
MCNullStreamer.cpp \
+ MCObjectDisassembler.cpp \
MCObjectFileInfo.cpp \
MCObjectStreamer.cpp \
+ MCObjectSymbolizer.cpp \
MCObjectWriter.cpp \
+ MCPureStreamer.cpp \
MCRegisterInfo.cpp \
+ MCRelocationInfo.cpp \
MCSection.cpp \
MCSectionCOFF.cpp \
MCSectionELF.cpp \
@@ -42,15 +49,15 @@ SRCS= ConstantPools.cpp \
MCSubtargetInfo.cpp \
MCSymbol.cpp \
MCSymbolizer.cpp \
- MCTargetOptions.cpp \
MCValue.cpp \
MCWin64EH.cpp \
- MCWinEH.cpp \
MachObjectWriter.cpp \
- StringTableBuilder.cpp \
SubtargetFeature.cpp \
WinCOFFObjectWriter.cpp \
- WinCOFFStreamer.cpp \
- YAML.cpp
+ WinCOFFStreamer.cpp
+
+.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no"
+SRCS+= MCDisassembler.cpp
+.endif
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmmc/Makefile.depend b/lib/clang/libllvmmc/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmmc/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmmcdisassembler/Makefile b/lib/clang/libllvmmcdisassembler/Makefile
index 2f8a940..cfcf919 100644
--- a/lib/clang/libllvmmcdisassembler/Makefile
+++ b/lib/clang/libllvmmcdisassembler/Makefile
@@ -5,9 +5,6 @@
LIB= llvmmcdisassembler
SRCDIR= lib/MC/MCDisassembler
-SRCS= Disassembler.cpp \
- MCDisassembler.cpp \
- MCExternalSymbolizer.cpp \
- MCRelocationInfo.cpp
+SRCS= Disassembler.cpp
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmmcdisassembler/Makefile.depend b/lib/clang/libllvmmcdisassembler/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmmcdisassembler/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmmcjit/Makefile.depend b/lib/clang/libllvmmcjit/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmmcjit/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmmcparser/Makefile.depend b/lib/clang/libllvmmcparser/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmmcparser/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmmipsasmparser/Makefile.depend b/lib/clang/libllvmmipsasmparser/Makefile.depend
new file mode 100644
index 0000000..bbb5c8a
--- /dev/null
+++ b/lib/clang/libllvmmipsasmparser/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+MipsAsmParser.o: MipsGenAsmMatcher.inc.h
+MipsAsmParser.o: MipsGenInstrInfo.inc.h
+MipsAsmParser.o: MipsGenRegisterInfo.inc.h
+MipsAsmParser.o: MipsGenSubtargetInfo.inc.h
+MipsAsmParser.po: MipsGenAsmMatcher.inc.h
+MipsAsmParser.po: MipsGenInstrInfo.inc.h
+MipsAsmParser.po: MipsGenRegisterInfo.inc.h
+MipsAsmParser.po: MipsGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmmipscodegen/Makefile b/lib/clang/libllvmmipscodegen/Makefile
index 4495f50..9ba7099 100644
--- a/lib/clang/libllvmmipscodegen/Makefile
+++ b/lib/clang/libllvmmipscodegen/Makefile
@@ -7,26 +7,24 @@ LIB= llvmmipscodegen
SRCDIR= lib/Target/Mips
SRCS= Mips16FrameLowering.cpp \
Mips16HardFloat.cpp \
- Mips16HardFloatInfo.cpp \
Mips16ISelDAGToDAG.cpp \
Mips16ISelLowering.cpp \
Mips16InstrInfo.cpp \
Mips16RegisterInfo.cpp \
MipsAnalyzeImmediate.cpp \
MipsAsmPrinter.cpp \
- MipsCCState.cpp \
+ MipsCodeEmitter.cpp \
MipsConstantIslandPass.cpp \
MipsDelaySlotFiller.cpp \
- MipsFastISel.cpp \
MipsFrameLowering.cpp \
MipsISelDAGToDAG.cpp \
MipsISelLowering.cpp \
MipsInstrInfo.cpp \
+ MipsJITInfo.cpp \
MipsLongBranch.cpp \
MipsMCInstLower.cpp \
MipsMachineFunction.cpp \
MipsModuleISelDAGToDAG.cpp \
- MipsOptimizePICCall.cpp \
MipsOs16.cpp \
MipsRegisterInfo.cpp \
MipsSEFrameLowering.cpp \
@@ -44,7 +42,6 @@ TGHDRS= Intrinsics \
MipsGenCallingConv \
MipsGenCodeEmitter \
MipsGenDAGISel \
- MipsGenFastISel \
MipsGenInstrInfo \
MipsGenMCPseudoLowering \
MipsGenRegisterInfo \
diff --git a/lib/clang/libllvmmipscodegen/Makefile.depend b/lib/clang/libllvmmipscodegen/Makefile.depend
new file mode 100644
index 0000000..dd0e891
--- /dev/null
+++ b/lib/clang/libllvmmipscodegen/Makefile.depend
@@ -0,0 +1,225 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+Mips16FrameLowering.o: MipsGenInstrInfo.inc.h
+Mips16FrameLowering.o: MipsGenRegisterInfo.inc.h
+Mips16FrameLowering.o: MipsGenSubtargetInfo.inc.h
+Mips16FrameLowering.po: MipsGenInstrInfo.inc.h
+Mips16FrameLowering.po: MipsGenRegisterInfo.inc.h
+Mips16FrameLowering.po: MipsGenSubtargetInfo.inc.h
+Mips16HardFloat.o: MipsGenInstrInfo.inc.h
+Mips16HardFloat.o: MipsGenRegisterInfo.inc.h
+Mips16HardFloat.o: MipsGenSubtargetInfo.inc.h
+Mips16HardFloat.po: MipsGenInstrInfo.inc.h
+Mips16HardFloat.po: MipsGenRegisterInfo.inc.h
+Mips16HardFloat.po: MipsGenSubtargetInfo.inc.h
+Mips16ISelDAGToDAG.o: Intrinsics.inc.h
+Mips16ISelDAGToDAG.o: MipsGenDAGISel.inc.h
+Mips16ISelDAGToDAG.o: MipsGenInstrInfo.inc.h
+Mips16ISelDAGToDAG.o: MipsGenRegisterInfo.inc.h
+Mips16ISelDAGToDAG.o: MipsGenSubtargetInfo.inc.h
+Mips16ISelDAGToDAG.po: Intrinsics.inc.h
+Mips16ISelDAGToDAG.po: MipsGenDAGISel.inc.h
+Mips16ISelDAGToDAG.po: MipsGenInstrInfo.inc.h
+Mips16ISelDAGToDAG.po: MipsGenRegisterInfo.inc.h
+Mips16ISelDAGToDAG.po: MipsGenSubtargetInfo.inc.h
+Mips16ISelLowering.o: MipsGenInstrInfo.inc.h
+Mips16ISelLowering.o: MipsGenRegisterInfo.inc.h
+Mips16ISelLowering.o: MipsGenSubtargetInfo.inc.h
+Mips16ISelLowering.po: MipsGenInstrInfo.inc.h
+Mips16ISelLowering.po: MipsGenRegisterInfo.inc.h
+Mips16ISelLowering.po: MipsGenSubtargetInfo.inc.h
+Mips16InstrInfo.o: MipsGenInstrInfo.inc.h
+Mips16InstrInfo.o: MipsGenRegisterInfo.inc.h
+Mips16InstrInfo.o: MipsGenSubtargetInfo.inc.h
+Mips16InstrInfo.po: MipsGenInstrInfo.inc.h
+Mips16InstrInfo.po: MipsGenRegisterInfo.inc.h
+Mips16InstrInfo.po: MipsGenSubtargetInfo.inc.h
+Mips16RegisterInfo.o: MipsGenInstrInfo.inc.h
+Mips16RegisterInfo.o: MipsGenRegisterInfo.inc.h
+Mips16RegisterInfo.o: MipsGenSubtargetInfo.inc.h
+Mips16RegisterInfo.po: MipsGenInstrInfo.inc.h
+Mips16RegisterInfo.po: MipsGenRegisterInfo.inc.h
+Mips16RegisterInfo.po: MipsGenSubtargetInfo.inc.h
+MipsAnalyzeImmediate.o: MipsGenInstrInfo.inc.h
+MipsAnalyzeImmediate.o: MipsGenRegisterInfo.inc.h
+MipsAnalyzeImmediate.o: MipsGenSubtargetInfo.inc.h
+MipsAnalyzeImmediate.po: MipsGenInstrInfo.inc.h
+MipsAnalyzeImmediate.po: MipsGenRegisterInfo.inc.h
+MipsAnalyzeImmediate.po: MipsGenSubtargetInfo.inc.h
+MipsAsmPrinter.o: MipsGenInstrInfo.inc.h
+MipsAsmPrinter.o: MipsGenMCPseudoLowering.inc.h
+MipsAsmPrinter.o: MipsGenRegisterInfo.inc.h
+MipsAsmPrinter.o: MipsGenSubtargetInfo.inc.h
+MipsAsmPrinter.po: MipsGenInstrInfo.inc.h
+MipsAsmPrinter.po: MipsGenMCPseudoLowering.inc.h
+MipsAsmPrinter.po: MipsGenRegisterInfo.inc.h
+MipsAsmPrinter.po: MipsGenSubtargetInfo.inc.h
+MipsCodeEmitter.o: MipsGenCodeEmitter.inc.h
+MipsCodeEmitter.o: MipsGenInstrInfo.inc.h
+MipsCodeEmitter.o: MipsGenRegisterInfo.inc.h
+MipsCodeEmitter.o: MipsGenSubtargetInfo.inc.h
+MipsCodeEmitter.po: MipsGenCodeEmitter.inc.h
+MipsCodeEmitter.po: MipsGenInstrInfo.inc.h
+MipsCodeEmitter.po: MipsGenRegisterInfo.inc.h
+MipsCodeEmitter.po: MipsGenSubtargetInfo.inc.h
+MipsConstantIslandPass.o: MipsGenInstrInfo.inc.h
+MipsConstantIslandPass.o: MipsGenRegisterInfo.inc.h
+MipsConstantIslandPass.o: MipsGenSubtargetInfo.inc.h
+MipsConstantIslandPass.po: MipsGenInstrInfo.inc.h
+MipsConstantIslandPass.po: MipsGenRegisterInfo.inc.h
+MipsConstantIslandPass.po: MipsGenSubtargetInfo.inc.h
+MipsDelaySlotFiller.o: MipsGenInstrInfo.inc.h
+MipsDelaySlotFiller.o: MipsGenRegisterInfo.inc.h
+MipsDelaySlotFiller.o: MipsGenSubtargetInfo.inc.h
+MipsDelaySlotFiller.po: MipsGenInstrInfo.inc.h
+MipsDelaySlotFiller.po: MipsGenRegisterInfo.inc.h
+MipsDelaySlotFiller.po: MipsGenSubtargetInfo.inc.h
+MipsFrameLowering.o: MipsGenInstrInfo.inc.h
+MipsFrameLowering.o: MipsGenRegisterInfo.inc.h
+MipsFrameLowering.o: MipsGenSubtargetInfo.inc.h
+MipsFrameLowering.po: MipsGenInstrInfo.inc.h
+MipsFrameLowering.po: MipsGenRegisterInfo.inc.h
+MipsFrameLowering.po: MipsGenSubtargetInfo.inc.h
+MipsISelDAGToDAG.o: Intrinsics.inc.h
+MipsISelDAGToDAG.o: MipsGenDAGISel.inc.h
+MipsISelDAGToDAG.o: MipsGenInstrInfo.inc.h
+MipsISelDAGToDAG.o: MipsGenRegisterInfo.inc.h
+MipsISelDAGToDAG.o: MipsGenSubtargetInfo.inc.h
+MipsISelDAGToDAG.po: Intrinsics.inc.h
+MipsISelDAGToDAG.po: MipsGenDAGISel.inc.h
+MipsISelDAGToDAG.po: MipsGenInstrInfo.inc.h
+MipsISelDAGToDAG.po: MipsGenRegisterInfo.inc.h
+MipsISelDAGToDAG.po: MipsGenSubtargetInfo.inc.h
+MipsISelLowering.o: MipsGenCallingConv.inc.h
+MipsISelLowering.o: MipsGenInstrInfo.inc.h
+MipsISelLowering.o: MipsGenRegisterInfo.inc.h
+MipsISelLowering.o: MipsGenSubtargetInfo.inc.h
+MipsISelLowering.po: MipsGenCallingConv.inc.h
+MipsISelLowering.po: MipsGenInstrInfo.inc.h
+MipsISelLowering.po: MipsGenRegisterInfo.inc.h
+MipsISelLowering.po: MipsGenSubtargetInfo.inc.h
+MipsInstrInfo.o: MipsGenInstrInfo.inc.h
+MipsInstrInfo.o: MipsGenRegisterInfo.inc.h
+MipsInstrInfo.o: MipsGenSubtargetInfo.inc.h
+MipsInstrInfo.po: MipsGenInstrInfo.inc.h
+MipsInstrInfo.po: MipsGenRegisterInfo.inc.h
+MipsInstrInfo.po: MipsGenSubtargetInfo.inc.h
+MipsJITInfo.o: MipsGenInstrInfo.inc.h
+MipsJITInfo.o: MipsGenRegisterInfo.inc.h
+MipsJITInfo.o: MipsGenSubtargetInfo.inc.h
+MipsJITInfo.po: MipsGenInstrInfo.inc.h
+MipsJITInfo.po: MipsGenRegisterInfo.inc.h
+MipsJITInfo.po: MipsGenSubtargetInfo.inc.h
+MipsLongBranch.o: MipsGenInstrInfo.inc.h
+MipsLongBranch.o: MipsGenRegisterInfo.inc.h
+MipsLongBranch.o: MipsGenSubtargetInfo.inc.h
+MipsLongBranch.po: MipsGenInstrInfo.inc.h
+MipsLongBranch.po: MipsGenRegisterInfo.inc.h
+MipsLongBranch.po: MipsGenSubtargetInfo.inc.h
+MipsMCInstLower.o: MipsGenInstrInfo.inc.h
+MipsMCInstLower.o: MipsGenRegisterInfo.inc.h
+MipsMCInstLower.o: MipsGenSubtargetInfo.inc.h
+MipsMCInstLower.po: MipsGenInstrInfo.inc.h
+MipsMCInstLower.po: MipsGenRegisterInfo.inc.h
+MipsMCInstLower.po: MipsGenSubtargetInfo.inc.h
+MipsMachineFunction.o: MipsGenInstrInfo.inc.h
+MipsMachineFunction.o: MipsGenRegisterInfo.inc.h
+MipsMachineFunction.o: MipsGenSubtargetInfo.inc.h
+MipsMachineFunction.po: MipsGenInstrInfo.inc.h
+MipsMachineFunction.po: MipsGenRegisterInfo.inc.h
+MipsMachineFunction.po: MipsGenSubtargetInfo.inc.h
+MipsModuleISelDAGToDAG.o: MipsGenDAGISel.inc.h
+MipsModuleISelDAGToDAG.o: MipsGenInstrInfo.inc.h
+MipsModuleISelDAGToDAG.o: MipsGenRegisterInfo.inc.h
+MipsModuleISelDAGToDAG.o: MipsGenSubtargetInfo.inc.h
+MipsModuleISelDAGToDAG.po: MipsGenDAGISel.inc.h
+MipsModuleISelDAGToDAG.po: MipsGenInstrInfo.inc.h
+MipsModuleISelDAGToDAG.po: MipsGenRegisterInfo.inc.h
+MipsModuleISelDAGToDAG.po: MipsGenSubtargetInfo.inc.h
+MipsOs16.o: MipsGenInstrInfo.inc.h
+MipsOs16.o: MipsGenRegisterInfo.inc.h
+MipsOs16.o: MipsGenSubtargetInfo.inc.h
+MipsOs16.po: MipsGenInstrInfo.inc.h
+MipsOs16.po: MipsGenRegisterInfo.inc.h
+MipsOs16.po: MipsGenSubtargetInfo.inc.h
+MipsRegisterInfo.o: MipsGenInstrInfo.inc.h
+MipsRegisterInfo.o: MipsGenRegisterInfo.inc.h
+MipsRegisterInfo.o: MipsGenSubtargetInfo.inc.h
+MipsRegisterInfo.po: MipsGenInstrInfo.inc.h
+MipsRegisterInfo.po: MipsGenRegisterInfo.inc.h
+MipsRegisterInfo.po: MipsGenSubtargetInfo.inc.h
+MipsSEFrameLowering.o: MipsGenInstrInfo.inc.h
+MipsSEFrameLowering.o: MipsGenRegisterInfo.inc.h
+MipsSEFrameLowering.o: MipsGenSubtargetInfo.inc.h
+MipsSEFrameLowering.po: MipsGenInstrInfo.inc.h
+MipsSEFrameLowering.po: MipsGenRegisterInfo.inc.h
+MipsSEFrameLowering.po: MipsGenSubtargetInfo.inc.h
+MipsSEISelDAGToDAG.o: Intrinsics.inc.h
+MipsSEISelDAGToDAG.o: MipsGenDAGISel.inc.h
+MipsSEISelDAGToDAG.o: MipsGenInstrInfo.inc.h
+MipsSEISelDAGToDAG.o: MipsGenRegisterInfo.inc.h
+MipsSEISelDAGToDAG.o: MipsGenSubtargetInfo.inc.h
+MipsSEISelDAGToDAG.po: Intrinsics.inc.h
+MipsSEISelDAGToDAG.po: MipsGenDAGISel.inc.h
+MipsSEISelDAGToDAG.po: MipsGenInstrInfo.inc.h
+MipsSEISelDAGToDAG.po: MipsGenRegisterInfo.inc.h
+MipsSEISelDAGToDAG.po: MipsGenSubtargetInfo.inc.h
+MipsSEISelLowering.o: Intrinsics.inc.h
+MipsSEISelLowering.o: MipsGenInstrInfo.inc.h
+MipsSEISelLowering.o: MipsGenRegisterInfo.inc.h
+MipsSEISelLowering.o: MipsGenSubtargetInfo.inc.h
+MipsSEISelLowering.po: Intrinsics.inc.h
+MipsSEISelLowering.po: MipsGenInstrInfo.inc.h
+MipsSEISelLowering.po: MipsGenRegisterInfo.inc.h
+MipsSEISelLowering.po: MipsGenSubtargetInfo.inc.h
+MipsSEInstrInfo.o: MipsGenInstrInfo.inc.h
+MipsSEInstrInfo.o: MipsGenRegisterInfo.inc.h
+MipsSEInstrInfo.o: MipsGenSubtargetInfo.inc.h
+MipsSEInstrInfo.po: MipsGenInstrInfo.inc.h
+MipsSEInstrInfo.po: MipsGenRegisterInfo.inc.h
+MipsSEInstrInfo.po: MipsGenSubtargetInfo.inc.h
+MipsSERegisterInfo.o: MipsGenInstrInfo.inc.h
+MipsSERegisterInfo.o: MipsGenRegisterInfo.inc.h
+MipsSERegisterInfo.o: MipsGenSubtargetInfo.inc.h
+MipsSERegisterInfo.po: MipsGenInstrInfo.inc.h
+MipsSERegisterInfo.po: MipsGenRegisterInfo.inc.h
+MipsSERegisterInfo.po: MipsGenSubtargetInfo.inc.h
+MipsSelectionDAGInfo.o: MipsGenInstrInfo.inc.h
+MipsSelectionDAGInfo.o: MipsGenRegisterInfo.inc.h
+MipsSelectionDAGInfo.o: MipsGenSubtargetInfo.inc.h
+MipsSelectionDAGInfo.po: MipsGenInstrInfo.inc.h
+MipsSelectionDAGInfo.po: MipsGenRegisterInfo.inc.h
+MipsSelectionDAGInfo.po: MipsGenSubtargetInfo.inc.h
+MipsSubtarget.o: MipsGenInstrInfo.inc.h
+MipsSubtarget.o: MipsGenRegisterInfo.inc.h
+MipsSubtarget.o: MipsGenSubtargetInfo.inc.h
+MipsSubtarget.po: MipsGenInstrInfo.inc.h
+MipsSubtarget.po: MipsGenRegisterInfo.inc.h
+MipsSubtarget.po: MipsGenSubtargetInfo.inc.h
+MipsTargetMachine.o: Intrinsics.inc.h
+MipsTargetMachine.o: MipsGenDAGISel.inc.h
+MipsTargetMachine.o: MipsGenInstrInfo.inc.h
+MipsTargetMachine.o: MipsGenRegisterInfo.inc.h
+MipsTargetMachine.o: MipsGenSubtargetInfo.inc.h
+MipsTargetMachine.po: Intrinsics.inc.h
+MipsTargetMachine.po: MipsGenDAGISel.inc.h
+MipsTargetMachine.po: MipsGenInstrInfo.inc.h
+MipsTargetMachine.po: MipsGenRegisterInfo.inc.h
+MipsTargetMachine.po: MipsGenSubtargetInfo.inc.h
+MipsTargetObjectFile.o: MipsGenSubtargetInfo.inc.h
+MipsTargetObjectFile.po: MipsGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmmipsdesc/Makefile b/lib/clang/libllvmmipsdesc/Makefile
index f22ff80..07cbbfa 100644
--- a/lib/clang/libllvmmipsdesc/Makefile
+++ b/lib/clang/libllvmmipsdesc/Makefile
@@ -5,17 +5,12 @@
LIB= llvmmipsdesc
SRCDIR= lib/Target/Mips/MCTargetDesc
-SRCS= MipsABIFlagsSection.cpp \
- MipsABIInfo.cpp \
- MipsAsmBackend.cpp \
+SRCS= MipsAsmBackend.cpp \
MipsELFObjectWriter.cpp \
- MipsELFStreamer.cpp \
MipsMCAsmInfo.cpp \
MipsMCCodeEmitter.cpp \
- MipsMCExpr.cpp \
MipsMCTargetDesc.cpp \
- MipsNaClELFStreamer.cpp \
- MipsOptionRecord.cpp \
+ MipsReginfo.cpp \
MipsTargetStreamer.cpp
CFLAGS+= -I${LLVM_SRCS}/${SRCDIR}/..
diff --git a/lib/clang/libllvmmipsdesc/Makefile.depend b/lib/clang/libllvmmipsdesc/Makefile.depend
new file mode 100644
index 0000000..c0c4959
--- /dev/null
+++ b/lib/clang/libllvmmipsdesc/Makefile.depend
@@ -0,0 +1,45 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+MipsAsmBackend.o: MipsGenInstrInfo.inc.h
+MipsAsmBackend.o: MipsGenRegisterInfo.inc.h
+MipsAsmBackend.o: MipsGenSubtargetInfo.inc.h
+MipsAsmBackend.po: MipsGenInstrInfo.inc.h
+MipsAsmBackend.po: MipsGenRegisterInfo.inc.h
+MipsAsmBackend.po: MipsGenSubtargetInfo.inc.h
+MipsELFObjectWriter.o: MipsGenInstrInfo.inc.h
+MipsELFObjectWriter.o: MipsGenRegisterInfo.inc.h
+MipsELFObjectWriter.o: MipsGenSubtargetInfo.inc.h
+MipsELFObjectWriter.po: MipsGenInstrInfo.inc.h
+MipsELFObjectWriter.po: MipsGenRegisterInfo.inc.h
+MipsELFObjectWriter.po: MipsGenSubtargetInfo.inc.h
+MipsMCCodeEmitter.o: MipsGenInstrInfo.inc.h
+MipsMCCodeEmitter.o: MipsGenMCCodeEmitter.inc.h
+MipsMCCodeEmitter.o: MipsGenRegisterInfo.inc.h
+MipsMCCodeEmitter.o: MipsGenSubtargetInfo.inc.h
+MipsMCCodeEmitter.po: MipsGenInstrInfo.inc.h
+MipsMCCodeEmitter.po: MipsGenMCCodeEmitter.inc.h
+MipsMCCodeEmitter.po: MipsGenRegisterInfo.inc.h
+MipsMCCodeEmitter.po: MipsGenSubtargetInfo.inc.h
+MipsMCTargetDesc.o: MipsGenInstrInfo.inc.h
+MipsMCTargetDesc.o: MipsGenRegisterInfo.inc.h
+MipsMCTargetDesc.o: MipsGenSubtargetInfo.inc.h
+MipsMCTargetDesc.po: MipsGenInstrInfo.inc.h
+MipsMCTargetDesc.po: MipsGenRegisterInfo.inc.h
+MipsMCTargetDesc.po: MipsGenSubtargetInfo.inc.h
+MipsReginfo.o: MipsGenSubtargetInfo.inc.h
+MipsReginfo.po: MipsGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmmipsdisassembler/Makefile.depend b/lib/clang/libllvmmipsdisassembler/Makefile.depend
new file mode 100644
index 0000000..878dd85
--- /dev/null
+++ b/lib/clang/libllvmmipsdisassembler/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+MipsDisassembler.o: MipsGenDisassemblerTables.inc.h
+MipsDisassembler.o: MipsGenInstrInfo.inc.h
+MipsDisassembler.o: MipsGenRegisterInfo.inc.h
+MipsDisassembler.o: MipsGenSubtargetInfo.inc.h
+MipsDisassembler.po: MipsGenDisassemblerTables.inc.h
+MipsDisassembler.po: MipsGenInstrInfo.inc.h
+MipsDisassembler.po: MipsGenRegisterInfo.inc.h
+MipsDisassembler.po: MipsGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmmipsinfo/Makefile.depend b/lib/clang/libllvmmipsinfo/Makefile.depend
new file mode 100644
index 0000000..452184f
--- /dev/null
+++ b/lib/clang/libllvmmipsinfo/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+MipsTargetInfo.o: MipsGenInstrInfo.inc.h
+MipsTargetInfo.o: MipsGenRegisterInfo.inc.h
+MipsTargetInfo.o: MipsGenSubtargetInfo.inc.h
+MipsTargetInfo.po: MipsGenInstrInfo.inc.h
+MipsTargetInfo.po: MipsGenRegisterInfo.inc.h
+MipsTargetInfo.po: MipsGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmmipsinstprinter/Makefile.depend b/lib/clang/libllvmmipsinstprinter/Makefile.depend
new file mode 100644
index 0000000..99744ba
--- /dev/null
+++ b/lib/clang/libllvmmipsinstprinter/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+MipsInstPrinter.o: MipsGenAsmWriter.inc.h
+MipsInstPrinter.o: MipsGenInstrInfo.inc.h
+MipsInstPrinter.o: MipsGenRegisterInfo.inc.h
+MipsInstPrinter.o: MipsGenSubtargetInfo.inc.h
+MipsInstPrinter.po: MipsGenAsmWriter.inc.h
+MipsInstPrinter.po: MipsGenInstrInfo.inc.h
+MipsInstPrinter.po: MipsGenRegisterInfo.inc.h
+MipsInstPrinter.po: MipsGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmobjcarcopts/Makefile b/lib/clang/libllvmobjcarcopts/Makefile
index ee3ca83..5c47aa8 100644
--- a/lib/clang/libllvmobjcarcopts/Makefile
+++ b/lib/clang/libllvmobjcarcopts/Makefile
@@ -13,8 +13,7 @@ SRCS= ObjCARC.cpp \
ObjCARCUtil.cpp \
ObjCARCContract.cpp \
DependencyAnalysis.cpp \
- ProvenanceAnalysis.cpp \
- ProvenanceAnalysisEvaluator.cpp
+ ProvenanceAnalysis.cpp
TGHDRS= Intrinsics
diff --git a/lib/clang/libllvmobjcarcopts/Makefile.depend b/lib/clang/libllvmobjcarcopts/Makefile.depend
new file mode 100644
index 0000000..4ebd17e
--- /dev/null
+++ b/lib/clang/libllvmobjcarcopts/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ObjCARCUtil.o: Intrinsics.inc.h
+ObjCARCUtil.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmobject/Makefile b/lib/clang/libllvmobject/Makefile
index 804fff8..7e48093 100644
--- a/lib/clang/libllvmobject/Makefile
+++ b/lib/clang/libllvmobject/Makefile
@@ -13,12 +13,10 @@ SRCS= Archive.cpp \
ELFObjectFile.cpp \
ELFYAML.cpp \
Error.cpp \
- IRObjectFile.cpp \
MachOObjectFile.cpp \
MachOUniversal.cpp \
Object.cpp \
ObjectFile.cpp \
- RecordStreamer.cpp \
- SymbolicFile.cpp
+ YAML.cpp
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmobject/Makefile.depend b/lib/clang/libllvmobject/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmobject/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmoption/Makefile.depend b/lib/clang/libllvmoption/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmoption/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmpowerpcasmparser/Makefile.depend b/lib/clang/libllvmpowerpcasmparser/Makefile.depend
new file mode 100644
index 0000000..194691f
--- /dev/null
+++ b/lib/clang/libllvmpowerpcasmparser/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+PPCAsmParser.o: PPCGenAsmMatcher.inc.h
+PPCAsmParser.o: PPCGenInstrInfo.inc.h
+PPCAsmParser.o: PPCGenRegisterInfo.inc.h
+PPCAsmParser.o: PPCGenSubtargetInfo.inc.h
+PPCAsmParser.po: PPCGenAsmMatcher.inc.h
+PPCAsmParser.po: PPCGenInstrInfo.inc.h
+PPCAsmParser.po: PPCGenRegisterInfo.inc.h
+PPCAsmParser.po: PPCGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmpowerpccodegen/Makefile b/lib/clang/libllvmpowerpccodegen/Makefile
index 211bc22..9fd268b 100644
--- a/lib/clang/libllvmpowerpccodegen/Makefile
+++ b/lib/clang/libllvmpowerpccodegen/Makefile
@@ -8,12 +8,14 @@ SRCDIR= lib/Target/PowerPC
SRCS= PPCAsmPrinter.cpp \
PPCBranchSelector.cpp \
PPCCTRLoops.cpp \
- PPCFastISel.cpp \
+ PPCCodeEmitter.cpp \
+ PPCFastISel.cpp \
PPCFrameLowering.cpp \
PPCHazardRecognizers.cpp \
PPCISelDAGToDAG.cpp \
PPCISelLowering.cpp \
PPCInstrInfo.cpp \
+ PPCJITInfo.cpp \
PPCMCInstLower.cpp \
PPCMachineFunctionInfo.cpp \
PPCRegisterInfo.cpp \
diff --git a/lib/clang/libllvmpowerpccodegen/Makefile.depend b/lib/clang/libllvmpowerpccodegen/Makefile.depend
new file mode 100644
index 0000000..2808f9a
--- /dev/null
+++ b/lib/clang/libllvmpowerpccodegen/Makefile.depend
@@ -0,0 +1,139 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+PPCAsmPrinter.o: PPCGenInstrInfo.inc.h
+PPCAsmPrinter.o: PPCGenRegisterInfo.inc.h
+PPCAsmPrinter.o: PPCGenSubtargetInfo.inc.h
+PPCAsmPrinter.po: PPCGenInstrInfo.inc.h
+PPCAsmPrinter.po: PPCGenRegisterInfo.inc.h
+PPCAsmPrinter.po: PPCGenSubtargetInfo.inc.h
+PPCBranchSelector.o: PPCGenInstrInfo.inc.h
+PPCBranchSelector.o: PPCGenRegisterInfo.inc.h
+PPCBranchSelector.o: PPCGenSubtargetInfo.inc.h
+PPCBranchSelector.po: PPCGenInstrInfo.inc.h
+PPCBranchSelector.po: PPCGenRegisterInfo.inc.h
+PPCBranchSelector.po: PPCGenSubtargetInfo.inc.h
+PPCCTRLoops.o: Intrinsics.inc.h
+PPCCTRLoops.o: PPCGenInstrInfo.inc.h
+PPCCTRLoops.o: PPCGenRegisterInfo.inc.h
+PPCCTRLoops.o: PPCGenSubtargetInfo.inc.h
+PPCCTRLoops.po: Intrinsics.inc.h
+PPCCTRLoops.po: PPCGenInstrInfo.inc.h
+PPCCTRLoops.po: PPCGenRegisterInfo.inc.h
+PPCCTRLoops.po: PPCGenSubtargetInfo.inc.h
+PPCCodeEmitter.o: PPCGenCodeEmitter.inc.h
+PPCCodeEmitter.o: PPCGenInstrInfo.inc.h
+PPCCodeEmitter.o: PPCGenRegisterInfo.inc.h
+PPCCodeEmitter.o: PPCGenSubtargetInfo.inc.h
+PPCCodeEmitter.po: PPCGenCodeEmitter.inc.h
+PPCCodeEmitter.po: PPCGenInstrInfo.inc.h
+PPCCodeEmitter.po: PPCGenRegisterInfo.inc.h
+PPCCodeEmitter.po: PPCGenSubtargetInfo.inc.h
+PPCFastISel.o: Intrinsics.inc.h
+PPCFastISel.o: PPCGenCallingConv.inc.h
+PPCFastISel.o: PPCGenFastISel.inc.h
+PPCFastISel.o: PPCGenInstrInfo.inc.h
+PPCFastISel.o: PPCGenRegisterInfo.inc.h
+PPCFastISel.o: PPCGenSubtargetInfo.inc.h
+PPCFastISel.po: Intrinsics.inc.h
+PPCFastISel.po: PPCGenCallingConv.inc.h
+PPCFastISel.po: PPCGenFastISel.inc.h
+PPCFastISel.po: PPCGenInstrInfo.inc.h
+PPCFastISel.po: PPCGenRegisterInfo.inc.h
+PPCFastISel.po: PPCGenSubtargetInfo.inc.h
+PPCFrameLowering.o: PPCGenInstrInfo.inc.h
+PPCFrameLowering.o: PPCGenRegisterInfo.inc.h
+PPCFrameLowering.o: PPCGenSubtargetInfo.inc.h
+PPCFrameLowering.po: PPCGenInstrInfo.inc.h
+PPCFrameLowering.po: PPCGenRegisterInfo.inc.h
+PPCFrameLowering.po: PPCGenSubtargetInfo.inc.h
+PPCHazardRecognizers.o: PPCGenInstrInfo.inc.h
+PPCHazardRecognizers.o: PPCGenRegisterInfo.inc.h
+PPCHazardRecognizers.o: PPCGenSubtargetInfo.inc.h
+PPCHazardRecognizers.po: PPCGenInstrInfo.inc.h
+PPCHazardRecognizers.po: PPCGenRegisterInfo.inc.h
+PPCHazardRecognizers.po: PPCGenSubtargetInfo.inc.h
+PPCISelDAGToDAG.o: Intrinsics.inc.h
+PPCISelDAGToDAG.o: PPCGenDAGISel.inc.h
+PPCISelDAGToDAG.o: PPCGenInstrInfo.inc.h
+PPCISelDAGToDAG.o: PPCGenRegisterInfo.inc.h
+PPCISelDAGToDAG.o: PPCGenSubtargetInfo.inc.h
+PPCISelDAGToDAG.po: Intrinsics.inc.h
+PPCISelDAGToDAG.po: PPCGenDAGISel.inc.h
+PPCISelDAGToDAG.po: PPCGenInstrInfo.inc.h
+PPCISelDAGToDAG.po: PPCGenRegisterInfo.inc.h
+PPCISelDAGToDAG.po: PPCGenSubtargetInfo.inc.h
+PPCISelLowering.o: Intrinsics.inc.h
+PPCISelLowering.o: PPCGenCallingConv.inc.h
+PPCISelLowering.o: PPCGenInstrInfo.inc.h
+PPCISelLowering.o: PPCGenRegisterInfo.inc.h
+PPCISelLowering.o: PPCGenSubtargetInfo.inc.h
+PPCISelLowering.po: Intrinsics.inc.h
+PPCISelLowering.po: PPCGenCallingConv.inc.h
+PPCISelLowering.po: PPCGenInstrInfo.inc.h
+PPCISelLowering.po: PPCGenRegisterInfo.inc.h
+PPCISelLowering.po: PPCGenSubtargetInfo.inc.h
+PPCInstrInfo.o: PPCGenInstrInfo.inc.h
+PPCInstrInfo.o: PPCGenRegisterInfo.inc.h
+PPCInstrInfo.o: PPCGenSubtargetInfo.inc.h
+PPCInstrInfo.po: PPCGenInstrInfo.inc.h
+PPCInstrInfo.po: PPCGenRegisterInfo.inc.h
+PPCInstrInfo.po: PPCGenSubtargetInfo.inc.h
+PPCJITInfo.o: PPCGenInstrInfo.inc.h
+PPCJITInfo.o: PPCGenRegisterInfo.inc.h
+PPCJITInfo.o: PPCGenSubtargetInfo.inc.h
+PPCJITInfo.po: PPCGenInstrInfo.inc.h
+PPCJITInfo.po: PPCGenRegisterInfo.inc.h
+PPCJITInfo.po: PPCGenSubtargetInfo.inc.h
+PPCMCInstLower.o: PPCGenInstrInfo.inc.h
+PPCMCInstLower.o: PPCGenRegisterInfo.inc.h
+PPCMCInstLower.o: PPCGenSubtargetInfo.inc.h
+PPCMCInstLower.po: PPCGenInstrInfo.inc.h
+PPCMCInstLower.po: PPCGenRegisterInfo.inc.h
+PPCMCInstLower.po: PPCGenSubtargetInfo.inc.h
+PPCRegisterInfo.o: PPCGenInstrInfo.inc.h
+PPCRegisterInfo.o: PPCGenRegisterInfo.inc.h
+PPCRegisterInfo.o: PPCGenSubtargetInfo.inc.h
+PPCRegisterInfo.po: PPCGenInstrInfo.inc.h
+PPCRegisterInfo.po: PPCGenRegisterInfo.inc.h
+PPCRegisterInfo.po: PPCGenSubtargetInfo.inc.h
+PPCSelectionDAGInfo.o: PPCGenInstrInfo.inc.h
+PPCSelectionDAGInfo.o: PPCGenRegisterInfo.inc.h
+PPCSelectionDAGInfo.o: PPCGenSubtargetInfo.inc.h
+PPCSelectionDAGInfo.po: PPCGenInstrInfo.inc.h
+PPCSelectionDAGInfo.po: PPCGenRegisterInfo.inc.h
+PPCSelectionDAGInfo.po: PPCGenSubtargetInfo.inc.h
+PPCSubtarget.o: PPCGenInstrInfo.inc.h
+PPCSubtarget.o: PPCGenRegisterInfo.inc.h
+PPCSubtarget.o: PPCGenSubtargetInfo.inc.h
+PPCSubtarget.po: PPCGenInstrInfo.inc.h
+PPCSubtarget.po: PPCGenRegisterInfo.inc.h
+PPCSubtarget.po: PPCGenSubtargetInfo.inc.h
+PPCTargetMachine.o: PPCGenInstrInfo.inc.h
+PPCTargetMachine.o: PPCGenRegisterInfo.inc.h
+PPCTargetMachine.o: PPCGenSubtargetInfo.inc.h
+PPCTargetMachine.po: PPCGenInstrInfo.inc.h
+PPCTargetMachine.po: PPCGenRegisterInfo.inc.h
+PPCTargetMachine.po: PPCGenSubtargetInfo.inc.h
+PPCTargetTransformInfo.o: Intrinsics.inc.h
+PPCTargetTransformInfo.o: PPCGenInstrInfo.inc.h
+PPCTargetTransformInfo.o: PPCGenRegisterInfo.inc.h
+PPCTargetTransformInfo.o: PPCGenSubtargetInfo.inc.h
+PPCTargetTransformInfo.po: Intrinsics.inc.h
+PPCTargetTransformInfo.po: PPCGenInstrInfo.inc.h
+PPCTargetTransformInfo.po: PPCGenRegisterInfo.inc.h
+PPCTargetTransformInfo.po: PPCGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmpowerpcdesc/Makefile.depend b/lib/clang/libllvmpowerpcdesc/Makefile.depend
new file mode 100644
index 0000000..d6220e7
--- /dev/null
+++ b/lib/clang/libllvmpowerpcdesc/Makefile.depend
@@ -0,0 +1,49 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+PPCAsmBackend.o: PPCGenInstrInfo.inc.h
+PPCAsmBackend.o: PPCGenRegisterInfo.inc.h
+PPCAsmBackend.o: PPCGenSubtargetInfo.inc.h
+PPCAsmBackend.po: PPCGenInstrInfo.inc.h
+PPCAsmBackend.po: PPCGenRegisterInfo.inc.h
+PPCAsmBackend.po: PPCGenSubtargetInfo.inc.h
+PPCELFObjectWriter.o: PPCGenInstrInfo.inc.h
+PPCELFObjectWriter.o: PPCGenRegisterInfo.inc.h
+PPCELFObjectWriter.o: PPCGenSubtargetInfo.inc.h
+PPCELFObjectWriter.po: PPCGenInstrInfo.inc.h
+PPCELFObjectWriter.po: PPCGenRegisterInfo.inc.h
+PPCELFObjectWriter.po: PPCGenSubtargetInfo.inc.h
+PPCMCCodeEmitter.o: PPCGenInstrInfo.inc.h
+PPCMCCodeEmitter.o: PPCGenMCCodeEmitter.inc.h
+PPCMCCodeEmitter.o: PPCGenRegisterInfo.inc.h
+PPCMCCodeEmitter.o: PPCGenSubtargetInfo.inc.h
+PPCMCCodeEmitter.po: PPCGenInstrInfo.inc.h
+PPCMCCodeEmitter.po: PPCGenMCCodeEmitter.inc.h
+PPCMCCodeEmitter.po: PPCGenRegisterInfo.inc.h
+PPCMCCodeEmitter.po: PPCGenSubtargetInfo.inc.h
+PPCMCTargetDesc.o: PPCGenInstrInfo.inc.h
+PPCMCTargetDesc.o: PPCGenRegisterInfo.inc.h
+PPCMCTargetDesc.o: PPCGenSubtargetInfo.inc.h
+PPCMCTargetDesc.po: PPCGenInstrInfo.inc.h
+PPCMCTargetDesc.po: PPCGenRegisterInfo.inc.h
+PPCMCTargetDesc.po: PPCGenSubtargetInfo.inc.h
+PPCMachObjectWriter.o: PPCGenInstrInfo.inc.h
+PPCMachObjectWriter.o: PPCGenRegisterInfo.inc.h
+PPCMachObjectWriter.o: PPCGenSubtargetInfo.inc.h
+PPCMachObjectWriter.po: PPCGenInstrInfo.inc.h
+PPCMachObjectWriter.po: PPCGenRegisterInfo.inc.h
+PPCMachObjectWriter.po: PPCGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmpowerpcdisassembler/Makefile b/lib/clang/libllvmpowerpcdisassembler/Makefile
deleted file mode 100644
index 58735e4..0000000
--- a/lib/clang/libllvmpowerpcdisassembler/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= llvmpowerpcdisassembler
-
-SRCDIR= lib/Target/PowerPC/Disassembler
-INCDIR= lib/Target/PowerPC
-SRCS= PPCDisassembler.cpp
-
-TGHDRS= PPCGenDisassemblerTables \
- PPCGenInstrInfo \
- PPCGenRegisterInfo \
- PPCGenSubtargetInfo
-
-.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmpowerpcinfo/Makefile.depend b/lib/clang/libllvmpowerpcinfo/Makefile.depend
new file mode 100644
index 0000000..022060a
--- /dev/null
+++ b/lib/clang/libllvmpowerpcinfo/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+PowerPCTargetInfo.o: PPCGenInstrInfo.inc.h
+PowerPCTargetInfo.o: PPCGenRegisterInfo.inc.h
+PowerPCTargetInfo.o: PPCGenSubtargetInfo.inc.h
+PowerPCTargetInfo.po: PPCGenInstrInfo.inc.h
+PowerPCTargetInfo.po: PPCGenRegisterInfo.inc.h
+PowerPCTargetInfo.po: PPCGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmpowerpcinstprinter/Makefile.depend b/lib/clang/libllvmpowerpcinstprinter/Makefile.depend
new file mode 100644
index 0000000..676a53c
--- /dev/null
+++ b/lib/clang/libllvmpowerpcinstprinter/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+PPCInstPrinter.o: PPCGenAsmWriter.inc.h
+PPCInstPrinter.o: PPCGenInstrInfo.inc.h
+PPCInstPrinter.o: PPCGenRegisterInfo.inc.h
+PPCInstPrinter.o: PPCGenSubtargetInfo.inc.h
+PPCInstPrinter.po: PPCGenAsmWriter.inc.h
+PPCInstPrinter.po: PPCGenInstrInfo.inc.h
+PPCInstPrinter.po: PPCGenRegisterInfo.inc.h
+PPCInstPrinter.po: PPCGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmprofiledata/Makefile b/lib/clang/libllvmprofiledata/Makefile
deleted file mode 100644
index 332bf1c..0000000
--- a/lib/clang/libllvmprofiledata/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= llvmprofiledata
-
-SRCDIR= lib/ProfileData
-SRCS= CoverageMapping.cpp \
- CoverageMappingReader.cpp \
- CoverageMappingWriter.cpp \
- InstrProf.cpp \
- InstrProfReader.cpp \
- InstrProfWriter.cpp \
- SampleProf.cpp \
- SampleProfReader.cpp \
- SampleProfWriter.cpp
-
-.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmruntimedyld/Makefile b/lib/clang/libllvmruntimedyld/Makefile
index 75eb843..02ca4bd 100644
--- a/lib/clang/libllvmruntimedyld/Makefile
+++ b/lib/clang/libllvmruntimedyld/Makefile
@@ -5,9 +5,8 @@
LIB= llvmruntimedyld
SRCDIR= lib/ExecutionEngine/RuntimeDyld
-SRCS= RTDyldMemoryManager.cpp \
+SRCS= GDBRegistrar.cpp \
RuntimeDyld.cpp \
- RuntimeDyldChecker.cpp \
RuntimeDyldELF.cpp \
RuntimeDyldMachO.cpp
diff --git a/lib/clang/libllvmruntimedyld/Makefile.depend b/lib/clang/libllvmruntimedyld/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmruntimedyld/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmscalaropts/Makefile b/lib/clang/libllvmscalaropts/Makefile
index bb8dc96..8da4bf0 100644
--- a/lib/clang/libllvmscalaropts/Makefile
+++ b/lib/clang/libllvmscalaropts/Makefile
@@ -6,8 +6,7 @@ LIB= llvmscalaropts
SRCDIR= lib/Transforms/Scalar
SRCS= ADCE.cpp \
- AlignmentFromAssumptions.cpp \
- ConstantHoisting.cpp \
+ CodeGenPrepare.cpp \
ConstantProp.cpp \
CorrelatedValuePropagation.cpp \
DCE.cpp \
@@ -15,10 +14,10 @@ SRCS= ADCE.cpp \
EarlyCSE.cpp \
FlattenCFGPass.cpp \
GVN.cpp \
+ GlobalMerge.cpp \
IndVarSimplify.cpp \
JumpThreading.cpp \
LICM.cpp \
- LoadCombine.cpp \
LoopDeletion.cpp \
LoopIdiomRecognize.cpp \
LoopRerollPass.cpp \
@@ -28,7 +27,6 @@ SRCS= ADCE.cpp \
LoopUnswitch.cpp \
LowerAtomic.cpp \
MemCpyOptimizer.cpp \
- MergedLoadStoreMotion.cpp \
PartiallyInlineLibCalls.cpp \
Reassociate.cpp \
Reg2Mem.cpp \
@@ -36,8 +34,6 @@ SRCS= ADCE.cpp \
SROA.cpp \
SampleProfile.cpp \
ScalarReplAggregates.cpp \
- Scalarizer.cpp \
- SeparateConstOffsetFromGEP.cpp \
SimplifyCFGPass.cpp \
Sink.cpp \
StructurizeCFG.cpp \
diff --git a/lib/clang/libllvmscalaropts/Makefile.depend b/lib/clang/libllvmscalaropts/Makefile.depend
new file mode 100644
index 0000000..1c880cd
--- /dev/null
+++ b/lib/clang/libllvmscalaropts/Makefile.depend
@@ -0,0 +1,67 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ADCE.o: Intrinsics.inc.h
+ADCE.po: Intrinsics.inc.h
+CodeGenPrepare.o: Intrinsics.inc.h
+CodeGenPrepare.po: Intrinsics.inc.h
+DeadStoreElimination.o: Intrinsics.inc.h
+DeadStoreElimination.po: Intrinsics.inc.h
+GVN.o: Intrinsics.inc.h
+GVN.po: Intrinsics.inc.h
+GlobalMerge.o: Intrinsics.inc.h
+GlobalMerge.po: Intrinsics.inc.h
+IndVarSimplify.o: Intrinsics.inc.h
+IndVarSimplify.po: Intrinsics.inc.h
+JumpThreading.o: Intrinsics.inc.h
+JumpThreading.po: Intrinsics.inc.h
+LICM.o: Intrinsics.inc.h
+LICM.po: Intrinsics.inc.h
+LoopIdiomRecognize.o: Intrinsics.inc.h
+LoopIdiomRecognize.po: Intrinsics.inc.h
+LoopRerollPass.o: Intrinsics.inc.h
+LoopRerollPass.po: Intrinsics.inc.h
+LoopRotation.o: Intrinsics.inc.h
+LoopRotation.po: Intrinsics.inc.h
+LoopStrengthReduce.o: Intrinsics.inc.h
+LoopStrengthReduce.po: Intrinsics.inc.h
+LoopUnrollPass.o: Intrinsics.inc.h
+LoopUnrollPass.po: Intrinsics.inc.h
+LoopUnswitch.o: Intrinsics.inc.h
+LoopUnswitch.po: Intrinsics.inc.h
+LowerAtomic.o: Intrinsics.inc.h
+LowerAtomic.po: Intrinsics.inc.h
+MemCpyOptimizer.o: Intrinsics.inc.h
+MemCpyOptimizer.po: Intrinsics.inc.h
+PartiallyInlineLibCalls.o: Intrinsics.inc.h
+PartiallyInlineLibCalls.po: Intrinsics.inc.h
+Reassociate.o: Intrinsics.inc.h
+Reassociate.po: Intrinsics.inc.h
+SCCP.o: Intrinsics.inc.h
+SCCP.po: Intrinsics.inc.h
+SROA.o: Intrinsics.inc.h
+SROA.po: Intrinsics.inc.h
+ScalarReplAggregates.o: Intrinsics.inc.h
+ScalarReplAggregates.po: Intrinsics.inc.h
+SimplifyCFGPass.o: Intrinsics.inc.h
+SimplifyCFGPass.po: Intrinsics.inc.h
+Sink.o: Intrinsics.inc.h
+Sink.po: Intrinsics.inc.h
+StructurizeCFG.o: Intrinsics.inc.h
+StructurizeCFG.po: Intrinsics.inc.h
+TailRecursionElimination.o: Intrinsics.inc.h
+TailRecursionElimination.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmselectiondag/Makefile b/lib/clang/libllvmselectiondag/Makefile
index b73a1c5..7543102 100644
--- a/lib/clang/libllvmselectiondag/Makefile
+++ b/lib/clang/libllvmselectiondag/Makefile
@@ -26,7 +26,6 @@ SRCS= DAGCombiner.cpp \
SelectionDAGDumper.cpp \
SelectionDAGISel.cpp \
SelectionDAGPrinter.cpp \
- StatepointLowering.cpp \
TargetLowering.cpp \
TargetSelectionDAGInfo.cpp
diff --git a/lib/clang/libllvmselectiondag/Makefile.depend b/lib/clang/libllvmselectiondag/Makefile.depend
new file mode 100644
index 0000000..737ede1
--- /dev/null
+++ b/lib/clang/libllvmselectiondag/Makefile.depend
@@ -0,0 +1,29 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+FastISel.o: Intrinsics.inc.h
+FastISel.po: Intrinsics.inc.h
+FunctionLoweringInfo.o: Intrinsics.inc.h
+FunctionLoweringInfo.po: Intrinsics.inc.h
+SelectionDAG.o: Intrinsics.inc.h
+SelectionDAG.po: Intrinsics.inc.h
+SelectionDAGBuilder.o: Intrinsics.inc.h
+SelectionDAGBuilder.po: Intrinsics.inc.h
+SelectionDAGDumper.o: Intrinsics.inc.h
+SelectionDAGDumper.po: Intrinsics.inc.h
+SelectionDAGISel.o: Intrinsics.inc.h
+SelectionDAGISel.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmsparcasmparser/Makefile.depend b/lib/clang/libllvmsparcasmparser/Makefile.depend
new file mode 100644
index 0000000..63286f9
--- /dev/null
+++ b/lib/clang/libllvmsparcasmparser/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+SparcAsmParser.o: SparcGenAsmMatcher.inc.h
+SparcAsmParser.o: SparcGenInstrInfo.inc.h
+SparcAsmParser.o: SparcGenRegisterInfo.inc.h
+SparcAsmParser.o: SparcGenSubtargetInfo.inc.h
+SparcAsmParser.po: SparcGenAsmMatcher.inc.h
+SparcAsmParser.po: SparcGenInstrInfo.inc.h
+SparcAsmParser.po: SparcGenRegisterInfo.inc.h
+SparcAsmParser.po: SparcGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmsparccodegen/Makefile b/lib/clang/libllvmsparccodegen/Makefile
index 29bbae1..36cf0a6 100644
--- a/lib/clang/libllvmsparccodegen/Makefile
+++ b/lib/clang/libllvmsparccodegen/Makefile
@@ -7,10 +7,12 @@ LIB= llvmsparccodegen
SRCDIR= lib/Target/Sparc
SRCS= DelaySlotFiller.cpp \
SparcAsmPrinter.cpp \
+ SparcCodeEmitter.cpp \
SparcFrameLowering.cpp \
SparcISelDAGToDAG.cpp \
SparcISelLowering.cpp \
SparcInstrInfo.cpp \
+ SparcJITInfo.cpp \
SparcMCInstLower.cpp \
SparcMachineFunctionInfo.cpp \
SparcRegisterInfo.cpp \
diff --git a/lib/clang/libllvmsparccodegen/Makefile.depend b/lib/clang/libllvmsparccodegen/Makefile.depend
new file mode 100644
index 0000000..19188f9
--- /dev/null
+++ b/lib/clang/libllvmsparccodegen/Makefile.depend
@@ -0,0 +1,103 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+DelaySlotFiller.o: SparcGenInstrInfo.inc.h
+DelaySlotFiller.o: SparcGenRegisterInfo.inc.h
+DelaySlotFiller.o: SparcGenSubtargetInfo.inc.h
+DelaySlotFiller.po: SparcGenInstrInfo.inc.h
+DelaySlotFiller.po: SparcGenRegisterInfo.inc.h
+DelaySlotFiller.po: SparcGenSubtargetInfo.inc.h
+SparcAsmPrinter.o: SparcGenInstrInfo.inc.h
+SparcAsmPrinter.o: SparcGenRegisterInfo.inc.h
+SparcAsmPrinter.o: SparcGenSubtargetInfo.inc.h
+SparcAsmPrinter.po: SparcGenInstrInfo.inc.h
+SparcAsmPrinter.po: SparcGenRegisterInfo.inc.h
+SparcAsmPrinter.po: SparcGenSubtargetInfo.inc.h
+SparcCodeEmitter.o: SparcGenCodeEmitter.inc.h
+SparcCodeEmitter.o: SparcGenInstrInfo.inc.h
+SparcCodeEmitter.o: SparcGenRegisterInfo.inc.h
+SparcCodeEmitter.o: SparcGenSubtargetInfo.inc.h
+SparcCodeEmitter.po: SparcGenCodeEmitter.inc.h
+SparcCodeEmitter.po: SparcGenInstrInfo.inc.h
+SparcCodeEmitter.po: SparcGenRegisterInfo.inc.h
+SparcCodeEmitter.po: SparcGenSubtargetInfo.inc.h
+SparcFrameLowering.o: SparcGenInstrInfo.inc.h
+SparcFrameLowering.o: SparcGenRegisterInfo.inc.h
+SparcFrameLowering.o: SparcGenSubtargetInfo.inc.h
+SparcFrameLowering.po: SparcGenInstrInfo.inc.h
+SparcFrameLowering.po: SparcGenRegisterInfo.inc.h
+SparcFrameLowering.po: SparcGenSubtargetInfo.inc.h
+SparcISelDAGToDAG.o: Intrinsics.inc.h
+SparcISelDAGToDAG.o: SparcGenDAGISel.inc.h
+SparcISelDAGToDAG.o: SparcGenInstrInfo.inc.h
+SparcISelDAGToDAG.o: SparcGenRegisterInfo.inc.h
+SparcISelDAGToDAG.o: SparcGenSubtargetInfo.inc.h
+SparcISelDAGToDAG.po: Intrinsics.inc.h
+SparcISelDAGToDAG.po: SparcGenDAGISel.inc.h
+SparcISelDAGToDAG.po: SparcGenInstrInfo.inc.h
+SparcISelDAGToDAG.po: SparcGenRegisterInfo.inc.h
+SparcISelDAGToDAG.po: SparcGenSubtargetInfo.inc.h
+SparcISelLowering.o: SparcGenCallingConv.inc.h
+SparcISelLowering.o: SparcGenInstrInfo.inc.h
+SparcISelLowering.o: SparcGenRegisterInfo.inc.h
+SparcISelLowering.o: SparcGenSubtargetInfo.inc.h
+SparcISelLowering.po: SparcGenCallingConv.inc.h
+SparcISelLowering.po: SparcGenInstrInfo.inc.h
+SparcISelLowering.po: SparcGenRegisterInfo.inc.h
+SparcISelLowering.po: SparcGenSubtargetInfo.inc.h
+SparcInstrInfo.o: SparcGenInstrInfo.inc.h
+SparcInstrInfo.o: SparcGenRegisterInfo.inc.h
+SparcInstrInfo.o: SparcGenSubtargetInfo.inc.h
+SparcInstrInfo.po: SparcGenInstrInfo.inc.h
+SparcInstrInfo.po: SparcGenRegisterInfo.inc.h
+SparcInstrInfo.po: SparcGenSubtargetInfo.inc.h
+SparcJITInfo.o: SparcGenInstrInfo.inc.h
+SparcJITInfo.o: SparcGenRegisterInfo.inc.h
+SparcJITInfo.o: SparcGenSubtargetInfo.inc.h
+SparcJITInfo.po: SparcGenInstrInfo.inc.h
+SparcJITInfo.po: SparcGenRegisterInfo.inc.h
+SparcJITInfo.po: SparcGenSubtargetInfo.inc.h
+SparcMCInstLower.o: SparcGenInstrInfo.inc.h
+SparcMCInstLower.o: SparcGenRegisterInfo.inc.h
+SparcMCInstLower.o: SparcGenSubtargetInfo.inc.h
+SparcMCInstLower.po: SparcGenInstrInfo.inc.h
+SparcMCInstLower.po: SparcGenRegisterInfo.inc.h
+SparcMCInstLower.po: SparcGenSubtargetInfo.inc.h
+SparcRegisterInfo.o: SparcGenInstrInfo.inc.h
+SparcRegisterInfo.o: SparcGenRegisterInfo.inc.h
+SparcRegisterInfo.o: SparcGenSubtargetInfo.inc.h
+SparcRegisterInfo.po: SparcGenInstrInfo.inc.h
+SparcRegisterInfo.po: SparcGenRegisterInfo.inc.h
+SparcRegisterInfo.po: SparcGenSubtargetInfo.inc.h
+SparcSelectionDAGInfo.o: SparcGenInstrInfo.inc.h
+SparcSelectionDAGInfo.o: SparcGenRegisterInfo.inc.h
+SparcSelectionDAGInfo.o: SparcGenSubtargetInfo.inc.h
+SparcSelectionDAGInfo.po: SparcGenInstrInfo.inc.h
+SparcSelectionDAGInfo.po: SparcGenRegisterInfo.inc.h
+SparcSelectionDAGInfo.po: SparcGenSubtargetInfo.inc.h
+SparcSubtarget.o: SparcGenInstrInfo.inc.h
+SparcSubtarget.o: SparcGenRegisterInfo.inc.h
+SparcSubtarget.o: SparcGenSubtargetInfo.inc.h
+SparcSubtarget.po: SparcGenInstrInfo.inc.h
+SparcSubtarget.po: SparcGenRegisterInfo.inc.h
+SparcSubtarget.po: SparcGenSubtargetInfo.inc.h
+SparcTargetMachine.o: SparcGenInstrInfo.inc.h
+SparcTargetMachine.o: SparcGenRegisterInfo.inc.h
+SparcTargetMachine.o: SparcGenSubtargetInfo.inc.h
+SparcTargetMachine.po: SparcGenInstrInfo.inc.h
+SparcTargetMachine.po: SparcGenRegisterInfo.inc.h
+SparcTargetMachine.po: SparcGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmsparcdesc/Makefile.depend b/lib/clang/libllvmsparcdesc/Makefile.depend
new file mode 100644
index 0000000..c7de054
--- /dev/null
+++ b/lib/clang/libllvmsparcdesc/Makefile.depend
@@ -0,0 +1,43 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+SparcAsmBackend.o: SparcGenInstrInfo.inc.h
+SparcAsmBackend.o: SparcGenRegisterInfo.inc.h
+SparcAsmBackend.o: SparcGenSubtargetInfo.inc.h
+SparcAsmBackend.po: SparcGenInstrInfo.inc.h
+SparcAsmBackend.po: SparcGenRegisterInfo.inc.h
+SparcAsmBackend.po: SparcGenSubtargetInfo.inc.h
+SparcELFObjectWriter.o: SparcGenInstrInfo.inc.h
+SparcELFObjectWriter.o: SparcGenRegisterInfo.inc.h
+SparcELFObjectWriter.o: SparcGenSubtargetInfo.inc.h
+SparcELFObjectWriter.po: SparcGenInstrInfo.inc.h
+SparcELFObjectWriter.po: SparcGenRegisterInfo.inc.h
+SparcELFObjectWriter.po: SparcGenSubtargetInfo.inc.h
+SparcMCCodeEmitter.o: SparcGenInstrInfo.inc.h
+SparcMCCodeEmitter.o: SparcGenMCCodeEmitter.inc.h
+SparcMCCodeEmitter.o: SparcGenRegisterInfo.inc.h
+SparcMCCodeEmitter.o: SparcGenSubtargetInfo.inc.h
+SparcMCCodeEmitter.po: SparcGenInstrInfo.inc.h
+SparcMCCodeEmitter.po: SparcGenMCCodeEmitter.inc.h
+SparcMCCodeEmitter.po: SparcGenRegisterInfo.inc.h
+SparcMCCodeEmitter.po: SparcGenSubtargetInfo.inc.h
+SparcMCTargetDesc.o: SparcGenInstrInfo.inc.h
+SparcMCTargetDesc.o: SparcGenRegisterInfo.inc.h
+SparcMCTargetDesc.o: SparcGenSubtargetInfo.inc.h
+SparcMCTargetDesc.po: SparcGenInstrInfo.inc.h
+SparcMCTargetDesc.po: SparcGenRegisterInfo.inc.h
+SparcMCTargetDesc.po: SparcGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmsparcdisassembler/Makefile.depend b/lib/clang/libllvmsparcdisassembler/Makefile.depend
new file mode 100644
index 0000000..e25131c
--- /dev/null
+++ b/lib/clang/libllvmsparcdisassembler/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+SparcDisassembler.o: SparcGenDisassemblerTables.inc.h
+SparcDisassembler.o: SparcGenInstrInfo.inc.h
+SparcDisassembler.o: SparcGenRegisterInfo.inc.h
+SparcDisassembler.o: SparcGenSubtargetInfo.inc.h
+SparcDisassembler.po: SparcGenDisassemblerTables.inc.h
+SparcDisassembler.po: SparcGenInstrInfo.inc.h
+SparcDisassembler.po: SparcGenRegisterInfo.inc.h
+SparcDisassembler.po: SparcGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmsparcinfo/Makefile.depend b/lib/clang/libllvmsparcinfo/Makefile.depend
new file mode 100644
index 0000000..f5a3bc9
--- /dev/null
+++ b/lib/clang/libllvmsparcinfo/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+SparcTargetInfo.o: SparcGenInstrInfo.inc.h
+SparcTargetInfo.o: SparcGenRegisterInfo.inc.h
+SparcTargetInfo.o: SparcGenSubtargetInfo.inc.h
+SparcTargetInfo.po: SparcGenInstrInfo.inc.h
+SparcTargetInfo.po: SparcGenRegisterInfo.inc.h
+SparcTargetInfo.po: SparcGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmsparcinstprinter/Makefile.depend b/lib/clang/libllvmsparcinstprinter/Makefile.depend
new file mode 100644
index 0000000..411f080
--- /dev/null
+++ b/lib/clang/libllvmsparcinstprinter/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+SparcInstPrinter.o: SparcGenAsmWriter.inc.h
+SparcInstPrinter.o: SparcGenInstrInfo.inc.h
+SparcInstPrinter.o: SparcGenRegisterInfo.inc.h
+SparcInstPrinter.o: SparcGenSubtargetInfo.inc.h
+SparcInstPrinter.po: SparcGenAsmWriter.inc.h
+SparcInstPrinter.po: SparcGenInstrInfo.inc.h
+SparcInstPrinter.po: SparcGenRegisterInfo.inc.h
+SparcInstPrinter.po: SparcGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmsupport/Makefile b/lib/clang/libllvmsupport/Makefile
index f325b15..b7cfe6a 100644
--- a/lib/clang/libllvmsupport/Makefile
+++ b/lib/clang/libllvmsupport/Makefile
@@ -8,14 +8,12 @@ SRCDIR= lib/Support
SRCS= APFloat.cpp \
APInt.cpp \
APSInt.cpp \
- ARMBuildAttrs.cpp \
- ARMWinEH.cpp \
Allocator.cpp \
Atomic.cpp \
BlockFrequency.cpp \
BranchProbability.cpp \
CommandLine.cpp \
- Compression.cpp \
+ ConstantRange.cpp \
ConvertUTF.c \
ConvertUTFWrapper.cpp \
CrashRecoveryContext.cpp \
@@ -33,44 +31,39 @@ SRCS= APFloat.cpp \
GraphWriter.cpp \
Hashing.cpp \
Host.cpp \
+ IncludeFile.cpp \
IntEqClasses.cpp \
IntervalMap.cpp \
IntrusiveRefCntPtr.cpp \
IsInf.cpp \
IsNAN.cpp \
- LEB128.cpp \
- LineIterator.cpp \
Locale.cpp \
LockFileManager.cpp \
MD5.cpp \
ManagedStatic.cpp \
- MathExtras.cpp \
Memory.cpp \
MemoryBuffer.cpp \
MemoryObject.cpp \
Mutex.cpp \
- Options.cpp \
Path.cpp \
PluginLoader.cpp \
PrettyStackTrace.cpp \
Process.cpp \
Program.cpp \
RWMutex.cpp \
- RandomNumberGenerator.cpp \
Regex.cpp \
- ScaledNumber.cpp \
SearchForAddressOfSpecialSymbol.cpp \
Signals.cpp \
SmallPtrSet.cpp \
SmallVector.cpp \
SourceMgr.cpp \
- SpecialCaseList.cpp \
Statistic.cpp \
- StreamingMemoryObject.cpp \
+ StreamableMemoryObject.cpp \
StringExtras.cpp \
StringMap.cpp \
StringPool.cpp \
StringRef.cpp \
+ StringRefMemoryObject.cpp \
TargetRegistry.cpp \
ThreadLocal.cpp \
Threading.cpp \
@@ -91,10 +84,16 @@ SRCS= APFloat.cpp \
regerror.c \
regexec.c \
regfree.c \
- regstrlcpy.c
+ regstrlcpy.c \
+ system_error.cpp
+
+.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no"
+SRCS+= Disassembler.cpp
+.endif
.if ${MK_CLANG_EXTRAS} != "no"
-SRCS+= DataStream.cpp \
+SRCS+= Compression.cpp \
+ DataStream.cpp \
FileUtilities.cpp \
SystemUtils.cpp
.endif
diff --git a/lib/clang/libllvmsupport/Makefile.depend b/lib/clang/libllvmsupport/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmsupport/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmtablegen/Makefile b/lib/clang/libllvmtablegen/Makefile
index fb0c5b8..9a764b3 100644
--- a/lib/clang/libllvmtablegen/Makefile
+++ b/lib/clang/libllvmtablegen/Makefile
@@ -8,7 +8,6 @@ SRCDIR= lib/TableGen
SRCS= Error.cpp \
Main.cpp \
Record.cpp \
- SetTheory.cpp \
StringMatcher.cpp \
TableGenBackend.cpp \
TGLexer.cpp \
diff --git a/lib/clang/libllvmtablegen/Makefile.depend b/lib/clang/libllvmtablegen/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmtablegen/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmtarget/Makefile b/lib/clang/libllvmtarget/Makefile
index 3f9619b..b85fbec 100644
--- a/lib/clang/libllvmtarget/Makefile
+++ b/lib/clang/libllvmtarget/Makefile
@@ -5,8 +5,10 @@
LIB= llvmtarget
SRCDIR= lib/Target
-SRCS= Target.cpp \
+SRCS= Mangler.cpp \
+ Target.cpp \
TargetIntrinsicInfo.cpp \
+ TargetJITInfo.cpp \
TargetLibraryInfo.cpp \
TargetLoweringObjectFile.cpp \
TargetMachine.cpp \
diff --git a/lib/clang/libllvmtarget/Makefile.depend b/lib/clang/libllvmtarget/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmtarget/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/libllvmtransformutils/Makefile b/lib/clang/libllvmtransformutils/Makefile
index a3cf212..cfad040 100644
--- a/lib/clang/libllvmtransformutils/Makefile
+++ b/lib/clang/libllvmtransformutils/Makefile
@@ -5,9 +5,7 @@
LIB= llvmtransformutils
SRCDIR= lib/Transforms/Utils
-SRCS= ASanStackFrameLayout.cpp \
- AddDiscriminators.cpp \
- BasicBlockUtils.cpp \
+SRCS= BasicBlockUtils.cpp \
BreakCriticalEdges.cpp \
BuildLibCalls.cpp \
BypassSlowDivision.cpp \
@@ -15,7 +13,6 @@ SRCS= ASanStackFrameLayout.cpp \
CloneModule.cpp \
CmpInstAnalysis.cpp \
CodeExtractor.cpp \
- CtorUtils.cpp \
DemoteRegToStack.cpp \
FlattenCFG.cpp \
GlobalStatus.cpp \
@@ -39,7 +36,7 @@ SRCS= ASanStackFrameLayout.cpp \
SimplifyIndVar.cpp \
SimplifyInstructions.cpp \
SimplifyLibCalls.cpp \
- SymbolRewriter.cpp \
+ SpecialCaseList.cpp \
UnifyFunctionExitNodes.cpp \
ValueMapper.cpp
diff --git a/lib/clang/libllvmtransformutils/Makefile.depend b/lib/clang/libllvmtransformutils/Makefile.depend
new file mode 100644
index 0000000..2aad904
--- /dev/null
+++ b/lib/clang/libllvmtransformutils/Makefile.depend
@@ -0,0 +1,47 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+BasicBlockUtils.o: Intrinsics.inc.h
+BasicBlockUtils.po: Intrinsics.inc.h
+BuildLibCalls.o: Intrinsics.inc.h
+BuildLibCalls.po: Intrinsics.inc.h
+CloneFunction.o: Intrinsics.inc.h
+CloneFunction.po: Intrinsics.inc.h
+CodeExtractor.o: Intrinsics.inc.h
+CodeExtractor.po: Intrinsics.inc.h
+GlobalStatus.o: Intrinsics.inc.h
+GlobalStatus.po: Intrinsics.inc.h
+InlineFunction.o: Intrinsics.inc.h
+InlineFunction.po: Intrinsics.inc.h
+IntegerDivision.o: Intrinsics.inc.h
+IntegerDivision.po: Intrinsics.inc.h
+Local.o: Intrinsics.inc.h
+Local.po: Intrinsics.inc.h
+LoopSimplify.o: Intrinsics.inc.h
+LoopSimplify.po: Intrinsics.inc.h
+LowerExpectIntrinsic.o: Intrinsics.inc.h
+LowerExpectIntrinsic.po: Intrinsics.inc.h
+LowerInvoke.o: Intrinsics.inc.h
+LowerInvoke.po: Intrinsics.inc.h
+PromoteMemoryToRegister.o: Intrinsics.inc.h
+PromoteMemoryToRegister.po: Intrinsics.inc.h
+SSAUpdater.o: Intrinsics.inc.h
+SSAUpdater.po: Intrinsics.inc.h
+SimplifyCFG.o: Intrinsics.inc.h
+SimplifyCFG.po: Intrinsics.inc.h
+SimplifyLibCalls.o: Intrinsics.inc.h
+SimplifyLibCalls.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmvectorize/Makefile.depend b/lib/clang/libllvmvectorize/Makefile.depend
new file mode 100644
index 0000000..171d928
--- /dev/null
+++ b/lib/clang/libllvmvectorize/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+BBVectorize.o: Intrinsics.inc.h
+BBVectorize.po: Intrinsics.inc.h
+LoopVectorize.o: Intrinsics.inc.h
+LoopVectorize.po: Intrinsics.inc.h
+SLPVectorizer.o: Intrinsics.inc.h
+SLPVectorizer.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmx86asmparser/Makefile b/lib/clang/libllvmx86asmparser/Makefile
index f972065..0d32f9c 100644
--- a/lib/clang/libllvmx86asmparser/Makefile
+++ b/lib/clang/libllvmx86asmparser/Makefile
@@ -6,8 +6,7 @@ LIB= llvmx86asmparser
SRCDIR= lib/Target/X86/AsmParser
INCDIR= lib/Target/X86
-SRCS= X86AsmInstrumentation.cpp \
- X86AsmParser.cpp
+SRCS= X86AsmParser.cpp
TGHDRS= X86GenAsmMatcher \
X86GenInstrInfo \
diff --git a/lib/clang/libllvmx86asmparser/Makefile.depend b/lib/clang/libllvmx86asmparser/Makefile.depend
new file mode 100644
index 0000000..200e80d
--- /dev/null
+++ b/lib/clang/libllvmx86asmparser/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+X86AsmParser.o: X86GenAsmMatcher.inc.h
+X86AsmParser.o: X86GenInstrInfo.inc.h
+X86AsmParser.o: X86GenRegisterInfo.inc.h
+X86AsmParser.o: X86GenSubtargetInfo.inc.h
+X86AsmParser.po: X86GenAsmMatcher.inc.h
+X86AsmParser.po: X86GenInstrInfo.inc.h
+X86AsmParser.po: X86GenRegisterInfo.inc.h
+X86AsmParser.po: X86GenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmx86codegen/Makefile b/lib/clang/libllvmx86codegen/Makefile
index b030b1f..ed7ab8e 100644
--- a/lib/clang/libllvmx86codegen/Makefile
+++ b/lib/clang/libllvmx86codegen/Makefile
@@ -6,7 +6,8 @@ LIB= llvmx86codegen
SRCDIR= lib/Target/X86
SRCS= X86AsmPrinter.cpp \
- X86CallFrameOptimization.cpp \
+ X86COFFMachineModuleInfo.cpp \
+ X86CodeEmitter.cpp \
X86FastISel.cpp \
X86FixupLEAs.cpp \
X86FloatingPoint.cpp \
@@ -14,6 +15,7 @@ SRCS= X86AsmPrinter.cpp \
X86ISelDAGToDAG.cpp \
X86ISelLowering.cpp \
X86InstrInfo.cpp \
+ X86JITInfo.cpp \
X86MCInstLower.cpp \
X86MachineFunctionInfo.cpp \
X86PadShortFunction.cpp \
diff --git a/lib/clang/libllvmx86codegen/Makefile.depend b/lib/clang/libllvmx86codegen/Makefile.depend
new file mode 100644
index 0000000..5303948
--- /dev/null
+++ b/lib/clang/libllvmx86codegen/Makefile.depend
@@ -0,0 +1,141 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+X86AsmPrinter.o: X86GenInstrInfo.inc.h
+X86AsmPrinter.o: X86GenRegisterInfo.inc.h
+X86AsmPrinter.o: X86GenSubtargetInfo.inc.h
+X86AsmPrinter.po: X86GenInstrInfo.inc.h
+X86AsmPrinter.po: X86GenRegisterInfo.inc.h
+X86AsmPrinter.po: X86GenSubtargetInfo.inc.h
+X86CodeEmitter.o: X86GenInstrInfo.inc.h
+X86CodeEmitter.o: X86GenRegisterInfo.inc.h
+X86CodeEmitter.o: X86GenSubtargetInfo.inc.h
+X86CodeEmitter.po: X86GenInstrInfo.inc.h
+X86CodeEmitter.po: X86GenRegisterInfo.inc.h
+X86CodeEmitter.po: X86GenSubtargetInfo.inc.h
+X86FastISel.o: Intrinsics.inc.h
+X86FastISel.o: X86GenCallingConv.inc.h
+X86FastISel.o: X86GenFastISel.inc.h
+X86FastISel.o: X86GenInstrInfo.inc.h
+X86FastISel.o: X86GenRegisterInfo.inc.h
+X86FastISel.o: X86GenSubtargetInfo.inc.h
+X86FastISel.po: Intrinsics.inc.h
+X86FastISel.po: X86GenCallingConv.inc.h
+X86FastISel.po: X86GenFastISel.inc.h
+X86FastISel.po: X86GenInstrInfo.inc.h
+X86FastISel.po: X86GenRegisterInfo.inc.h
+X86FastISel.po: X86GenSubtargetInfo.inc.h
+X86FixupLEAs.o: X86GenInstrInfo.inc.h
+X86FixupLEAs.o: X86GenRegisterInfo.inc.h
+X86FixupLEAs.o: X86GenSubtargetInfo.inc.h
+X86FixupLEAs.po: X86GenInstrInfo.inc.h
+X86FixupLEAs.po: X86GenRegisterInfo.inc.h
+X86FixupLEAs.po: X86GenSubtargetInfo.inc.h
+X86FloatingPoint.o: X86GenInstrInfo.inc.h
+X86FloatingPoint.o: X86GenRegisterInfo.inc.h
+X86FloatingPoint.o: X86GenSubtargetInfo.inc.h
+X86FloatingPoint.po: X86GenInstrInfo.inc.h
+X86FloatingPoint.po: X86GenRegisterInfo.inc.h
+X86FloatingPoint.po: X86GenSubtargetInfo.inc.h
+X86FrameLowering.o: X86GenInstrInfo.inc.h
+X86FrameLowering.o: X86GenRegisterInfo.inc.h
+X86FrameLowering.o: X86GenSubtargetInfo.inc.h
+X86FrameLowering.po: X86GenInstrInfo.inc.h
+X86FrameLowering.po: X86GenRegisterInfo.inc.h
+X86FrameLowering.po: X86GenSubtargetInfo.inc.h
+X86ISelDAGToDAG.o: Intrinsics.inc.h
+X86ISelDAGToDAG.o: X86GenDAGISel.inc.h
+X86ISelDAGToDAG.o: X86GenInstrInfo.inc.h
+X86ISelDAGToDAG.o: X86GenRegisterInfo.inc.h
+X86ISelDAGToDAG.o: X86GenSubtargetInfo.inc.h
+X86ISelDAGToDAG.po: Intrinsics.inc.h
+X86ISelDAGToDAG.po: X86GenDAGISel.inc.h
+X86ISelDAGToDAG.po: X86GenInstrInfo.inc.h
+X86ISelDAGToDAG.po: X86GenRegisterInfo.inc.h
+X86ISelDAGToDAG.po: X86GenSubtargetInfo.inc.h
+X86ISelLowering.o: Intrinsics.inc.h
+X86ISelLowering.o: X86GenCallingConv.inc.h
+X86ISelLowering.o: X86GenInstrInfo.inc.h
+X86ISelLowering.o: X86GenRegisterInfo.inc.h
+X86ISelLowering.o: X86GenSubtargetInfo.inc.h
+X86ISelLowering.po: Intrinsics.inc.h
+X86ISelLowering.po: X86GenCallingConv.inc.h
+X86ISelLowering.po: X86GenInstrInfo.inc.h
+X86ISelLowering.po: X86GenRegisterInfo.inc.h
+X86ISelLowering.po: X86GenSubtargetInfo.inc.h
+X86InstrInfo.o: X86GenInstrInfo.inc.h
+X86InstrInfo.o: X86GenRegisterInfo.inc.h
+X86InstrInfo.o: X86GenSubtargetInfo.inc.h
+X86InstrInfo.po: X86GenInstrInfo.inc.h
+X86InstrInfo.po: X86GenRegisterInfo.inc.h
+X86InstrInfo.po: X86GenSubtargetInfo.inc.h
+X86JITInfo.o: X86GenInstrInfo.inc.h
+X86JITInfo.o: X86GenRegisterInfo.inc.h
+X86JITInfo.o: X86GenSubtargetInfo.inc.h
+X86JITInfo.po: X86GenInstrInfo.inc.h
+X86JITInfo.po: X86GenRegisterInfo.inc.h
+X86JITInfo.po: X86GenSubtargetInfo.inc.h
+X86MCInstLower.o: X86GenInstrInfo.inc.h
+X86MCInstLower.o: X86GenRegisterInfo.inc.h
+X86MCInstLower.o: X86GenSubtargetInfo.inc.h
+X86MCInstLower.po: X86GenInstrInfo.inc.h
+X86MCInstLower.po: X86GenRegisterInfo.inc.h
+X86MCInstLower.po: X86GenSubtargetInfo.inc.h
+X86PadShortFunction.o: X86GenInstrInfo.inc.h
+X86PadShortFunction.o: X86GenRegisterInfo.inc.h
+X86PadShortFunction.o: X86GenSubtargetInfo.inc.h
+X86PadShortFunction.po: X86GenInstrInfo.inc.h
+X86PadShortFunction.po: X86GenRegisterInfo.inc.h
+X86PadShortFunction.po: X86GenSubtargetInfo.inc.h
+X86RegisterInfo.o: X86GenInstrInfo.inc.h
+X86RegisterInfo.o: X86GenRegisterInfo.inc.h
+X86RegisterInfo.o: X86GenSubtargetInfo.inc.h
+X86RegisterInfo.po: X86GenInstrInfo.inc.h
+X86RegisterInfo.po: X86GenRegisterInfo.inc.h
+X86RegisterInfo.po: X86GenSubtargetInfo.inc.h
+X86SelectionDAGInfo.o: X86GenInstrInfo.inc.h
+X86SelectionDAGInfo.o: X86GenRegisterInfo.inc.h
+X86SelectionDAGInfo.o: X86GenSubtargetInfo.inc.h
+X86SelectionDAGInfo.po: X86GenInstrInfo.inc.h
+X86SelectionDAGInfo.po: X86GenRegisterInfo.inc.h
+X86SelectionDAGInfo.po: X86GenSubtargetInfo.inc.h
+X86Subtarget.o: X86GenInstrInfo.inc.h
+X86Subtarget.o: X86GenRegisterInfo.inc.h
+X86Subtarget.o: X86GenSubtargetInfo.inc.h
+X86Subtarget.po: X86GenInstrInfo.inc.h
+X86Subtarget.po: X86GenRegisterInfo.inc.h
+X86Subtarget.po: X86GenSubtargetInfo.inc.h
+X86TargetMachine.o: X86GenInstrInfo.inc.h
+X86TargetMachine.o: X86GenRegisterInfo.inc.h
+X86TargetMachine.o: X86GenSubtargetInfo.inc.h
+X86TargetMachine.po: X86GenInstrInfo.inc.h
+X86TargetMachine.po: X86GenRegisterInfo.inc.h
+X86TargetMachine.po: X86GenSubtargetInfo.inc.h
+X86TargetTransformInfo.o: Intrinsics.inc.h
+X86TargetTransformInfo.o: X86GenInstrInfo.inc.h
+X86TargetTransformInfo.o: X86GenRegisterInfo.inc.h
+X86TargetTransformInfo.o: X86GenSubtargetInfo.inc.h
+X86TargetTransformInfo.po: Intrinsics.inc.h
+X86TargetTransformInfo.po: X86GenInstrInfo.inc.h
+X86TargetTransformInfo.po: X86GenRegisterInfo.inc.h
+X86TargetTransformInfo.po: X86GenSubtargetInfo.inc.h
+X86VZeroUpper.o: X86GenInstrInfo.inc.h
+X86VZeroUpper.o: X86GenRegisterInfo.inc.h
+X86VZeroUpper.o: X86GenSubtargetInfo.inc.h
+X86VZeroUpper.po: X86GenInstrInfo.inc.h
+X86VZeroUpper.po: X86GenRegisterInfo.inc.h
+X86VZeroUpper.po: X86GenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmx86desc/Makefile b/lib/clang/libllvmx86desc/Makefile
index 1ca2839..6401649 100644
--- a/lib/clang/libllvmx86desc/Makefile
+++ b/lib/clang/libllvmx86desc/Makefile
@@ -13,8 +13,7 @@ SRCS= X86AsmBackend.cpp \
X86MCTargetDesc.cpp \
X86MachORelocationInfo.cpp \
X86MachObjectWriter.cpp \
- X86WinCOFFObjectWriter.cpp \
- X86WinCOFFStreamer.cpp
+ X86WinCOFFObjectWriter.cpp
CFLAGS+= -I${LLVM_SRCS}/${SRCDIR}/..
TGHDRS= X86GenInstrInfo \
diff --git a/lib/clang/libllvmx86desc/Makefile.depend b/lib/clang/libllvmx86desc/Makefile.depend
new file mode 100644
index 0000000..5034757
--- /dev/null
+++ b/lib/clang/libllvmx86desc/Makefile.depend
@@ -0,0 +1,65 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+X86AsmBackend.o: X86GenInstrInfo.inc.h
+X86AsmBackend.o: X86GenRegisterInfo.inc.h
+X86AsmBackend.o: X86GenSubtargetInfo.inc.h
+X86AsmBackend.po: X86GenInstrInfo.inc.h
+X86AsmBackend.po: X86GenRegisterInfo.inc.h
+X86AsmBackend.po: X86GenSubtargetInfo.inc.h
+X86ELFObjectWriter.o: X86GenInstrInfo.inc.h
+X86ELFObjectWriter.o: X86GenRegisterInfo.inc.h
+X86ELFObjectWriter.o: X86GenSubtargetInfo.inc.h
+X86ELFObjectWriter.po: X86GenInstrInfo.inc.h
+X86ELFObjectWriter.po: X86GenRegisterInfo.inc.h
+X86ELFObjectWriter.po: X86GenSubtargetInfo.inc.h
+X86ELFRelocationInfo.o: X86GenInstrInfo.inc.h
+X86ELFRelocationInfo.o: X86GenRegisterInfo.inc.h
+X86ELFRelocationInfo.o: X86GenSubtargetInfo.inc.h
+X86ELFRelocationInfo.po: X86GenInstrInfo.inc.h
+X86ELFRelocationInfo.po: X86GenRegisterInfo.inc.h
+X86ELFRelocationInfo.po: X86GenSubtargetInfo.inc.h
+X86MCCodeEmitter.o: X86GenInstrInfo.inc.h
+X86MCCodeEmitter.o: X86GenRegisterInfo.inc.h
+X86MCCodeEmitter.o: X86GenSubtargetInfo.inc.h
+X86MCCodeEmitter.po: X86GenInstrInfo.inc.h
+X86MCCodeEmitter.po: X86GenRegisterInfo.inc.h
+X86MCCodeEmitter.po: X86GenSubtargetInfo.inc.h
+X86MCTargetDesc.o: X86GenInstrInfo.inc.h
+X86MCTargetDesc.o: X86GenRegisterInfo.inc.h
+X86MCTargetDesc.o: X86GenSubtargetInfo.inc.h
+X86MCTargetDesc.po: X86GenInstrInfo.inc.h
+X86MCTargetDesc.po: X86GenRegisterInfo.inc.h
+X86MCTargetDesc.po: X86GenSubtargetInfo.inc.h
+X86MachORelocationInfo.o: X86GenInstrInfo.inc.h
+X86MachORelocationInfo.o: X86GenRegisterInfo.inc.h
+X86MachORelocationInfo.o: X86GenSubtargetInfo.inc.h
+X86MachORelocationInfo.po: X86GenInstrInfo.inc.h
+X86MachORelocationInfo.po: X86GenRegisterInfo.inc.h
+X86MachORelocationInfo.po: X86GenSubtargetInfo.inc.h
+X86MachObjectWriter.o: X86GenInstrInfo.inc.h
+X86MachObjectWriter.o: X86GenRegisterInfo.inc.h
+X86MachObjectWriter.o: X86GenSubtargetInfo.inc.h
+X86MachObjectWriter.po: X86GenInstrInfo.inc.h
+X86MachObjectWriter.po: X86GenRegisterInfo.inc.h
+X86MachObjectWriter.po: X86GenSubtargetInfo.inc.h
+X86WinCOFFObjectWriter.o: X86GenInstrInfo.inc.h
+X86WinCOFFObjectWriter.o: X86GenRegisterInfo.inc.h
+X86WinCOFFObjectWriter.o: X86GenSubtargetInfo.inc.h
+X86WinCOFFObjectWriter.po: X86GenInstrInfo.inc.h
+X86WinCOFFObjectWriter.po: X86GenRegisterInfo.inc.h
+X86WinCOFFObjectWriter.po: X86GenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmx86disassembler/Makefile b/lib/clang/libllvmx86disassembler/Makefile
index 23ec976..e5489a0 100644
--- a/lib/clang/libllvmx86disassembler/Makefile
+++ b/lib/clang/libllvmx86disassembler/Makefile
@@ -9,12 +9,11 @@ INCDIR= lib/Target/X86
SRCS= X86Disassembler.cpp
.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no"
-SRCS+= X86DisassemblerDecoder.cpp
+SRCS+= X86DisassemblerDecoder.c
.endif
TGHDRS= X86GenDisassemblerTables \
X86GenInstrInfo \
- X86GenRegisterInfo \
- X86GenSubtargetInfo
+ X86GenRegisterInfo
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmx86disassembler/Makefile.depend b/lib/clang/libllvmx86disassembler/Makefile.depend
new file mode 100644
index 0000000..fa7a65b
--- /dev/null
+++ b/lib/clang/libllvmx86disassembler/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+X86Disassembler.o: X86GenInstrInfo.inc.h
+X86Disassembler.o: X86GenRegisterInfo.inc.h
+X86Disassembler.po: X86GenInstrInfo.inc.h
+X86Disassembler.po: X86GenRegisterInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmx86info/Makefile.depend b/lib/clang/libllvmx86info/Makefile.depend
new file mode 100644
index 0000000..1ea75cb
--- /dev/null
+++ b/lib/clang/libllvmx86info/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+X86TargetInfo.o: X86GenInstrInfo.inc.h
+X86TargetInfo.o: X86GenRegisterInfo.inc.h
+X86TargetInfo.o: X86GenSubtargetInfo.inc.h
+X86TargetInfo.po: X86GenInstrInfo.inc.h
+X86TargetInfo.po: X86GenRegisterInfo.inc.h
+X86TargetInfo.po: X86GenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmx86instprinter/Makefile.depend b/lib/clang/libllvmx86instprinter/Makefile.depend
new file mode 100644
index 0000000..86a651a
--- /dev/null
+++ b/lib/clang/libllvmx86instprinter/Makefile.depend
@@ -0,0 +1,39 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+X86ATTInstPrinter.o: X86GenAsmWriter.inc.h
+X86ATTInstPrinter.o: X86GenInstrInfo.inc.h
+X86ATTInstPrinter.o: X86GenRegisterInfo.inc.h
+X86ATTInstPrinter.o: X86GenSubtargetInfo.inc.h
+X86ATTInstPrinter.po: X86GenAsmWriter.inc.h
+X86ATTInstPrinter.po: X86GenInstrInfo.inc.h
+X86ATTInstPrinter.po: X86GenRegisterInfo.inc.h
+X86ATTInstPrinter.po: X86GenSubtargetInfo.inc.h
+X86InstComments.o: X86GenInstrInfo.inc.h
+X86InstComments.o: X86GenRegisterInfo.inc.h
+X86InstComments.o: X86GenSubtargetInfo.inc.h
+X86InstComments.po: X86GenInstrInfo.inc.h
+X86InstComments.po: X86GenRegisterInfo.inc.h
+X86InstComments.po: X86GenSubtargetInfo.inc.h
+X86IntelInstPrinter.o: X86GenAsmWriter1.inc.h
+X86IntelInstPrinter.o: X86GenInstrInfo.inc.h
+X86IntelInstPrinter.o: X86GenRegisterInfo.inc.h
+X86IntelInstPrinter.o: X86GenSubtargetInfo.inc.h
+X86IntelInstPrinter.po: X86GenAsmWriter1.inc.h
+X86IntelInstPrinter.po: X86GenInstrInfo.inc.h
+X86IntelInstPrinter.po: X86GenRegisterInfo.inc.h
+X86IntelInstPrinter.po: X86GenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmx86utils/Makefile.depend b/lib/clang/libllvmx86utils/Makefile.depend
new file mode 100644
index 0000000..4d8f064
--- /dev/null
+++ b/lib/clang/libllvmx86utils/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/csu/Makefile b/lib/csu/Makefile
index 5f1cddc..320a5a4 100644
--- a/lib/csu/Makefile
+++ b/lib/csu/Makefile
@@ -1,7 +1,8 @@
# $FreeBSD$
-.if exists(${.CURDIR}/${MACHINE_ARCH})
-SUBDIR+= ${MACHINE_ARCH}
+ARCH= ${MACHINE_ARCH:S/i386/i386-elf/}
+.if exists(${.CURDIR}/${ARCH})
+SUBDIR+= ${ARCH}
.else
SUBDIR+= ${MACHINE_CPUARCH}
.endif
diff --git a/lib/csu/Makefile.inc b/lib/csu/Makefile.inc
index 95d5c5e..ff77f66 100644
--- a/lib/csu/Makefile.inc
+++ b/lib/csu/Makefile.inc
@@ -7,3 +7,8 @@ SED_FIX_NOTE = -i "" -e '/\.note\.tag/s/progbits/note/'
NO_WMISSING_VARIABLE_DECLARATIONS=
.include "../Makefile.inc"
+
+.if ${MK_STAGING} == "yes" && ${.TARGETS:Nall} == ""
+FILES?= ${OBJS}
+FILESDIR?= ${LIBDIR}
+.endif
diff --git a/lib/csu/aarch64/Makefile b/lib/csu/aarch64/Makefile
deleted file mode 100644
index bf4c7b1..0000000
--- a/lib/csu/aarch64/Makefile
+++ /dev/null
@@ -1,44 +0,0 @@
-# $FreeBSD$
-
-.PATH: ${.CURDIR}/../common
-
-SRCS= crt1.c crti.S crtn.S
-OBJS= ${SRCS:N*.h:R:S/$/.o/g}
-OBJS+= Scrt1.o gcrt1.o
-CFLAGS+= -I${.CURDIR}/../common \
- -I${.CURDIR}/../../libc/include
-
-all: ${OBJS}
-
-CLEANFILES= ${OBJS}
-CLEANFILES+= crt1.s gcrt1.s Scrt1.s
-
-# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
-# directly compiled to .o files.
-
-crt1.s: crt1.c
- ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
- sed ${SED_FIX_NOTE} ${.TARGET}
-
-crt1.o: crt1.s
- ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
-
-gcrt1.s: crt1.c
- ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
- sed ${SED_FIX_NOTE} ${.TARGET}
-
-gcrt1.o: gcrt1.s
- ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
-
-Scrt1.s: crt1.c
- ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
- sed ${SED_FIX_NOTE} ${.TARGET}
-
-Scrt1.o: Scrt1.s
- ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
-
-realinstall:
- ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${OBJS} ${DESTDIR}${LIBDIR}
-
-.include <bsd.lib.mk>
diff --git a/lib/csu/aarch64/crt1.c b/lib/csu/aarch64/crt1.c
deleted file mode 100644
index 6518e8d..0000000
--- a/lib/csu/aarch64/crt1.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* LINTLIBRARY */
-/*-
- * Copyright 1996-1998 John D. Polstra.
- * Copyright 2014 Andrew Turner.
- * Copyright 2014-2015 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Andrew Turner
- * 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 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 <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#ifndef lint
-#ifndef __GNUC__
-#error "GCC is needed to compile this file"
-#endif
-#endif /* lint */
-
-#include <stdlib.h>
-
-#include "libc_private.h"
-#include "crtbrand.c"
-#include "ignore_init.c"
-
-#ifdef GCRT
-extern void _mcleanup(void);
-extern void monstartup(void *, void *);
-extern int eprol;
-extern int etext;
-#endif
-
-void __start(int, char **, char **, void (*)(void));
-
-/* The entry function. */
-__asm(" .text \n"
-" .align 0 \n"
-" .globl _start \n"
-" _start: \n"
-" mov x3, x2 \n" /* cleanup */
-" ldr x0, [sp] \n" /* Load argc */
-" add x1, sp, #8 \n" /* load argv */
-" add x2, x1, x0, lsl #3 \n" /* env is after argv */
-" add x2, x2, #8 \n" /* argv is null terminated */
-" b __start ");
-
-
-/* The entry function. */
-void
-__start(int argc, char *argv[], char *env[], void (*cleanup)(void))
-{
-
- handle_argv(argc, argv, env);
-
- if (&_DYNAMIC != NULL)
- atexit(cleanup);
- else
- _init_tls();
-
-#ifdef GCRT
- atexit(_mcleanup);
- monstartup(&eprol, &etext);
-__asm__("eprol:");
-#endif
-
- handle_static_init(argc, argv, env);
- exit(main(argc, argv, env));
-}
diff --git a/lib/csu/amd64/Makefile.depend b/lib/csu/amd64/Makefile.depend
new file mode 100644
index 0000000..7d982eb
--- /dev/null
+++ b/lib/csu/amd64/Makefile.depend
@@ -0,0 +1,13 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/csu/arm/Makefile.depend b/lib/csu/arm/Makefile.depend
new file mode 100644
index 0000000..ff699f7
--- /dev/null
+++ b/lib/csu/arm/Makefile.depend
@@ -0,0 +1,15 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DEP_MACHINE := ${.PARSEFILE:E}
+
+DIRDEPS = \
+ include \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/csu/i386/Makefile b/lib/csu/i386-elf/Makefile
index d5ca479..57f4f05 100644
--- a/lib/csu/i386/Makefile
+++ b/lib/csu/i386-elf/Makefile
@@ -35,7 +35,7 @@ crt1_c.o: crt1_c.s
crt1.o: crt1_c.o crt1_s.o
${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o
- ${OBJCOPY} --localize-symbol _start1 crt1.o
+ objcopy --localize-symbol _start1 crt1.o
Scrt1_c.s: crt1_c.c
${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
@@ -46,7 +46,7 @@ Scrt1_c.o: Scrt1_c.s
Scrt1.o: Scrt1_c.o crt1_s.o
${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o
- ${OBJCOPY} --localize-symbol _start1 Scrt1.o
+ objcopy --localize-symbol _start1 Scrt1.o
realinstall:
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
diff --git a/lib/csu/i386-elf/Makefile.depend b/lib/csu/i386-elf/Makefile.depend
new file mode 100644
index 0000000..7d982eb
--- /dev/null
+++ b/lib/csu/i386-elf/Makefile.depend
@@ -0,0 +1,13 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/csu/i386/crt1_c.c b/lib/csu/i386-elf/crt1_c.c
index 65de04c..65de04c 100644
--- a/lib/csu/i386/crt1_c.c
+++ b/lib/csu/i386-elf/crt1_c.c
diff --git a/lib/csu/i386/crt1_s.S b/lib/csu/i386-elf/crt1_s.S
index 17ac0e3..17ac0e3 100644
--- a/lib/csu/i386/crt1_s.S
+++ b/lib/csu/i386-elf/crt1_s.S
diff --git a/lib/csu/i386/crti.S b/lib/csu/i386-elf/crti.S
index 77e4e77..77e4e77 100644
--- a/lib/csu/i386/crti.S
+++ b/lib/csu/i386-elf/crti.S
diff --git a/lib/csu/i386/crtn.S b/lib/csu/i386-elf/crtn.S
index 0264e22..0264e22 100644
--- a/lib/csu/i386/crtn.S
+++ b/lib/csu/i386-elf/crtn.S
diff --git a/lib/csu/mips/Makefile.depend b/lib/csu/mips/Makefile.depend
new file mode 100644
index 0000000..ff699f7
--- /dev/null
+++ b/lib/csu/mips/Makefile.depend
@@ -0,0 +1,15 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DEP_MACHINE := ${.PARSEFILE:E}
+
+DIRDEPS = \
+ include \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/csu/powerpc/Makefile.depend b/lib/csu/powerpc/Makefile.depend
new file mode 100644
index 0000000..ff699f7
--- /dev/null
+++ b/lib/csu/powerpc/Makefile.depend
@@ -0,0 +1,15 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DEP_MACHINE := ${.PARSEFILE:E}
+
+DIRDEPS = \
+ include \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/csu/powerpc64/Makefile b/lib/csu/powerpc64/Makefile
index 1c93355..123391e 100644
--- a/lib/csu/powerpc64/Makefile
+++ b/lib/csu/powerpc64/Makefile
@@ -9,13 +9,6 @@ CFLAGS+= -I${.CURDIR}/../common \
-I${.CURDIR}/../../libc/include \
-mlongcall
-# XXX: See the log for r232932 as to why the above -mlongcall is needed. Since
-# clang doesn't support -mlongcall, and testing shows a clang linked with a
-# clang-built csu segfaults, this must currently be compiled with gcc. Once
-# clang supports -mlongcall, or we get a fixed ld, this can be revisited.
-CC:= gcc
-COMPILER_TYPE:= gcc
-
all: ${OBJS}
CLEANFILES= ${OBJS}
diff --git a/lib/csu/powerpc64/Makefile.depend b/lib/csu/powerpc64/Makefile.depend
new file mode 100644
index 0000000..ff699f7
--- /dev/null
+++ b/lib/csu/powerpc64/Makefile.depend
@@ -0,0 +1,15 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DEP_MACHINE := ${.PARSEFILE:E}
+
+DIRDEPS = \
+ include \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/csu/sparc64/Makefile.depend b/lib/csu/sparc64/Makefile.depend
new file mode 100644
index 0000000..ff699f7
--- /dev/null
+++ b/lib/csu/sparc64/Makefile.depend
@@ -0,0 +1,15 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DEP_MACHINE := ${.PARSEFILE:E}
+
+DIRDEPS = \
+ include \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libalias/libalias/Makefile.depend b/lib/libalias/libalias/Makefile.depend
new file mode 100644
index 0000000..807c0a4
--- /dev/null
+++ b/lib/libalias/libalias/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libalias/modules/cuseeme/Makefile.depend b/lib/libalias/modules/cuseeme/Makefile.depend
new file mode 100644
index 0000000..96aa2a2
--- /dev/null
+++ b/lib/libalias/modules/cuseeme/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libalias/modules/dummy/Makefile.depend b/lib/libalias/modules/dummy/Makefile.depend
new file mode 100644
index 0000000..96aa2a2
--- /dev/null
+++ b/lib/libalias/modules/dummy/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libalias/modules/ftp/Makefile.depend b/lib/libalias/modules/ftp/Makefile.depend
new file mode 100644
index 0000000..96aa2a2
--- /dev/null
+++ b/lib/libalias/modules/ftp/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libalias/modules/irc/Makefile.depend b/lib/libalias/modules/irc/Makefile.depend
new file mode 100644
index 0000000..96aa2a2
--- /dev/null
+++ b/lib/libalias/modules/irc/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libalias/modules/nbt/Makefile.depend b/lib/libalias/modules/nbt/Makefile.depend
new file mode 100644
index 0000000..96aa2a2
--- /dev/null
+++ b/lib/libalias/modules/nbt/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libalias/modules/pptp/Makefile.depend b/lib/libalias/modules/pptp/Makefile.depend
new file mode 100644
index 0000000..96aa2a2
--- /dev/null
+++ b/lib/libalias/modules/pptp/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libalias/modules/skinny/Makefile.depend b/lib/libalias/modules/skinny/Makefile.depend
new file mode 100644
index 0000000..96aa2a2
--- /dev/null
+++ b/lib/libalias/modules/skinny/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libalias/modules/smedia/Makefile.depend b/lib/libalias/modules/smedia/Makefile.depend
new file mode 100644
index 0000000..96aa2a2
--- /dev/null
+++ b/lib/libalias/modules/smedia/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile
index 9dfad77..b7e9d7f 100644
--- a/lib/libarchive/Makefile
+++ b/lib/libarchive/Makefile
@@ -4,9 +4,19 @@
LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive
LIB= archive
+DPADD= ${LIBZ}
+LDADD= -lz
-LIBADD= z bz2 lzma bsdxml
-CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
+DPADD+= ${LIBBZ2}
+LDADD+= -lbz2
+CFLAGS+= -DHAVE_BZLIB_H=1
+
+DPADD+= ${LIBLZMA}
+LDADD+= -llzma
+CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
+
+DPADD+= ${LIBBSDXML}
+LDADD+= -lbsdxml
# FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system.
# It has no real relation to the libarchive version number.
@@ -17,15 +27,17 @@ CFLAGS+= -I${.OBJDIR}
.if ${MK_OPENSSL} != "no"
CFLAGS+= -DWITH_OPENSSL
-LIBADD+= crypto
+DPADD+= ${LIBCRYPTO}
+LDADD+= -lcrypto
.else
-LIBADD+= md
+DPADD+= ${LIBMD}
+LDADD+= -lmd
.endif
.if ${MK_ICONV} != "no"
# TODO: This can be changed back to CFLAGS once iconv works correctly
# with statically linked binaries.
-SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=
+SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=const
.endif
.if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mmips*} != "" || \
diff --git a/lib/libarchive/Makefile.depend b/lib/libarchive/Makefile.depend
new file mode 100644
index 0000000..f87de01
--- /dev/null
+++ b/lib/libarchive/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libbz2 \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libexpat \
+ lib/liblzma \
+ lib/libz \
+ secure/lib/libcrypto \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libarchive/config_freebsd.h b/lib/libarchive/config_freebsd.h
index fbf429f..0df3f91 100644
--- a/lib/libarchive/config_freebsd.h
+++ b/lib/libarchive/config_freebsd.h
@@ -25,8 +25,6 @@
* $FreeBSD$
*/
-#include <osreldate.h>
-
/* FreeBSD 5.0 and later have ACL and extattr support. */
#if __FreeBSD__ > 4
#define HAVE_ACL_CREATE_ENTRY 1
@@ -222,11 +220,6 @@
#define HAVE_ZLIB_H 1
#define TIME_WITH_SYS_TIME 1
-#if __FreeBSD_version >= 1100056
-#define HAVE_FUTIMENS 1
-#define HAVE_UTIMENSAT 1
-#endif
-
/* FreeBSD 4 and earlier lack intmax_t/uintmax_t */
#if __FreeBSD__ < 5
#define intmax_t int64_t
diff --git a/lib/libarchive/test/Makefile b/lib/libarchive/test/Makefile
index 80d6dd4..16a485a 100644
--- a/lib/libarchive/test/Makefile
+++ b/lib/libarchive/test/Makefile
@@ -6,8 +6,9 @@ MAN=
PROG=libarchive_test
INTERNALPROG=yes # Don't install this; it's just for testing
+DPADD=${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBCRYPTO} ${LIBBSDXML}
LDADD= -L ${.OBJDIR}/.. -larchive
-LIBADD= z bz2 lzma md crypto bsdxml
+LDADD+= -lz -lbz2 -llzma -lmd -lcrypto -lbsdxml
CFLAGS+= -g
CFLAGS+= -I${.CURDIR}/.. -I${.OBJDIR}
CFLAGS+= -I${LIBARCHIVEDIR}/libarchive -I${LIBARCHIVEDIR}/test_utils
diff --git a/lib/libauditd/Makefile.depend b/lib/libauditd/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libauditd/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libbegemot/Makefile.depend b/lib/libbegemot/Makefile.depend
new file mode 100644
index 0000000..4acc32f
--- /dev/null
+++ b/lib/libbegemot/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libblocksruntime/Makefile b/lib/libblocksruntime/Makefile
index f9539331..01a78fe 100644
--- a/lib/libblocksruntime/Makefile
+++ b/lib/libblocksruntime/Makefile
@@ -5,7 +5,7 @@ SHLIB_MAJOR=0
CFLAGS+=-I${.CURDIR}
WARNS?= 2
-.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/BlocksRuntime
+.PATH: ${.CURDIR}/../../contrib/compiler-rt/BlocksRuntime
INCS= Block.h Block_private.h
SRCS= data.c runtime.c
diff --git a/lib/libblocksruntime/Makefile.depend b/lib/libblocksruntime/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libblocksruntime/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libbluetooth/Makefile.depend b/lib/libbluetooth/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libbluetooth/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libbluetooth/bluetooth.c b/lib/libbluetooth/bluetooth.c
index bbcf007..23b7df0 100644
--- a/lib/libbluetooth/bluetooth.c
+++ b/lib/libbluetooth/bluetooth.c
@@ -30,7 +30,7 @@
* $Id: bluetooth.c,v 1.3 2003/05/20 23:04:30 max Exp $
* $FreeBSD$
*/
-#define L2CAP_SOCKET_CHECKED
+
#include <bluetooth.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/libbluetooth/dev.c b/lib/libbluetooth/dev.c
index a6295dd..1f9e745 100644
--- a/lib/libbluetooth/dev.c
+++ b/lib/libbluetooth/dev.c
@@ -30,7 +30,6 @@
* $FreeBSD$
*/
-#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <string.h>
diff --git a/lib/libbluetooth/hci.c b/lib/libbluetooth/hci.c
index 651c0dd..1ae6ff9 100644
--- a/lib/libbluetooth/hci.c
+++ b/lib/libbluetooth/hci.c
@@ -31,7 +31,6 @@
*/
#include <assert.h>
-#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <inttypes.h>
#include <stdio.h>
diff --git a/lib/libbsm/Makefile.depend b/lib/libbsm/Makefile.depend
new file mode 100644
index 0000000..807c0a4
--- /dev/null
+++ b/lib/libbsm/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libbsnmp/libbsnmp/Makefile b/lib/libbsnmp/libbsnmp/Makefile
index ef6e35b..0b9087d 100644
--- a/lib/libbsnmp/libbsnmp/Makefile
+++ b/lib/libbsnmp/libbsnmp/Makefile
@@ -9,14 +9,14 @@ CONTRIB= ${.CURDIR}/../../../contrib/bsnmp/lib
LIB= bsnmp
SHLIB_MAJOR= 6
-LD_FATAL_WARNINGS= no
CFLAGS+= -I${CONTRIB} -DHAVE_ERR_H -DHAVE_GETADDRINFO -DHAVE_STRLCPY
CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DQUADFMT='"llu"' -DQUADXFMT='"llx"'
.if ${MK_OPENSSL} != "no"
CFLAGS+= -DHAVE_LIBCRYPTO
-LIBADD= crypto
+DPADD+= ${LIBCRYPTO}
+LDADD+= -lcrypto
.endif
SRCS= asn1.c snmp.c snmpagent.c snmpclient.c snmpcrypto.c support.c
diff --git a/lib/libbsnmp/libbsnmp/Makefile.depend b/lib/libbsnmp/libbsnmp/Makefile.depend
new file mode 100644
index 0000000..4de5cd3
--- /dev/null
+++ b/lib/libbsnmp/libbsnmp/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ secure/lib/libcrypto \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libbz2/Makefile.depend b/lib/libbz2/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libbz2/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libc++/Makefile b/lib/libc++/Makefile
index c254ef3..e55cf55 100644
--- a/lib/libc++/Makefile
+++ b/lib/libc++/Makefile
@@ -62,7 +62,8 @@ CFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -nostdlib -DLIBCXXRT
CXXFLAGS+= -std=c++11
.endif
-LIBADD+= cxxrt
+DPADD= ${LIBCXXRT}
+LDADD= -lcxxrt
LDFLAGS+= --verbose
INCSGROUPS= STD EXP EXT
@@ -75,7 +76,6 @@ STD_HEADERS= __bit_reference\
__hash_table\
__locale\
__mutex_base\
- __refstring\
__split_buffer\
__sso_allocator\
__std_stream\
@@ -177,12 +177,8 @@ STD+= ${LIBCXXRTDIR}/${hdr}
.endfor
STDDIR= ${CXXINCLUDEDIR}
-EXP_HEADERS= __config\
- dynarray\
- optional\
- string_view\
- type_traits\
- utility
+EXP_HEADERS= dynarray\
+ optional
.for hdr in ${EXP_HEADERS}
EXP+= ${HDRDIR}/experimental/${hdr}
diff --git a/lib/libc++/Makefile.depend b/lib/libc++/Makefile.depend
new file mode 100644
index 0000000..e391c40
--- /dev/null
+++ b/lib/libc++/Makefile.depend
@@ -0,0 +1,39 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libcxxrt \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+cxxrt_auxhelper.o: cxxrt_auxhelper.cc
+cxxrt_auxhelper.po: cxxrt_auxhelper.cc
+cxxrt_dynamic_cast.o: cxxrt_dynamic_cast.cc
+cxxrt_dynamic_cast.po: cxxrt_dynamic_cast.cc
+cxxrt_exception.o: cxxrt_exception.cc
+cxxrt_exception.po: cxxrt_exception.cc
+cxxrt_guard.o: cxxrt_guard.cc
+cxxrt_guard.po: cxxrt_guard.cc
+cxxrt_libelftc_dem_gnu3.o: cxxrt_libelftc_dem_gnu3.c
+cxxrt_libelftc_dem_gnu3.po: cxxrt_libelftc_dem_gnu3.c
+cxxrt_memory.o: cxxrt_memory.cc
+cxxrt_memory.po: cxxrt_memory.cc
+cxxrt_stdexcept.o: cxxrt_stdexcept.cc
+cxxrt_stdexcept.po: cxxrt_stdexcept.cc
+cxxrt_terminate.o: cxxrt_terminate.cc
+cxxrt_terminate.po: cxxrt_terminate.cc
+cxxrt_typeinfo.o: cxxrt_typeinfo.cc
+cxxrt_typeinfo.po: cxxrt_typeinfo.cc
+.endif
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index 93ab138..5653220 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -44,11 +44,13 @@ CFLAGS+=${CANCELPOINTS_CFLAGS}
#
# Link with static libcompiler_rt.a.
#
+DPADD+= ${LIBCOMPILER_RT}
LDFLAGS+= -nodefaultlibs
-LIBADD+= compiler_rt
+LDADD+= -lcompiler_rt
.if ${MK_SSP} != "no"
-LIBADD+= ssp_nonshared
+DPADD+= ${LIBSSP_NONSHARED}
+LDADD+= -lssp_nonshared
.endif
# Extras that live in either libc.a or libc_nonshared.a
@@ -79,8 +81,7 @@ NOASM=
.include "${LIBC_SRCTOP}/net/Makefile.inc"
.include "${LIBC_SRCTOP}/nls/Makefile.inc"
.include "${LIBC_SRCTOP}/posix1e/Makefile.inc"
-.if ${LIBC_ARCH} != "aarch64" && \
- ${LIBC_ARCH} != "amd64" && \
+.if ${LIBC_ARCH} != "amd64" && \
${LIBC_ARCH} != "powerpc64" && \
${LIBC_ARCH} != "sparc64" && \
${MACHINE_ARCH:Mmipsn32*} == "" && \
@@ -150,19 +151,35 @@ KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c mcount.c strcat.c strchr.c \
libkern: libkern.gen libkern.${LIBC_ARCH}
libkern.gen: ${KQSRCS} ${KSRCS}
- ${CP} ${LIBC_SRCTOP}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
+ cp -fp ${LIBC_SRCTOP}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
libkern.${LIBC_ARCH}:: ${KMSRCS}
.if defined(KMSRCS) && !empty(KMSRCS)
- ${CP} ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH}
+ cp -fp ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH}
.endif
-.if ${MK_TESTS} != "no"
-SUBDIR+= tests
-.endif
+.include <bsd.arch.inc.mk>
.include <bsd.lib.mk>
+.if !defined(_SKIP_BUILD)
+# We need libutil.h, get it directly to avoid
+# recording a build dependency
+CFLAGS+= -I${.CURDIR:H}/libutil
+# Same issue with libm
+MSUN_ARCH_SUBDIR != ${MAKE} -B -C ${.CURDIR:H}/msun -V ARCH_SUBDIR
+# unfortunately msun/src contains both private and public headers
+CFLAGS+= -I${.CURDIR:H}/msun/${MSUN_ARCH_SUBDIR}
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+CFLAGS+= -I${.CURDIR:H}/msun/x86
+.endif
+CFLAGS+= -I${.CURDIR:H}/msun/src
+# and we do not want to record a dependency on msun
+.if ${.MAKE.LEVEL} > 0
+GENDIRDEPS_FILTER+= N${RELDIR:H}/msun
+.endif
+.endif
+
# Disable warnings in contributed sources.
CWARNFLAGS:= ${.IMPSRC:Ngdtoa_*.c:C/^.+$/${CWARNFLAGS}/:C/^$/-w/}
# XXX For now, we don't allow libc to be compiled with
diff --git a/lib/libc/Makefile.amd64 b/lib/libc/Makefile.amd64
new file mode 100644
index 0000000..dd0f5b0
--- /dev/null
+++ b/lib/libc/Makefile.amd64
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
diff --git a/lib/libc/Makefile.depend b/lib/libc/Makefile.depend
new file mode 100644
index 0000000..d23769e
--- /dev/null
+++ b/lib/libc/Makefile.depend
@@ -0,0 +1,169 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ include \
+ include/rpc \
+ include/rpcsvc \
+ lib/${CSU_DIR} \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+cancelpoints_sem.So: cancelpoints_sem.c
+cancelpoints_sem.o: cancelpoints_sem.c
+cancelpoints_sem.po: cancelpoints_sem.c
+cancelpoints_sem_new.So: cancelpoints_sem_new.c
+cancelpoints_sem_new.o: cancelpoints_sem_new.c
+cancelpoints_sem_new.po: cancelpoints_sem_new.c
+crypt_clnt.So: crypt.h
+crypt_clnt.So: crypt_clnt.c
+crypt_clnt.o: crypt.h
+crypt_clnt.o: crypt_clnt.c
+crypt_clnt.po: crypt.h
+crypt_clnt.po: crypt_clnt.c
+crypt_xdr.So: crypt.h
+crypt_xdr.So: crypt_xdr.c
+crypt_xdr.o: crypt.h
+crypt_xdr.o: crypt_xdr.c
+crypt_xdr.po: crypt.h
+crypt_xdr.po: crypt_xdr.c
+gdtoa_dmisc.So: gdtoa_dmisc.c
+gdtoa_dmisc.o: gdtoa_dmisc.c
+gdtoa_dmisc.po: gdtoa_dmisc.c
+gdtoa_dtoa.So: gdtoa_dtoa.c
+gdtoa_dtoa.o: gdtoa_dtoa.c
+gdtoa_dtoa.po: gdtoa_dtoa.c
+gdtoa_gdtoa.So: gdtoa_gdtoa.c
+gdtoa_gdtoa.o: gdtoa_gdtoa.c
+gdtoa_gdtoa.po: gdtoa_gdtoa.c
+gdtoa_gethex.So: gdtoa_gethex.c
+gdtoa_gethex.o: gdtoa_gethex.c
+gdtoa_gethex.po: gdtoa_gethex.c
+gdtoa_gmisc.So: gdtoa_gmisc.c
+gdtoa_gmisc.o: gdtoa_gmisc.c
+gdtoa_gmisc.po: gdtoa_gmisc.c
+gdtoa_hd_init.So: gdtoa_hd_init.c
+gdtoa_hd_init.o: gdtoa_hd_init.c
+gdtoa_hd_init.po: gdtoa_hd_init.c
+gdtoa_hexnan.So: gdtoa_hexnan.c
+gdtoa_hexnan.o: gdtoa_hexnan.c
+gdtoa_hexnan.po: gdtoa_hexnan.c
+gdtoa_misc.So: gdtoa_misc.c
+gdtoa_misc.o: gdtoa_misc.c
+gdtoa_misc.po: gdtoa_misc.c
+gdtoa_smisc.So: gdtoa_smisc.c
+gdtoa_smisc.o: gdtoa_smisc.c
+gdtoa_smisc.po: gdtoa_smisc.c
+gdtoa_strtod.So: gdtoa_strtod.c
+gdtoa_strtod.o: gdtoa_strtod.c
+gdtoa_strtod.po: gdtoa_strtod.c
+gdtoa_strtodg.So: gdtoa_strtodg.c
+gdtoa_strtodg.o: gdtoa_strtodg.c
+gdtoa_strtodg.po: gdtoa_strtodg.c
+gdtoa_strtof.So: gdtoa_strtof.c
+gdtoa_strtof.o: gdtoa_strtof.c
+gdtoa_strtof.po: gdtoa_strtof.c
+gdtoa_strtord.So: gdtoa_strtord.c
+gdtoa_strtord.o: gdtoa_strtord.c
+gdtoa_strtord.po: gdtoa_strtord.c
+gdtoa_strtorx.So: gdtoa_strtorx.c
+gdtoa_strtorx.o: gdtoa_strtorx.c
+gdtoa_strtorx.po: gdtoa_strtorx.c
+gdtoa_sum.So: gdtoa_sum.c
+gdtoa_sum.o: gdtoa_sum.c
+gdtoa_sum.po: gdtoa_sum.c
+gdtoa_ulp.So: gdtoa_ulp.c
+gdtoa_ulp.o: gdtoa_ulp.c
+gdtoa_ulp.po: gdtoa_ulp.c
+jemalloc_arena.So: jemalloc_arena.c
+jemalloc_arena.o: jemalloc_arena.c
+jemalloc_arena.po: jemalloc_arena.c
+jemalloc_atomic.So: jemalloc_atomic.c
+jemalloc_atomic.o: jemalloc_atomic.c
+jemalloc_atomic.po: jemalloc_atomic.c
+jemalloc_base.So: jemalloc_base.c
+jemalloc_base.o: jemalloc_base.c
+jemalloc_base.po: jemalloc_base.c
+jemalloc_bitmap.So: jemalloc_bitmap.c
+jemalloc_bitmap.o: jemalloc_bitmap.c
+jemalloc_bitmap.po: jemalloc_bitmap.c
+jemalloc_chunk.So: jemalloc_chunk.c
+jemalloc_chunk.o: jemalloc_chunk.c
+jemalloc_chunk.po: jemalloc_chunk.c
+jemalloc_chunk_dss.So: jemalloc_chunk_dss.c
+jemalloc_chunk_dss.o: jemalloc_chunk_dss.c
+jemalloc_chunk_dss.po: jemalloc_chunk_dss.c
+jemalloc_chunk_mmap.So: jemalloc_chunk_mmap.c
+jemalloc_chunk_mmap.o: jemalloc_chunk_mmap.c
+jemalloc_chunk_mmap.po: jemalloc_chunk_mmap.c
+jemalloc_ckh.So: jemalloc_ckh.c
+jemalloc_ckh.o: jemalloc_ckh.c
+jemalloc_ckh.po: jemalloc_ckh.c
+jemalloc_ctl.So: jemalloc_ctl.c
+jemalloc_ctl.o: jemalloc_ctl.c
+jemalloc_ctl.po: jemalloc_ctl.c
+jemalloc_extent.So: jemalloc_extent.c
+jemalloc_extent.o: jemalloc_extent.c
+jemalloc_extent.po: jemalloc_extent.c
+jemalloc_hash.So: jemalloc_hash.c
+jemalloc_hash.o: jemalloc_hash.c
+jemalloc_hash.po: jemalloc_hash.c
+jemalloc_huge.So: jemalloc_huge.c
+jemalloc_huge.o: jemalloc_huge.c
+jemalloc_huge.po: jemalloc_huge.c
+jemalloc_jemalloc.So: jemalloc_jemalloc.c
+jemalloc_jemalloc.o: jemalloc_jemalloc.c
+jemalloc_jemalloc.po: jemalloc_jemalloc.c
+jemalloc_mb.So: jemalloc_mb.c
+jemalloc_mb.o: jemalloc_mb.c
+jemalloc_mb.po: jemalloc_mb.c
+jemalloc_mutex.So: jemalloc_mutex.c
+jemalloc_mutex.o: jemalloc_mutex.c
+jemalloc_mutex.po: jemalloc_mutex.c
+jemalloc_prof.So: jemalloc_prof.c
+jemalloc_prof.o: jemalloc_prof.c
+jemalloc_prof.po: jemalloc_prof.c
+jemalloc_quarantine.So: jemalloc_quarantine.c
+jemalloc_quarantine.o: jemalloc_quarantine.c
+jemalloc_quarantine.po: jemalloc_quarantine.c
+jemalloc_rtree.So: jemalloc_rtree.c
+jemalloc_rtree.o: jemalloc_rtree.c
+jemalloc_rtree.po: jemalloc_rtree.c
+jemalloc_stats.So: jemalloc_stats.c
+jemalloc_stats.o: jemalloc_stats.c
+jemalloc_stats.po: jemalloc_stats.c
+jemalloc_tcache.So: jemalloc_tcache.c
+jemalloc_tcache.o: jemalloc_tcache.c
+jemalloc_tcache.po: jemalloc_tcache.c
+jemalloc_tsd.So: jemalloc_tsd.c
+jemalloc_tsd.o: jemalloc_tsd.c
+jemalloc_tsd.po: jemalloc_tsd.c
+jemalloc_util.So: jemalloc_util.c
+jemalloc_util.o: jemalloc_util.c
+jemalloc_util.po: jemalloc_util.c
+nslexer.So: nslexer.c
+nslexer.So: nsparser.h
+nslexer.o: nslexer.c
+nslexer.o: nsparser.h
+nslexer.po: nslexer.c
+nslexer.po: nsparser.h
+nsparser.So: nsparser.c
+nsparser.o: nsparser.c
+nsparser.po: nsparser.c
+subr_acl_nfs4.So: subr_acl_nfs4.c
+subr_acl_nfs4.o: subr_acl_nfs4.c
+subr_acl_nfs4.po: subr_acl_nfs4.c
+yp_xdr.So: yp.h
+yp_xdr.So: yp_xdr.c
+yp_xdr.o: yp.h
+yp_xdr.o: yp_xdr.c
+yp_xdr.po: yp.h
+yp_xdr.po: yp_xdr.c
+.endif
diff --git a/lib/libc/Makefile.i386 b/lib/libc/Makefile.i386
new file mode 100644
index 0000000..dd0f5b0
--- /dev/null
+++ b/lib/libc/Makefile.i386
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
diff --git a/lib/libc/aarch64/Makefile.inc b/lib/libc/aarch64/Makefile.inc
deleted file mode 100644
index 5f17200..0000000
--- a/lib/libc/aarch64/Makefile.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-# $FreeBSD$
-#
-# Machine dependent definitions for the arm 64-bit architecture.
-#
-
-# Long double is quad precision
-GDTOASRCS+=strtorQ.c
-MDSRCS+=machdep_ldisQ.c
-SYM_MAPS+=${LIBC_SRCTOP}/aarch64/Symbol.map
diff --git a/lib/libc/aarch64/SYS.h b/lib/libc/aarch64/SYS.h
deleted file mode 100644
index e0be59d..0000000
--- a/lib/libc/aarch64/SYS.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * Copyright (c) 2014 Andrew Turner
- * Copyright (c) 2015 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner 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 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$
- */
-
-#include <sys/syscall.h>
-#include <machine/asm.h>
-
-#define _SYSCALL(name) \
- mov x8, SYS_ ## name; \
- svc 0
-
-#define SYSCALL(name) \
-ENTRY(__sys_##name); \
- WEAK_REFERENCE(__sys_##name, name); \
- WEAK_REFERENCE(__sys_##name, _##name); \
- _SYSCALL(name); \
- ret; \
-END(__sys_##name)
-
-#define PSEUDO(name) \
-ENTRY(__sys_##name); \
- WEAK_REFERENCE(__sys_##name, _##name); \
- _SYSCALL(name); \
- b.cs cerror; \
- ret; \
-END(__sys_##name)
-
-#define RSYSCALL(name) \
-ENTRY(__sys_##name); \
- WEAK_REFERENCE(__sys_##name, name); \
- WEAK_REFERENCE(__sys_##name, _##name); \
- _SYSCALL(name); \
- b.cs cerror; \
- ret; \
-END(__sys_##name)
diff --git a/lib/libc/aarch64/Symbol.map b/lib/libc/aarch64/Symbol.map
deleted file mode 100644
index a0b33da..0000000
--- a/lib/libc/aarch64/Symbol.map
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * $FreeBSD$
- */
-
-/*
- * This only needs to contain symbols that are not listed in
- * symbol maps from other parts of libc (i.e., not found in
- * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...).
- */
-FBSD_1.0 {
- /* PSEUDO syscalls */
- _exit;
-
- _setjmp;
- _longjmp;
- fabs;
- setjmp;
- longjmp;
- sigsetjmp;
- siglongjmp;
- vfork;
- brk;
- sbrk;
-};
-
-FBSDprivate_1.0 {
- _set_tp;
- curbrk;
- minbrk;
-};
diff --git a/lib/libc/aarch64/_fpmath.h b/lib/libc/aarch64/_fpmath.h
deleted file mode 100644
index 71d0a71..0000000
--- a/lib/libc/aarch64/_fpmath.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
- * Copyright (2) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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$
- */
-
-union IEEEl2bits {
- long double e;
- struct {
- unsigned long manl :64;
- unsigned long manh :48;
- unsigned int exp :15;
- unsigned int sign :1;
- } bits;
- /* TODO andrew: Check the packing here */
- struct {
- unsigned long manl :64;
- unsigned long manh :48;
- unsigned int expsign :16;
- } xbits;
-};
-
-#define LDBL_NBIT 0
-#define LDBL_IMPLICIT_NBIT
-#define mask_nbit_l(u) ((void)0)
-
-#define LDBL_MANH_SIZE 48
-#define LDBL_MANL_SIZE 64
-
-#define LDBL_TO_ARRAY32(u, a) do { \
- (a)[0] = (uint32_t)(u).bits.manl; \
- (a)[1] = (uint32_t)((u).bits.manl >> 32); \
- (a)[2] = (uint32_t)(u).bits.manh; \
- (a)[3] = (uint32_t)((u).bits.manh >> 32); \
-} while(0)
diff --git a/lib/libc/aarch64/arith.h b/lib/libc/aarch64/arith.h
deleted file mode 100644
index ecb1a33..0000000
--- a/lib/libc/aarch64/arith.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * MD header for contrib/gdtoa
- *
- * $FreeBSD$
- */
-
-/*
- * NOTE: The definitions in this file must be correct or strtod(3) and
- * floating point formats in printf(3) will break! The file can be
- * generated by running contrib/gdtoa/arithchk.c on the target
- * architecture. See contrib/gdtoa/gdtoaimp.h for details.
- */
-
-#define IEEE_8087
-#define Arith_Kind_ASL 1
-#define Long int
-#define Intcast (int)(long)
-#define Double_Align
-#define X64_bit_pointers
diff --git a/lib/libc/aarch64/gd_qnan.h b/lib/libc/aarch64/gd_qnan.h
deleted file mode 100644
index 27e8d58..0000000
--- a/lib/libc/aarch64/gd_qnan.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * MD header for contrib/gdtoa
- *
- * This file can be generated by compiling and running contrib/gdtoa/qnan.c
- * on the target architecture after arith.h has been generated.
- *
- * $FreeBSD$
- */
-
-#define f_QNAN 0x7fc00000
-#define d_QNAN0 0x0
-#define d_QNAN1 0x7ff80000
-#define ld_QNAN0 0x0
-#define ld_QNAN1 0x0
-#define ld_QNAN2 0x0
-#define ld_QNAN3 0x7fff8000
-#define ldus_QNAN0 0x0
-#define ldus_QNAN1 0x0
-#define ldus_QNAN2 0x0
-#define ldus_QNAN3 0x0
-#define ldus_QNAN4 0x0
diff --git a/lib/libc/aarch64/gen/Makefile.inc b/lib/libc/aarch64/gen/Makefile.inc
deleted file mode 100644
index c4f7c80..0000000
--- a/lib/libc/aarch64/gen/Makefile.inc
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD$
-
-SRCS+= fabs.S \
- flt_rounds.c \
- ldexp.c \
- _setjmp.S \
- _set_tp.c \
- setjmp.S \
- sigsetjmp.S \
- trivial-getcontextx.c
diff --git a/lib/libc/aarch64/gen/_setjmp.S b/lib/libc/aarch64/gen/_setjmp.S
deleted file mode 100644
index 504423b..0000000
--- a/lib/libc/aarch64/gen/_setjmp.S
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * Copyright (c) 2014 Andrew Turner
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * Portions of this software were developed by Andrew Turner
- * 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 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#include <machine/setjmp.h>
-
-ENTRY(_setjmp)
- /* Store the magic value and stack pointer */
- ldr x8, .Lmagic
- mov x9, sp
- stp x8, x9, [x0], #16
-
- /* Store the general purpose registers and lr */
- stp x19, x20, [x0], #16
- stp x21, x22, [x0], #16
- stp x23, x24, [x0], #16
- stp x25, x26, [x0], #16
- stp x27, x28, [x0], #16
- stp x29, lr, [x0], #16
-
-#ifndef _STANDALONE
- /* Store the vfp registers */
- stp d8, d9, [x0], #16
- stp d10, d11, [x0], #16
- stp d12, d13, [x0], #16
- stp d14, d15, [x0]
-#endif
-
- /* Return value */
- mov x0, #0
- ret
-.Lmagic:
- .align 3
- .quad _JB_MAGIC__SETJMP
-END(_setjmp)
-
-ENTRY(_longjmp)
- /* Check the magic value */
- ldr x8, [x0], #8
- ldr x9, .Lmagic
- cmp x8, x9
- b.ne botch
-
- /* Restore the stack pointer */
- ldr x8, [x0], #8
- mov sp, x8
-
- /* Restore the general purpose registers and lr */
- ldp x19, x20, [x0], #16
- ldp x21, x22, [x0], #16
- ldp x23, x24, [x0], #16
- ldp x25, x26, [x0], #16
- ldp x27, x28, [x0], #16
- ldp x29, lr, [x0], #16
-
-#ifndef _STANDALONE
- /* Restore the vfp registers */
- ldp d8, d9, [x0], #16
- ldp d10, d11, [x0], #16
- ldp d12, d13, [x0], #16
- ldp d14, d15, [x0]
-#endif
-
- /* Load the return value */
- mov x0, x1
- ret
-
-botch:
-#ifdef _STANDALONE
- b botch
-#else
- bl _C_LABEL(longjmperror)
- bl _C_LABEL(abort)
-#endif
-END(_longjmp)
diff --git a/lib/libc/aarch64/gen/fabs.S b/lib/libc/aarch64/gen/fabs.S
deleted file mode 100644
index 2f5fd06..0000000
--- a/lib/libc/aarch64/gen/fabs.S
+++ /dev/null
@@ -1,33 +0,0 @@
-/*-
- * Copyright (c) 2015 The FreeBSD Foundation
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-ENTRY(fabs)
- fabs d0, d0
- ret
-END(fabs)
diff --git a/lib/libc/aarch64/gen/setjmp.S b/lib/libc/aarch64/gen/setjmp.S
deleted file mode 100644
index 80a9484..0000000
--- a/lib/libc/aarch64/gen/setjmp.S
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-
- * Copyright (c) 2014 Andrew Turner
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * Portions of this software were developed by Andrew Turner
- * 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 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#include <machine/setjmp.h>
-
-ENTRY(setjmp)
- sub sp, sp, #16
- stp x0, lr, [sp]
-
- /* Store the signal mask */
- add x2, x0, #(_JB_SIGMASK * 8) /* oset */
- mov x1, #0 /* set */
- mov x0, #1 /* SIG_BLOCK */
- bl sigprocmask
-
- ldp x0, lr, [sp]
- add sp, sp, #16
-
- /* Store the magic value and stack pointer */
- ldr x8, .Lmagic
- mov x9, sp
- stp x8, x9, [x0], #16
-
- /* Store the general purpose registers and lr */
- stp x19, x20, [x0], #16
- stp x21, x22, [x0], #16
- stp x23, x24, [x0], #16
- stp x25, x26, [x0], #16
- stp x27, x28, [x0], #16
- stp x29, lr, [x0], #16
-
- /* Store the vfp registers */
- stp d8, d9, [x0], #16
- stp d10, d11, [x0], #16
- stp d12, d13, [x0], #16
- stp d14, d15, [x0]
-
- /* Return value */
- mov x0, #0
- ret
-.Lmagic:
- .align 3
- .quad _JB_MAGIC_SETJMP
-END(setjmp)
-
-ENTRY(longjmp)
- sub sp, sp, #32
- stp x0, lr, [sp]
- str x1, [sp, #16]
-
- /* Restore the signal mask */
- mov x1, #0 /* oset */
- add x1, x0, #(_JB_SIGMASK * 8) /* set */
- mov x0, #3 /* SIG_BLOCK */
- bl sigprocmask
-
- ldr x1, [sp, #16]
- ldp x0, lr, [sp]
- add sp, sp, #32
-
- /* Check the magic value */
- ldr x8, [x0], #8
- ldr x9, .Lmagic
- cmp x8, x9
- b.ne botch
-
- /* Restore the stack pointer */
- ldr x8, [x0], #8
- mov sp, x8
-
- /* Restore the general purpose registers and lr */
- ldp x19, x20, [x0], #16
- ldp x21, x22, [x0], #16
- ldp x23, x24, [x0], #16
- ldp x25, x26, [x0], #16
- ldp x27, x28, [x0], #16
- ldp x29, lr, [x0], #16
-
- /* Restore the vfp registers */
- ldp d8, d9, [x0], #16
- ldp d10, d11, [x0], #16
- ldp d12, d13, [x0], #16
- ldp d14, d15, [x0]
-
- /* Load the return value */
- mov x0, x1
- ret
-
-botch:
- bl _C_LABEL(longjmperror)
- bl _C_LABEL(abort)
-END(longjmp)
diff --git a/lib/libc/aarch64/gen/sigsetjmp.S b/lib/libc/aarch64/gen/sigsetjmp.S
deleted file mode 100644
index 8a13c9f..0000000
--- a/lib/libc/aarch64/gen/sigsetjmp.S
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner 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 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#include <machine/setjmp.h>
-
-ENTRY(sigsetjmp)
- cmp x1, #0
- b.eq _C_LABEL(_setjmp)
- b _C_LABEL(setjmp)
-END(sigsetjmp)
-
-ENTRY(siglongjmp)
- /* Load the _setjmp magic */
- ldr x2, .Lmagic
- ldr x3, [x0]
-
- /* Check the magic */
- cmp x2, x3
- b.eq _C_LABEL(_longjmp)
- b _C_LABEL(longjmp)
-.Lmagic:
- .align 3
- .quad _JB_MAGIC__SETJMP
-END(siglongjmp)
diff --git a/lib/libc/aarch64/sys/Makefile.inc b/lib/libc/aarch64/sys/Makefile.inc
deleted file mode 100644
index cb56f73..0000000
--- a/lib/libc/aarch64/sys/Makefile.inc
+++ /dev/null
@@ -1,25 +0,0 @@
-# $FreeBSD$
-
-SRCS+= trivial-vdso_tc.c
-
-#MDASM= ptrace.S
-MDASM= brk.S \
- cerror.S \
- pipe.S \
- sbrk.S \
- shmat.S \
- sigreturn.S \
- syscall.S \
- vfork.S
-
-# Don't generate default code for these syscalls:
-NOASM= break.o \
- exit.o \
- getlogin.o \
- openbsd_poll.o \
- sstk.o \
- vfork.o \
- yield.o
-
-PSEUDO= _exit.o \
- _getlogin.o
diff --git a/lib/libc/aarch64/sys/brk.S b/lib/libc/aarch64/sys/brk.S
deleted file mode 100644
index 09167b6..0000000
--- a/lib/libc/aarch64/sys/brk.S
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner 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 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#include "SYS.h"
-
- .data
- .align 3
- .globl _C_LABEL(minbrk)
- .type _C_LABEL(minbrk),#object
-_C_LABEL(minbrk):
- .quad _C_LABEL(_end)
-
- .text
-/*
- * int brk(const void *addr);
- */
-ENTRY(_brk)
- WEAK_REFERENCE(_brk, brk)
-
- /* Load the address of minbrk */
-#ifdef __PIC__
- adrp x2, :got:minbrk
- ldr x3, [x2, #:got_lo12:minbrk]
-#else
- ldr x3, .Lminbrk
-#endif
-
- /* Get the minimum allowable brk address */
- ldr x2, [x3]
-
- /* Validate the address */
- cmp x0, x2
- b.ge 1f
- /* Invalid, set it to the minimum */
- mov x0, x2
-
- /* Backup the new address */
-1: mov x4, x0
-
- /* Update for this value, will overwrite x0 and x1 */
- _SYSCALL(break)
- b.cs cerror
-
-#ifdef __PIC__
- adrp x2, :got:curbrk
- ldr x3, [x2, #:got_lo12:curbrk]
-#else
- ldr x3, .Lcurbrk
-#endif
-
- /* Store the new curbrk value */
- str x4, [x3]
-
- /* Return success */
- mov x0, #0
- ret
-
-#ifndef __PIC__
-.Lcurbrk:
- .quad _C_LABEL(curbrk)
-.Lminbrk:
- .quad _C_LABEL(minbrk)
-#endif
-END(_brk)
diff --git a/lib/libc/aarch64/sys/cerror.S b/lib/libc/aarch64/sys/cerror.S
deleted file mode 100644
index 26c61bc..0000000
--- a/lib/libc/aarch64/sys/cerror.S
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-
- * Copyright (c) 2014 Andrew Turner
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-ENTRY(cerror)
- sub sp, sp, #16
- stp x0, lr, [sp]
- bl _C_LABEL(__error)
- ldp x1, lr, [sp]
- str x1, [x0]
- movn x0, #0
- movn x1, #0
- add sp, sp, #16
- ret
-END(cerror)
diff --git a/lib/libc/aarch64/sys/pipe.S b/lib/libc/aarch64/sys/pipe.S
deleted file mode 100644
index 6b1cf24..0000000
--- a/lib/libc/aarch64/sys/pipe.S
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner 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 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#include "SYS.h"
-
-ENTRY(__sys_pipe)
- WEAK_REFERENCE(__sys_pipe, pipe)
-
- /* Backup the pointer passed to us */
- mov x2, x0
-
- /* Make the syscall */
- _SYSCALL(pipe)
- b.cs cerror
-
- /* Store the result */
- str w0, [x2, #0]
- str w1, [x2, #4]
-
- /* Return */
- mov x0, #0
- ret
-END(__sys_pipe)
diff --git a/lib/libc/aarch64/sys/sbrk.S b/lib/libc/aarch64/sys/sbrk.S
deleted file mode 100644
index db9d7e1..0000000
--- a/lib/libc/aarch64/sys/sbrk.S
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner 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 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#include "SYS.h"
-
- .data
- .align 3
- .global _C_LABEL(curbrk)
- .type _C_LABEL(curbrk),#object
-_C_LABEL(curbrk):
- .quad _C_LABEL(_end)
-
- .text
-/*
- * void *sbrk(intptr_t incr);
- */
-ENTRY(_sbrk)
- WEAK_REFERENCE(_sbrk, sbrk)
-
- /* Load the address of curbrk */
-#ifdef __PIC__
- adrp x2, :got:curbrk
- ldr x3, [x2, #:got_lo12:curbrk]
-#else
- ldr x3, .Lcurbrk
-#endif
-
- /* Get the current brk address */
- ldr x2, [x3]
-
- /* Calculate the new value */
- add x0, x2, x0
- mov x4, x0
-
- /* Update for this value, will overwrite x0 and x1 */
- _SYSCALL(break)
- b.cs cerror
-
- /* Load the old value to return */
- ldr x0, [x3]
-
- /* Store the new curbrk value */
- str x4, [x3]
-
- ret
-#ifndef __PIC__
-.Lcurbrk:
- .quad _C_LABEL(curbrk)
-#endif
-END(_sbrk)
diff --git a/lib/libc/aarch64/sys/shmat.S b/lib/libc/aarch64/sys/shmat.S
deleted file mode 100644
index c0fb34f..0000000
--- a/lib/libc/aarch64/sys/shmat.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner 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 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#include "SYS.h"
-
-RSYSCALL(shmat)
diff --git a/lib/libc/aarch64/sys/syscall.S b/lib/libc/aarch64/sys/syscall.S
deleted file mode 100644
index 6314835..0000000
--- a/lib/libc/aarch64/sys/syscall.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner 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 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#include "SYS.h"
-
-RSYSCALL(syscall)
diff --git a/lib/libc/aarch64/sys/vfork.S b/lib/libc/aarch64/sys/vfork.S
deleted file mode 100644
index daecd1f..0000000
--- a/lib/libc/aarch64/sys/vfork.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * Copyright (c) 2014 Andrew Turner
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-#include "SYS.h"
-
-ENTRY(__sys_vfork)
- WEAK_REFERENCE(__sys_vfork, vfork)
- WEAK_REFERENCE(__sys_vfork, _vfork)
- mov x2, lr
- _SYSCALL(vfork)
- b.cs cerror
- sub x1, x1, #1
- and x0, x0, x1
- mov lr, x2
- ret
-END(__sys_vfork)
diff --git a/lib/libc/amd64/sys/Makefile.inc b/lib/libc/amd64/sys/Makefile.inc
index 46ea955..8e0d614 100644
--- a/lib/libc/amd64/sys/Makefile.inc
+++ b/lib/libc/amd64/sys/Makefile.inc
@@ -11,3 +11,6 @@ MDASM= vfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
PSEUDO= _getlogin.o _exit.o
+.if ${MK_SYSCALL_COMPAT} != "no"
+PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
+.endif
diff --git a/lib/libc/arm/SYS.h b/lib/libc/arm/SYS.h
index 3254c45..ed1a045 100644
--- a/lib/libc/arm/SYS.h
+++ b/lib/libc/arm/SYS.h
@@ -62,7 +62,6 @@
#define _SYSCALL(x) \
_SYSCALL_NOERROR(x); \
- it cs; \
bcs PIC_SYM(CERROR, PLT)
#define SYSCALL(x) \
@@ -73,7 +72,6 @@
.weak _C_LABEL(__CONCAT(_,x)); \
.set _C_LABEL(__CONCAT(_,x)),_C_LABEL(__CONCAT(__sys_,x)); \
SYSTRAP(x); \
- it cs; \
bcs PIC_SYM(CERROR, PLT); \
RET
diff --git a/lib/libc/arm/aeabi/Makefile.inc b/lib/libc/arm/aeabi/Makefile.inc
index fa0ec8e..b204a53 100644
--- a/lib/libc/arm/aeabi/Makefile.inc
+++ b/lib/libc/arm/aeabi/Makefile.inc
@@ -20,7 +20,7 @@ SRCS+= aeabi_vfp_double.S \
# libc. This causes issues when other parts of libc call these functions.
# We work around this by including these functions in libc but mark them as
# hidden so users of libc will not pick up these versions.
-.PATH: ${LIBC_SRCTOP}/../../contrib/compiler-rt/lib/builtins/arm
+.PATH: ${LIBC_SRCTOP}/../../contrib/compiler-rt/lib/arm
SRCS+= aeabi_memcmp.S \
aeabi_memcpy.S \
diff --git a/lib/libc/arm/aeabi/aeabi_vfp_double.S b/lib/libc/arm/aeabi/aeabi_vfp_double.S
index aae49f8..62100d2 100644
--- a/lib/libc/arm/aeabi/aeabi_vfp_double.S
+++ b/lib/libc/arm/aeabi/aeabi_vfp_double.S
@@ -66,7 +66,6 @@ AEABI_ENTRY(dcmpeq)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
- ite ne
movne r0, #0
moveq r0, #1
RET
@@ -78,9 +77,8 @@ AEABI_ENTRY(dcmplt)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
- ite cs
movcs r0, #0
- movcc r0, #1
+ movlt r0, #1
RET
AEABI_END(dcmplt)
@@ -90,7 +88,6 @@ AEABI_ENTRY(dcmple)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
- ite hi
movhi r0, #0
movls r0, #1
RET
@@ -102,7 +99,6 @@ AEABI_ENTRY(dcmpge)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
- ite lt
movlt r0, #0
movge r0, #1
RET
@@ -114,7 +110,6 @@ AEABI_ENTRY(dcmpgt)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
- ite le
movle r0, #0
movgt r0, #1
RET
@@ -126,7 +121,6 @@ AEABI_ENTRY(dcmpun)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
- ite vc
movvc r0, #0
movvs r0, #1
RET
diff --git a/lib/libc/arm/aeabi/aeabi_vfp_float.S b/lib/libc/arm/aeabi/aeabi_vfp_float.S
index 7de8daf..c9a9a7e 100644
--- a/lib/libc/arm/aeabi/aeabi_vfp_float.S
+++ b/lib/libc/arm/aeabi/aeabi_vfp_float.S
@@ -62,7 +62,6 @@ AEABI_ENTRY(fcmpeq)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
- ite ne
movne r0, #0
moveq r0, #1
RET
@@ -73,9 +72,8 @@ AEABI_ENTRY(fcmplt)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
- ite cs
movcs r0, #0
- movcc r0, #1
+ movlt r0, #1
RET
AEABI_END(fcmplt)
@@ -84,7 +82,6 @@ AEABI_ENTRY(fcmple)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
- ite hi
movhi r0, #0
movls r0, #1
RET
@@ -95,7 +92,6 @@ AEABI_ENTRY(fcmpge)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
- ite lt
movlt r0, #0
movge r0, #1
RET
@@ -106,7 +102,6 @@ AEABI_ENTRY(fcmpgt)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
- ite le
movle r0, #0
movgt r0, #1
RET
@@ -117,7 +112,6 @@ AEABI_ENTRY(fcmpun)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
- ite vc
movvc r0, #0
movvs r0, #1
RET
diff --git a/lib/libc/arm/gen/Makefile.inc b/lib/libc/arm/gen/Makefile.inc
index c0f5392..8efde09 100644
--- a/lib/libc/arm/gen/Makefile.inc
+++ b/lib/libc/arm/gen/Makefile.inc
@@ -2,10 +2,9 @@
# $FreeBSD$
SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \
- infinity.c ldexp.c makecontext.c \
+ getcontextx.c infinity.c ldexp.c makecontext.c \
__aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S flt_rounds.c \
- arm_initfini.c \
- trivial-getcontextx.c
+ arm_initfini.c
.if ${MACHINE_ARCH} == "armv6hf"
SRCS+= fpgetmask_vfp.c fpgetround_vfp.c fpgetsticky_vfp.c fpsetmask_vfp.c \
diff --git a/lib/libc/arm/gen/_setjmp.S b/lib/libc/arm/gen/_setjmp.S
index 3de9d99..387f8a9 100644
--- a/lib/libc/arm/gen/_setjmp.S
+++ b/lib/libc/arm/gen/_setjmp.S
@@ -85,13 +85,7 @@ ENTRY(_setjmp)
add r0, r0, #(_JB_REG_R4 * 4)
/* Store integer registers */
-#ifndef __thumb__
stmia r0, {r4-r14}
-#else
- stmia r0, {r4-r12}
- str r13, [r0, #((_JB_REG_R13 - _JB_REG_R4) * 4)]
- str r14, [r0, #((_JB_REG_R14 - _JB_REG_R4) * 4)]
-#endif
mov r0, #0x00000000
RET
@@ -126,24 +120,15 @@ ENTRY(_longjmp)
add r0, r0, #(_JB_REG_R4 * 4)
/* Restore integer registers */
-#ifndef __thumb__
ldmia r0, {r4-r14}
-#else
- ldmia r0, {r4-r12}
- ldr r13, [r0, #((_JB_REG_R13 - _JB_REG_R4) * 4)]
- ldr r14, [r0, #((_JB_REG_R14 - _JB_REG_R4) * 4)]
-#endif
/* Validate sp and r14 */
teq sp, #0
- it ne
teqne r14, #0
- it eq
beq botch
/* Set return value */
movs r0, r1
- it eq
moveq r0, #0x00000001
RET
@@ -152,7 +137,7 @@ botch:
#if !defined(_STANDALONE)
bl PIC_SYM(_C_LABEL(longjmperror), PLT)
bl PIC_SYM(_C_LABEL(abort), PLT)
-1: b 1b /* Cannot get here */
+ b . - 8 /* Cannot get here */
#else
b .
#endif
diff --git a/lib/libc/gen/trivial-getcontextx.c b/lib/libc/arm/gen/getcontextx.c
index 54f8513..54f8513 100644
--- a/lib/libc/gen/trivial-getcontextx.c
+++ b/lib/libc/arm/gen/getcontextx.c
diff --git a/lib/libc/arm/gen/setjmp.S b/lib/libc/arm/gen/setjmp.S
index 6269563..ad4ba38 100644
--- a/lib/libc/arm/gen/setjmp.S
+++ b/lib/libc/arm/gen/setjmp.S
@@ -90,13 +90,7 @@ ENTRY(setjmp)
/* Store integer registers */
add r0, r0, #(_JB_REG_R4 * 4)
-#ifndef __thumb__
stmia r0, {r4-r14}
-#else
- stmia r0, {r4-r12}
- str r13, [r0, #((_JB_REG_R13 - _JB_REG_R4) * 4)]
- str r14, [r0, #((_JB_REG_R14 - _JB_REG_R4) * 4)]
-#endif
mov r0, #0x00000000
RET
@@ -139,24 +133,15 @@ ENTRY(__longjmp)
add r0, r0, #(_JB_REG_R4 * 4)
/* Restore integer registers */
-#ifndef __thumb__
ldmia r0, {r4-r14}
-#else
- ldmia r0, {r4-r12}
- ldr r13, [r0, #((_JB_REG_R13 - _JB_REG_R4) * 4)]
- ldr r14, [r0, #((_JB_REG_R14 - _JB_REG_R4) * 4)]
-#endif
/* Validate sp and r14 */
teq sp, #0
- it ne
teqne r14, #0
- it eq
beq .Lbotch
/* Set return value */
movs r0, r1
- it eq
moveq r0, #0x00000001
RET
@@ -164,5 +149,5 @@ ENTRY(__longjmp)
.Lbotch:
bl PIC_SYM(_C_LABEL(longjmperror), PLT)
bl PIC_SYM(_C_LABEL(abort), PLT)
-1: b 1b /* Cannot get here */
+ b . - 8 /* Cannot get here */
END(__longjmp)
diff --git a/lib/libc/arm/string/ffs.S b/lib/libc/arm/string/ffs.S
index 4567f6c..d3684ed 100644
--- a/lib/libc/arm/string/ffs.S
+++ b/lib/libc/arm/string/ffs.S
@@ -32,8 +32,6 @@
__FBSDID("$FreeBSD$");
-.syntax unified
-
/*
* ffs - find first set bit, this algorithm isolates the first set
* bit, then multiplies the number by 0x0450fbaf which leaves the top
@@ -62,7 +60,7 @@ ENTRY(ffs)
rsbne r0, r0, r0, lsl #16 /* r0 = X * 0x0450fbaf */
/* now lookup in table indexed on top 6 bits of r0 */
- ldrbne r0, [ r2, r0, lsr #26 ]
+ ldrneb r0, [ r2, r0, lsr #26 ]
RET
.text;
diff --git a/lib/libc/arm/string/memcmp.S b/lib/libc/arm/string/memcmp.S
index 6fd8130..63a00ef 100644
--- a/lib/libc/arm/string/memcmp.S
+++ b/lib/libc/arm/string/memcmp.S
@@ -66,8 +66,6 @@
__FBSDID("$FreeBSD$");
-.syntax unified
-
ENTRY(memcmp)
mov ip, r0
#if defined(_KERNEL) && !defined(_STANDALONE)
@@ -78,7 +76,7 @@ ENTRY(memcmp)
/* Are both addresses aligned the same way? */
cmp r2, #0x00
- eorsne r3, ip, r1
+ eornes r3, ip, r1
RETeq /* len == 0, or same addresses! */
tst r3, #0x03
subne r2, r2, #0x01
diff --git a/lib/libc/arm/string/memcpy_arm.S b/lib/libc/arm/string/memcpy_arm.S
index 56fb703..eff1eb0 100644
--- a/lib/libc/arm/string/memcpy_arm.S
+++ b/lib/libc/arm/string/memcpy_arm.S
@@ -31,9 +31,6 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
-
-.syntax unified
-
/*
* This is one fun bit of code ...
* Some easy listening music is suggested while trying to understand this
@@ -94,8 +91,8 @@ ENTRY(memcpy)
bge .Lmemcpy_loop32
cmn r2, #0x10
- ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
- stmiage r0!, {r3, r4, r12, lr}
+ ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
+ stmgeia r0!, {r3, r4, r12, lr}
subge r2, r2, #0x10
ldmia sp!, {r4} /* return r4 */
@@ -104,9 +101,9 @@ ENTRY(memcpy)
/* blat 12 bytes at a time */
.Lmemcpy_loop12:
- ldmiage r1!, {r3, r12, lr}
- stmiage r0!, {r3, r12, lr}
- subsge r2, r2, #0x0c
+ ldmgeia r1!, {r3, r12, lr}
+ stmgeia r0!, {r3, r12, lr}
+ subges r2, r2, #0x0c
bge .Lmemcpy_loop12
.Lmemcpy_l12:
@@ -116,26 +113,26 @@ ENTRY(memcpy)
subs r2, r2, #4
ldrlt r3, [r1], #4
strlt r3, [r0], #4
- ldmiage r1!, {r3, r12}
- stmiage r0!, {r3, r12}
+ ldmgeia r1!, {r3, r12}
+ stmgeia r0!, {r3, r12}
subge r2, r2, #4
.Lmemcpy_l4:
/* less than 4 bytes to go */
adds r2, r2, #4
#ifdef __APCS_26_
- ldmiaeq sp!, {r0, pc}^ /* done */
+ ldmeqia sp!, {r0, pc}^ /* done */
#else
- ldmiaeq sp!, {r0, pc} /* done */
+ ldmeqia sp!, {r0, pc} /* done */
#endif
/* copy the crud byte at a time */
cmp r2, #2
ldrb r3, [r1], #1
strb r3, [r0], #1
- ldrbge r3, [r1], #1
- strbge r3, [r0], #1
- ldrbgt r3, [r1], #1
- strbgt r3, [r0], #1
+ ldrgeb r3, [r1], #1
+ strgeb r3, [r0], #1
+ ldrgtb r3, [r1], #1
+ strgtb r3, [r0], #1
ldmia sp!, {r0, pc}
/* erg - unaligned destination */
@@ -146,10 +143,10 @@ ENTRY(memcpy)
/* align destination with byte copies */
ldrb r3, [r1], #1
strb r3, [r0], #1
- ldrbge r3, [r1], #1
- strbge r3, [r0], #1
- ldrbgt r3, [r1], #1
- strbgt r3, [r0], #1
+ ldrgeb r3, [r1], #1
+ strgeb r3, [r0], #1
+ ldrgtb r3, [r1], #1
+ strgtb r3, [r0], #1
subs r2, r2, r12
blt .Lmemcpy_l4 /* less the 4 bytes */
diff --git a/lib/libc/arm/string/memcpy_xscale.S b/lib/libc/arm/string/memcpy_xscale.S
index a451de4..1f48cd9 100644
--- a/lib/libc/arm/string/memcpy_xscale.S
+++ b/lib/libc/arm/string/memcpy_xscale.S
@@ -38,8 +38,6 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
-.syntax unified
-
/* LINTSTUB: Func: void *memcpy(void *dst, const void *src, size_t len) */
ENTRY(memcpy)
pld [r1]
@@ -54,12 +52,12 @@ ENTRY(memcpy)
ldrb ip, [r1], #0x01
sub r2, r2, #0x01
strb ip, [r3], #0x01
- ldrble ip, [r1], #0x01
+ ldrleb ip, [r1], #0x01
suble r2, r2, #0x01
- strble ip, [r3], #0x01
- ldrblt ip, [r1], #0x01
+ strleb ip, [r3], #0x01
+ ldrltb ip, [r1], #0x01
sublt r2, r2, #0x01
- strblt ip, [r3], #0x01
+ strltb ip, [r3], #0x01
/* Destination buffer is now word aligned */
.Lmemcpy_wordaligned:
@@ -136,7 +134,7 @@ ENTRY(memcpy)
.Lmemcpy_w_lessthan128:
adds r2, r2, #0x80 /* Adjust for extra sub */
- ldmfdeq sp!, {r4-r9}
+ ldmeqfd sp!, {r4-r9}
bxeq lr /* Return now if done */
subs r2, r2, #0x20
blt .Lmemcpy_w_lessthan32
@@ -161,7 +159,7 @@ ENTRY(memcpy)
.Lmemcpy_w_lessthan32:
adds r2, r2, #0x20 /* Adjust for extra sub */
- ldmfdeq sp!, {r4-r9}
+ ldmeqfd sp!, {r4-r9}
bxeq lr /* Return now if done */
and r4, r2, #0x18
@@ -197,11 +195,11 @@ ENTRY(memcpy)
addlt r2, r2, #0x04
ldrb ip, [r1], #0x01
cmp r2, #0x02
- ldrbge r2, [r1], #0x01
+ ldrgeb r2, [r1], #0x01
strb ip, [r3], #0x01
- ldrbgt ip, [r1]
- strbge r2, [r3], #0x01
- strbgt ip, [r3]
+ ldrgtb ip, [r1]
+ strgeb r2, [r3], #0x01
+ strgtb ip, [r3]
bx lr
@@ -255,7 +253,7 @@ ENTRY(memcpy)
bge .Lmemcpy_bad1_loop16
adds r2, r2, #0x10
- ldmfdeq sp!, {r4-r7}
+ ldmeqfd sp!, {r4-r7}
bxeq lr /* Return now if done */
subs r2, r2, #0x04
sublt r1, r1, #0x03
@@ -316,7 +314,7 @@ ENTRY(memcpy)
bge .Lmemcpy_bad2_loop16
adds r2, r2, #0x10
- ldmfdeq sp!, {r4-r7}
+ ldmeqfd sp!, {r4-r7}
bxeq lr /* Return now if done */
subs r2, r2, #0x04
sublt r1, r1, #0x02
@@ -377,7 +375,7 @@ ENTRY(memcpy)
bge .Lmemcpy_bad3_loop16
adds r2, r2, #0x10
- ldmfdeq sp!, {r4-r7}
+ ldmeqfd sp!, {r4-r7}
bxeq lr /* Return now if done */
subs r2, r2, #0x04
sublt r1, r1, #0x01
@@ -406,11 +404,11 @@ ENTRY(memcpy)
bxeq lr
ldrb ip, [r1], #0x01
cmp r2, #0x02
- ldrbge r2, [r1], #0x01
+ ldrgeb r2, [r1], #0x01
strb ip, [r3], #0x01
- ldrbgt ip, [r1]
- strbge r2, [r3], #0x01
- strbgt ip, [r3]
+ ldrgtb ip, [r1]
+ strgeb r2, [r3], #0x01
+ strgtb ip, [r3]
bx lr
@@ -442,7 +440,7 @@ ENTRY(memcpy)
ldrb ip, [r1], #0x01
1: subs r2, r2, #0x01
strb ip, [r3], #0x01
- ldrbne ip, [r1], #0x01
+ ldrneb ip, [r1], #0x01
bne 1b
bx lr
diff --git a/lib/libc/arm/string/memmove.S b/lib/libc/arm/string/memmove.S
index 94e5474..75a2744 100644
--- a/lib/libc/arm/string/memmove.S
+++ b/lib/libc/arm/string/memmove.S
@@ -32,8 +32,6 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
-.syntax unified
-
#ifndef _BCOPY
/* LINTSTUB: Func: void *memmove(void *, const void *, size_t) */
ENTRY(memmove)
@@ -88,8 +86,8 @@ ENTRY(bcopy)
bge .Lmemmove_floop32
cmn r2, #0x10
- ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
- stmiage r0!, {r3, r4, r12, lr}
+ ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
+ stmgeia r0!, {r3, r4, r12, lr}
subge r2, r2, #0x10
ldmia sp!, {r4} /* return r4 */
@@ -98,9 +96,9 @@ ENTRY(bcopy)
/* blat 12 bytes at a time */
.Lmemmove_floop12:
- ldmiage r1!, {r3, r12, lr}
- stmiage r0!, {r3, r12, lr}
- subsge r2, r2, #0x0c
+ ldmgeia r1!, {r3, r12, lr}
+ stmgeia r0!, {r3, r12, lr}
+ subges r2, r2, #0x0c
bge .Lmemmove_floop12
.Lmemmove_fl12:
@@ -110,23 +108,23 @@ ENTRY(bcopy)
subs r2, r2, #4
ldrlt r3, [r1], #4
strlt r3, [r0], #4
- ldmiage r1!, {r3, r12}
- stmiage r0!, {r3, r12}
+ ldmgeia r1!, {r3, r12}
+ stmgeia r0!, {r3, r12}
subge r2, r2, #4
.Lmemmove_fl4:
/* less than 4 bytes to go */
adds r2, r2, #4
- ldmiaeq sp!, {r0, pc} /* done */
+ ldmeqia sp!, {r0, pc} /* done */
/* copy the crud byte at a time */
cmp r2, #2
ldrb r3, [r1], #1
strb r3, [r0], #1
- ldrbge r3, [r1], #1
- strbge r3, [r0], #1
- ldrbgt r3, [r1], #1
- strbgt r3, [r0], #1
+ ldrgeb r3, [r1], #1
+ strgeb r3, [r0], #1
+ ldrgtb r3, [r1], #1
+ strgtb r3, [r0], #1
ldmia sp!, {r0, pc}
/* erg - unaligned destination */
@@ -137,10 +135,10 @@ ENTRY(bcopy)
/* align destination with byte copies */
ldrb r3, [r1], #1
strb r3, [r0], #1
- ldrbge r3, [r1], #1
- strbge r3, [r0], #1
- ldrbgt r3, [r1], #1
- strbgt r3, [r0], #1
+ ldrgeb r3, [r1], #1
+ strgeb r3, [r0], #1
+ ldrgtb r3, [r1], #1
+ strgtb r3, [r0], #1
subs r2, r2, r12
blt .Lmemmove_fl4 /* less the 4 bytes */
@@ -355,12 +353,12 @@ ENTRY(bcopy)
.Lmemmove_bl32:
cmn r2, #0x10
- ldmdbge r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
- stmdbge r0!, {r3, r4, r12, lr}
+ ldmgedb r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
+ stmgedb r0!, {r3, r4, r12, lr}
subge r2, r2, #0x10
adds r2, r2, #0x14
- ldmdbge r1!, {r3, r12, lr} /* blat a remaining 12 bytes */
- stmdbge r0!, {r3, r12, lr}
+ ldmgedb r1!, {r3, r12, lr} /* blat a remaining 12 bytes */
+ stmgedb r0!, {r3, r12, lr}
subge r2, r2, #0x0c
ldmia sp!, {r4, lr}
@@ -370,8 +368,8 @@ ENTRY(bcopy)
subs r2, r2, #4
ldrlt r3, [r1, #-4]!
strlt r3, [r0, #-4]!
- ldmdbge r1!, {r3, r12}
- stmdbge r0!, {r3, r12}
+ ldmgedb r1!, {r3, r12}
+ stmgedb r0!, {r3, r12}
subge r2, r2, #4
.Lmemmove_bl4:
@@ -383,10 +381,10 @@ ENTRY(bcopy)
cmp r2, #2
ldrb r3, [r1, #-1]!
strb r3, [r0, #-1]!
- ldrbge r3, [r1, #-1]!
- strbge r3, [r0, #-1]!
- ldrbgt r3, [r1, #-1]!
- strbgt r3, [r0, #-1]!
+ ldrgeb r3, [r1, #-1]!
+ strgeb r3, [r0, #-1]!
+ ldrgtb r3, [r1, #-1]!
+ strgtb r3, [r0, #-1]!
RET
/* erg - unaligned destination */
@@ -396,10 +394,10 @@ ENTRY(bcopy)
/* align destination with byte copies */
ldrb r3, [r1, #-1]!
strb r3, [r0, #-1]!
- ldrbge r3, [r1, #-1]!
- strbge r3, [r0, #-1]!
- ldrbgt r3, [r1, #-1]!
- strbgt r3, [r0, #-1]!
+ ldrgeb r3, [r1, #-1]!
+ strgeb r3, [r0, #-1]!
+ ldrgtb r3, [r1, #-1]!
+ strgtb r3, [r0, #-1]!
subs r2, r2, r12
blt .Lmemmove_bl4 /* less than 4 bytes to go */
ands r12, r1, #3
diff --git a/lib/libc/arm/string/memset.S b/lib/libc/arm/string/memset.S
index 66af33e..458f8f7 100644
--- a/lib/libc/arm/string/memset.S
+++ b/lib/libc/arm/string/memset.S
@@ -69,8 +69,6 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
-.syntax unified
-
/*
* memset: Sets a block of memory to the specified value
*
@@ -127,39 +125,39 @@ ENTRY(memset)
.Lmemset_loop128:
subs r1, r1, #0x80
#ifdef _ARM_ARCH_5E
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
#else
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
#endif
bgt .Lmemset_loop128
RETeq /* Zero length so just exit */
@@ -170,15 +168,15 @@ ENTRY(memset)
.Lmemset_loop32:
subs r1, r1, #0x20
#ifdef _ARM_ARCH_5E
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
#else
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
#endif
bgt .Lmemset_loop32
RETeq /* Zero length so just exit */
@@ -187,11 +185,11 @@ ENTRY(memset)
/* Deal with 16 bytes or more */
#ifdef _ARM_ARCH_5E
- strdge r2, [ip], #0x08
- strdge r2, [ip], #0x08
+ strged r2, [ip], #0x08
+ strged r2, [ip], #0x08
#else
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
+ stmgeia ip!, {r2-r3}
#endif
RETeq /* Zero length so just exit */
@@ -214,17 +212,17 @@ ENTRY(memset)
#endif
strb r3, [ip], #0x01 /* Set 1 byte */
- strbge r3, [ip], #0x01 /* Set another byte */
- strbgt r3, [ip] /* and a third */
+ strgeb r3, [ip], #0x01 /* Set another byte */
+ strgtb r3, [ip] /* and a third */
RET /* Exit */
.Lmemset_wordunaligned:
rsb r2, r2, #0x004
strb r3, [ip], #0x01 /* Set 1 byte */
cmp r2, #0x02
- strbge r3, [ip], #0x01 /* Set another byte */
+ strgeb r3, [ip], #0x01 /* Set another byte */
sub r1, r1, r2
- strbgt r3, [ip], #0x01 /* and a third */
+ strgtb r3, [ip], #0x01 /* and a third */
cmp r1, #0x04 /* More than 4 bytes left? */
bge .Lmemset_wordaligned /* Yup */
@@ -233,8 +231,8 @@ ENTRY(memset)
RETeq /* Zero length so exit */
strb r3, [ip], #0x01 /* Set 1 byte */
cmp r1, #0x02
- strbge r3, [ip], #0x01 /* Set another byte */
- strbgt r3, [ip] /* and a third */
+ strgeb r3, [ip], #0x01 /* Set another byte */
+ strgtb r3, [ip] /* and a third */
RET /* Exit */
#ifdef _BZERO
END(bzero)
diff --git a/lib/libc/arm/string/strlen.S b/lib/libc/arm/string/strlen.S
index 7447710..3d7726f 100644
--- a/lib/libc/arm/string/strlen.S
+++ b/lib/libc/arm/string/strlen.S
@@ -27,8 +27,6 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
-.syntax unified
-
ENTRY(strlen)
mov r1, #0
/* Check that the pointer is aligned on 32 bits. */
@@ -55,23 +53,23 @@ ENTRY(strlen)
addne r1, r1, #1
.Ldo_3:
#ifndef __ARMEB__
- andsne r3, r2, #0x0000ff00
+ andnes r3, r2, #0x0000ff00
#else
- andsne r3, r2, #0x00ff0000
+ andnes r3, r2, #0x00ff0000
#endif
addne r1, r1, #1
.Ldo_2:
#ifndef __ARMEB__
- andsne r3, r2, #0x00ff0000
+ andnes r3, r2, #0x00ff0000
#else
- andsne r3, r2, #0x0000ff00
+ andnes r3, r2, #0x0000ff00
#endif
addne r1, r1, #1
.Ldo_1:
#ifndef __ARMEB__
- andsne r3, r2, #0xff000000
+ andnes r3, r2, #0xff000000
#else
- andsne r3, r2, #0x000000ff
+ andnes r3, r2, #0x000000ff
#endif
addne r1, r1, #1
bne .Loop
diff --git a/lib/libc/arm/sys/Makefile.inc b/lib/libc/arm/sys/Makefile.inc
index 60c2dc3..069aad3 100644
--- a/lib/libc/arm/sys/Makefile.inc
+++ b/lib/libc/arm/sys/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-SRCS+= trivial-vdso_tc.c
+SRCS+= __vdso_gettc.c
MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S
@@ -8,3 +8,6 @@ MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscal
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
PSEUDO= _exit.o _getlogin.o
+.if ${MK_SYSCALL_COMPAT} != "no"
+PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
+.endif
diff --git a/lib/libc/sys/trivial-vdso_tc.c b/lib/libc/arm/sys/__vdso_gettc.c
index b99bbc4..b99bbc4 100644
--- a/lib/libc/sys/trivial-vdso_tc.c
+++ b/lib/libc/arm/sys/__vdso_gettc.c
diff --git a/lib/libc/arm/sys/brk.S b/lib/libc/arm/sys/brk.S
index e5f8336..f3d8d87 100644
--- a/lib/libc/arm/sys/brk.S
+++ b/lib/libc/arm/sys/brk.S
@@ -53,10 +53,16 @@ _C_LABEL(minbrk):
* Change the data segment size
*/
ENTRY(_brk)
+#ifdef PIC
/* Setup the GOT */
- GOT_INIT(r3, .Lgot, .L1)
- GOT_GET(r1, r3, .Lminbrk)
-
+ ldr r3, .Lgot
+ add r3, pc, r3
+.L1:
+ ldr r1, .Lminbrk
+ ldr r1, [r3, r1]
+#else
+ ldr r1, .Lminbrk
+#endif
/* Get the minimum allowable brk address */
ldr r1, [r1]
@@ -65,7 +71,6 @@ ENTRY(_brk)
* if the address is below minbrk.
*/
cmp r0, r1
- it lt
movlt r0, r1
mov r2, r0
SYSTRAP(break)
@@ -85,7 +90,10 @@ ENTRY(_brk)
RET
.align 2
- GOT_INITSYM(.Lgot, .L1)
+#ifdef PIC
+.Lgot:
+ .word _GLOBAL_OFFSET_TABLE_ - (.L1+4)
+#endif
.Lminbrk:
.word PIC_SYM(_C_LABEL(minbrk), GOT)
.Lcurbrk:
diff --git a/lib/libc/arm/sys/sbrk.S b/lib/libc/arm/sys/sbrk.S
index 5cd9a03..7d22aa7 100644
--- a/lib/libc/arm/sys/sbrk.S
+++ b/lib/libc/arm/sys/sbrk.S
@@ -52,10 +52,16 @@ CURBRK:
* Change the data segment size
*/
ENTRY(_sbrk)
+#ifdef PIC
/* Setup the GOT */
- GOT_INIT(r3, .Lgot, .L1)
- GOT_GET(r2, r3, .Lcurbrk)
-
+ ldr r3, .Lgot
+ add r3, pc, r3
+.L1:
+ ldr r2, .Lcurbrk
+ ldr r2, [r3, r2]
+#else
+ ldr r2, .Lcurbrk
+#endif
/* Get the current brk address */
ldr r1, [r2]
@@ -74,7 +80,10 @@ ENTRY(_sbrk)
RET
.align 0
- GOT_INITSYM(.Lgot, .L1)
+#ifdef PIC
+.Lgot:
+ .word _GLOBAL_OFFSET_TABLE_ - (.L1+4)
+#endif
.Lcurbrk:
.word PIC_SYM(CURBRK, GOT)
END(_sbrk)
diff --git a/lib/libc/compat-43/creat.c b/lib/libc/compat-43/creat.c
index 4545482..fc3be06 100644
--- a/lib/libc/compat-43/creat.c
+++ b/lib/libc/compat-43/creat.c
@@ -36,18 +36,11 @@ __FBSDID("$FreeBSD$");
#include "namespace.h"
#include <fcntl.h>
#include "un-namespace.h"
-#include "libc_private.h"
-__weak_reference(__creat, creat);
-__weak_reference(__creat, _creat);
-
-#pragma weak creat
int
__creat(const char *path, mode_t mode)
{
-
- return (((int (*)(int, const char *, int, ...))
- __libc_interposing[INTERPOS_openat])(AT_FDCWD, path, O_WRONLY |
- O_CREAT | O_TRUNC, mode));
+ return(_open(path, O_WRONLY|O_CREAT|O_TRUNC, mode));
}
-
+__weak_reference(__creat, creat);
+__weak_reference(__creat, _creat);
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index e6da5fe..af80929 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -808,7 +808,7 @@ __expand_table(HTAB *hashp)
hashp->DSIZE = dirsize << 1;
}
if ((hashp->dir[new_segnum] =
- calloc(hashp->SGSIZE, sizeof(SEGMENT))) == NULL)
+ (SEGMENT)calloc(hashp->SGSIZE, sizeof(SEGMENT))) == NULL)
return (-1);
hashp->exsegs++;
hashp->nsegs++;
@@ -877,7 +877,7 @@ alloc_segs(HTAB *hashp, int nsegs)
int save_errno;
if ((hashp->dir =
- calloc(hashp->DSIZE, sizeof(SEGMENT *))) == NULL) {
+ (SEGMENT *)calloc(hashp->DSIZE, sizeof(SEGMENT *))) == NULL) {
save_errno = errno;
(void)hdestroy(hashp);
errno = save_errno;
@@ -887,7 +887,8 @@ alloc_segs(HTAB *hashp, int nsegs)
if (nsegs == 0)
return (0);
/* Allocate segments */
- if ((store = calloc(nsegs << hashp->SSHIFT, sizeof(SEGMENT))) == NULL) {
+ if ((store = (SEGMENT)calloc(nsegs << hashp->SSHIFT,
+ sizeof(SEGMENT))) == NULL) {
save_errno = errno;
(void)hdestroy(hashp);
errno = save_errno;
diff --git a/lib/libc/db/man/dbm.3 b/lib/libc/db/man/dbm.3
index eedf804..fabce8a 100644
--- a/lib/libc/db/man/dbm.3
+++ b/lib/libc/db/man/dbm.3
@@ -15,7 +15,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 19, 2015
+.Dd April 16, 2006
.Dt DBM 3
.Os
.Sh NAME
@@ -174,7 +174,9 @@ deletes the entry for
The
.Fn dbm_delete
function
-normally returns zero or returns -1 and sets
+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
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 2232b79..f64caf0 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -5,7 +5,6 @@
.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen
SRCS+= __getosreldate.c \
- __pthread_mutex_init_calloc_cb_stub.c \
__xuname.c \
_once_stub.c \
_pthread_stubs.c \
diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map
index ee4d619..77413d6 100644
--- a/lib/libc/gen/Symbol.map
+++ b/lib/libc/gen/Symbol.map
@@ -487,7 +487,6 @@ FBSDprivate_1.0 {
_rtld_atfork_post;
_rtld_error; /* for private use */
_rtld_get_stack_prot;
- _rtld_is_dlopened;
_rtld_thread_init; /* for private use */
__elf_phdr_match_addr;
_err;
@@ -533,8 +532,6 @@ FBSDprivate_1.0 {
_libc_sem_post_compat;
_libc_sem_getvalue_compat;
- __libc_tcdrain;
-
__elf_aux_vector;
__pthread_map_stacks_exec;
__fillcontextx;
diff --git a/lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c b/lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c
deleted file mode 100644
index 1c566ec..0000000
--- a/lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <pthread.h>
-#include "libc_private.h"
-
-int
-_pthread_mutex_init_calloc_cb_stub(pthread_mutex_t *mutex,
- void *(calloc_cb)(size_t, size_t))
-{
-
- return (0);
-}
diff --git a/lib/libc/gen/_once_stub.c b/lib/libc/gen/_once_stub.c
index c45565a..d2acc29 100644
--- a/lib/libc/gen/_once_stub.c
+++ b/lib/libc/gen/_once_stub.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2009 Hudson River Trading LLC
+ * Copyright (c) 2009 Advanced Computing Technologies LLC
* Written by: John H. Baldwin <jhb@FreeBSD.org>
* All rights reserved.
*
diff --git a/lib/libc/gen/_spinlock_stub.c b/lib/libc/gen/_spinlock_stub.c
index 3decf8a..47bbfeb 100644
--- a/lib/libc/gen/_spinlock_stub.c
+++ b/lib/libc/gen/_spinlock_stub.c
@@ -33,48 +33,51 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include "spinlock.h"
-#include "libc_private.h"
long _atomic_lock_stub(volatile long *);
void _spinlock_stub(spinlock_t *);
void _spinunlock_stub(spinlock_t *);
void _spinlock_debug_stub(spinlock_t *, char *, int);
+/*
+ * Declare weak definitions in case the application is not linked
+ * with libpthread.
+ */
__weak_reference(_atomic_lock_stub, _atomic_lock);
+__weak_reference(_spinlock_stub, _spinlock);
+__weak_reference(_spinunlock_stub, _spinunlock);
+__weak_reference(_spinlock_debug_stub, _spinlock_debug);
+/*
+ * This function is a stub for the _atomic_lock function in libpthread.
+ */
long
_atomic_lock_stub(volatile long *lck __unused)
{
return (0L);
}
-__weak_reference(_spinlock, _spinlock_debug);
-#pragma weak _spinlock
-void
-_spinlock(spinlock_t *lck)
-{
-
- ((void (*)(spinlock_t *lck))__libc_interposing[INTERPOS_spinlock])
- (lck);
-
-}
-#pragma weak _spinunlock
+/*
+ * This function is a stub for the spinlock function in libpthread.
+ */
void
-_spinunlock(spinlock_t *lck)
+_spinlock_stub(spinlock_t *lck __unused)
{
-
- ((void (*)(spinlock_t *lck))__libc_interposing[INTERPOS_spinunlock])
- (lck);
-
}
+/*
+ * This function is a stub for the spinunlock function in libpthread.
+ */
void
-__libc_spinlock_stub(spinlock_t *lck __unused)
+_spinunlock_stub(spinlock_t *lck __unused)
{
}
+/*
+ * This function is a stub for the debug spinlock function in libpthread.
+ */
void
-__libc_spinunlock_stub(spinlock_t *lck __unused)
+_spinlock_debug_stub(spinlock_t *lck __unused, char *fname __unused, int lineno __unused)
{
}
diff --git a/lib/libc/gen/cap_rights_get.3 b/lib/libc/gen/cap_rights_get.3
index a665465..f74d1f7a 100644
--- a/lib/libc/gen/cap_rights_get.3
+++ b/lib/libc/gen/cap_rights_get.3
@@ -100,10 +100,10 @@ argument points at an invalid address.
.El
.Sh SEE ALSO
.Xr cap_rights_limit 2 ,
+.Xr cap_rights_init 3 ,
.Xr errno 2 ,
.Xr open 2 ,
.Xr assert 3 ,
-.Xr cap_rights_init 3 ,
.Xr err 3 ,
.Xr memcmp 3 ,
.Xr memset 3 ,
diff --git a/lib/libc/gen/directory.3 b/lib/libc/gen/directory.3
index f0d0f4b..1e864f8 100644
--- a/lib/libc/gen/directory.3
+++ b/lib/libc/gen/directory.3
@@ -28,7 +28,7 @@
.\" @(#)directory.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd May 6, 2015
+.Dd July 28, 2014
.Dt DIRECTORY 3
.Os
.Sh NAME
@@ -263,25 +263,8 @@ function appeared in
function appeared in
.Fx 10.0 .
.Sh BUGS
-The behaviour of
+The invalidation of
.Fn telldir
-and
-.Fn seekdir
-is likely to be wrong if there are parallel unlinks happening
-and the directory is larger than one page.
-There is code to ensure that a
+tokens when calling
.Fn seekdir
-to the location given by a
-.Fn telldir
-immediately before the last
-.Fn readdir
-will always set the correct location to return the same value as that last
-.Fn readdir
-performed.
-This is enough for some applications which want to "push back the last entry read" E.g. Samba.
-Seeks back to any other location,
-other than the beginning of the directory,
-may result in unexpected behaviour if deletes are present.
-It is hoped that this situation will be resolved with changes to
-.Fn getdirentries
-and the VFS.
+is non-standard.
diff --git a/lib/libc/gen/disklabel.c b/lib/libc/gen/disklabel.c
index 8780573..bd15a47 100644
--- a/lib/libc/gen/disklabel.c
+++ b/lib/libc/gen/disklabel.c
@@ -85,13 +85,10 @@ getdiskbyname(const char *name)
cq++, cp++;
*cq = '\0';
- if (cgetstr(buf, "ty", &cq) > 0) {
- if (strcmp(cq, "removable") == 0)
- dp->d_flags |= D_REMOVABLE;
- else if (cq && strcmp(cq, "simulated") == 0)
- dp->d_flags |= D_RAMDISK;
- free(cq);
- }
+ 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;
@@ -103,10 +100,9 @@ getdiskbyname(const char *name)
getnumdflt(dp->d_nsectors, "ns", 0);
getnumdflt(dp->d_ncylinders, "nc", 0);
- if (cgetstr(buf, "dt", &cq) > 0) {
+ if (cgetstr(buf, "dt", &cq) > 0)
dp->d_type = gettype(cq, dktypenames);
- free(cq);
- } else
+ 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);
@@ -144,11 +140,8 @@ getdiskbyname(const char *name)
pp->p_frag = 8;
}
getnumdflt(pp->p_fstype, ptype, 0);
- if (pp->p_fstype == 0)
- if (cgetstr(buf, ptype, &cq) >= 0) {
- pp->p_fstype = gettype(cq, fstypenames);
- free(cq);
- }
+ if (pp->p_fstype == 0 && cgetstr(buf, ptype, &cq) > 0)
+ pp->p_fstype = gettype(cq, fstypenames);
max = p;
}
}
diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c
index 7d28797..ad24bb4 100644
--- a/lib/libc/gen/dlfcn.c
+++ b/lib/libc/gen/dlfcn.c
@@ -149,8 +149,10 @@ static void
dl_init_phdr_info(void)
{
Elf_Auxinfo *auxp;
+ size_t phent;
unsigned int i;
+ phent = 0;
for (auxp = __elf_aux_vector; auxp->a_type != AT_NULL; auxp++) {
switch (auxp->a_type) {
case AT_BASE:
@@ -163,6 +165,9 @@ dl_init_phdr_info(void)
phdr_info.dlpi_phdr =
(const Elf_Phdr *)auxp->a_un.a_ptr;
break;
+ case AT_PHENT:
+ phent = auxp->a_un.a_val;
+ break;
case AT_PHNUM:
phdr_info.dlpi_phnum = (Elf_Half)auxp->a_un.a_val;
break;
@@ -228,10 +233,3 @@ _rtld_get_stack_prot(void)
return (PROT_EXEC | PROT_READ | PROT_WRITE);
}
-#pragma weak _rtld_is_dlopened
-int
-_rtld_is_dlopened(void *arg)
-{
-
- return (0);
-}
diff --git a/lib/libc/gen/dlopen.3 b/lib/libc/gen/dlopen.3
index 1963528..089e631 100644
--- a/lib/libc/gen/dlopen.3
+++ b/lib/libc/gen/dlopen.3
@@ -32,7 +32,7 @@
.\" @(#) dlopen.3 1.6 90/01/31 SMI
.\" $FreeBSD$
.\"
-.Dd February 14, 2015
+.Dd December 21, 2011
.Dt DLOPEN 3
.Os
.Sh NAME
@@ -236,7 +236,7 @@ as follows, in the given order:
The referencing object itself (or the object from which the call to
.Fn dlsym
is made), if that object was linked using the
-.Fl Bsymbolic
+.Fl Wsymbolic
option to
.Xr ld 1 .
.It
diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c
index c21ceb3..6a77abd 100644
--- a/lib/libc/gen/fstab.c
+++ b/lib/libc/gen/fstab.c
@@ -181,7 +181,7 @@ fstabscan(void)
if (cp != NULL)
_fs_fstab.fs_passno = atoi(cp);
}
- (void)strlcpy(subline, _fs_fstab.fs_mntops, sizeof(subline));
+ strcpy(subline, _fs_fstab.fs_mntops);
p = subline;
for (typexx = 0, cp = strsep(&p, ","); cp;
cp = strsep(&p, ",")) {
diff --git a/lib/libc/gen/ftok.3 b/lib/libc/gen/ftok.3
index b819dbd..98f8bad 100644
--- a/lib/libc/gen/ftok.3
+++ b/lib/libc/gen/ftok.3
@@ -64,9 +64,9 @@ function will return -1 if
.Fa path
does not exist or if it cannot be accessed by the calling process.
.Sh SEE ALSO
-.Xr msgget 2 ,
.Xr semget 2 ,
-.Xr shmget 2
+.Xr shmget 2 ,
+.Xr msgget 2
.Sh HISTORY
The
.Fn ftok
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index 1ca8334..7635fbc 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -905,13 +905,12 @@ fts_stat(FTS *sp, FTSENT *p, int follow, int dfd)
if (ISSET(FTS_LOGICAL) || follow) {
if (fstatat(dfd, path, sbp, 0)) {
saved_errno = errno;
- if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) {
- p->fts_errno = saved_errno;
- goto err;
- }
- errno = 0;
- if (S_ISLNK(sbp->st_mode))
+ if (!fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) {
+ errno = 0;
return (FTS_SLNONE);
+ }
+ p->fts_errno = saved_errno;
+ goto err;
}
} else if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) {
p->fts_errno = errno;
diff --git a/lib/libc/gen/ftw.3 b/lib/libc/gen/ftw.3
index df8abab..ba8859b 100644
--- a/lib/libc/gen/ftw.3
+++ b/lib/libc/gen/ftw.3
@@ -87,9 +87,8 @@ A directory which cannot be read.
The directory will not be descended into.
.It Dv FTW_DP
A directory being visited in post-order
-.Po Fn nftw
-only
-.Pc .
+.Fn ( nftw
+only).
.It Dv FTW_NS
A file for which no
.Xr stat 2
@@ -101,9 +100,8 @@ structure are undefined.
A symbolic link.
.It Dv FTW_SLN
A symbolic link with a non-existent target
-.Po Fn nftw
-only
-.Pc .
+.Fn ( nftw
+only).
.El
.Pp
The
diff --git a/lib/libc/gen/getcap.3 b/lib/libc/gen/getcap.3
index c3a9ce8..73826ae 100644
--- a/lib/libc/gen/getcap.3
+++ b/lib/libc/gen/getcap.3
@@ -137,10 +137,9 @@ It must be called before the
call.
If a sequential access is being performed (see below), it must be called
before the first sequential access call
-.Po Fn cgetfirst
+.Fn ( cgetfirst
or
-.Fn cgetnext
-.Pc ,
+.Fn cgetnext ) ,
or be directly preceded by a
.Fn cgetclose
call.
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index 1f4d7e9..f9480c3 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -896,7 +896,7 @@ files_group(void *retval, void *mdata, va_list ap)
break;
pos = ftello(st->fp);
}
- if (st->fp != NULL && !stayopen) {
+ if (!stayopen && st->fp != NULL) {
fclose(st->fp);
st->fp = NULL;
}
@@ -1173,10 +1173,8 @@ nis_group(void *retval, void *mdata, va_list ap)
* terminator, alignment padding, and one (char *)
* pointer for the member list terminator.
*/
- if (resultlen >= bufsize - _ALIGNBYTES - sizeof(char *)) {
- free(result);
+ if (resultlen >= bufsize - _ALIGNBYTES - sizeof(char *))
goto erange;
- }
memcpy(buffer, result, resultlen);
buffer[resultlen] = '\0';
free(result);
@@ -1452,7 +1450,7 @@ docompat:
pos = ftello(st->fp);
}
fin:
- if (st->fp != NULL && !stayopen) {
+ if (!stayopen && st->fp != NULL) {
fclose(st->fp);
st->fp = NULL;
}
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 09a6247..f729cdf 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -815,7 +815,7 @@ files_passwd(void *retval, void *mdata, va_list ap)
size_t bufsize, namesize;
uid_t uid;
uint32_t store;
- int rv, stayopen = 0, *errnop;
+ int rv, stayopen, *errnop;
name = NULL;
uid = (uid_t)-1;
@@ -921,7 +921,7 @@ files_passwd(void *retval, void *mdata, va_list ap)
errnop);
} while (how == nss_lt_all && !(rv & NS_TERMINATE));
fin:
- if (st->db != NULL && !stayopen) {
+ if (!stayopen && st->db != NULL) {
(void)st->db->close(st->db);
st->db = NULL;
}
@@ -1392,10 +1392,8 @@ nis_passwd(void *retval, void *mdata, va_list ap)
continue;
}
}
- if (resultlen >= bufsize) {
- free(result);
+ if (resultlen >= bufsize)
goto erange;
- }
memcpy(buffer, result, resultlen);
buffer[resultlen] = '\0';
free(result);
@@ -1942,7 +1940,7 @@ docompat:
break;
}
fin:
- if (st->db != NULL && !stayopen) {
+ if (!stayopen && st->db != NULL) {
(void)st->db->close(st->db);
st->db = NULL;
}
diff --git a/lib/libc/gen/getutxent.3 b/lib/libc/gen/getutxent.3
index 85c37b1..120f4a0 100644
--- a/lib/libc/gen/getutxent.3
+++ b/lib/libc/gen/getutxent.3
@@ -475,4 +475,4 @@ They replaced the
.In utmp.h
interface.
.Sh AUTHORS
-.An \&Ed Schouten Aq Mt ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/nice.3 b/lib/libc/gen/nice.3
index b04c8f4..9c39b78 100644
--- a/lib/libc/gen/nice.3
+++ b/lib/libc/gen/nice.3
@@ -28,7 +28,7 @@
.\" @(#)nice.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd February 28, 2015
+.Dd June 4, 1993
.Dt NICE 3
.Os
.Sh NAME
@@ -48,48 +48,20 @@ This interface is obsoleted by
.Pp
The
.Fn nice
-function adds
-.Fa incr
-to the scheduling priority of the process.
+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 RETURN VALUES
-Upon successful completion,
-.Fn nice
-returns 0, and
-.Va errno
-is unchanged.
-Otherwise, \-1 is returned, the process' nice value is not changed, and
-.Va errno
-is set to indicate the error.
-.Sh ERRORS
-The
-.Fn nice
-function will fail if:
-.Bl -tag -width Er
-.It Bq Er EPERM
-The
-.Fa incr
-argument is negative and the caller does not have appropriate privileges.
-.El
.Sh SEE ALSO
.Xr nice 1 ,
.Xr fork 2 ,
.Xr setpriority 2 ,
.Xr renice 8
-.Sh STANDARDS
-The
-.Fn nice
-function conforms to
-.St -p1003.1-2008
-except for the return value.
-This implementation returns 0 upon successful completion but
-the standard requires returning the new nice value,
-which could be \-1.
.Sh HISTORY
A
.Fn nice
diff --git a/lib/libc/gen/nice.c b/lib/libc/gen/nice.c
index ba9524b..e8375e8 100644
--- a/lib/libc/gen/nice.c
+++ b/lib/libc/gen/nice.c
@@ -43,20 +43,14 @@ __FBSDID("$FreeBSD$");
* Backwards compatible nice.
*/
int
-nice(int incr)
+nice(incr)
+ int incr;
{
- int saverrno, prio;
+ int prio;
- saverrno = errno;
errno = 0;
prio = getpriority(PRIO_PROCESS, 0);
- if (prio == -1 && errno != 0)
+ if (prio == -1 && errno)
return (-1);
- if (setpriority(PRIO_PROCESS, 0, prio + incr) == -1) {
- if (errno == EACCES)
- errno = EPERM;
- return (-1);
- }
- errno = saverrno;
- return (0);
+ return (setpriority(PRIO_PROCESS, 0, prio + incr));
}
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index ec878c5..bdadd55 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -47,10 +47,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "un-namespace.h"
-/* There is no a.out support on arm64 */
-#ifndef __aarch64__
#define _NLIST_DO_AOUT
-#endif
#define _NLIST_DO_ELF
#ifdef _NLIST_DO_ELF
diff --git a/lib/libc/gen/pause.c b/lib/libc/gen/pause.c
index ef48c1c..51706cf 100644
--- a/lib/libc/gen/pause.c
+++ b/lib/libc/gen/pause.c
@@ -33,10 +33,10 @@ static char sccsid[] = "@(#)pause.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "namespace.h"
#include <signal.h>
#include <unistd.h>
-
-#include "libc_private.h"
+#include "un-namespace.h"
/*
* Backwards compatible pause.
@@ -46,10 +46,9 @@ __pause(void)
{
sigset_t oset;
- if (sigprocmask(SIG_BLOCK, NULL, &oset) == -1)
+ if (_sigprocmask(SIG_BLOCK, NULL, &oset) == -1)
return (-1);
- return (sigsuspend(&oset));
+ return (_sigsuspend(&oset));
}
-
__weak_reference(__pause, pause);
__weak_reference(__pause, _pause);
diff --git a/lib/libc/gen/posix_spawn.3 b/lib/libc/gen/posix_spawn.3
index 2c9131b..dd5bd2b 100644
--- a/lib/libc/gen/posix_spawn.3
+++ b/lib/libc/gen/posix_spawn.3
@@ -413,10 +413,6 @@ including trying to close a descriptor that is not open.
.Xr execve 2 ,
.Xr fcntl 2 ,
.Xr open 2 ,
-.Xr sched_setparam 2 ,
-.Xr sched_setscheduler 2 ,
-.Xr setpgid 2 ,
-.Xr vfork 2 ,
.Xr posix_spawn_file_actions_addclose 3 ,
.Xr posix_spawn_file_actions_adddup2 3 ,
.Xr posix_spawn_file_actions_addopen 3 ,
@@ -435,7 +431,11 @@ including trying to close a descriptor that is not open.
.Xr posix_spawnattr_setschedparam 3 ,
.Xr posix_spawnattr_setschedpolicy 3 ,
.Xr posix_spawnattr_setsigdefault 3 ,
-.Xr posix_spawnattr_setsigmask 3
+.Xr posix_spawnattr_setsigmask 3 ,
+.Xr sched_setparam 2 ,
+.Xr sched_setscheduler 2 ,
+.Xr setpgid 2 ,
+.Xr vfork 2
.Sh STANDARDS
The
.Fn posix_spawn
@@ -457,4 +457,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An \&Ed Schouten Aq Mt ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawn_file_actions_addopen.3 b/lib/libc/gen/posix_spawn_file_actions_addopen.3
index 0b57999b..b28f396 100644
--- a/lib/libc/gen/posix_spawn_file_actions_addopen.3
+++ b/lib/libc/gen/posix_spawn_file_actions_addopen.3
@@ -200,4 +200,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An \&Ed Schouten Aq Mt ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawn_file_actions_init.3 b/lib/libc/gen/posix_spawn_file_actions_init.3
index 380eed7..eda2a1d 100644
--- a/lib/libc/gen/posix_spawn_file_actions_init.3
+++ b/lib/libc/gen/posix_spawn_file_actions_init.3
@@ -101,4 +101,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An \&Ed Schouten Aq Mt ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_getflags.3 b/lib/libc/gen/posix_spawnattr_getflags.3
index 2571f4a..b5995ce 100644
--- a/lib/libc/gen/posix_spawnattr_getflags.3
+++ b/lib/libc/gen/posix_spawnattr_getflags.3
@@ -108,4 +108,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An \&Ed Schouten Aq Mt ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_getpgroup.3 b/lib/libc/gen/posix_spawnattr_getpgroup.3
index cfc1b54..91b3e5c 100644
--- a/lib/libc/gen/posix_spawnattr_getpgroup.3
+++ b/lib/libc/gen/posix_spawnattr_getpgroup.3
@@ -93,4 +93,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An \&Ed Schouten Aq Mt ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_getschedparam.3 b/lib/libc/gen/posix_spawnattr_getschedparam.3
index 5eef96e..a137200 100644
--- a/lib/libc/gen/posix_spawnattr_getschedparam.3
+++ b/lib/libc/gen/posix_spawnattr_getschedparam.3
@@ -97,4 +97,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An \&Ed Schouten Aq Mt ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_getschedpolicy.3 b/lib/libc/gen/posix_spawnattr_getschedpolicy.3
index 5276de5..3e79d4b 100644
--- a/lib/libc/gen/posix_spawnattr_getschedpolicy.3
+++ b/lib/libc/gen/posix_spawnattr_getschedpolicy.3
@@ -95,4 +95,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An \&Ed Schouten Aq Mt ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_getsigdefault.3 b/lib/libc/gen/posix_spawnattr_getsigdefault.3
index a81c714..8878332 100644
--- a/lib/libc/gen/posix_spawnattr_getsigdefault.3
+++ b/lib/libc/gen/posix_spawnattr_getsigdefault.3
@@ -95,4 +95,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An \&Ed Schouten Aq Mt ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_getsigmask.3 b/lib/libc/gen/posix_spawnattr_getsigmask.3
index be15d9d..4f9c014 100644
--- a/lib/libc/gen/posix_spawnattr_getsigmask.3
+++ b/lib/libc/gen/posix_spawnattr_getsigmask.3
@@ -95,4 +95,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An \&Ed Schouten Aq Mt ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_init.3 b/lib/libc/gen/posix_spawnattr_init.3
index b4ec52c..388fe5a 100644
--- a/lib/libc/gen/posix_spawnattr_init.3
+++ b/lib/libc/gen/posix_spawnattr_init.3
@@ -120,4 +120,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An \&Ed Schouten Aq Mt ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/raise.c b/lib/libc/gen/raise.c
index 994fea5..b3d0aae 100644
--- a/lib/libc/gen/raise.c
+++ b/lib/libc/gen/raise.c
@@ -36,17 +36,11 @@ __FBSDID("$FreeBSD$");
#include <signal.h>
#include <unistd.h>
-#include "libc_private.h"
-
__weak_reference(__raise, raise);
__weak_reference(__raise, _raise);
int
__raise(int s)
{
- long id;
-
- if (__sys_thr_self(&id) == -1)
- return (-1);
- return (__sys_thr_kill(id, s));
+ return(kill(getpid(), s));
}
diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c
index c6f5d3f..69f59d1 100644
--- a/lib/libc/gen/readdir.c
+++ b/lib/libc/gen/readdir.c
@@ -54,25 +54,19 @@ _readdir_unlocked(dirp, skip)
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)
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_SKIPREAD))) {
- initial_seek = dirp->dd_seek;
dirp->dd_size = _getdirentries(dirp->dd_fd,
dirp->dd_buf, dirp->dd_len, &dirp->dd_seek);
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);
diff --git a/lib/libc/gen/rewinddir.c b/lib/libc/gen/rewinddir.c
index e157cd6..193f4b0 100644
--- a/lib/libc/gen/rewinddir.c
+++ b/lib/libc/gen/rewinddir.c
@@ -51,7 +51,6 @@ rewinddir(dirp)
if (__isthreaded)
_pthread_mutex_lock(&dirp->dd_lock);
- dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */
if (dirp->dd_flags & __DTF_READALL)
_filldir(dirp, false);
else {
diff --git a/lib/libc/gen/scandir.3 b/lib/libc/gen/scandir.3
index aa8dea0..eaba754 100644
--- a/lib/libc/gen/scandir.3
+++ b/lib/libc/gen/scandir.3
@@ -92,7 +92,7 @@ by freeing each pointer in the array and then the array itself.
.Pp
The
.Fn scandir_b
-function behaves in the same way as
+function behaves in the same way as
.Fn scandir ,
but takes blocks as arguments instead of function pointers and calls
.Fn qsort_b
@@ -106,8 +106,8 @@ cannot allocate enough memory to hold all the data structures.
.Xr directory 3 ,
.Xr malloc 3 ,
.Xr qsort 3 ,
-.Xr strcoll 3 ,
-.Xr dir 5
+.Xr dir 5 ,
+.Xr strcoll 3
.Sh HISTORY
The
.Fn scandir
diff --git a/lib/libc/gen/sem_new.c b/lib/libc/gen/sem_new.c
index c5dc7e7..3ee0272 100644
--- a/lib/libc/gen/sem_new.c
+++ b/lib/libc/gen/sem_new.c
@@ -439,10 +439,8 @@ _sem_post(sem_t *sem)
do {
count = sem->_kern._count;
- if (USEM_COUNT(count) + 1 > SEM_VALUE_MAX) {
- errno = EOVERFLOW;
- return (-1);
- }
+ if (USEM_COUNT(count) + 1 > SEM_VALUE_MAX)
+ return (EOVERFLOW);
} while (!atomic_cmpset_rel_int(&sem->_kern._count, count, count + 1));
if (count & USEM_HAS_WAITERS)
usem_wake(&sem->_kern);
diff --git a/lib/libc/gen/sem_post.3 b/lib/libc/gen/sem_post.3
index dea8eb6..485d2fc 100644
--- a/lib/libc/gen/sem_post.3
+++ b/lib/libc/gen/sem_post.3
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 28, 2015
+.Dd February 15, 2000
.Dt SEM_POST 3
.Os
.Sh NAME
@@ -65,9 +65,6 @@ The
.Fa sem
argument
points to an invalid semaphore.
-.It Bq Er EOVERFLOW
-The semaphore value would exceed
-.Dv SEM_VALUE_MAX .
.El
.Sh SEE ALSO
.Xr sem_getvalue 3 ,
diff --git a/lib/libc/gen/setmode.3 b/lib/libc/gen/setmode.3
index 684c2e1..5cab44a 100644
--- a/lib/libc/gen/setmode.3
+++ b/lib/libc/gen/setmode.3
@@ -28,7 +28,7 @@
.\" @(#)setmode.3 8.2 (Berkeley) 4/28/95
.\" $FreeBSD$
.\"
-.Dd February 22, 2015
+.Dd April 28, 1995
.Dt SETMODE 3
.Os
.Sh NAME
@@ -99,20 +99,7 @@ The
function
may fail and set errno for any of the errors specified for the library
routine
-.Xr malloc 3
-or
-.Xr strtol 3 .
-In addition,
-.Fn setmode
-will fail and set
-.Va errno
-to:
-.Bl -tag -width Er
-.It Bq Er EINVAL
-The
-.Fa mode
-argument does not represent a valid mode.
-.El
+.Xr malloc 3 .
.Sh SEE ALSO
.Xr chmod 1 ,
.Xr stat 2 ,
diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c
index 815cf14..3966fd0 100644
--- a/lib/libc/gen/setmode.c
+++ b/lib/libc/gen/setmode.c
@@ -39,11 +39,8 @@ __FBSDID("$FreeBSD$");
#include "namespace.h"
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/sysctl.h>
#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
#include <signal.h>
#include <stddef.h>
#include <stdlib.h>
@@ -69,8 +66,7 @@ typedef struct bitcmd {
#define CMD2_OBITS 0x08
#define CMD2_UBITS 0x10
-static mode_t getumask(void);
-static BITCMD *addcmd(BITCMD *, mode_t, mode_t, mode_t, mode_t);
+static BITCMD *addcmd(BITCMD *, int, int, int, u_int);
static void compress_mode(BITCMD *);
#ifdef SETMODE_DEBUG
static void dumpmode(BITCMD *);
@@ -155,37 +151,45 @@ common: if (set->cmd2 & CMD2_CLR) {
BITCMD *newset; \
setlen += SET_LEN_INCR; \
newset = realloc(saveset, sizeof(BITCMD) * setlen); \
- if (newset == NULL) \
- goto out; \
+ if (!newset) { \
+ if (saveset) \
+ free(saveset); \
+ saveset = NULL; \
+ return (NULL); \
+ } \
set = newset + (set - saveset); \
saveset = newset; \
endset = newset + (setlen - 2); \
} \
- set = addcmd(set, (mode_t)(a), (mode_t)(b), (mode_t)(c), (d))
+ set = addcmd(set, (a), (b), (c), (d))
#define STANDARD_BITS (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO)
void *
setmode(const char *p)
{
- int serrno;
+ int perm, who;
char op, *ep;
BITCMD *set, *saveset, *endset;
- mode_t mask, perm, permXbits, who;
+ sigset_t sigset, sigoset;
+ mode_t mask;
+ int equalopdone=0, permXbits, setlen;
long perml;
- int equalopdone;
- int setlen;
- if (!*p) {
- errno = EINVAL;
+ 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.
+ * 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.
*/
- mask = ~getumask();
+ 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;
@@ -199,17 +203,10 @@ setmode(const char *p)
* or illegal bits.
*/
if (isdigit((unsigned char)*p)) {
- errno = 0;
perml = strtol(p, &ep, 8);
- if (*ep) {
- errno = EINVAL;
- goto out;
- }
- if (errno == ERANGE && (perml == LONG_MAX || perml == LONG_MIN))
- goto out;
- if (perml & ~(STANDARD_BITS|S_ISTXT)) {
- errno = EINVAL;
- goto out;
+ if (*ep || perml < 0 || perml & ~(STANDARD_BITS|S_ISTXT)) {
+ free(saveset);
+ return (NULL);
}
perm = (mode_t)perml;
ADDCMD('=', (STANDARD_BITS|S_ISTXT), perm, mask);
@@ -221,7 +218,6 @@ setmode(const char *p)
* Build list of structures to set/clear/copy bits as described by
* each clause of the symbolic mode.
*/
- equalopdone = 0;
for (;;) {
/* First, find out which bits might be modified. */
for (who = 0;; ++p) {
@@ -244,8 +240,8 @@ setmode(const char *p)
}
getop: if ((op = *p++) != '+' && op != '-' && op != '=') {
- errno = EINVAL;
- goto out;
+ free(saveset);
+ return (NULL);
}
if (op == '=')
equalopdone = 0;
@@ -334,44 +330,10 @@ apply: if (!*p)
dumpmode(saveset);
#endif
return (saveset);
-out:
- serrno = errno;
- free(saveset);
- errno = serrno;
- return NULL;
-}
-
-static mode_t
-getumask(void)
-{
- sigset_t sigset, sigoset;
- size_t len;
- mode_t mask;
- u_short smask;
-
- /*
- * First try requesting the umask without temporarily modifying it.
- * Note that this does not work if the sysctl
- * security.bsd.unprivileged_proc_debug is set to 0.
- */
- len = sizeof(smask);
- if (sysctl((int[4]){ CTL_KERN, KERN_PROC, KERN_PROC_UMASK, getpid() },
- 4, &smask, &len, NULL, 0) == 0)
- return (smask);
-
- /*
- * 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));
- (void)_sigprocmask(SIG_SETMASK, &sigoset, NULL);
- return (mask);
}
static BITCMD *
-addcmd(BITCMD *set, mode_t op, mode_t who, mode_t oparg, mode_t mask)
+addcmd(BITCMD *set, int op, int who, int oparg, u_int mask)
{
switch (op) {
case '=':
diff --git a/lib/libc/gen/setproctitle.c b/lib/libc/gen/setproctitle.c
index 9dff328..cd705fb 100644
--- a/lib/libc/gen/setproctitle.c
+++ b/lib/libc/gen/setproctitle.c
@@ -42,10 +42,9 @@ __FBSDID("$FreeBSD$");
* 1: old_ps_strings at the very top of the stack.
* 2: old_ps_strings at SPARE_USRSPACE below the top of the stack.
* 3: ps_strings at the very top of the stack.
- * We only support a kernel providing #3 style ps_strings.
- *
- * For historical purposes, a definition of the old ps_strings structure
- * and location is preserved below:
+ * This attempts to support a kernel built in the #2 and #3 era.
+ */
+
struct old_ps_strings {
char *old_ps_argvstr;
int old_ps_nargvstr;
@@ -54,7 +53,6 @@ struct old_ps_strings {
};
#define OLD_PS_STRINGS ((struct old_ps_strings *) \
(USRSTACK - SPARE_USRSPACE - sizeof(struct old_ps_strings)))
- */
#include <stdarg.h>
@@ -138,38 +136,41 @@ setproctitle(const char *fmt, ...)
ps_strings = (struct ps_strings *)ul_ps_strings;
}
- /*
- * PS_STRINGS points to zeroed memory on a style #2 kernel.
- * Should not happen.
- */
- if (ps_strings->ps_argvstr == NULL)
- return;
-
- /* style #3 */
- if (oargc == -1) {
- /* Record our original args */
- oargc = ps_strings->ps_nargvstr;
- oargv = ps_strings->ps_argvstr;
- for (i = len = 0; i < oargc; i++) {
- /*
- * The program may have scribbled into its
- * argv array, e.g., to remove some arguments.
- * If that has happened, break out before
- * trying to call strlen on a NULL pointer.
- */
- if (oargv[i] == NULL) {
- oargc = i;
- break;
+ /* PS_STRINGS points to zeroed memory on a style #2 kernel */
+ if (ps_strings->ps_argvstr) {
+ /* style #3 */
+ if (oargc == -1) {
+ /* Record our original args */
+ oargc = ps_strings->ps_nargvstr;
+ oargv = ps_strings->ps_argvstr;
+ for (i = len = 0; i < oargc; i++) {
+ /*
+ * The program may have scribbled into its
+ * argv array, e.g., to remove some arguments.
+ * If that has happened, break out before
+ * trying to call strlen on a NULL pointer.
+ */
+ if (oargv[i] == NULL) {
+ oargc = i;
+ break;
+ }
+ snprintf(obuf + len, SPT_BUFSIZE - len, "%s%s",
+ len ? " " : "", oargv[i]);
+ if (len)
+ len++;
+ len += strlen(oargv[i]);
+ if (len >= SPT_BUFSIZE)
+ break;
}
- snprintf(obuf + len, SPT_BUFSIZE - len, "%s%s",
- len != 0 ? " " : "", oargv[i]);
- if (len != 0)
- len++;
- len += strlen(oargv[i]);
- if (len >= SPT_BUFSIZE)
- break;
}
+ ps_strings->ps_nargvstr = nargc;
+ ps_strings->ps_argvstr = nargvp;
+ } else {
+ /* style #2 - we can only restore our first arg :-( */
+ if (*obuf == '\0')
+ strncpy(obuf, OLD_PS_STRINGS->old_ps_argvstr,
+ SPT_BUFSIZE - 1);
+ OLD_PS_STRINGS->old_ps_nargvstr = 1;
+ OLD_PS_STRINGS->old_ps_argvstr = nargvp[0];
}
- ps_strings->ps_nargvstr = nargc;
- ps_strings->ps_argvstr = nargvp;
}
diff --git a/lib/libc/gen/sleep.3 b/lib/libc/gen/sleep.3
index 00e8f8d..ecfa237 100644
--- a/lib/libc/gen/sleep.3
+++ b/lib/libc/gen/sleep.3
@@ -33,7 +33,7 @@
.Os
.Sh NAME
.Nm sleep
-.Nd suspend thread execution for an interval measured in seconds
+.Nd suspend process execution for an interval measured in seconds
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
@@ -43,11 +43,11 @@
.Sh DESCRIPTION
The
.Fn sleep
-function suspends execution of the calling thread until either
+function suspends execution of the calling process until either
.Fa seconds
-seconds have elapsed or a signal is delivered to the thread and its
+seconds have elapsed or a signal is delivered to the process and its
action is to invoke a signal-catching function or to terminate the
-thread or process.
+process.
System activity may lengthen the sleep by an indeterminate amount.
.Pp
This function is implemented using
diff --git a/lib/libc/gen/sleep.c b/lib/libc/gen/sleep.c
index 6bb4ecd..b807c2d 100644
--- a/lib/libc/gen/sleep.c
+++ b/lib/libc/gen/sleep.c
@@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "un-namespace.h"
-#include "libc_private.h"
-
unsigned int
__sleep(unsigned int seconds)
{
@@ -57,14 +55,12 @@ __sleep(unsigned int seconds)
time_to_sleep.tv_sec = seconds;
time_to_sleep.tv_nsec = 0;
- if (((int (*)(const struct timespec *, struct timespec *))
- __libc_interposing[INTERPOS_nanosleep])(
- &time_to_sleep, &time_remaining) != -1)
+ 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 */
+ (time_remaining.tv_nsec != 0)); /* round up */
}
__weak_reference(__sleep, sleep);
diff --git a/lib/libc/gen/stringlist.c b/lib/libc/gen/stringlist.c
index 236af17..a09a8e7 100644
--- a/lib/libc/gen/stringlist.c
+++ b/lib/libc/gen/stringlist.c
@@ -10,6 +10,8 @@
* 2. Redistributions in binary form must reproduce 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
diff --git a/lib/libc/sys/swapcontext.c b/lib/libc/gen/swapcontext.c
index 0a8125e..c34cb23 100644
--- a/lib/libc/sys/swapcontext.c
+++ b/lib/libc/gen/swapcontext.c
@@ -1,11 +1,7 @@
/*
* Copyright (c) 2001 Daniel M. Eischen <deischen@freebsd.org>
- * Copyright (c) 2014 The FreeBSD Foundation.
* All rights reserved.
*
- * Portions of this software were developed by Konstantin Belousov
- * 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:
@@ -34,20 +30,26 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/signal.h>
#include <sys/ucontext.h>
+
#include <errno.h>
#include <stddef.h>
-#include "libc_private.h"
-__weak_reference(__sys_swapcontext, __swapcontext);
-__sym_compat(swapcontext, __impl_swapcontext, FBSD_1.0);
-__weak_reference(swapcontext, __impl_swapcontext);
-__sym_default(swapcontext, swapcontext, FBSD_1.2);
+__weak_reference(__swapcontext, swapcontext);
-#pragma weak swapcontext
int
-swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
+__swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
{
+ int ret;
- return (((int (*)(ucontext_t *, const ucontext_t *))
- __libc_interposing[INTERPOS_swapcontext])(oucp, ucp));
+ if ((oucp == NULL) || (ucp == NULL)) {
+ errno = EINVAL;
+ return (-1);
+ }
+ oucp->uc_flags &= ~UCF_SWAPPED;
+ ret = getcontext(oucp);
+ if ((ret == 0) && !(oucp->uc_flags & UCF_SWAPPED)) {
+ oucp->uc_flags |= UCF_SWAPPED;
+ ret = setcontext(ucp);
+ }
+ return (ret);
}
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c
index 003f24d..3a5cafe 100644
--- a/lib/libc/gen/syslog.c
+++ b/lib/libc/gen/syslog.c
@@ -261,45 +261,26 @@ vsyslog(int pri, const char *fmt, va_list ap)
connectlog();
/*
- * If the send() fails, there are two likely scenarios:
+ * If the send() failed, there are two likely scenarios:
* 1) syslogd was restarted
* 2) /var/run/log is out of socket buffer space, which
* in most cases means local DoS.
- * If the error does not indicate a full buffer, we address
- * case #1 by attempting to reconnect to /var/run/log[priv]
- * and resending the message once.
+ * We attempt to reconnect to /var/run/log[priv] to take care of
+ * case #1 and keep send()ing data to cover case #2
+ * to give syslogd a chance to empty its socket buffer.
*
- * If we are working with a privileged socket, the retry
- * attempts end there, because we don't want to freeze a
+ * If we are working with a priveleged socket, then take
+ * only one attempt, because we don't want to freeze a
* critical application like su(1) or sshd(8).
*
- * Otherwise, we address case #2 by repeatedly retrying the
- * send() to give syslogd a chance to empty its socket buffer.
*/
if (send(LogFile, tbuf, cnt, 0) < 0) {
if (errno != ENOBUFS) {
- /*
- * Scenario 1: syslogd was restarted
- * reconnect and resend once
- */
disconnectlog();
connectlog();
- if (send(LogFile, tbuf, cnt, 0) >= 0) {
- THREAD_UNLOCK();
- return;
- }
- /*
- * if the resend failed, fall through to
- * possible scenario 2
- */
}
- while (errno == ENOBUFS) {
- /*
- * Scenario 2: out of socket buffer space
- * possible DoS, fail fast on a privileged
- * socket
- */
+ do {
if (status == CONNPRIV)
break;
_usleep(1);
@@ -307,7 +288,7 @@ vsyslog(int pri, const char *fmt, va_list ap)
THREAD_UNLOCK();
return;
}
- }
+ } while (errno == ENOBUFS);
} else {
THREAD_UNLOCK();
return;
@@ -369,7 +350,7 @@ connectlog(void)
SyslogAddr.sun_family = AF_UNIX;
/*
- * First try privileged socket. If no success,
+ * First try priveleged socket. If no success,
* then try default socket.
*/
(void)strncpy(SyslogAddr.sun_path, _PATH_LOG_PRIV,
diff --git a/lib/libc/gen/telldir.c b/lib/libc/gen/telldir.c
index 19cd6ee..d72b500 100644
--- a/lib/libc/gen/telldir.c
+++ b/lib/libc/gen/telldir.c
@@ -101,22 +101,9 @@ _seekdir(dirp, loc)
return;
if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek)
return;
-
- /* If it's within the same chunk of data, don't bother reloading. */
- if (lp->loc_seek == dirp->dd_seek) {
- /*
- * 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);
dirp->dd_seek = lp->loc_seek;
dirp->dd_loc = 0;
- dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */
while (dirp->dd_loc < lp->loc_loc) {
dp = _readdir_unlocked(dirp, 0);
if (dp == NULL)
@@ -125,30 +112,6 @@ _seekdir(dirp, loc)
}
/*
- * 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) {
- lp->loc_seek = dirp->dd_seek;
- lp->loc_loc = dirp->dd_loc;
- }
- }
-}
-
-/*
* Reclaim memory for telldir cookies which weren't used.
*/
void
diff --git a/lib/libc/gen/telldir.h b/lib/libc/gen/telldir.h
index bccabb1..04989bb 100644
--- a/lib/libc/gen/telldir.h
+++ b/lib/libc/gen/telldir.h
@@ -64,6 +64,5 @@ bool _filldir(DIR *, bool);
struct dirent *_readdir_unlocked(DIR *, int);
void _reclaim_telldir(DIR *);
void _seekdir(DIR *, long);
-void _fixtelldir(DIR *dirp, long oldseek, long oldloc);
#endif
diff --git a/lib/libc/gen/termios.c b/lib/libc/gen/termios.c
index f8b7354..7e9f169 100644
--- a/lib/libc/gen/termios.c
+++ b/lib/libc/gen/termios.c
@@ -46,8 +46,6 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "un-namespace.h"
-#include "libc_private.h"
-
int
tcgetattr(int fd, struct termios *t)
{
@@ -210,23 +208,13 @@ tcsendbreak(int fd, int len __unused)
}
int
-__libc_tcdrain(int fd)
+__tcdrain(int fd)
{
-
return (_ioctl(fd, TIOCDRAIN, 0));
}
-#pragma weak tcdrain
-int
-tcdrain(int fd)
-{
-
- return (((int (*)(int))
- __libc_interposing[INTERPOS_tcdrain])(fd));
-}
-
-__weak_reference(__libc_tcdrain, __tcdrain);
-__weak_reference(__libc_tcdrain, _tcdrain);
+__weak_reference(__tcdrain, tcdrain);
+__weak_reference(__tcdrain, _tcdrain);
int
tcflush(int fd, int which)
diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c
index 58ebb55..5219418 100644
--- a/lib/libc/gen/tls.c
+++ b/lib/libc/gen/tls.c
@@ -65,14 +65,13 @@ void __libc_free_tls(void *tls, size_t tcbsize, size_t tcbalign);
#if defined(__amd64__)
#define TLS_TCB_ALIGN 16
#elif defined(__powerpc__) || defined(__i386__) || defined(__arm__) || \
- defined(__sparc64__) || defined(__mips__) || defined(__aarch64__)
+ defined(__sparc64__) || defined(__mips__)
#define TLS_TCB_ALIGN sizeof(void *)
#else
#error TLS_TCB_ALIGN undefined for target architecture
#endif
-#if defined(__arm__) || defined(__mips__) || defined(__powerpc__) || \
- defined(__aarch64__)
+#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
#define TLS_VARIANT_I
#endif
#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__)
diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c
index 02aa158..a21b77f 100644
--- a/lib/libc/gen/ttyname.c
+++ b/lib/libc/gen/ttyname.c
@@ -65,7 +65,7 @@ ttyname_r(int fd, char *buf, size_t len)
/* Must be a terminal. */
if (!isatty(fd))
- return (errno);
+ return (ENOTTY);
/* Must have enough room */
if (len <= sizeof(_PATH_DEV))
return (ERANGE);
@@ -73,7 +73,7 @@ ttyname_r(int fd, char *buf, size_t len)
strcpy(buf, _PATH_DEV);
used = strlen(buf);
if (fdevname_r(fd, buf + used, len - used) == NULL)
- return (errno == EINVAL ? ERANGE : errno);
+ return (ENOTTY);
return (0);
}
diff --git a/lib/libc/gen/ulimit.c b/lib/libc/gen/ulimit.c
index 2c090c0..e1bc020 100644
--- a/lib/libc/gen/ulimit.c
+++ b/lib/libc/gen/ulimit.c
@@ -40,7 +40,7 @@ ulimit(int cmd, ...)
{
struct rlimit limit;
va_list ap;
- rlim_t arg;
+ long arg;
if (cmd == UL_GETFSIZE) {
if (getrlimit(RLIMIT_FSIZE, &limit) == -1)
@@ -53,16 +53,14 @@ ulimit(int cmd, ...)
va_start(ap, cmd);
arg = va_arg(ap, long);
va_end(ap);
- if (arg < 0)
- arg = LONG_MAX;
- if (arg > RLIM_INFINITY / 512)
- arg = RLIM_INFINITY / 512;
- limit.rlim_max = limit.rlim_cur = arg * 512;
+ 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);
- return ((long)arg);
+ if (arg * 512 > LONG_MAX)
+ return (LONG_MAX);
+ return (arg);
} else {
errno = EINVAL;
return (-1);
diff --git a/lib/libc/gen/usleep.c b/lib/libc/gen/usleep.c
index 7c35f6c..7d6559b 100644
--- a/lib/libc/gen/usleep.c
+++ b/lib/libc/gen/usleep.c
@@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "un-namespace.h"
-#include "libc_private.h"
-
int
__usleep(useconds_t useconds)
{
@@ -47,8 +45,7 @@ __usleep(useconds_t useconds)
time_to_sleep.tv_nsec = (useconds % 1000000) * 1000;
time_to_sleep.tv_sec = useconds / 1000000;
- return (((int (*)(const struct timespec *, struct timespec *))
- __libc_interposing[INTERPOS_nanosleep])(&time_to_sleep, NULL));
+ return (_nanosleep(&time_to_sleep, NULL));
}
__weak_reference(__usleep, usleep);
diff --git a/lib/libc/gen/wait.c b/lib/libc/gen/wait.c
index 46a3fdd..2169b9d 100644
--- a/lib/libc/gen/wait.c
+++ b/lib/libc/gen/wait.c
@@ -40,14 +40,10 @@ __FBSDID("$FreeBSD$");
#include <sys/resource.h>
#include "un-namespace.h"
-#include "libc_private.h"
-
pid_t
__wait(int *istat)
{
-
- return (((pid_t (*)(pid_t, int *, int, struct rusage *))
- __libc_interposing[INTERPOS_wait4])(WAIT_ANY, istat, 0, NULL));
+ return (_wait4(WAIT_ANY, istat, 0, (struct rusage *)0));
}
__weak_reference(__wait, wait);
diff --git a/lib/libc/gen/wait3.c b/lib/libc/gen/wait3.c
index 965effe..6098773 100644
--- a/lib/libc/gen/wait3.c
+++ b/lib/libc/gen/wait3.c
@@ -40,14 +40,11 @@ __FBSDID("$FreeBSD$");
#include <sys/resource.h>
#include "un-namespace.h"
-#include "libc_private.h"
-
pid_t
-__wait3(int *istat, int options, struct rusage *rup)
+wait3(istat, options, rup)
+ int *istat;
+ int options;
+ struct rusage *rup;
{
-
- return (((pid_t (*)(pid_t, int *, int, struct rusage *))
- __libc_interposing[INTERPOS_wait4])(WAIT_ANY, istat, options, rup));
+ return (_wait4(WAIT_ANY, istat, options, rup));
}
-
-__weak_reference(__wait3, wait3);
diff --git a/lib/libc/gen/waitid.c b/lib/libc/gen/waitid.c
index 17a2dd6..795b208 100644
--- a/lib/libc/gen/waitid.c
+++ b/lib/libc/gen/waitid.c
@@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$");
#include <signal.h>
#include <errno.h>
#include "un-namespace.h"
-#include "libc_private.h"
int
__waitid(idtype_t idtype, id_t id, siginfo_t *info, int flags)
@@ -45,9 +44,7 @@ __waitid(idtype_t idtype, id_t id, siginfo_t *info, int flags)
int status;
pid_t ret;
- ret = ((pid_t (*)(idtype_t, id_t, int *, int, struct __wrusage *,
- siginfo_t *))__libc_interposing[INTERPOS_wait6])(idtype, id,
- &status, flags, NULL, info);
+ ret = _wait6(idtype, id, &status, flags, NULL, info);
/*
* According to SUSv4, waitid() shall not return a PID when a
diff --git a/lib/libc/gen/waitpid.c b/lib/libc/gen/waitpid.c
index 5177591..b001837 100644
--- a/lib/libc/gen/waitpid.c
+++ b/lib/libc/gen/waitpid.c
@@ -40,14 +40,10 @@ __FBSDID("$FreeBSD$");
#include <sys/resource.h>
#include "un-namespace.h"
-#include "libc_private.h"
-
pid_t
__waitpid(pid_t pid, int *istat, int options)
{
-
- return (((pid_t (*)(pid_t, int *, int, struct rusage *))
- __libc_interposing[INTERPOS_wait4])(pid, istat, options, NULL));
+ return (_wait4(pid, istat, options, (struct rusage *)0));
}
__weak_reference(__waitpid, waitpid);
diff --git a/lib/libc/gen/wordexp.c b/lib/libc/gen/wordexp.c
index c7f4b1d..377caff 100644
--- a/lib/libc/gen/wordexp.c
+++ b/lib/libc/gen/wordexp.c
@@ -118,10 +118,8 @@ we_askshell(const char *words, wordexp_t *we, int flags)
char *nstrings; /* Temporary for realloc() */
char **nwv; /* Temporary for realloc() */
sigset_t newsigblock, oldsigblock;
- const char *ifs;
serrno = errno;
- ifs = getenv("IFS");
if (pipe2(pdes, O_CLOEXEC) < 0)
return (WRDE_NOSPACE); /* XXX */
@@ -147,8 +145,7 @@ we_askshell(const char *words, wordexp_t *we, int flags)
_fcntl(pdes[1], F_SETFD, 0)) < 0)
_exit(1);
execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u",
- "-c", "IFS=$1;eval \"$2\";eval \"wordexp $3\"", "",
- ifs != NULL ? ifs : " \t\n",
+ "-c", "eval \"$1\";eval \"wordexp $2\"", "",
flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null", words,
(char *)NULL);
_exit(1);
diff --git a/lib/libc/i386/sys/Makefile.inc b/lib/libc/i386/sys/Makefile.inc
index ebaa462..b56183c 100644
--- a/lib/libc/i386/sys/Makefile.inc
+++ b/lib/libc/i386/sys/Makefile.inc
@@ -15,6 +15,9 @@ MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
PSEUDO= _getlogin.o _exit.o
+.if ${MK_SYSCALL_COMPAT} != "no"
+PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
+.endif
MAN+= i386_get_ioperm.2 i386_get_ldt.2 i386_vm86.2
MAN+= i386_set_watch.3
diff --git a/lib/libc/iconv/__iconv.c b/lib/libc/iconv/__iconv.c
index 85170b7..c9bee3f 100644
--- a/lib/libc/iconv/__iconv.c
+++ b/lib/libc/iconv/__iconv.c
@@ -31,7 +31,7 @@
#include "iconv-internal.h"
size_t
-__iconv(iconv_t a, char **b, size_t *c, char **d,
+__iconv(iconv_t a, const char **b, size_t *c, char **d,
size_t *e, __uint32_t f, size_t *g)
{
return __bsd___iconv(a, b, c, d, e, f, g);
diff --git a/lib/libc/iconv/bsd_iconv.c b/lib/libc/iconv/bsd_iconv.c
index e032a5b..f764886 100644
--- a/lib/libc/iconv/bsd_iconv.c
+++ b/lib/libc/iconv/bsd_iconv.c
@@ -120,7 +120,7 @@ __bsd_iconv_close(iconv_t handle)
}
size_t
-__bsd_iconv(iconv_t handle, char **in, size_t *szin, char **out, size_t *szout)
+__bsd_iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout)
{
size_t ret;
int err;
@@ -141,7 +141,7 @@ __bsd_iconv(iconv_t handle, char **in, size_t *szin, char **out, size_t *szout)
}
size_t
-__bsd___iconv(iconv_t handle, char **in, size_t *szin, char **out,
+__bsd___iconv(iconv_t handle, const char **in, size_t *szin, char **out,
size_t *szout, uint32_t flags, size_t *invalids)
{
size_t ret;
diff --git a/lib/libc/iconv/citrus_iconv.c b/lib/libc/iconv/citrus_iconv.c
index 5994063..5c8bf49 100644
--- a/lib/libc/iconv/citrus_iconv.c
+++ b/lib/libc/iconv/citrus_iconv.c
@@ -278,9 +278,7 @@ _citrus_iconv_open(struct _citrus_iconv * __restrict * __restrict rcv,
struct _citrus_iconv *cv = NULL;
struct _citrus_iconv_shared *ci = NULL;
char realdst[PATH_MAX], realsrc[PATH_MAX];
-#ifdef _PATH_ICONV
char buf[PATH_MAX], path[PATH_MAX];
-#endif
int ret;
init_cache();
@@ -292,16 +290,10 @@ _citrus_iconv_open(struct _citrus_iconv * __restrict * __restrict rcv,
dst = nl_langinfo(CODESET);
/* resolve codeset name aliases */
-#ifdef _PATH_ICONV
- snprintf(path, sizeof(path), "%s/%s", _PATH_ICONV, _CITRUS_ICONV_ALIAS);
strlcpy(realsrc, _lookup_alias(path, src, buf, (size_t)PATH_MAX,
_LOOKUP_CASE_IGNORE), (size_t)PATH_MAX);
strlcpy(realdst, _lookup_alias(path, dst, buf, (size_t)PATH_MAX,
_LOOKUP_CASE_IGNORE), (size_t)PATH_MAX);
-#else
- strlcpy(realsrc, src, (size_t)PATH_MAX);
- strlcpy(realdst, dst, (size_t)PATH_MAX);
-#endif
/* sanity check */
if (strchr(realsrc, '/') != NULL || strchr(realdst, '/'))
diff --git a/lib/libc/iconv/citrus_iconv.h b/lib/libc/iconv/citrus_iconv.h
index 99604e9..ac14ac3 100644
--- a/lib/libc/iconv/citrus_iconv.h
+++ b/lib/libc/iconv/citrus_iconv.h
@@ -52,7 +52,7 @@ __END_DECLS
*/
static __inline int
_citrus_iconv_convert(struct _citrus_iconv * __restrict cv,
- char * __restrict * __restrict in, size_t * __restrict inbytes,
+ const char * __restrict * __restrict in, size_t * __restrict inbytes,
char * __restrict * __restrict out, size_t * __restrict outbytes,
uint32_t flags, size_t * __restrict nresults)
{
diff --git a/lib/libc/iconv/citrus_iconv_local.h b/lib/libc/iconv/citrus_iconv_local.h
index 5392da1..12d2fa3 100644
--- a/lib/libc/iconv/citrus_iconv_local.h
+++ b/lib/libc/iconv/citrus_iconv_local.h
@@ -46,7 +46,7 @@ static void _citrus_##_m_##_iconv_uninit_shared \
(struct _citrus_iconv_shared *); \
static int _citrus_##_m_##_iconv_convert \
(struct _citrus_iconv * __restrict, \
- char * __restrict * __restrict, \
+ const char * __restrict * __restrict, \
size_t * __restrict, \
char * __restrict * __restrict, \
size_t * __restrict outbytes, \
@@ -75,7 +75,7 @@ typedef void (*_citrus_iconv_uninit_shared_t)
(struct _citrus_iconv_shared *);
typedef int (*_citrus_iconv_convert_t)
(struct _citrus_iconv * __restrict,
- char *__restrict* __restrict, size_t * __restrict,
+ const char *__restrict* __restrict, size_t * __restrict,
char * __restrict * __restrict, size_t * __restrict, uint32_t,
size_t * __restrict);
typedef int (*_citrus_iconv_init_context_t)(struct _citrus_iconv *);
diff --git a/lib/libc/iconv/citrus_none.c b/lib/libc/iconv/citrus_none.c
index 9ec4bd3..4f9b254 100644
--- a/lib/libc/iconv/citrus_none.c
+++ b/lib/libc/iconv/citrus_none.c
@@ -83,7 +83,7 @@ _citrus_NONE_stdenc_init_state(struct _citrus_stdenc * __restrict ce __unused,
static int
_citrus_NONE_stdenc_mbtocs(struct _citrus_stdenc * __restrict ce __unused,
- _csid_t *csid, _index_t *idx, char **s, size_t n,
+ _csid_t *csid, _index_t *idx, const char **s, size_t n,
void *ps __unused, size_t *nresult, struct iconv_hooks *hooks)
{
@@ -159,7 +159,7 @@ _citrus_NONE_stdenc_cstomb(struct _citrus_stdenc * __restrict ce __unused,
static int
_citrus_NONE_stdenc_mbtowc(struct _citrus_stdenc * __restrict ce __unused,
- _wc_t * __restrict pwc, char ** __restrict s, size_t n,
+ _wc_t * __restrict pwc, const char ** __restrict s, size_t n,
void * __restrict pspriv __unused, size_t * __restrict nresult,
struct iconv_hooks *hooks)
{
diff --git a/lib/libc/iconv/citrus_prop.c b/lib/libc/iconv/citrus_prop.c
index 642e423..28318de 100644
--- a/lib/libc/iconv/citrus_prop.c
+++ b/lib/libc/iconv/citrus_prop.c
@@ -293,10 +293,8 @@ done:
}
_memstream_ungetc(ms, ch);
errnum = _citrus_prop_read_character_common(ms, &ch);
- if (errnum != 0) {
- free(s);
+ if (errnum != 0)
return (errnum);
- }
s[n] = ch;
++n, --m;
}
diff --git a/lib/libc/iconv/citrus_stdenc.h b/lib/libc/iconv/citrus_stdenc.h
index 50f4dff..28fa29d 100644
--- a/lib/libc/iconv/citrus_stdenc.h
+++ b/lib/libc/iconv/citrus_stdenc.h
@@ -69,7 +69,7 @@ _citrus_stdenc_init_state(struct _citrus_stdenc * __restrict ce,
static __inline int
_citrus_stdenc_mbtocs(struct _citrus_stdenc * __restrict ce,
_citrus_csid_t * __restrict csid, _citrus_index_t * __restrict idx,
- char ** __restrict s, size_t n, void * __restrict ps,
+ const char ** __restrict s, size_t n, void * __restrict ps,
size_t * __restrict nresult, struct iconv_hooks *hooks)
{
diff --git a/lib/libc/iconv/citrus_stdenc_local.h b/lib/libc/iconv/citrus_stdenc_local.h
index 141abff..7b627a0 100644
--- a/lib/libc/iconv/citrus_stdenc_local.h
+++ b/lib/libc/iconv/citrus_stdenc_local.h
@@ -55,7 +55,7 @@ static int _citrus_##_e_##_stdenc_mbtocs \
(struct _citrus_stdenc * __restrict, \
_citrus_csid_t * __restrict, \
_citrus_index_t * __restrict, \
- char ** __restrict, size_t, \
+ const char ** __restrict, size_t, \
void * __restrict, size_t * __restrict, \
struct iconv_hooks *); \
static int _citrus_##_e_##_stdenc_cstomb \
@@ -66,7 +66,7 @@ static int _citrus_##_e_##_stdenc_cstomb \
static int _citrus_##_e_##_stdenc_mbtowc \
(struct _citrus_stdenc * __restrict, \
_citrus_wc_t * __restrict, \
- char ** __restrict, size_t, \
+ const char ** __restrict, size_t, \
void * __restrict, size_t * __restrict, \
struct iconv_hooks *); \
static int _citrus_##_e_##_stdenc_wctomb \
@@ -106,7 +106,7 @@ typedef int (*_citrus_stdenc_init_state_t)
typedef int (*_citrus_stdenc_mbtocs_t)
(struct _citrus_stdenc * __restrict,
_citrus_csid_t * __restrict, _citrus_index_t * __restrict,
- char ** __restrict, size_t,
+ const char ** __restrict, size_t,
void * __restrict, size_t * __restrict,
struct iconv_hooks *);
typedef int (*_citrus_stdenc_cstomb_t)
@@ -116,7 +116,7 @@ typedef int (*_citrus_stdenc_cstomb_t)
typedef int (*_citrus_stdenc_mbtowc_t)
(struct _citrus_stdenc * __restrict,
_citrus_wc_t * __restrict,
- char ** __restrict, size_t,
+ const char ** __restrict, size_t,
void * __restrict, size_t * __restrict,
struct iconv_hooks *);
typedef int (*_citrus_stdenc_wctomb_t)
diff --git a/lib/libc/iconv/citrus_stdenc_template.h b/lib/libc/iconv/citrus_stdenc_template.h
index 9a05fa7..21bc5cc 100644
--- a/lib/libc/iconv/citrus_stdenc_template.h
+++ b/lib/libc/iconv/citrus_stdenc_template.h
@@ -112,7 +112,7 @@ _FUNCNAME(stdenc_init_state)(struct _citrus_stdenc * __restrict ce,
static int
_FUNCNAME(stdenc_mbtocs)(struct _citrus_stdenc * __restrict ce,
_citrus_csid_t * __restrict csid, _citrus_index_t * __restrict idx,
- char ** __restrict s, size_t n, void * __restrict ps,
+ const char ** __restrict s, size_t n, void * __restrict ps,
size_t * __restrict nresult, struct iconv_hooks *hooks)
{
wchar_t wc;
@@ -151,7 +151,7 @@ _FUNCNAME(stdenc_cstomb)(struct _citrus_stdenc * __restrict ce,
static int
_FUNCNAME(stdenc_mbtowc)(struct _citrus_stdenc * __restrict ce,
- _citrus_wc_t * __restrict wc, char ** __restrict s, size_t n,
+ _citrus_wc_t * __restrict wc, const char ** __restrict s, size_t n,
void * __restrict ps, size_t * __restrict nresult,
struct iconv_hooks *hooks)
{
diff --git a/lib/libc/iconv/iconv-internal.h b/lib/libc/iconv/iconv-internal.h
index 9937f09..9a6b3d9 100644
--- a/lib/libc/iconv/iconv-internal.h
+++ b/lib/libc/iconv/iconv-internal.h
@@ -29,11 +29,11 @@
/*
* Interal prototypes for our back-end functions.
*/
-size_t __bsd___iconv(iconv_t, char **, size_t *, char **,
+size_t __bsd___iconv(iconv_t, const char **, size_t *, char **,
size_t *, __uint32_t, size_t *);
void __bsd___iconv_free_list(char **, size_t);
int __bsd___iconv_get_list(char ***, size_t *, __iconv_bool);
-size_t __bsd_iconv(iconv_t, char ** __restrict,
+size_t __bsd_iconv(iconv_t, const char ** __restrict,
size_t * __restrict, char ** __restrict,
size_t * __restrict);
const char *__bsd_iconv_canonicalize(const char *);
diff --git a/lib/libc/iconv/iconv.3 b/lib/libc/iconv/iconv.3
index 1a4f8c3..6692c47 100644
--- a/lib/libc/iconv/iconv.3
+++ b/lib/libc/iconv/iconv.3
@@ -48,7 +48,7 @@
.Ft size_t
.Fn iconv "iconv_t cd" "char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft"
.Ft size_t
-.Fn __iconv "iconv_t cd" "char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" "uint32_t flags" "size_t * invalids"
+.Fn __iconv "iconv_t cd" "const char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" "uint32_t flags" "size_t invalids"
.Sh DESCRIPTION
The
.Fn iconv_open
@@ -176,8 +176,8 @@ may be
.Dv NULL .
In this case, the shift sequence for the destination switching
to the initial state is discarded.
-.El
.Pp
+.El
The
.Fn __iconv
function works just like
diff --git a/lib/libc/iconv/iconv.c b/lib/libc/iconv/iconv.c
index 4bd9620..d13c1df 100644
--- a/lib/libc/iconv/iconv.c
+++ b/lib/libc/iconv/iconv.c
@@ -31,7 +31,7 @@
#include "iconv-internal.h"
size_t
-iconv(iconv_t a, char ** __restrict b,
+iconv(iconv_t a, const char ** __restrict b,
size_t * __restrict c, char ** __restrict d,
size_t * __restrict e)
{
diff --git a/lib/libc/iconv/iconv_compat.c b/lib/libc/iconv/iconv_compat.c
index ded2499..dea968f 100644
--- a/lib/libc/iconv/iconv_compat.c
+++ b/lib/libc/iconv/iconv_compat.c
@@ -37,7 +37,7 @@
#include "iconv-internal.h"
size_t
-__iconv_compat(iconv_t a, char ** b, size_t * c, char ** d,
+__iconv_compat(iconv_t a, const char ** b, size_t * c, char ** d,
size_t * e, __uint32_t f, size_t *g)
{
return __bsd___iconv(a, b, c, d, e, f, g);
@@ -56,7 +56,7 @@ __iconv_get_list_compat(char ***a, size_t *b, __iconv_bool c)
}
size_t
-iconv_compat(iconv_t a, char ** __restrict b,
+iconv_compat(iconv_t a, const char ** __restrict b,
size_t * __restrict c, char ** __restrict d,
size_t * __restrict e)
{
diff --git a/lib/libc/iconv/iconvlist.3 b/lib/libc/iconv/iconvlist.3
index b1a6e05..bef609b 100644
--- a/lib/libc/iconv/iconvlist.3
+++ b/lib/libc/iconv/iconvlist.3
@@ -78,9 +78,9 @@ If an error occurs,
will be NULL when calling
.Fn do_one .
.Sh SEE ALSO
-.Xr __iconv_free_list 3 ,
+.Xr iconv 3 ,
.Xr __iconv_get_list 3 ,
-.Xr iconv 3
+.Xr __iconv_free_list 3
.Sh STANDARDS
The
.Nm
diff --git a/lib/libc/include/compat.h b/lib/libc/include/compat.h
index b20fac5..7694540 100644
--- a/lib/libc/include/compat.h
+++ b/lib/libc/include/compat.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2009 Hudson River Trading LLC
+ * Copyright (c) 2009 Advanced Computing Technologies LLC
* Written by: John H. Baldwin <jhb@FreeBSD.org>
* All rights reserved.
*
@@ -44,12 +44,5 @@ __sym_compat(shmctl, freebsd7_shmctl, FBSD_1.0);
#undef __sym_compat
-#define __weak_reference(sym,alias) \
- .weak alias;.equ alias,sym
-
-__weak_reference(__sys_fcntl,__fcntl_compat)
-
-#undef __weak_reference
-
#endif /* __LIBC_COMPAT_H__ */
diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h
index a670d63..40a5f72 100644
--- a/lib/libc/include/libc_private.h
+++ b/lib/libc/include/libc_private.h
@@ -95,9 +95,6 @@ do { \
_SPINUNLOCK(&__stdio_thread_lock); \
} while (0)
-void __libc_spinlock_stub(struct _spinlock *);
-void __libc_spinunlock_stub(struct _spinlock *);
-
/*
* Indexes into the pthread jump table.
*
@@ -176,57 +173,6 @@ typedef pthread_func_t pthread_func_entry_t[2];
extern pthread_func_entry_t __thr_jtable[];
-void __set_error_selector(int *(*arg)(void));
-int _pthread_mutex_init_calloc_cb_stub(pthread_mutex_t *mutex,
- void *(calloc_cb)(__size_t, __size_t));
-
-typedef int (*interpos_func_t)(void);
-interpos_func_t *__libc_interposing_slot(int interposno);
-extern interpos_func_t __libc_interposing[] __hidden;
-
-enum {
- INTERPOS_accept,
- INTERPOS_accept4,
- INTERPOS_aio_suspend,
- INTERPOS_close,
- INTERPOS_connect,
- INTERPOS_fcntl,
- INTERPOS_fsync,
- INTERPOS_fork,
- INTERPOS_msync,
- INTERPOS_nanosleep,
- INTERPOS_openat,
- INTERPOS_poll,
- INTERPOS_pselect,
- INTERPOS_recvfrom,
- INTERPOS_recvmsg,
- INTERPOS_select,
- INTERPOS_sendmsg,
- INTERPOS_sendto,
- INTERPOS_setcontext,
- INTERPOS_sigaction,
- INTERPOS_sigprocmask,
- INTERPOS_sigsuspend,
- INTERPOS_sigwait,
- INTERPOS_sigtimedwait,
- INTERPOS_sigwaitinfo,
- INTERPOS_swapcontext,
- INTERPOS_system,
- INTERPOS_tcdrain,
- INTERPOS_read,
- INTERPOS_readv,
- INTERPOS_wait4,
- INTERPOS_write,
- INTERPOS_writev,
- INTERPOS__pthread_mutex_init_calloc_cb,
- INTERPOS_spinlock,
- INTERPOS_spinunlock,
- INTERPOS_kevent,
- INTERPOS_wait6,
- INTERPOS_ppoll,
- INTERPOS_MAX
-};
-
/*
* yplib internal interfaces
*/
@@ -269,8 +215,6 @@ void _malloc_thread_cleanup(void);
void _malloc_prefork(void);
void _malloc_postfork(void);
-void _malloc_first_thread(void);
-
/*
* Function to clean up streams, called from abort() and exit().
*/
@@ -278,96 +222,35 @@ extern void (*__cleanup)(void) __hidden;
/*
* Get kern.osreldate to detect ABI revisions. Explicitly
- * ignores value of $OSVERSION and caches result.
+ * ignores value of $OSVERSION and caches result. Prototypes
+ * for the wrapped "new" pad-less syscalls are here for now.
*/
-int __getosreldate(void);
+extern int __getosreldate(void);
#include <sys/_types.h>
-#include <sys/_sigset.h>
+/* Without pad */
+extern __off_t __sys_lseek(int, __off_t, int);
+extern int __sys_ftruncate(int, __off_t);
+extern int __sys_truncate(const char *, __off_t);
+extern __ssize_t __sys_pread(int, void *, __size_t, __off_t);
+extern __ssize_t __sys_pwrite(int, const void *, __size_t, __off_t);
+extern void * __sys_mmap(void *, __size_t, int, int, int, __off_t);
+
+/* With pad */
+extern __off_t __sys_freebsd6_lseek(int, int, __off_t, int);
+extern int __sys_freebsd6_ftruncate(int, int, __off_t);
+extern int __sys_freebsd6_truncate(const char *, int, __off_t);
+extern __ssize_t __sys_freebsd6_pread(int, void *, __size_t, int, __off_t);
+extern __ssize_t __sys_freebsd6_pwrite(int, const void *, __size_t, int, __off_t);
+extern void * __sys_freebsd6_mmap(void *, __size_t, int, int, int, int, __off_t);
+
+/* Without back-compat translation */
+extern int __sys_fcntl(int, int, ...);
-struct aiocb;
-struct fd_set;
-struct iovec;
-struct kevent;
-struct msghdr;
-struct pollfd;
-struct rusage;
-struct sigaction;
-struct sockaddr;
struct timespec;
struct timeval;
struct timezone;
-struct __siginfo;
-struct __ucontext;
-struct __wrusage;
-enum idtype;
-int __sys_aio_suspend(const struct aiocb * const[], int,
- const struct timespec *);
-int __sys_accept(int, struct sockaddr *, __socklen_t *);
-int __sys_accept4(int, struct sockaddr *, __socklen_t *, int);
-int __sys_clock_gettime(__clockid_t, struct timespec *ts);
-int __sys_close(int);
-int __sys_connect(int, const struct sockaddr *, __socklen_t);
-int __sys_fcntl(int, int, ...);
-int __sys_fsync(int);
-__pid_t __sys_fork(void);
-int __sys_ftruncate(int, __off_t);
-int __sys_gettimeofday(struct timeval *, struct timezone *);
-int __sys_kevent(int, const struct kevent *, int, struct kevent *,
- int, const struct timespec *);
-__off_t __sys_lseek(int, __off_t, int);
-void *__sys_mmap(void *, __size_t, int, int, int, __off_t);
-int __sys_msync(void *, __size_t, int);
-int __sys_nanosleep(const struct timespec *, struct timespec *);
-int __sys_open(const char *, int, ...);
-int __sys_openat(int, const char *, int, ...);
-int __sys_pselect(int, struct fd_set *, struct fd_set *,
- struct fd_set *, const struct timespec *,
- const __sigset_t *);
-int __sys_poll(struct pollfd *, unsigned, int);
-int __sys_ppoll(struct pollfd *, unsigned, const struct timespec *,
- const __sigset_t *);
-__ssize_t __sys_pread(int, void *, __size_t, __off_t);
-__ssize_t __sys_pwrite(int, const void *, __size_t, __off_t);
-__ssize_t __sys_read(int, void *, __size_t);
-__ssize_t __sys_readv(int, const struct iovec *, int);
-__ssize_t __sys_recv(int, void *, __size_t, int);
-__ssize_t __sys_recvfrom(int, void *, __size_t, int, struct sockaddr *,
- __socklen_t *);
-__ssize_t __sys_recvmsg(int, struct msghdr *, int);
-int __sys_select(int, struct fd_set *, struct fd_set *,
- struct fd_set *, struct timeval *);
-__ssize_t __sys_sendmsg(int, const struct msghdr *, int);
-__ssize_t __sys_sendto(int, const void *, __size_t, int,
- const struct sockaddr *, __socklen_t);
-int __sys_setcontext(const struct __ucontext *);
-int __sys_sigaction(int, const struct sigaction *,
- struct sigaction *);
-int __sys_sigprocmask(int, const __sigset_t *, __sigset_t *);
-int __sys_sigsuspend(const __sigset_t *);
-int __sys_sigtimedwait(const __sigset_t *, struct __siginfo *,
- const struct timespec *);
-int __sys_sigwait(const __sigset_t *, int *);
-int __sys_sigwaitinfo(const __sigset_t *, struct __siginfo *);
-int __sys_swapcontext(struct __ucontext *,
- const struct __ucontext *);
-int __sys_thr_kill(long, int);
-int __sys_thr_self(long *);
-int __sys_truncate(const char *, __off_t);
-__pid_t __sys_wait4(__pid_t, int *, int, struct rusage *);
-__pid_t __sys_wait6(enum idtype, __id_t, int *, int,
- struct __wrusage *, struct __siginfo *);
-__ssize_t __sys_write(int, const void *, __size_t);
-__ssize_t __sys_writev(int, const struct iovec *, int);
-
-int __libc_sigwait(const __sigset_t * __restrict,
- int * restrict sig);
-int __libc_system(const char *);
-int __libc_tcdrain(int);
-int __fcntl_compat(int fd, int cmd, ...);
-
-int __sys_futimens(int fd, const struct timespec *times) __hidden;
-int __sys_utimensat(int fd, const char *path,
- const struct timespec *times, int flag) __hidden;
+int __sys_gettimeofday(struct timeval *, struct timezone *);
+int __sys_clock_gettime(__clockid_t, struct timespec *ts);
/* execve() with PATH processing to implement posix_spawnp() */
int _execvpe(const char *, char * const *, char * const *);
diff --git a/lib/libc/locale/cXXrtomb_iconv.h b/lib/libc/locale/cXXrtomb_iconv.h
index d6e7ce0..0ea553b 100644
--- a/lib/libc/locale/cXXrtomb_iconv.h
+++ b/lib/libc/locale/cXXrtomb_iconv.h
@@ -57,7 +57,8 @@ cXXrtomb_l(char * __restrict s, charXX_t c, mbstate_t * __restrict ps,
{
_ConversionState *cs;
struct _citrus_iconv *handle;
- char *src, *dst;
+ const char *src;
+ char *dst;
size_t srcleft, dstleft, invlen;
int err;
diff --git a/lib/libc/locale/digittoint.3 b/lib/libc/locale/digittoint.3
index 6670abe..4a7f2e2 100644
--- a/lib/libc/locale/digittoint.3
+++ b/lib/libc/locale/digittoint.3
@@ -64,5 +64,5 @@ the function will return 0.
.Sh SEE ALSO
.Xr ctype 3 ,
.Xr isdigit 3 ,
-.Xr isxdigit 3 ,
+.Xr isxdigit 3,
.Xr xlocale 3
diff --git a/lib/libc/locale/duplocale.3 b/lib/libc/locale/duplocale.3
index bc0c4bc..f2e8215 100644
--- a/lib/libc/locale/duplocale.3
+++ b/lib/libc/locale/duplocale.3
@@ -36,7 +36,7 @@
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In locale.h
+.In xlocale.h
.Ft locale_t
.Fn duplocale "locale_t locale"
.Sh DESCRIPTION
diff --git a/lib/libc/locale/freelocale.3 b/lib/libc/locale/freelocale.3
index 0df80e7..86f4809 100644
--- a/lib/libc/locale/freelocale.3
+++ b/lib/libc/locale/freelocale.3
@@ -38,7 +38,7 @@ or
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In locale.h
+.In xlocale.h
.Ft int
.Fn freelocale "locale_t locale"
.Sh DESCRIPTION
diff --git a/lib/libc/locale/mbrtocXX_iconv.h b/lib/libc/locale/mbrtocXX_iconv.h
index 9eb6f68..ac85a5a 100644
--- a/lib/libc/locale/mbrtocXX_iconv.h
+++ b/lib/libc/locale/mbrtocXX_iconv.h
@@ -99,7 +99,8 @@ mbrtocXX_l(charXX_t * __restrict pc, const char * __restrict s, size_t n,
/* Convert as few characters to the dst buffer as possible. */
for (i = 0; ; i++) {
- char *src, *dst;
+ const char *src;
+ char *dst;
size_t srcleft, dstleft, invlen;
int err;
diff --git a/lib/libc/locale/newlocale.3 b/lib/libc/locale/newlocale.3
index c7414be..a639c37 100644
--- a/lib/libc/locale/newlocale.3
+++ b/lib/libc/locale/newlocale.3
@@ -35,7 +35,7 @@
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In locale.h
+.In xlocale
.Ft locale_t
.Fn newlocale "int mask" "const char * locale" "locale_t base"
.Sh DESCRIPTION
diff --git a/lib/libc/locale/none.c b/lib/libc/locale/none.c
index cacfd73..75adffa 100644
--- a/lib/libc/locale/none.c
+++ b/lib/libc/locale/none.c
@@ -209,7 +209,7 @@ struct xlocale_ctype __xlocale_global_ctype = {
256 /* __mb_sb_limit */
};
-struct xlocale_ctype __xlocale_C_ctype = {
+const struct xlocale_ctype __xlocale_C_ctype = {
{{0}, "C"},
(_RuneLocale*)&_DefaultRuneLocale,
_none_mbrtowc,
diff --git a/lib/libc/locale/querylocale.3 b/lib/libc/locale/querylocale.3
index d1bb688..f90d626 100644
--- a/lib/libc/locale/querylocale.3
+++ b/lib/libc/locale/querylocale.3
@@ -36,7 +36,7 @@
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In locale.h
+.In xlocale.h
.Ft const char *
.Fn querylocale "int mask" "locale_t locale"
.Sh DESCRIPTION
diff --git a/lib/libc/locale/uselocale.3 b/lib/libc/locale/uselocale.3
index 96d0008..df29a62 100644
--- a/lib/libc/locale/uselocale.3
+++ b/lib/libc/locale/uselocale.3
@@ -36,7 +36,7 @@
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In locale.h
+.In xlocale.h
.Ft locale_t
.Fn uselocale "locale_t locale"
.Sh DESCRIPTION
diff --git a/lib/libc/locale/xlocale.3 b/lib/libc/locale/xlocale.3
index da217c6..d467a10 100644
--- a/lib/libc/locale/xlocale.3
+++ b/lib/libc/locale/xlocale.3
@@ -71,7 +71,7 @@ function.
.Xr localeconv 3 ,
.Xr newlocale 3 ,
.Xr querylocale 3 ,
-.Xr uselocale 3
+.Xr uselocale 3 ,
.Sh CONVENIENCE FUNCTIONS
The xlocale API includes a number of
.Fa _l
diff --git a/lib/libc/mips/gen/Makefile.inc b/lib/libc/mips/gen/Makefile.inc
index a186fda..9d9cc7a 100644
--- a/lib/libc/mips/gen/Makefile.inc
+++ b/lib/libc/mips/gen/Makefile.inc
@@ -6,6 +6,5 @@ SRCS+= infinity.c fabs.c ldexp.c
# SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
# fpsetround.c fpsetsticky.c
-SRCS+= _ctx_start.S _set_tp.c _setjmp.S makecontext.c \
- setjmp.S signalcontext.c sigsetjmp.S \
- trivial-getcontextx.c
+SRCS+= _ctx_start.S _set_tp.c _setjmp.S getcontextx.c makecontext.c \
+ setjmp.S signalcontext.c sigsetjmp.S
diff --git a/lib/libc/mips/gen/_setjmp.S b/lib/libc/mips/gen/_setjmp.S
index 0f7a75a..3918407 100644
--- a/lib/libc/mips/gen/_setjmp.S
+++ b/lib/libc/mips/gen/_setjmp.S
@@ -61,16 +61,9 @@ __FBSDID("$FreeBSD$");
LEAF(_setjmp)
REG_PROLOGUE
- REG_LI v0, _JB_MAGIC__SETJMP # sigcontext magic number
+ REG_LI v0, _JB_MAGIC__SETJMP
REG_S v0, (_JB_MAGIC * SZREG)(a0)
REG_S ra, (_JB_REG_RA * SZREG)(a0)
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * Registers s0..s7 are callee-saved.
- * The sp register is callee-saved.
- * The fp (or s8) register is callee-saved.
- * The gp register is callee-saved (for n32/n64).
- */
REG_S s0, (_JB_REG_S0 * SZREG)(a0)
REG_S s1, (_JB_REG_S1 * SZREG)(a0)
REG_S s2, (_JB_REG_S2 * SZREG)(a0)
@@ -79,41 +72,11 @@ LEAF(_setjmp)
REG_S s5, (_JB_REG_S5 * SZREG)(a0)
REG_S s6, (_JB_REG_S6 * SZREG)(a0)
REG_S s7, (_JB_REG_S7 * SZREG)(a0)
- REG_S sp, (_JB_REG_SP * SZREG)(a0)
REG_S s8, (_JB_REG_S8 * SZREG)(a0)
#if defined(__mips_n32) || defined(__mips_n64)
REG_S gp, (_JB_REG_GP * SZREG)(a0) # newabi gp is callee-saved
#endif
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
- * In N64, FP registers F24 .. F31 are callee-saved.
- * In O32, FP registers F20 .. F23 are callee-saved.
- */
-#ifndef SOFTFLOAT
- cfc1 v0, $31 # too bad can't check if FP used
-#if defined(__mips_n64) || defined(__mips_n32)
- FP_S $f30, (_JB_FPREG_F30 * SZREG)(a0)
- FP_S $f28, (_JB_FPREG_F28 * SZREG)(a0)
- FP_S $f26, (_JB_FPREG_F26 * SZREG)(a0)
- FP_S $f24, (_JB_FPREG_F24 * SZREG)(a0)
-#endif
-#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
- FP_S $f22, (_JB_FPREG_F22 * SZREG)(a0)
- FP_S $f20, (_JB_FPREG_F20 * SZREG)(a0)
-#endif
-#if defined(__mips_o32) || defined(__mips_o64)
- FP_S $f21, (_JB_FPREG_F21 * SZREG)(a0)
- FP_S $f23, (_JB_FPREG_F23 * SZREG)(a0)
-#endif
-#if defined(__mips_n64)
- FP_S $f25, (_JB_FPREG_F25 * SZREG)(a0)
- FP_S $f27, (_JB_FPREG_F27 * SZREG)(a0)
- FP_S $f29, (_JB_FPREG_F29 * SZREG)(a0)
- FP_S $f31, (_JB_FPREG_F31 * SZREG)(a0)
-#endif
- INT_S v0, (_JB_FPREG_FCSR * SZREG)(a0)
-#endif /* ! SOFTFLOAT */
+ REG_S sp, (_JB_REG_SP * SZREG)(a0)
REG_EPILOGUE
j ra
@@ -131,13 +94,6 @@ LEAF(_longjmp)
REG_LI t0, _JB_MAGIC__SETJMP
bne v0, t0, botch # jump if error
PTR_ADDU sp, sp, CALLFRAME_SIZ # does not matter, sanity
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * Registers s0..s7 are callee-saved.
- * The sp register is callee-saved.
- * The fp (or s8) register is callee-saved.
- * The gp register is callee-saved (for n32/n64).
- */
REG_L s0, (_JB_REG_S0 * SZREG)(a0)
REG_L s1, (_JB_REG_S1 * SZREG)(a0)
REG_L s2, (_JB_REG_S2 * SZREG)(a0)
@@ -146,42 +102,11 @@ LEAF(_longjmp)
REG_L s5, (_JB_REG_S5 * SZREG)(a0)
REG_L s6, (_JB_REG_S6 * SZREG)(a0)
REG_L s7, (_JB_REG_S7 * SZREG)(a0)
- REG_L sp, (_JB_REG_SP * SZREG)(a0)
- REG_L s8, (_JB_REG_S8 * SZREG)(a0)
#if defined(__mips_n32) || defined(__mips_n64)
REG_L gp, (_JB_REG_GP * SZREG)(a0)
#endif
-#ifndef SOFTFLOAT
- # get fpu status
- INT_L v0, (_JB_FPREG_FCSR * SZREG)(a0)
- ctc1 v0, $31
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
- * In N64, FP registers F24 .. F31 are callee-saved.
- * In O32, FP registers F20 .. F23 are callee-saved.
- */
-#if defined(__mips_n64) || defined(__mips_n32)
- FP_L $f30, (_JB_FPREG_F30 * SZREG)(a0)
- FP_L $f28, (_JB_FPREG_F28 * SZREG)(a0)
- FP_L $f26, (_JB_FPREG_F26 * SZREG)(a0)
- FP_L $f24, (_JB_FPREG_F24 * SZREG)(a0)
-#endif
-#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
- FP_L $f22, (_JB_FPREG_F22 * SZREG)(a0)
- FP_L $f20, (_JB_FPREG_F20 * SZREG)(a0)
-#endif
-#if defined(__mips_o32) || defined(__mips_o64)
- FP_L $f21, (_JB_FPREG_F21 * SZREG)(a0)
- FP_L $f23, (_JB_FPREG_F23 * SZREG)(a0)
-#endif
-#if defined(__mips_n64)
- FP_L $f25, (_JB_FPREG_F25 * SZREG)(a0)
- FP_L $f27, (_JB_FPREG_F27 * SZREG)(a0)
- FP_L $f29, (_JB_FPREG_F29 * SZREG)(a0)
- FP_L $f31, (_JB_FPREG_F31 * SZREG)(a0)
-#endif
-#endif /* ! SOFTFLOAT */
+ REG_L sp, (_JB_REG_SP * SZREG)(a0)
+ REG_L s8, (_JB_REG_S8 * SZREG)(a0)
REG_EPILOGUE
move v0, a1 # get return value in 1st arg
diff --git a/lib/csu/aarch64/crtn.S b/lib/libc/mips/gen/getcontextx.c
index ebb59b7..54f8513 100644
--- a/lib/csu/aarch64/crtn.S
+++ b/lib/libc/mips/gen/getcontextx.c
@@ -1,14 +1,11 @@
-/*-
- * Copyright 2001 David E. O'Brien
- * Copyright 2014 The FreeBSD Foundation
+/*
+ * Copyright (c) 2011 Konstantin Belousov <kib@FreeBSD.org>
* All rights reserved.
*
- * Portions of this software were developed by Andrew Turner
- * 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
@@ -27,18 +24,53 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
- .section .init,"ax",@progbits
- ldr lr, [sp]
- add sp, sp, #16
- ret
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <errno.h>
+#include <stdlib.h>
+
+int
+__getcontextx_size(void)
+{
+
+ return (sizeof(ucontext_t));
+}
+
+int
+__fillcontextx2(char *ctx)
+{
+
+ return (0);
+}
+
+int
+__fillcontextx(char *ctx)
+{
+ ucontext_t *ucp;
+
+ ucp = (ucontext_t *)ctx;
+ return (getcontext(ucp));
+}
+__weak_reference(__getcontextx, getcontextx);
- .section .fini,"ax",@progbits
- ldr lr, [sp]
- add sp, sp, #16
- ret
+ucontext_t *
+__getcontextx(void)
+{
+ char *ctx;
+ int error;
- .section .note.GNU-stack,"",%progbits
+ ctx = malloc(__getcontextx_size());
+ if (ctx == NULL)
+ return (NULL);
+ if (__fillcontextx(ctx) == -1) {
+ error = errno;
+ free(ctx);
+ errno = error;
+ return (NULL);
+ }
+ return ((ucontext_t *)ctx);
+}
diff --git a/lib/libc/mips/gen/setjmp.S b/lib/libc/mips/gen/setjmp.S
index 9c9e8b8..deeb892 100644
--- a/lib/libc/mips/gen/setjmp.S
+++ b/lib/libc/mips/gen/setjmp.S
@@ -86,13 +86,6 @@ NESTED(setjmp, SETJMP_FRAME_SIZE, ra)
REG_LI v0, _JB_MAGIC_SETJMP
REG_S v0, (_JB_MAGIC * SZREG)(a0)
REG_S ra, (_JB_REG_RA * SZREG)(a0)
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * Registers s0..s7 are callee-saved.
- * The sp register is callee-saved.
- * The fp (or s8) register is callee-saved.
- * The gp register is callee-saved (for n32/n64).
- */
REG_S s0, (_JB_REG_S0 * SZREG)(a0)
REG_S s1, (_JB_REG_S1 * SZREG)(a0)
REG_S s2, (_JB_REG_S2 * SZREG)(a0)
@@ -106,36 +99,6 @@ NESTED(setjmp, SETJMP_FRAME_SIZE, ra)
#if defined(__mips_n32) || defined(__mips_n64)
REG_S gp, (_JB_REG_GP * SZREG)(a0)
#endif
-#ifndef SOFTFLOAT
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
- * In N64, FP registers F24 .. F31 are callee-saved.
- * In O32, FP registers F20 .. F23 are callee-saved.
- */
- cfc1 v0, $31
- INT_S v0, (_JB_FPREG_FCSR * SZREG)(a0)
-#if defined(__mips_o32) || defined(__mips_o64) || defined(__mips_n32)
- FP_S $f20, (_JB_FPREG_F20 * SZREG)(a0)
- FP_S $f22, (_JB_FPREG_F22 * SZREG)(a0)
-#endif
-#if defined(__mips_o32) || defined(__mips_o64)
- FP_S $f21, (_JB_FPREG_F21 * SZREG)(a0)
- FP_S $f23, (_JB_FPREG_F23 * SZREG)(a0)
-#endif
-#if defined(__mips_n32) || defined(__mips_n64)
- FP_S $f24, (_JB_FPREG_F24 * SZREG)(a0)
- FP_S $f26, (_JB_FPREG_F26 * SZREG)(a0)
- FP_S $f28, (_JB_FPREG_F28 * SZREG)(a0)
- FP_S $f30, (_JB_FPREG_F30 * SZREG)(a0)
-#endif
-#if defined(__mips_n64)
- FP_S $f25, (_JB_FPREG_F25 * SZREG)(a0)
- FP_S $f27, (_JB_FPREG_F27 * SZREG)(a0)
- FP_S $f29, (_JB_FPREG_F29 * SZREG)(a0)
- FP_S $f31, (_JB_FPREG_F31 * SZREG)(a0)
-#endif
-#endif /* ! SOFTFLOAT */
move v0, zero
jr ra
@@ -170,13 +133,6 @@ NESTED(longjmp, LONGJMP_FRAME_SIZE, ra)
REG_L a1, (CALLFRAME_SIZ + SZREG)(sp) # restore return value
REG_L ra, (_JB_REG_RA * SZREG)(a0)
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * Registers s0..s7 are callee-saved.
- * The sp register is callee-saved.
- * The fp (or s8) register is callee-saved.
- * The gp register is callee-saved (for n32/n64).
- */
REG_L s0, (_JB_REG_S0 * SZREG)(a0)
REG_L s1, (_JB_REG_S1 * SZREG)(a0)
REG_L s2, (_JB_REG_S2 * SZREG)(a0)
@@ -190,36 +146,6 @@ NESTED(longjmp, LONGJMP_FRAME_SIZE, ra)
#if defined(__mips_n32) || defined(__mips_n64)
REG_L gp, (_JB_REG_GP * SZREG)(a0)
#endif
-#ifndef SOFTFLOAT
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
- * In N64, FP registers F23 .. F31 are callee-saved.
- * In O32, FP registers F20 .. F23 are callee-saved.
- */
- INT_L v0, (_JB_FPREG_FCSR * SZREG)(a0)
- ctc1 v0, $31
-#if defined(__mips_n64) || defined(__mips_n32)
- FP_L $f30, (_JB_FPREG_F30 * SZREG)(a0)
- FP_L $f28, (_JB_FPREG_F28 * SZREG)(a0)
- FP_L $f26, (_JB_FPREG_F26 * SZREG)(a0)
- FP_L $f24, (_JB_FPREG_F24 * SZREG)(a0)
-#endif
-#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
- FP_L $f22, (_JB_FPREG_F22 * SZREG)(a0)
- FP_L $f20, (_JB_FPREG_F20 * SZREG)(a0)
-#endif
-#if defined(__mips_o32) || defined(__mips_o64)
- FP_L $f21, (_JB_FPREG_F21 * SZREG)(a0)
- FP_L $f23, (_JB_FPREG_F23 * SZREG)(a0)
-#endif
-#if defined(__mips_n64)
- FP_L $f25, (_JB_FPREG_F25 * SZREG)(a0)
- FP_L $f27, (_JB_FPREG_F27 * SZREG)(a0)
- FP_L $f29, (_JB_FPREG_F29 * SZREG)(a0)
- FP_L $f31, (_JB_FPREG_F31 * SZREG)(a0)
-#endif
-#endif /* ! SOFTFLOAT */
move v0, a1
j ra
diff --git a/lib/libc/mips/gen/sigsetjmp.S b/lib/libc/mips/gen/sigsetjmp.S
index 41c47f2..7705c29 100644
--- a/lib/libc/mips/gen/sigsetjmp.S
+++ b/lib/libc/mips/gen/sigsetjmp.S
@@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$");
LEAF(sigsetjmp)
PIC_PROLOGUE(sigsetjmp)
- bne a1, zero, 1f # do saving of signal mask?
+ bne a1, 0x0, 1f # do saving of signal mask?
PIC_TAILCALL(_setjmp)
1: PIC_TAILCALL(setjmp)
diff --git a/lib/libc/mips/sys/Makefile.inc b/lib/libc/mips/sys/Makefile.inc
index 460e69b..c754f36 100644
--- a/lib/libc/mips/sys/Makefile.inc
+++ b/lib/libc/mips/sys/Makefile.inc
@@ -1,11 +1,15 @@
# $FreeBSD$
-SRCS+= trivial-vdso_tc.c
+SRCS+= __vdso_gettc.c
MDASM= Ovfork.S brk.S cerror.S exect.S \
fork.S pipe.S ptrace.S sbrk.S syscall.S
# Don't generate default code for these syscalls:
-NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
+NOASM= break.o exit.o ftruncate.o getlogin.o lseek.o mmap.o \
+ openbsd_poll.o pread.o pwrite.o sstk.o truncate.o vfork.o yield.o
PSEUDO= _exit.o _getlogin.o
+.if ${MK_SYSCALL_COMPAT} != "no"
+PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
+.endif
diff --git a/lib/libc/aarch64/gen/flt_rounds.c b/lib/libc/mips/sys/__vdso_gettc.c
index 6f8eeeb..b99bbc4 100644
--- a/lib/libc/aarch64/gen/flt_rounds.c
+++ b/lib/libc/mips/sys/__vdso_gettc.c
@@ -1,6 +1,5 @@
/*-
- * Copyright (c) 2012 Ian Lepore <freebsd@damnhippie.dyndns.org>
- * All rights reserved.
+ * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,22 +27,22 @@
__FBSDID("$FreeBSD$");
#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/vdso.h>
+#include <errno.h>
-#include <fenv.h>
-#include <float.h>
+#pragma weak __vdso_gettc
+u_int
+__vdso_gettc(const struct vdso_timehands *th)
+{
-static int map[] = {
- 1, /* round to nearest */
- 2, /* round to positive infinity */
- 3, /* round to negative infinity */
- 0 /* round to zero */
-};
+ return (0);
+}
+#pragma weak __vdso_gettimekeep
int
-__flt_rounds(void)
+__vdso_gettimekeep(struct vdso_timekeep **tk)
{
- uint64_t fpcr;
- asm volatile("mrs %0, fpcr" : "=r" (fpcr));
- return map[(fpcr >> 22) & 3];
+ return (ENOSYS);
}
diff --git a/lib/libc/net/Symbol.map b/lib/libc/net/Symbol.map
index 01d3bcb..2eddc47 100644
--- a/lib/libc/net/Symbol.map
+++ b/lib/libc/net/Symbol.map
@@ -124,7 +124,6 @@ FBSD_1.0 {
in6addr_nodelocal_allnodes;
in6addr_linklocal_allnodes;
sctp_getaddrlen;
- sctp_getassocid;
sctp_bindx;
sctp_connectx;
sctp_peeloff;
diff --git a/lib/libc/net/base64.c b/lib/libc/net/base64.c
index 8a9c59e..4335030 100644
--- a/lib/libc/net/base64.c
+++ b/lib/libc/net/base64.c
@@ -193,10 +193,12 @@ b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
*/
int
-b64_pton(const char *src, u_char *target, size_t targsize)
+b64_pton(src, target, targsize)
+ char const *src;
+ u_char *target;
+ size_t targsize;
{
int tarindex, state, ch;
- u_char nextbyte;
char *pos;
state = 0;
@@ -224,28 +226,22 @@ b64_pton(const char *src, u_char *target, size_t targsize)
break;
case 1:
if (target) {
- if ((size_t)tarindex >= targsize)
+ if ((size_t)tarindex + 1 >= targsize)
return (-1);
target[tarindex] |= (pos - Base64) >> 4;
- nextbyte = ((pos - Base64) & 0x0f) << 4;
- if ((size_t)tarindex + 1 < targsize)
- target[tarindex + 1] = nextbyte;
- else if (nextbyte)
- return (-1);
+ target[tarindex+1] = ((pos - Base64) & 0x0f)
+ << 4 ;
}
tarindex++;
state = 2;
break;
case 2:
if (target) {
- if ((size_t)tarindex >= targsize)
+ if ((size_t)tarindex + 1 >= targsize)
return (-1);
target[tarindex] |= (pos - Base64) >> 2;
- nextbyte = ((pos - Base64) & 0x03) << 6;
- if ((size_t)tarindex + 1 < targsize)
- target[tarindex + 1] = nextbyte;
- else if (nextbyte)
- return (-1);
+ target[tarindex+1] = ((pos - Base64) & 0x03)
+ << 6;
}
tarindex++;
state = 3;
@@ -303,8 +299,7 @@ b64_pton(const char *src, u_char *target, size_t targsize)
* zeros. If we don't check them, they become a
* subliminal channel.
*/
- if (target && (size_t)tarindex < targsize &&
- target[tarindex] != 0)
+ if (target && target[tarindex] != 0)
return (-1);
}
} else {
diff --git a/lib/libc/net/eui64.c b/lib/libc/net/eui64.c
index bb3077f..d9ed76c 100644
--- a/lib/libc/net/eui64.c
+++ b/lib/libc/net/eui64.c
@@ -132,7 +132,6 @@ eui64_line(const char *l, struct eui64 *e, char *hostname, size_t len)
goto bad;
}
- free(linehead);
return (0);
bad:
diff --git a/lib/libc/net/getaddrinfo.3 b/lib/libc/net/getaddrinfo.3
index 570fc2e..5d03aab 100644
--- a/lib/libc/net/getaddrinfo.3
+++ b/lib/libc/net/getaddrinfo.3
@@ -237,8 +237,8 @@ pointer in each
.Li addrinfo
structure until a null pointer is encountered.
The three members
-.Fa ai_family ,
-.Fa ai_socktype ,
+.Fa ai_family,
+.Fa ai_socktype,
and
.Fa ai_protocol
in each returned
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index 17c9b65..c50374e 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$");
#include <ifaddrs.h>
#include <sys/queue.h>
#ifdef INET6
+#include <net/if_var.h>
#include <sys/sysctl.h>
#include <sys/ioctl.h>
#include <netinet6/in6_var.h>
diff --git a/lib/libc/net/getifaddrs.3 b/lib/libc/net/getifaddrs.3
index b0b17bb..ff3f774 100644
--- a/lib/libc/net/getifaddrs.3
+++ b/lib/libc/net/getifaddrs.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 25, 2014
+.Dd May 21, 2013
.Dt GETIFADDRS 3
.Os
.Sh NAME
@@ -110,17 +110,19 @@ if one exists, otherwise it is NULL.
.Pp
The
.Li ifa_data
-field references address family specific data
-in a pointer to the
-.Fa struct if_data
-(as defined in include file
-.In net/if.h ) .
+field references address family specific data.
For
.Dv AF_LINK
-addresses,
-it contains various interface attributes and statistics.
-For all other address families,
-it contains per-address interface statistics.
+addresses it contains a pointer to the
+.Fa struct if_data
+(as defined in include file
+.In net/if.h )
+which contains various interface attributes and statistics.
+For all other address families, it contains a pointer to the
+.Fa struct ifa_data
+(as defined in include file
+.In net/if.h )
+which contains per-address interface statistics.
.Pp
The data returned by
.Fn getifaddrs
diff --git a/lib/libc/net/ip6opt.c b/lib/libc/net/ip6opt.c
index 2f0c51d..a467758 100644
--- a/lib/libc/net/ip6opt.c
+++ b/lib/libc/net/ip6opt.c
@@ -419,7 +419,7 @@ inet6_opt_append(void *extbuf, socklen_t extlen, int offset, u_int8_t type,
* The option data length must have a value between 0 and 255,
* inclusive, and is the length of the option data that follows.
*/
- if (len > 255 || len < 0 )
+ if (len < 0 || len > 255)
return(-1);
/*
diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c
index 89effe6..97880a2 100644
--- a/lib/libc/net/name6.c
+++ b/lib/libc/net/name6.c
@@ -94,6 +94,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/in.h>
#ifdef INET6
#include <net/if.h>
+#include <net/if_var.h>
#include <sys/sysctl.h>
#include <sys/ioctl.h>
#include <netinet6/in6_var.h> /* XXX */
diff --git a/lib/libc/net/nsdispatch.c b/lib/libc/net/nsdispatch.c
index 4de1df3..c23315c 100644
--- a/lib/libc/net/nsdispatch.c
+++ b/lib/libc/net/nsdispatch.c
@@ -132,17 +132,14 @@ static void *nss_cache_cycle_prevention_func = NULL;
#endif
/*
- * We keep track of nsdispatch() nesting depth in dispatch_depth. When a
- * fallback method is invoked from nsdispatch(), we temporarily set
- * fallback_depth to the current dispatch depth plus one. Subsequent
- * calls at that exact depth will run in fallback mode (restricted to the
- * same source as the call that was handled by the fallback method), while
- * calls below that depth will be handled normally, allowing fallback
- * methods to perform arbitrary lookups.
+ * When this is set to 1, nsdispatch won't use nsswitch.conf
+ * but will consult the 'defaults' source list only.
+ * NOTE: nested fallbacks (when nsdispatch calls fallback functions,
+ * which in turn calls nsdispatch, which should call fallback
+ * function) are not supported
*/
struct fb_state {
- int dispatch_depth;
- int fallback_depth;
+ int fb_dispatch;
};
static void fb_endstate(void *);
NSS_TLS_HANDLING(fb);
@@ -616,7 +613,6 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database,
void *mdata;
int isthreaded, serrno, i, result, srclistsize;
struct fb_state *st;
- int saved_depth;
#ifdef NS_CACHING
nss_cache_data cache_data;
@@ -648,8 +644,7 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database,
result = NS_UNAVAIL;
goto fin;
}
- ++st->dispatch_depth;
- if (st->dispatch_depth > st->fallback_depth) {
+ if (st->fb_dispatch == 0) {
dbt = vector_search(&database, _nsmap, _nsmapsize, sizeof(*_nsmap),
string_compare);
fb_method = nss_method_lookup(NSSRC_FALLBACK, database,
@@ -718,13 +713,12 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database,
break;
} else {
if (fb_method != NULL) {
- saved_depth = st->fallback_depth;
- st->fallback_depth = st->dispatch_depth + 1;
+ st->fb_dispatch = 1;
va_start(ap, defaults);
result = fb_method(retval,
(void *)srclist[i].name, ap);
va_end(ap);
- st->fallback_depth = saved_depth;
+ st->fb_dispatch = 0;
} else
nss_log(LOG_DEBUG, "%s, %s, %s, not found, "
"and no fallback provided",
@@ -756,7 +750,6 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database,
if (isthreaded)
(void)_pthread_rwlock_unlock(&nss_lock);
- --st->dispatch_depth;
fin:
errno = serrno;
return (result);
diff --git a/lib/libc/net/recv.c b/lib/libc/net/recv.c
index 6a584ca..f71d478 100644
--- a/lib/libc/net/recv.c
+++ b/lib/libc/net/recv.c
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/socket.h>
-#include "libc_private.h"
#include <stddef.h>
@@ -49,8 +48,5 @@ recv(s, buf, len, flags)
* POSIX says recv() shall be a cancellation point, so call the
* cancellation-enabled recvfrom() and not _recvfrom().
*/
- return (((ssize_t (*)(int, void *, size_t, int,
- struct sockaddr *, socklen_t *))
- __libc_interposing[INTERPOS_recvfrom])(s, buf, len, flags,
- NULL, NULL));
+ return (recvfrom(s, buf, len, flags, NULL, 0));
}
diff --git a/lib/libc/net/sctp_recvmsg.3 b/lib/libc/net/sctp_recvmsg.3
index 945797d..e3ced9c 100644
--- a/lib/libc/net/sctp_recvmsg.3
+++ b/lib/libc/net/sctp_recvmsg.3
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 23, 2015
+.Dd August 13, 2007
.Dt SCTP_RECVMSG 3
.Os
.Sh NAME
@@ -98,13 +98,13 @@ receive buffer, then the
argument will
.Em not
have the
-.Dv MSG_EOR
+.Dv MSG_EOF
flag applied.
If the message is a complete message then
the
.Fa flags
argument will have
-.Dv MSG_EOR
+.Dv MSG_EOF
set.
Locally detected errors are
indicated by a return value of -1 with
@@ -282,12 +282,12 @@ This typically means that the socket
is not connected and is a one-to-one style socket.
.El
.Sh SEE ALSO
-.Xr getsockopt 2 ,
.Xr recv 2 ,
.Xr select 2 ,
-.Xr setsockopt 2 ,
.Xr socket 2 ,
.Xr write 2 ,
+.Xr getsockopt 2 ,
+.Xr setsockopt 2 ,
.Xr sctp_send 3 ,
.Xr sctp_sendmsg 3 ,
.Xr sendmsg 3 ,
diff --git a/lib/libc/net/sctp_send.3 b/lib/libc/net/sctp_send.3
index 9c7f833..37b0b71 100644
--- a/lib/libc/net/sctp_send.3
+++ b/lib/libc/net/sctp_send.3
@@ -337,7 +337,7 @@ is not connected and is a one-to-one style socket.
.Xr select 2 ,
.Xr sendmsg 2 ,
.Xr socket 2 ,
-.Xr write 2 ,
+.Xr write 2
.Xr sctp_connectx 3 ,
.Xr sctp_recvmsg 3 ,
.Xr sctp_sendmsg 3 ,
diff --git a/lib/libc/net/sctp_sys_calls.c b/lib/libc/net/sctp_sys_calls.c
index f07aa43..91527c3 100644
--- a/lib/libc/net/sctp_sys_calls.c
+++ b/lib/libc/net/sctp_sys_calls.c
@@ -383,9 +383,6 @@ sctp_opt_info(int sd, sctp_assoc_t id, int opt, void *arg, socklen_t * size)
case SCTP_PR_ASSOC_STATUS:
((struct sctp_prstatus *)arg)->sprstat_assoc_id = id;
break;
- case SCTP_MAX_CWND:
- ((struct sctp_assoc_value *)arg)->assoc_id = id;
- break;
default:
break;
}
@@ -600,7 +597,6 @@ sctp_sendmsg(int s,
msg.msg_iovlen = 1;
msg.msg_control = cmsgbuf;
msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo));
- msg.msg_flags = 0;
cmsg = (struct cmsghdr *)cmsgbuf;
cmsg->cmsg_level = IPPROTO_SCTP;
cmsg->cmsg_type = SCTP_SNDRCV;
@@ -667,7 +663,6 @@ sctp_send(int sd, const void *data, size_t len,
msg.msg_iovlen = 1;
msg.msg_control = cmsgbuf;
msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo));
- msg.msg_flags = 0;
cmsg = (struct cmsghdr *)cmsgbuf;
cmsg->cmsg_level = IPPROTO_SCTP;
cmsg->cmsg_type = SCTP_SNDRCV;
@@ -825,6 +820,7 @@ sctp_recvmsg(int s,
errno = EINVAL;
return (-1);
}
+ msg.msg_flags = 0;
iov.iov_base = dbuf;
iov.iov_len = len;
msg.msg_name = (caddr_t)from;
@@ -836,7 +832,6 @@ sctp_recvmsg(int s,
msg.msg_iovlen = 1;
msg.msg_control = cmsgbuf;
msg.msg_controllen = sizeof(cmsgbuf);
- msg.msg_flags = 0;
sz = recvmsg(s, &msg, *msg_flags);
*msg_flags = msg.msg_flags;
if (sz <= 0) {
@@ -891,7 +886,7 @@ sctp_recvv(int sd,
struct sctp_rcvinfo *rcvinfo;
struct sctp_nxtinfo *nxtinfo;
- if (((info != NULL) && (infolen == NULL)) ||
+ if (((info != NULL) && (infolen == NULL)) |
((info == NULL) && (infolen != NULL) && (*infolen != 0)) ||
((info != NULL) && (infotype == NULL))) {
errno = EINVAL;
@@ -910,7 +905,6 @@ sctp_recvv(int sd,
msg.msg_iovlen = iovlen;
msg.msg_control = cmsgbuf;
msg.msg_controllen = sizeof(cmsgbuf);
- msg.msg_flags = 0;
ret = recvmsg(sd, &msg, *flags);
*flags = msg.msg_flags;
if ((ret > 0) &&
diff --git a/lib/libc/net/send.c b/lib/libc/net/send.c
index c44f4b9..93cdfda 100644
--- a/lib/libc/net/send.c
+++ b/lib/libc/net/send.c
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/socket.h>
-#include "libc_private.h"
#include <stddef.h>
@@ -49,8 +48,5 @@ send(s, msg, len, flags)
* POSIX says send() shall be a cancellation point, so call the
* cancellation-enabled sendto() and not _sendto().
*/
- return (((ssize_t (*)(int, const void *, size_t, int,
- const struct sockaddr *, socklen_t))
- __libc_interposing[INTERPOS_sendto])(s, msg, len, flags,
- NULL, 0));
+ return (sendto(s, msg, len, flags, NULL, 0));
}
diff --git a/lib/libc/nls/catopen.3 b/lib/libc/nls/catopen.3
index 7744b0b..7a16ee5 100644
--- a/lib/libc/nls/catopen.3
+++ b/lib/libc/nls/catopen.3
@@ -94,7 +94,7 @@ An empty string is substituted for undefined values.
Path names templates defined in
.Ev NLSPATH
are separated by colons
-.Pq Sq \&: .
+.No ( Sq \&: ) .
A leading or two adjacent colons
is equivalent to specifying %N.
.Pp
diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c
index 0cba460..2859916 100644
--- a/lib/libc/nls/msgcat.c
+++ b/lib/libc/nls/msgcat.c
@@ -83,7 +83,6 @@ __FBSDID("$FreeBSD$");
np->name = strdup(n); \
np->path = NULL; \
np->catd = NLERR; \
- np->refcount = 0; \
np->lang = (l == NULL) ? NULL : \
strdup(l); \
np->caterrno = e; \
diff --git a/lib/libc/posix1e/acl_calc_mask.c b/lib/libc/posix1e/acl_calc_mask.c
index 56215b9..a2d1527 100644
--- a/lib/libc/posix1e/acl_calc_mask.c
+++ b/lib/libc/posix1e/acl_calc_mask.c
@@ -104,7 +104,6 @@ acl_calc_mask(acl_t *acl_p)
/* if no mask exists, check acl_cnt... */
if (acl_int_new->acl_cnt == ACL_MAX_ENTRIES) {
errno = ENOMEM;
- acl_free(acl_new);
return (-1);
}
/* ...and add the mask entry */
diff --git a/lib/libc/posix1e/acl_set_flagset_np.3 b/lib/libc/posix1e/acl_set_flagset_np.3
index 685680d..2230c48 100644
--- a/lib/libc/posix1e/acl_set_flagset_np.3
+++ b/lib/libc/posix1e/acl_set_flagset_np.3
@@ -64,9 +64,9 @@ ACL is already branded as POSIX.1e.
.Sh SEE ALSO
.Xr acl 3 ,
.Xr acl_add_flag_np 3 ,
+.Xr acl_get_brand_np 3 ,
.Xr acl_clear_flags_np 3 ,
.Xr acl_delete_flag_np 3 ,
-.Xr acl_get_brand_np 3 ,
.Xr acl_get_flagset_np 3 ,
.Xr posix1e 3
.Sh STANDARDS
diff --git a/lib/libc/aarch64/gen/_set_tp.c b/lib/libc/posix1e/acl_size.c
index a587b2e..27ad651 100644
--- a/lib/libc/aarch64/gen/_set_tp.c
+++ b/lib/libc/posix1e/acl_size.c
@@ -1,5 +1,5 @@
-/*-
- * Copyright (c) 2014 Andrew Turner
+/*
+ * Copyright (c) 2001-2002 Chris D. Faulhaber
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* 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
+ * 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)
@@ -27,16 +27,17 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <string.h>
#include <sys/types.h>
+#include "namespace.h"
+#include <sys/acl.h>
+#include "un-namespace.h"
-#include <machine/sysarch.h>
+#include <errno.h>
-#include <stdlib.h>
-
-void
-_set_tp(void *tp)
+ssize_t
+acl_size(acl_t acl)
{
- asm volatile("msr tpidr_el0, %0" : : "r"(tp));
+ errno = ENOSYS;
+ return (-1);
}
diff --git a/lib/libc/posix1e/acl_strip.c b/lib/libc/posix1e/acl_strip.c
index 85dfb47..ae37b38 100644
--- a/lib/libc/posix1e/acl_strip.c
+++ b/lib/libc/posix1e/acl_strip.c
@@ -82,10 +82,8 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculate_mask)
have_mask_entry = 0;
acl_new = acl_init(ACL_MAX_ENTRIES);
- if (acl_new == NULL) {
- acl_free(acl_old);
+ if (acl_new == NULL)
return (NULL);
- }
tag = ACL_UNDEFINED_TAG;
/* only save the default user/group/other entries */
@@ -96,16 +94,16 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculate_mask)
assert(_entry_brand(entry) == ACL_BRAND_POSIX);
if (acl_get_tag_type(entry, &tag) == -1)
- goto fail;
+ return (NULL);
switch(tag) {
case ACL_USER_OBJ:
case ACL_GROUP_OBJ:
case ACL_OTHER:
if (acl_get_tag_type(entry, &tag) == -1)
- goto fail;
+ return (NULL);
if (acl_get_permset(entry, &perm) == -1)
- goto fail;
+ return (NULL);
if (acl_create_entry(&acl_new, &entry_new) == -1)
return (NULL);
if (acl_set_tag_type(entry_new, tag) == -1)
@@ -122,10 +120,6 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculate_mask)
default:
break;
}
-fail:
- acl_free(acl_new);
- acl_free(acl_old);
- return (NULL);
}
assert(_acl_brand(acl_new) == ACL_BRAND_POSIX);
diff --git a/lib/libc/powerpc/Makefile.inc b/lib/libc/powerpc/Makefile.inc
index 42982671..f378780 100644
--- a/lib/libc/powerpc/Makefile.inc
+++ b/lib/libc/powerpc/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-SRCS+= trivial-vdso_tc.c
+SRCS+= __vdso_gettc.c
# Long double is 64-bits
MDSRCS+=machdep_ldisd.c
diff --git a/lib/libc/powerpc/gen/Makefile.inc b/lib/libc/powerpc/gen/Makefile.inc
index 2a00ba3..81c6a69 100644
--- a/lib/libc/powerpc/gen/Makefile.inc
+++ b/lib/libc/powerpc/gen/Makefile.inc
@@ -1,11 +1,9 @@
# $FreeBSD$
SRCS += _ctx_start.S eabi.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \
- fpgetsticky.c fpsetmask.c fpsetround.c \
+ fpgetsticky.c fpsetmask.c fpsetround.c getcontextx.c \
infinity.c ldexp.c makecontext.c _setjmp.S \
setjmp.S sigsetjmp.S signalcontext.c syncicache.c \
- _set_tp.c \
- trivial-getcontextx.c
-
+ _set_tp.c
diff --git a/lib/libc/powerpc/gen/_set_tp.c b/lib/libc/powerpc/gen/_set_tp.c
index aa1150a..5a89698 100644
--- a/lib/libc/powerpc/gen/_set_tp.c
+++ b/lib/libc/powerpc/gen/_set_tp.c
@@ -29,6 +29,7 @@
void
_set_tp(void *tpval)
{
+ register void *tp __asm__("r2");
- __asm __volatile("mr 2,%0" :: "r"((char*)tpval + 0x7008));
+ __asm __volatile("mr %0,%1" : "=r"(tp) : "r"((char*)tpval + 0x7008));
}
diff --git a/lib/libc/powerpc/gen/_setjmp.S b/lib/libc/powerpc/gen/_setjmp.S
index 663a8b6..e28386c 100644
--- a/lib/libc/powerpc/gen/_setjmp.S
+++ b/lib/libc/powerpc/gen/_setjmp.S
@@ -56,54 +56,12 @@ ENTRY(_setjmp)
mr %r10,%r1
mr %r9,%r2
stmw %r9,20(%r3)
-
- /* FPRs */
- stfd %f14,112+0*8(%r3)
- stfd %f15,112+1*8(%r3)
- stfd %f16,112+2*8(%r3)
- stfd %f17,112+3*8(%r3)
- stfd %f18,112+4*8(%r3)
- stfd %f19,112+5*8(%r3)
- stfd %f20,112+6*8(%r3)
- stfd %f21,112+7*8(%r3)
- stfd %f22,112+8*8(%r3)
- stfd %f23,112+9*8(%r3)
- stfd %f24,112+10*8(%r3)
- stfd %f25,112+11*8(%r3)
- stfd %f26,112+12*8(%r3)
- stfd %f27,112+13*8(%r3)
- stfd %f28,112+14*8(%r3)
- stfd %f29,112+15*8(%r3)
- stfd %f30,112+16*8(%r3)
- stfd %f31,112+17*8(%r3)
-
li %r3,0
blr
END(_setjmp)
ENTRY(_longjmp)
lmw %r9,20(%r3)
-
- /* FPRs */
- lfd %f14,112+0*8(%r3)
- lfd %f15,112+1*8(%r3)
- lfd %f16,112+2*8(%r3)
- lfd %f17,112+3*8(%r3)
- lfd %f18,112+4*8(%r3)
- lfd %f19,112+5*8(%r3)
- lfd %f20,112+6*8(%r3)
- lfd %f21,112+7*8(%r3)
- lfd %f22,112+8*8(%r3)
- lfd %f23,112+9*8(%r3)
- lfd %f24,112+10*8(%r3)
- lfd %f25,112+11*8(%r3)
- lfd %f26,112+12*8(%r3)
- lfd %f27,112+13*8(%r3)
- lfd %f28,112+14*8(%r3)
- lfd %f29,112+15*8(%r3)
- lfd %f30,112+16*8(%r3)
- lfd %f31,112+17*8(%r3)
-
mtlr %r11
mtcr %r12
mr %r1,%r10
diff --git a/lib/csu/aarch64/crti.S b/lib/libc/powerpc/gen/getcontextx.c
index 13e3b74..54f8513 100644
--- a/lib/csu/aarch64/crti.S
+++ b/lib/libc/powerpc/gen/getcontextx.c
@@ -1,14 +1,11 @@
-/*-
- * Copyright 2001 David E. O'Brien
- * Copyright 2014 The FreeBSD Foundation
+/*
+ * Copyright (c) 2011 Konstantin Belousov <kib@FreeBSD.org>
* All rights reserved.
*
- * Portions of this software were developed by Andrew Turner
- * 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
@@ -27,22 +24,53 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
- .section .init,"ax",@progbits
- .align 4
- .globl _init
- .type _init,@function
-_init:
- sub sp, sp, #16
- str lr, [sp]
-
- .section .fini,"ax",@progbits
- .align 4
- .globl _fini
- .type _fini,@function
-_fini:
- sub sp, sp, #16
- str lr, [sp]
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <errno.h>
+#include <stdlib.h>
+
+int
+__getcontextx_size(void)
+{
+
+ return (sizeof(ucontext_t));
+}
+
+int
+__fillcontextx2(char *ctx)
+{
+
+ return (0);
+}
+
+int
+__fillcontextx(char *ctx)
+{
+ ucontext_t *ucp;
+
+ ucp = (ucontext_t *)ctx;
+ return (getcontext(ucp));
+}
+
+__weak_reference(__getcontextx, getcontextx);
+
+ucontext_t *
+__getcontextx(void)
+{
+ char *ctx;
+ int error;
+ ctx = malloc(__getcontextx_size());
+ if (ctx == NULL)
+ return (NULL);
+ if (__fillcontextx(ctx) == -1) {
+ error = errno;
+ free(ctx);
+ errno = error;
+ return (NULL);
+ }
+ return ((ucontext_t *)ctx);
+}
diff --git a/lib/libc/powerpc/gen/setjmp.S b/lib/libc/powerpc/gen/setjmp.S
index ef7cb7e..9325fc2 100644
--- a/lib/libc/powerpc/gen/setjmp.S
+++ b/lib/libc/powerpc/gen/setjmp.S
@@ -66,27 +66,6 @@ ENTRY(setjmp)
mr %r10,%r1 /* r10 <- stackptr */
mr %r9,%r2 /* r9 <- global ptr */
stmw %r9,20(%r6)
-
- /* FPRs */
- stfd %f14,112+0*8(%r6)
- stfd %f15,112+1*8(%r6)
- stfd %f16,112+2*8(%r6)
- stfd %f17,112+3*8(%r6)
- stfd %f18,112+4*8(%r6)
- stfd %f19,112+5*8(%r6)
- stfd %f20,112+6*8(%r6)
- stfd %f21,112+7*8(%r6)
- stfd %f22,112+8*8(%r6)
- stfd %f23,112+9*8(%r6)
- stfd %f24,112+10*8(%r6)
- stfd %f25,112+11*8(%r6)
- stfd %f26,112+12*8(%r6)
- stfd %f27,112+13*8(%r6)
- stfd %f28,112+14*8(%r6)
- stfd %f29,112+15*8(%r6)
- stfd %f30,112+16*8(%r6)
- stfd %f31,112+17*8(%r6)
-
li %r3,0 /* return (0) */
blr
END(setjmp)
@@ -94,27 +73,6 @@ END(setjmp)
WEAK_REFERENCE(CNAME(__longjmp), longjmp)
ENTRY(__longjmp)
lmw %r9,20(%r3) /* restore regs */
-
- /* FPRs */
- lfd %f14,112+0*8(%r3)
- lfd %f15,112+1*8(%r3)
- lfd %f16,112+2*8(%r3)
- lfd %f17,112+3*8(%r3)
- lfd %f18,112+4*8(%r3)
- lfd %f19,112+5*8(%r3)
- lfd %f20,112+6*8(%r3)
- lfd %f21,112+7*8(%r3)
- lfd %f22,112+8*8(%r3)
- lfd %f23,112+9*8(%r3)
- lfd %f24,112+10*8(%r3)
- lfd %f25,112+11*8(%r3)
- lfd %f26,112+12*8(%r3)
- lfd %f27,112+13*8(%r3)
- lfd %f28,112+14*8(%r3)
- lfd %f29,112+15*8(%r3)
- lfd %f30,112+16*8(%r3)
- lfd %f31,112+17*8(%r3)
-
mr %r6,%r4 /* save val param */
mtlr %r11 /* r11 -> link reg */
mtcr %r12 /* r12 -> condition reg */
diff --git a/lib/libc/powerpc/gen/sigsetjmp.S b/lib/libc/powerpc/gen/sigsetjmp.S
index 9c75f4f..c67afc6 100644
--- a/lib/libc/powerpc/gen/sigsetjmp.S
+++ b/lib/libc/powerpc/gen/sigsetjmp.S
@@ -71,54 +71,12 @@ ENTRY(sigsetjmp)
mr %r10,%r1
mr %r9,%r2
stmw %r9,20(%r6)
-
- /* FPRs */
- stfd %f14,112+0*8(%r6)
- stfd %f15,112+1*8(%r6)
- stfd %f16,112+2*8(%r6)
- stfd %f17,112+3*8(%r6)
- stfd %f18,112+4*8(%r6)
- stfd %f19,112+5*8(%r6)
- stfd %f20,112+6*8(%r6)
- stfd %f21,112+7*8(%r6)
- stfd %f22,112+8*8(%r6)
- stfd %f23,112+9*8(%r6)
- stfd %f24,112+10*8(%r6)
- stfd %f25,112+11*8(%r6)
- stfd %f26,112+12*8(%r6)
- stfd %f27,112+13*8(%r6)
- stfd %f28,112+14*8(%r6)
- stfd %f29,112+15*8(%r6)
- stfd %f30,112+16*8(%r6)
- stfd %f31,112+17*8(%r6)
-
li %r3,0
blr
END(sigsetjmp)
ENTRY(siglongjmp)
lmw %r9,20(%r3)
-
- /* FPRs */
- lfd %f14,112+0*8(%r3)
- lfd %f15,112+1*8(%r3)
- lfd %f16,112+2*8(%r3)
- lfd %f17,112+3*8(%r3)
- lfd %f18,112+4*8(%r3)
- lfd %f19,112+5*8(%r3)
- lfd %f20,112+6*8(%r3)
- lfd %f21,112+7*8(%r3)
- lfd %f22,112+8*8(%r3)
- lfd %f23,112+9*8(%r3)
- lfd %f24,112+10*8(%r3)
- lfd %f25,112+11*8(%r3)
- lfd %f26,112+12*8(%r3)
- lfd %f27,112+13*8(%r3)
- lfd %f28,112+14*8(%r3)
- lfd %f29,112+15*8(%r3)
- lfd %f30,112+16*8(%r3)
- lfd %f31,112+17*8(%r3)
-
lwz %r7,0(%r3)
mr %r6,%r4
mtlr %r11
diff --git a/lib/libc/powerpc/sys/Makefile.inc b/lib/libc/powerpc/sys/Makefile.inc
index 98ec888..ad98ba1 100644
--- a/lib/libc/powerpc/sys/Makefile.inc
+++ b/lib/libc/powerpc/sys/Makefile.inc
@@ -6,3 +6,6 @@ MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o
PSEUDO= _getlogin.o _exit.o
+.if ${MK_SYSCALL_COMPAT} != "no"
+PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
+.endif
diff --git a/lib/libc/aarch64/sys/sigreturn.S b/lib/libc/powerpc/sys/__vdso_gettc.c
index 21ec1e4..b99bbc4 100644
--- a/lib/libc/aarch64/sys/sigreturn.S
+++ b/lib/libc/powerpc/sys/__vdso_gettc.c
@@ -1,9 +1,5 @@
/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner under
- * sponsorship from the FreeBSD Foundation.
+ * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,9 +23,26 @@
* SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "SYS.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/vdso.h>
+#include <errno.h>
+
+#pragma weak __vdso_gettc
+u_int
+__vdso_gettc(const struct vdso_timehands *th)
+{
+
+ return (0);
+}
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
-RSYSCALL(sigreturn)
+ return (ENOSYS);
+}
diff --git a/lib/libc/powerpc64/Makefile.inc b/lib/libc/powerpc64/Makefile.inc
index 8e9bcc5..2a080f6 100644
--- a/lib/libc/powerpc64/Makefile.inc
+++ b/lib/libc/powerpc64/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-SRCS+= trivial-vdso_tc.c
+SRCS+= __vdso_gettc.c
# Long double is 64-bits
MDSRCS+=machdep_ldisd.c
diff --git a/lib/libc/powerpc64/gen/Makefile.inc b/lib/libc/powerpc64/gen/Makefile.inc
index 864fb9e..79a2746 100644
--- a/lib/libc/powerpc64/gen/Makefile.inc
+++ b/lib/libc/powerpc64/gen/Makefile.inc
@@ -1,10 +1,9 @@
# $FreeBSD$
SRCS += _ctx_start.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \
- fpgetsticky.c fpsetmask.c fpsetround.c \
+ fpgetsticky.c fpsetmask.c fpsetround.c getcontextx.c \
infinity.c ldexp.c makecontext.c _setjmp.S \
setjmp.S sigsetjmp.S signalcontext.c syncicache.c \
- _set_tp.c \
- trivial-getcontextx.c
+ _set_tp.c
diff --git a/lib/libc/powerpc64/gen/_set_tp.c b/lib/libc/powerpc64/gen/_set_tp.c
index 32137e5..9adb6a5 100644
--- a/lib/libc/powerpc64/gen/_set_tp.c
+++ b/lib/libc/powerpc64/gen/_set_tp.c
@@ -29,6 +29,7 @@
void
_set_tp(void *tpval)
{
+ register void *tp __asm__("r13");
- __asm __volatile("mr 13,%0" :: "r"((char*)tpval + 0x7010));
+ __asm __volatile("mr %0,%1" : "=r"(tp) : "r"((char*)tpval + 0x7010));
}
diff --git a/lib/libc/powerpc64/gen/_setjmp.S b/lib/libc/powerpc64/gen/_setjmp.S
index f7689ae..207c4f7 100644
--- a/lib/libc/powerpc64/gen/_setjmp.S
+++ b/lib/libc/powerpc64/gen/_setjmp.S
@@ -56,41 +56,23 @@ ENTRY(_setjmp)
mr %r10,%r1
mr %r9,%r2
std %r9,40 + 0*8(%r3)
- stfd %f14,40 + 23*8(%r3)
std %r10,40 + 1*8(%r3)
- stfd %f15,40 + 24*8(%r3)
std %r11,40 + 2*8(%r3)
- stfd %f16,40 + 25*8(%r3)
std %r12,40 + 3*8(%r3)
- stfd %f17,40 + 26*8(%r3)
std %r13,40 + 4*8(%r3)
- stfd %f18,40 + 27*8(%r3)
std %r14,40 + 5*8(%r3)
- stfd %f19,40 + 28*8(%r3)
std %r15,40 + 6*8(%r3)
- stfd %f20,40 + 29*8(%r3)
std %r16,40 + 7*8(%r3)
- stfd %f21,40 + 30*8(%r3)
std %r17,40 + 8*8(%r3)
- stfd %f22,40 + 31*8(%r3)
std %r18,40 + 9*8(%r3)
- stfd %f23,40 + 32*8(%r3)
std %r19,40 + 10*8(%r3)
- stfd %f24,40 + 33*8(%r3)
std %r20,40 + 11*8(%r3)
- stfd %f25,40 + 34*8(%r3)
std %r21,40 + 12*8(%r3)
- stfd %f26,40 + 35*8(%r3)
std %r22,40 + 13*8(%r3)
- stfd %f27,40 + 36*8(%r3)
std %r23,40 + 14*8(%r3)
- stfd %f28,40 + 37*8(%r3)
std %r24,40 + 15*8(%r3)
- stfd %f29,40 + 38*8(%r3)
std %r25,40 + 16*8(%r3)
- stfd %f30,40 + 39*8(%r3)
std %r26,40 + 17*8(%r3)
- stfd %f31,40 + 40*8(%r3)
std %r27,40 + 18*8(%r3)
std %r28,40 + 19*8(%r3)
std %r29,40 + 20*8(%r3)
@@ -102,41 +84,23 @@ END(_setjmp)
ENTRY(_longjmp)
ld %r9,40 + 0*8(%r3)
- lfd %f14,40 + 23*8(%r3)
ld %r10,40 + 1*8(%r3)
- lfd %f15,40 + 24*8(%r3)
ld %r11,40 + 2*8(%r3)
- lfd %f16,40 + 25*8(%r3)
ld %r12,40 + 3*8(%r3)
- lfd %f17,40 + 26*8(%r3)
ld %r14,40 + 5*8(%r3)
- lfd %f18,40 + 27*8(%r3)
ld %r15,40 + 6*8(%r3)
- lfd %f19,40 + 28*8(%r3)
ld %r16,40 + 7*8(%r3)
- lfd %f20,40 + 29*8(%r3)
ld %r17,40 + 8*8(%r3)
- lfd %f21,40 + 30*8(%r3)
ld %r18,40 + 9*8(%r3)
- lfd %f22,40 + 31*8(%r3)
ld %r19,40 + 10*8(%r3)
- lfd %f23,40 + 32*8(%r3)
ld %r20,40 + 11*8(%r3)
- lfd %f24,40 + 33*8(%r3)
ld %r21,40 + 12*8(%r3)
- lfd %f25,40 + 34*8(%r3)
ld %r22,40 + 13*8(%r3)
- lfd %f26,40 + 35*8(%r3)
ld %r23,40 + 14*8(%r3)
- lfd %f27,40 + 36*8(%r3)
ld %r24,40 + 15*8(%r3)
- lfd %f28,40 + 37*8(%r3)
ld %r25,40 + 16*8(%r3)
- lfd %f29,40 + 38*8(%r3)
ld %r26,40 + 17*8(%r3)
- lfd %f30,40 + 39*8(%r3)
ld %r27,40 + 18*8(%r3)
- lfd %f31,40 + 40*8(%r3)
ld %r28,40 + 19*8(%r3)
ld %r29,40 + 20*8(%r3)
ld %r30,40 + 21*8(%r3)
diff --git a/lib/libc/powerpc64/gen/getcontextx.c b/lib/libc/powerpc64/gen/getcontextx.c
new file mode 100644
index 0000000..54f8513
--- /dev/null
+++ b/lib/libc/powerpc64/gen/getcontextx.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2011 Konstantin Belousov <kib@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <errno.h>
+#include <stdlib.h>
+
+int
+__getcontextx_size(void)
+{
+
+ return (sizeof(ucontext_t));
+}
+
+int
+__fillcontextx2(char *ctx)
+{
+
+ return (0);
+}
+
+int
+__fillcontextx(char *ctx)
+{
+ ucontext_t *ucp;
+
+ ucp = (ucontext_t *)ctx;
+ return (getcontext(ucp));
+}
+
+__weak_reference(__getcontextx, getcontextx);
+
+ucontext_t *
+__getcontextx(void)
+{
+ char *ctx;
+ int error;
+
+ ctx = malloc(__getcontextx_size());
+ if (ctx == NULL)
+ return (NULL);
+ if (__fillcontextx(ctx) == -1) {
+ error = errno;
+ free(ctx);
+ errno = error;
+ return (NULL);
+ }
+ return ((ucontext_t *)ctx);
+}
diff --git a/lib/libc/powerpc64/gen/setjmp.S b/lib/libc/powerpc64/gen/setjmp.S
index 5eb395e..1495466 100644
--- a/lib/libc/powerpc64/gen/setjmp.S
+++ b/lib/libc/powerpc64/gen/setjmp.S
@@ -67,49 +67,29 @@ ENTRY(setjmp)
mr %r9,%r2 /* r9 <- global ptr */
std %r9,40 + 0*8(%r6)
- stfd %f14,40 + 23*8(%r6)
std %r10,40 + 1*8(%r6)
- stfd %f15,40 + 24*8(%r6)
std %r11,40 + 2*8(%r6)
- stfd %f16,40 + 25*8(%r6)
std %r12,40 + 3*8(%r6)
- stfd %f17,40 + 26*8(%r6)
std %r13,40 + 4*8(%r6)
- stfd %f18,40 + 27*8(%r6)
std %r14,40 + 5*8(%r6)
- stfd %f19,40 + 28*8(%r6)
std %r15,40 + 6*8(%r6)
- stfd %f20,40 + 29*8(%r6)
std %r16,40 + 7*8(%r6)
- stfd %f21,40 + 30*8(%r6)
std %r17,40 + 8*8(%r6)
- stfd %f22,40 + 31*8(%r6)
std %r18,40 + 9*8(%r6)
- stfd %f23,40 + 32*8(%r6)
std %r19,40 + 10*8(%r6)
- stfd %f24,40 + 33*8(%r6)
std %r20,40 + 11*8(%r6)
- stfd %f25,40 + 34*8(%r6)
std %r21,40 + 12*8(%r6)
- stfd %f26,40 + 35*8(%r6)
std %r22,40 + 13*8(%r6)
- stfd %f27,40 + 36*8(%r6)
std %r23,40 + 14*8(%r6)
- stfd %f28,40 + 37*8(%r6)
std %r24,40 + 15*8(%r6)
- stfd %f29,40 + 38*8(%r6)
std %r25,40 + 16*8(%r6)
- stfd %f30,40 + 39*8(%r6)
std %r26,40 + 17*8(%r6)
- stfd %f31,40 + 40*8(%r6)
std %r27,40 + 18*8(%r6)
std %r28,40 + 19*8(%r6)
std %r29,40 + 20*8(%r6)
std %r30,40 + 21*8(%r6)
std %r31,40 + 22*8(%r6)
- /* XXX Altivec regs */
-
li %r3,0 /* return (0) */
blr
END(setjmp)
@@ -117,41 +97,23 @@ END(setjmp)
WEAK_REFERENCE(__longjmp, longjmp)
ENTRY(__longjmp)
ld %r9,40 + 0*8(%r3)
- lfd %f14,40 + 23*8(%r3)
ld %r10,40 + 1*8(%r3)
- lfd %f15,40 + 24*8(%r3)
ld %r11,40 + 2*8(%r3)
- lfd %f16,40 + 25*8(%r3)
ld %r12,40 + 3*8(%r3)
- lfd %f17,40 + 26*8(%r3)
ld %r14,40 + 5*8(%r3)
- lfd %f18,40 + 27*8(%r3)
ld %r15,40 + 6*8(%r3)
- lfd %f19,40 + 28*8(%r3)
ld %r16,40 + 7*8(%r3)
- lfd %f20,40 + 29*8(%r3)
ld %r17,40 + 8*8(%r3)
- lfd %f21,40 + 30*8(%r3)
ld %r18,40 + 9*8(%r3)
- lfd %f22,40 + 31*8(%r3)
ld %r19,40 + 10*8(%r3)
- lfd %f23,40 + 32*8(%r3)
ld %r20,40 + 11*8(%r3)
- lfd %f24,40 + 33*8(%r3)
ld %r21,40 + 12*8(%r3)
- lfd %f25,40 + 34*8(%r3)
ld %r22,40 + 13*8(%r3)
- lfd %f26,40 + 35*8(%r3)
ld %r23,40 + 14*8(%r3)
- lfd %f27,40 + 36*8(%r3)
ld %r24,40 + 15*8(%r3)
- lfd %f28,40 + 37*8(%r3)
ld %r25,40 + 16*8(%r3)
- lfd %f29,40 + 38*8(%r3)
ld %r26,40 + 17*8(%r3)
- lfd %f30,40 + 39*8(%r3)
ld %r27,40 + 18*8(%r3)
- lfd %f31,40 + 40*8(%r3)
ld %r28,40 + 19*8(%r3)
ld %r29,40 + 20*8(%r3)
ld %r30,40 + 21*8(%r3)
diff --git a/lib/libc/powerpc64/gen/sigsetjmp.S b/lib/libc/powerpc64/gen/sigsetjmp.S
index c0648a6..5cfd684 100644
--- a/lib/libc/powerpc64/gen/sigsetjmp.S
+++ b/lib/libc/powerpc64/gen/sigsetjmp.S
@@ -72,41 +72,23 @@ ENTRY(sigsetjmp)
mr %r9,%r2
std %r9,40 + 0*8(%r6)
- stfd %f14,40 + 23*8(%r6)
std %r10,40 + 1*8(%r6)
- stfd %f15,40 + 24*8(%r6)
std %r11,40 + 2*8(%r6)
- stfd %f16,40 + 25*8(%r6)
std %r12,40 + 3*8(%r6)
- stfd %f17,40 + 26*8(%r6)
std %r13,40 + 4*8(%r6)
- stfd %f18,40 + 27*8(%r6)
std %r14,40 + 5*8(%r6)
- stfd %f19,40 + 28*8(%r6)
std %r15,40 + 6*8(%r6)
- stfd %f20,40 + 29*8(%r6)
std %r16,40 + 7*8(%r6)
- stfd %f21,40 + 30*8(%r6)
std %r17,40 + 8*8(%r6)
- stfd %f22,40 + 31*8(%r6)
std %r18,40 + 9*8(%r6)
- stfd %f23,40 + 32*8(%r6)
std %r19,40 + 10*8(%r6)
- stfd %f24,40 + 33*8(%r6)
std %r20,40 + 11*8(%r6)
- stfd %f25,40 + 34*8(%r6)
std %r21,40 + 12*8(%r6)
- stfd %f26,40 + 35*8(%r6)
std %r22,40 + 13*8(%r6)
- stfd %f27,40 + 36*8(%r6)
std %r23,40 + 14*8(%r6)
- stfd %f28,40 + 37*8(%r6)
std %r24,40 + 15*8(%r6)
- stfd %f29,40 + 38*8(%r6)
std %r25,40 + 16*8(%r6)
- stfd %f30,40 + 39*8(%r6)
std %r26,40 + 17*8(%r6)
- stfd %f31,40 + 40*8(%r6)
std %r27,40 + 18*8(%r6)
std %r28,40 + 19*8(%r6)
std %r29,40 + 20*8(%r6)
@@ -119,41 +101,23 @@ END(sigsetjmp)
ENTRY(siglongjmp)
ld %r9,40 + 0*8(%r3)
- lfd %f14,40 + 23*8(%r3)
ld %r10,40 + 1*8(%r3)
- lfd %f15,40 + 24*8(%r3)
ld %r11,40 + 2*8(%r3)
- lfd %f16,40 + 25*8(%r3)
ld %r12,40 + 3*8(%r3)
- lfd %f17,40 + 26*8(%r3)
ld %r14,40 + 5*8(%r3)
- lfd %f18,40 + 27*8(%r3)
ld %r15,40 + 6*8(%r3)
- lfd %f19,40 + 28*8(%r3)
ld %r16,40 + 7*8(%r3)
- lfd %f20,40 + 29*8(%r3)
ld %r17,40 + 8*8(%r3)
- lfd %f21,40 + 30*8(%r3)
ld %r18,40 + 9*8(%r3)
- lfd %f22,40 + 31*8(%r3)
ld %r19,40 + 10*8(%r3)
- lfd %f23,40 + 32*8(%r3)
ld %r20,40 + 11*8(%r3)
- lfd %f24,40 + 33*8(%r3)
ld %r21,40 + 12*8(%r3)
- lfd %f25,40 + 34*8(%r3)
ld %r22,40 + 13*8(%r3)
- lfd %f26,40 + 35*8(%r3)
ld %r23,40 + 14*8(%r3)
- lfd %f27,40 + 36*8(%r3)
ld %r24,40 + 15*8(%r3)
- lfd %f28,40 + 37*8(%r3)
ld %r25,40 + 16*8(%r3)
- lfd %f29,40 + 38*8(%r3)
ld %r26,40 + 17*8(%r3)
- lfd %f30,40 + 39*8(%r3)
ld %r27,40 + 18*8(%r3)
- lfd %f31,40 + 40*8(%r3)
ld %r28,40 + 19*8(%r3)
ld %r29,40 + 20*8(%r3)
ld %r30,40 + 21*8(%r3)
diff --git a/lib/libc/powerpc64/sys/Makefile.inc b/lib/libc/powerpc64/sys/Makefile.inc
index 98ec888..ad98ba1 100644
--- a/lib/libc/powerpc64/sys/Makefile.inc
+++ b/lib/libc/powerpc64/sys/Makefile.inc
@@ -6,3 +6,6 @@ MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o
PSEUDO= _getlogin.o _exit.o
+.if ${MK_SYSCALL_COMPAT} != "no"
+PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
+.endif
diff --git a/lib/libc/powerpc64/sys/__vdso_gettc.c b/lib/libc/powerpc64/sys/__vdso_gettc.c
new file mode 100644
index 0000000..b99bbc4
--- /dev/null
+++ b/lib/libc/powerpc64/sys/__vdso_gettc.c
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/vdso.h>
+#include <errno.h>
+
+#pragma weak __vdso_gettc
+u_int
+__vdso_gettc(const struct vdso_timehands *th)
+{
+
+ return (0);
+}
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
+
+ return (ENOSYS);
+}
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c
index 436370d..589bb9d 100644
--- a/lib/libc/regex/engine.c
+++ b/lib/libc/regex/engine.c
@@ -157,7 +157,7 @@ matcher(struct re_guts *g,
int i;
struct match mv;
struct match *m = &mv;
- const char *dp = NULL;
+ const char *dp;
const sopno gf = g->firststate+1; /* +1 for OEND */
const sopno gl = g->laststate;
const char *start;
@@ -244,7 +244,7 @@ matcher(struct re_guts *g,
ZAPSTATE(&m->mbs);
/* Adjust start according to moffset, to speed things up */
- if (dp != NULL && g->moffset > -1)
+ if (g->moffset > -1)
start = ((dp - g->moffset) < start) ? start : dp - g->moffset;
SP("mloop", m->st, *start);
diff --git a/lib/libc/regex/re_format.7 b/lib/libc/regex/re_format.7
index b3f9561..05b1494 100644
--- a/lib/libc/regex/re_format.7
+++ b/lib/libc/regex/re_format.7
@@ -314,10 +314,10 @@ compatible with but not specified by
.St -p1003.2 ,
and should be used with
caution in software intended to be portable to other systems.
-The additional word delimiters
+The additional word delimiters
.Ql \e<
and
-.Ql \e>
+.Ql \e>
are provided to ease compatibility with traditional
.Xr svr4 4
systems but are not portable and should be avoided.
@@ -392,12 +392,10 @@ and
.Ql ?\&
are ordinary characters, and their functionality
can be expressed using bounds
-.Po
-.Ql {1,}
+.No ( Ql {1,}
or
.Ql {0,1}
-respectively
-.Pc .
+respectively).
Also note that
.Ql x+
in modern REs is equivalent to
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index 2f2d827..a01bb95 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -192,7 +192,6 @@ regcomp(regex_t * __restrict preg,
struct parse *p = &pa;
int i;
size_t len;
- size_t maxlen;
#ifdef REDEBUG
# define GOODFLAGS(f) (f)
#else
@@ -214,23 +213,7 @@ regcomp(regex_t * __restrict preg,
g = (struct re_guts *)malloc(sizeof(struct re_guts));
if (g == NULL)
return(REG_ESPACE);
- /*
- * Limit the pattern space to avoid a 32-bit overflow on buffer
- * extension. Also avoid any signed overflow in case of conversion
- * so make the real limit based on a 31-bit overflow.
- *
- * Likely not applicable on 64-bit systems but handle the case
- * generically (who are we to stop people from using ~715MB+
- * patterns?).
- */
- maxlen = ((size_t)-1 >> 1) / sizeof(sop) * 2 / 3;
- if (len >= maxlen) {
- free((char *)g);
- return(REG_ESPACE);
- }
p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */
- assert(p->ssize >= len);
-
p->strip = (sop *)malloc(p->ssize * sizeof(sop));
p->slen = 0;
if (p->strip == NULL) {
@@ -1422,8 +1405,8 @@ static void
findmust(struct parse *p, struct re_guts *g)
{
sop *scan;
- sop *start = NULL;
- sop *newstart = NULL;
+ sop *start;
+ sop *newstart;
sopno newlen;
sop s;
char *cp;
@@ -1726,17 +1709,15 @@ computematchjumps(struct parse *p, struct re_guts *g)
if (p->error != 0)
return;
- pmatches = (int*) malloc(g->mlen * sizeof(int));
+ pmatches = (int*) malloc(g->mlen * sizeof(unsigned int));
if (pmatches == NULL) {
g->matchjump = NULL;
return;
}
- g->matchjump = (int*) malloc(g->mlen * sizeof(int));
- if (g->matchjump == NULL) { /* Not a fatal error */
- free(pmatches);
+ g->matchjump = (int*) malloc(g->mlen * sizeof(unsigned int));
+ if (g->matchjump == NULL) /* Not a fatal error */
return;
- }
/* Set maximum possible jump for each character in the pattern */
for (mindex = 0; mindex < g->mlen; mindex++)
diff --git a/lib/libc/regex/regex.3 b/lib/libc/regex/regex.3
index 6df2f09..ea1ba25 100644
--- a/lib/libc/regex/regex.3
+++ b/lib/libc/regex/regex.3
@@ -420,12 +420,10 @@ it should have been the result from the most recent
using that
.Ft regex_t .
The
-.Po
-.Fn regerror
+.Fn ( regerror
may be able to supply a more detailed message using information
from the
-.Ft regex_t .
-.Pc
+.Ft regex_t . )
The
.Fn regerror
function
diff --git a/lib/libc/rpc/clnt_dg.c b/lib/libc/rpc/clnt_dg.c
index cebbaf9..5feab88 100644
--- a/lib/libc/rpc/clnt_dg.c
+++ b/lib/libc/rpc/clnt_dg.c
@@ -327,7 +327,7 @@ clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
struct sockaddr *sa;
sigset_t mask;
sigset_t newmask;
- socklen_t salen;
+ socklen_t inlen, salen;
ssize_t recvlen = 0;
int kin_len, n, rpc_lock_value;
u_int32_t xid;
@@ -520,6 +520,7 @@ get_reply:
goto call_again_same_xid;
}
}
+ inlen = (socklen_t)recvlen;
/*
* now decode and validate the response
diff --git a/lib/libc/rpc/crypt_client.c b/lib/libc/rpc/crypt_client.c
index 5290021..4e5c793 100644
--- a/lib/libc/rpc/crypt_client.c
+++ b/lib/libc/rpc/crypt_client.c
@@ -64,7 +64,6 @@ _des_crypt_call(buf, len, dparms)
}
if (nconf == NULL) {
warnx("getnetconfig: %s", nc_sperror());
- endnetconfig(localhandle);
return(DESERR_HWERROR);
}
clnt = clnt_tp_create(NULL, CRYPT_PROG, CRYPT_VERS, nconf);
diff --git a/lib/libc/rpc/rpc.3 b/lib/libc/rpc/rpc.3
index 988b5f1..4fa3e2c 100644
--- a/lib/libc/rpc/rpc.3
+++ b/lib/libc/rpc/rpc.3
@@ -504,6 +504,7 @@ pages on which they are described:
.Sh SEE ALSO
.Xr getnetconfig 3 ,
.Xr getnetpath 3 ,
+.Xr rpcbind 3 ,
.Xr rpc_clnt_auth 3 ,
.Xr rpc_clnt_calls 3 ,
.Xr rpc_clnt_create 3 ,
@@ -512,6 +513,5 @@ pages on which they are described:
.Xr rpc_svc_err 3 ,
.Xr rpc_svc_reg 3 ,
.Xr rpc_xdr 3 ,
-.Xr rpcbind 3 ,
.Xr xdr 3 ,
.Xr netconfig 5
diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c
index febc597..d7702f5 100644
--- a/lib/libc/rpc/rpc_soc.c
+++ b/lib/libc/rpc/rpc_soc.c
@@ -462,10 +462,12 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
u_int recvsz;
{
struct netbuf *svcaddr;
+ struct netconfig *nconf;
CLIENT *cl;
int len;
cl = NULL;
+ nconf = NULL;
svcaddr = NULL;
if ((raddr->sun_len == 0) ||
((svcaddr = malloc(sizeof(struct netbuf))) == NULL ) ||
diff --git a/lib/libc/rpc/rpc_svc_reg.3 b/lib/libc/rpc/rpc_svc_reg.3
index 81a749a..aed2ba1 100644
--- a/lib/libc/rpc/rpc_svc_reg.3
+++ b/lib/libc/rpc/rpc_svc_reg.3
@@ -176,8 +176,8 @@ Service implementors usually do not need this routine.
.Sh SEE ALSO
.Xr select 2 ,
.Xr rpc 3 ,
+.Xr rpcbind 3 ,
.Xr rpc_svc_calls 3 ,
.Xr rpc_svc_create 3 ,
.Xr rpc_svc_err 3 ,
-.Xr rpcbind 3 ,
.Xr rpcbind 8
diff --git a/lib/libc/rpc/rpcbind.3 b/lib/libc/rpc/rpcbind.3
index 3bf8be9..0b716ca 100644
--- a/lib/libc/rpc/rpcbind.3
+++ b/lib/libc/rpc/rpcbind.3
@@ -25,7 +25,7 @@
.Ft bool_t
.Fn rpcb_gettime "const char *host" "time_t * timep"
.Ft "enum clnt_stat"
-.Fn rpcb_rmtcall "const struct netconfig *netconf" "const char *host" "const rpcprog_t prognum" "const rpcvers_t versnum" "const rpcproc_t procnum" "const xdrproc_t inproc" "const caddr_t in" "const xdrproc_t outproc" "const caddr_t out" "const struct timeval tout" "const struct netbuf *svcaddr"
+.Fn rpcb_rmtcall "const struct netconfig *netconf" "const char *host" "const rpcprog_t prognum, const rpcvers_t versnum" "const rpcproc_t procnum, const xdrproc_t inproc" "const caddr_t in" "const xdrproc_t outproc" "const caddr_t out" "const struct timeval tout, const struct netbuf *svcaddr"
.Ft bool_t
.Fn rpcb_set "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" "const struct netbuf *svcaddr"
.Ft bool_t
diff --git a/lib/libc/rpc/svc_vc.c b/lib/libc/rpc/svc_vc.c
index aa45396..f830425 100644
--- a/lib/libc/rpc/svc_vc.c
+++ b/lib/libc/rpc/svc_vc.c
@@ -128,7 +128,7 @@ svc_vc_create(fd, sendsize, recvsize)
u_int sendsize;
u_int recvsize;
{
- SVCXPRT *xprt = NULL;
+ SVCXPRT *xprt;
struct cf_rendezvous *r = NULL;
struct __rpc_sockinfo si;
struct sockaddr_storage sslocal;
diff --git a/lib/libc/sparc64/Makefile.inc b/lib/libc/sparc64/Makefile.inc
index 74fb7cd..af23ae4 100644
--- a/lib/libc/sparc64/Makefile.inc
+++ b/lib/libc/sparc64/Makefile.inc
@@ -5,7 +5,7 @@
.include "fpu/Makefile.inc"
-SRCS+= trivial-vdso_tc.c
+SRCS+= __vdso_gettc.c
# Long double is quad precision
GDTOASRCS+=strtorQ.c
diff --git a/lib/libc/sparc64/gen/Makefile.inc b/lib/libc/sparc64/gen/Makefile.inc
index 5442a33..d3fbfe4 100644
--- a/lib/libc/sparc64/gen/Makefile.inc
+++ b/lib/libc/sparc64/gen/Makefile.inc
@@ -2,6 +2,5 @@
SRCS+= _ctx_start.S _setjmp.S fabs.S fixunsdfsi.S flt_rounds.c fpgetmask.c \
fpgetround.c fpgetsticky.c fpsetmask.c fpsetround.c \
- infinity.c ldexp.c makecontext.c \
- signalcontext.c setjmp.S sigsetjmp.S _set_tp.c \
- trivial-getcontextx.c
+ getcontextx.c infinity.c ldexp.c makecontext.c \
+ signalcontext.c setjmp.S sigsetjmp.S _set_tp.c
diff --git a/lib/libc/sparc64/gen/getcontextx.c b/lib/libc/sparc64/gen/getcontextx.c
new file mode 100644
index 0000000..54f8513
--- /dev/null
+++ b/lib/libc/sparc64/gen/getcontextx.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2011 Konstantin Belousov <kib@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <errno.h>
+#include <stdlib.h>
+
+int
+__getcontextx_size(void)
+{
+
+ return (sizeof(ucontext_t));
+}
+
+int
+__fillcontextx2(char *ctx)
+{
+
+ return (0);
+}
+
+int
+__fillcontextx(char *ctx)
+{
+ ucontext_t *ucp;
+
+ ucp = (ucontext_t *)ctx;
+ return (getcontext(ucp));
+}
+
+__weak_reference(__getcontextx, getcontextx);
+
+ucontext_t *
+__getcontextx(void)
+{
+ char *ctx;
+ int error;
+
+ ctx = malloc(__getcontextx_size());
+ if (ctx == NULL)
+ return (NULL);
+ if (__fillcontextx(ctx) == -1) {
+ error = errno;
+ free(ctx);
+ errno = error;
+ return (NULL);
+ }
+ return ((ucontext_t *)ctx);
+}
diff --git a/lib/libc/sparc64/sys/Makefile.inc b/lib/libc/sparc64/sys/Makefile.inc
index a62aac2..031af19 100644
--- a/lib/libc/sparc64/sys/Makefile.inc
+++ b/lib/libc/sparc64/sys/Makefile.inc
@@ -12,9 +12,12 @@ SRCS+= __sparc_sigtramp_setup.c \
CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu
-MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction1.S
+MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction.S
# Don't generate default code for these syscalls:
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o
PSEUDO= _getlogin.o _exit.o
+.if ${MK_SYSCALL_COMPAT} != "no"
+PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
+.endif
diff --git a/lib/libc/sparc64/sys/__vdso_gettc.c b/lib/libc/sparc64/sys/__vdso_gettc.c
new file mode 100644
index 0000000..b99bbc4
--- /dev/null
+++ b/lib/libc/sparc64/sys/__vdso_gettc.c
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/vdso.h>
+#include <errno.h>
+
+#pragma weak __vdso_gettc
+u_int
+__vdso_gettc(const struct vdso_timehands *th)
+{
+
+ return (0);
+}
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
+
+ return (ENOSYS);
+}
diff --git a/lib/libc/sparc64/sys/sigaction1.S b/lib/libc/sparc64/sys/sigaction.S
index 219a238..7d32f97 100644
--- a/lib/libc/sparc64/sys/sigaction1.S
+++ b/lib/libc/sparc64/sys/sigaction.S
@@ -29,8 +29,7 @@ __FBSDID("$FreeBSD$");
#include "SYS.h"
- WEAK_REFERENCE(__sys_sigaction, _sigaction)
-ENTRY(__sys_sigaction)
+_SYSENTRY(sigaction)
PIC_PROLOGUE(%o3, %o4)
SET(sigcode_installed, %o4, %o3)
lduw [%o3], %o4
@@ -45,6 +44,6 @@ ENTRY(__sys_sigaction)
1: _SYSCALL(sigaction)
retl
nop
-END(__sys_sigaction)
+_SYSEND(sigaction)
.comm sigcode_installed, 4, 4
diff --git a/lib/libc/stdio/fflush.c b/lib/libc/stdio/fflush.c
index 123167a..ef9b45b 100644
--- a/lib/libc/stdio/fflush.c
+++ b/lib/libc/stdio/fflush.c
@@ -124,13 +124,11 @@ __sflush(FILE *fp)
t = _swrite(fp, (char *)p, n);
if (t <= 0) {
/* Reset _p and _w. */
- if (p > fp->_p) {
- /* Some was written. */
+ if (p > fp->_p) /* Some was written. */
memmove(fp->_p, p, n);
- fp->_p += n;
- if ((fp->_flags & (__SLBF | __SNBF)) == 0)
- fp->_w -= n;
- }
+ fp->_p += n;
+ if ((fp->_flags & (__SLBF | __SNBF)) == 0)
+ fp->_w -= n;
fp->_flags |= __SERR;
return (EOF);
}
diff --git a/lib/libc/stdio/flags.c b/lib/libc/stdio/flags.c
index 9eed6d7..b7552a4 100644
--- a/lib/libc/stdio/flags.c
+++ b/lib/libc/stdio/flags.c
@@ -97,10 +97,6 @@ __sflags(const char *mode, int *optr)
/* set close-on-exec */
o |= O_CLOEXEC;
break;
- case 'v':
- /* verify */
- o |= O_VERIFY;
- break;
default:
known = 0;
break;
diff --git a/lib/libc/stdio/open_memstream.3 b/lib/libc/stdio/open_memstream.3
index e01952b..117dcb2 100644
--- a/lib/libc/stdio/open_memstream.3
+++ b/lib/libc/stdio/open_memstream.3
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2013 Hudson River Trading LLC
+.\" Copyright (c) 2013 Advanced Computing Technologies LLC
.\" Written by: John H. Baldwin <jhb@FreeBSD.org>
.\" All rights reserved.
.\"
diff --git a/lib/libc/stdio/open_memstream.c b/lib/libc/stdio/open_memstream.c
index baa71e4..aa50822 100644
--- a/lib/libc/stdio/open_memstream.c
+++ b/lib/libc/stdio/open_memstream.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2013 Hudson River Trading LLC
+ * Copyright (c) 2013 Advanced Computing Technologies LLC
* Written by: John H. Baldwin <jhb@FreeBSD.org>
* All rights reserved.
*
diff --git a/lib/libc/stdio/open_wmemstream.c b/lib/libc/stdio/open_wmemstream.c
index 299e3d8..cf2968a 100644
--- a/lib/libc/stdio/open_wmemstream.c
+++ b/lib/libc/stdio/open_wmemstream.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2013 Hudson River Trading LLC
+ * Copyright (c) 2013 Advanced Computing Technologies LLC
* Written by: John H. Baldwin <jhb@FreeBSD.org>
* All rights reserved.
*
diff --git a/lib/libc/stdio/xprintf_float.c b/lib/libc/stdio/xprintf_float.c
index ad17eb2..b719aac 100644
--- a/lib/libc/stdio/xprintf_float.c
+++ b/lib/libc/stdio/xprintf_float.c
@@ -168,6 +168,7 @@ __printf_render_float(struct __printf_io *io, const struct printf_info *pi, cons
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 */
char *decimal_point; /* locale specific decimal point */
int n2; /* XXX: for PRINTANDPAD */
@@ -343,6 +344,8 @@ here:
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);
diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc
index 7cee03a..57205a7 100644
--- a/lib/libc/stdlib/Makefile.inc
+++ b/lib/libc/stdlib/Makefile.inc
@@ -10,8 +10,7 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \
merge.c mergesort_b.c ptsname.c qsort.c qsort_r.c quick_exit.c \
radixsort.c rand.c \
- random.c reallocarray.c reallocf.c realpath.c remque.c strfmon.c \
- strtoimax.c \
+ random.c reallocf.c realpath.c remque.c strfmon.c strtoimax.c \
strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \
strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c
@@ -26,7 +25,7 @@ MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 \
hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 llabs.3 lldiv.3 \
lsearch.3 memory.3 ptsname.3 qsort.3 \
quick_exit.3 \
- radixsort.3 rand.3 random.3 reallocarray.3 reallocf.3 \
+ radixsort.3 rand.3 random.3 reallocf.3 \
realpath.3 strfmon.3 strtod.3 strtol.3 strtonum.3 strtoul.3 system.3 \
tsearch.3
diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map
index 782023e..8355f9a 100644
--- a/lib/libc/stdlib/Symbol.map
+++ b/lib/libc/stdlib/Symbol.map
@@ -113,11 +113,9 @@ FBSD_1.4 {
hcreate_r;
hdestroy_r;
hsearch_r;
- reallocarray;
};
FBSDprivate_1.0 {
__system;
_system;
- __libc_system;
};
diff --git a/lib/libc/stdlib/atexit.3 b/lib/libc/stdlib/atexit.3
index 3cdc59f..68f4e8f 100644
--- a/lib/libc/stdlib/atexit.3
+++ b/lib/libc/stdlib/atexit.3
@@ -88,12 +88,12 @@ The existing list of functions is unmodified.
.It Bq Er ENOSYS
The
.Fn atexit_b
-function was called by a program that did not supply a
+function was called by a program that did not supply a
.Fn _Block_copy
implementation.
.El
.Sh SEE ALSO
-.Xr at_quick_exit 3 ,
+.Xr at_quick_exit 3
.Xr exit 3
.Sh STANDARDS
The
diff --git a/lib/libc/stdlib/exit.3 b/lib/libc/stdlib/exit.3
index 7d657c9..07ce0d7 100644
--- a/lib/libc/stdlib/exit.3
+++ b/lib/libc/stdlib/exit.3
@@ -117,8 +117,8 @@ never return.
.Sh SEE ALSO
.Xr _exit 2 ,
.Xr wait 2 ,
-.Xr at_quick_exit 3 ,
.Xr atexit 3 ,
+.Xr at_quick_exit 3 ,
.Xr intro 3 ,
.Xr quick_exit 3 ,
.Xr sysexits 3 ,
diff --git a/lib/libc/stdlib/jemalloc/Symbol.map b/lib/libc/stdlib/jemalloc/Symbol.map
index 132664a..35a5dad 100644
--- a/lib/libc/stdlib/jemalloc/Symbol.map
+++ b/lib/libc/stdlib/jemalloc/Symbol.map
@@ -55,5 +55,4 @@ FBSDprivate_1.0 {
_malloc_thread_cleanup;
_malloc_prefork;
_malloc_postfork;
- _malloc_first_thread;
};
diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c
index e97ea92..93e22cd 100644
--- a/lib/libc/stdlib/qsort.c
+++ b/lib/libc/stdlib/qsort.c
@@ -41,55 +41,47 @@ typedef int cmp_t(void *, const void *, const void *);
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 *, int, int, int);
+static inline void swapfunc(char *, char *, int, int);
-#define MIN(a, b) ((a) < (b) ? a : b)
+#define min(a, b) (a) < (b) ? a : b
/*
* 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); \
+#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); \
+ } 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;
+#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_long, swaptype_int)
+swapfunc(a, b, n, swaptype)
char *a, *b;
- int n, swaptype_long, swaptype_int;
+ int n, swaptype;
{
- if (swaptype_long <= 1)
+ if(swaptype <= 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) { \
+#define swap(a, b) \
+ if (swaptype == 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)
+ swapfunc(a, b, es, swaptype)
-#define vecswap(a, b, n) \
- if ((n) > 0) swapfunc(a, b, n, swaptype_long, swaptype_int)
+#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype)
#ifdef I_AM_QSORT_R
#define CMP(t, x, y) (cmp((t), (x), (y)))
@@ -106,14 +98,14 @@ __unused
{
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 ));
+ :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
}
#ifdef I_AM_QSORT_R
void
qsort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp)
#else
-#define thunk NULL
+#define thunk NULL
void
qsort(void *a, size_t n, size_t es, cmp_t *cmp)
#endif
@@ -121,10 +113,9 @@ qsort(void *a, size_t n, size_t es, cmp_t *cmp)
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
size_t d, r;
int cmp_result;
- int swaptype_long, swaptype_int, swap_cnt;
+ int swaptype, swap_cnt;
-loop: SWAPINIT(long, a, es);
- SWAPINIT(int, a, es);
+loop: SWAPINIT(a, es);
swap_cnt = 0;
if (n < 7) {
for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
@@ -184,9 +175,9 @@ loop: SWAPINIT(long, a, es);
}
pn = (char *)a + n * es;
- r = MIN(pa - (char *)a, pb - pa);
+ r = min(pa - (char *)a, pb - pa);
vecswap(a, pb - r, r);
- r = MIN(pd - pc, pn - pd - es);
+ r = min(pd - pc, pn - pd - es);
vecswap(pb, pn - r, r);
if ((r = pb - pa) > es)
#ifdef I_AM_QSORT_R
diff --git a/lib/libc/stdlib/quick_exit.3 b/lib/libc/stdlib/quick_exit.3
index 7bbd2f3..f2ea379 100644
--- a/lib/libc/stdlib/quick_exit.3
+++ b/lib/libc/stdlib/quick_exit.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 13, 2014
+.Dd December 7, 2011
.Dt QUICK_EXIT 3
.Os
.Sh NAME
@@ -35,7 +35,7 @@
.Sh SYNOPSIS
.In stdlib.h
.Ft _Noreturn void
-.Fn quick_exit "int status"
+.Fn quick_exit "void"
.Sh DESCRIPTION
The
.Fn quick_exit
diff --git a/lib/libc/stdlib/random.3 b/lib/libc/stdlib/random.3
index 254be0a..dc8e961 100644
--- a/lib/libc/stdlib/random.3
+++ b/lib/libc/stdlib/random.3
@@ -54,8 +54,9 @@
.Fn setstate "char *state"
.Sh DESCRIPTION
.Bf -symbolic
-The functions described in this manual page are not secure.
-Applications which require unpredictable random numbers should use
+The functions described in this manual page are not cryptographically
+secure.
+Cryptographic applications should use
.Xr arc4random 3
instead.
.Ef
diff --git a/lib/libc/stdlib/reallocarray.3 b/lib/libc/stdlib/reallocarray.3
deleted file mode 100644
index 8e714f4..0000000
--- a/lib/libc/stdlib/reallocarray.3
+++ /dev/null
@@ -1,142 +0,0 @@
-.\" 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.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (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 May 1, 2015
-.Dt REALLOCARRAY 3
-.Os
-.Sh NAME
-.Nm reallocarray
-.Nd memory reallocation function
-.Sh LIBRARY
-.Lb libc
-.Sh SYNOPSIS
-.In stdlib.h
-.Ft void *
-.Fn reallocarray "void *ptr" "size_t nmemb" "size_t size"
-.Sh DESCRIPTION
-The
-.Fn reallocarray
-function is similar to the
-.Fn realloc
-function
-except it operates on
-.Fa nmemb
-members of size
-.Fa size
-and checks for integer overflow in the calculation
-.Fa nmemb
-*
-.Fa size .
-.Sh RETURN VALUES
-The
-.Fn reallocarray
-function returns a pointer to the allocated space; otherwise, a
-.Dv NULL
-pointer is returned and
-.Va errno
-is set to
-.Er ENOMEM .
-.Sh EXAMPLES
-Consider
-.Fn reallocarray
-when there is multiplication in the
-.Fa size
-argument of
-.Fn malloc
-or
-.Fn realloc .
-For example, avoid this common idiom as it may lead to integer overflow:
-.Bd -literal -offset indent
-if ((p = malloc(num * size)) == NULL)
- err(1, "malloc");
-.Ed
-.Pp
-A drop-in replacement is the
-.Ox
-extension
-.Fn reallocarray :
-.Bd -literal -offset indent
-if ((p = reallocarray(NULL, num, size)) == NULL)
- err(1, "reallocarray");
-.Ed
-.Pp
-When using
-.Fn realloc ,
-be careful to avoid the following idiom:
-.Bd -literal -offset indent
-size += 50;
-if ((p = realloc(p, size)) == NULL)
- return (NULL);
-.Ed
-.Pp
-Do not adjust the variable describing how much memory has been allocated
-until the allocation has been successful.
-This can cause aberrant program behavior if the incorrect size value is used.
-In most cases, the above sample will also result in a leak of memory.
-As stated earlier, a return value of
-.Dv NULL
-indicates that the old object still remains allocated.
-Better code looks like this:
-.Bd -literal -offset indent
-newsize = size + 50;
-if ((newp = realloc(p, newsize)) == NULL) {
- free(p);
- p = NULL;
- size = 0;
- return (NULL);
-}
-p = newp;
-size = newsize;
-.Ed
-.Pp
-As with
-.Fn malloc ,
-it is important to ensure the new size value will not overflow;
-i.e. avoid allocations like the following:
-.Bd -literal -offset indent
-if ((newp = realloc(p, num * size)) == NULL) {
- ...
-.Ed
-.Pp
-Instead, use
-.Fn reallocarray :
-.Bd -literal -offset indent
-if ((newp = reallocarray(p, num, size)) == NULL) {
- ...
-.Ed
-.Sh SEE ALSO
-.Xr realloc 3
-.Sh HISTORY
-The
-.Fn reallocarray
-function first appeared in
-.Ox 5.6
-and
-.Fx 11.0 .
diff --git a/lib/libc/stdlib/reallocarray.c b/lib/libc/stdlib/reallocarray.c
deleted file mode 100644
index e1e9b7c..0000000
--- a/lib/libc/stdlib/reallocarray.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* $OpenBSD: reallocarray.c,v 1.2 2014/12/08 03:45:00 bcook Exp $ */
-/*
- * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
- *
- * 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 <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <errno.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-/*
- * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
- * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
- */
-#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
-
-void *
-reallocarray(void *optr, size_t nmemb, size_t size)
-{
-
- if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
- nmemb > 0 && SIZE_MAX / nmemb < size) {
- errno = ENOMEM;
- return (NULL);
- }
- return (realloc(optr, size * nmemb));
-}
diff --git a/lib/libc/stdlib/system.c b/lib/libc/stdlib/system.c
index bd9ea5a..e018e6f 100644
--- a/lib/libc/stdlib/system.c
+++ b/lib/libc/stdlib/system.c
@@ -46,17 +46,8 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
#include "libc_private.h"
-#pragma weak system
int
-system(const char *command)
-{
-
- return (((int (*)(const char *))
- __libc_interposing[INTERPOS_system])(command));
-}
-
-int
-__libc_system(const char *command)
+__system(const char *command)
{
pid_t pid, savedpid;
int pstat;
@@ -104,5 +95,5 @@ __libc_system(const char *command)
return(pid == -1 ? -1 : pstat);
}
-__weak_reference(__libc_system, __system);
-__weak_reference(__libc_system, _system);
+__weak_reference(__system, system);
+__weak_reference(__system, _system);
diff --git a/lib/libc/stdlib/tdelete.c b/lib/libc/stdlib/tdelete.c
index bef187e..c83afb8 100644
--- a/lib/libc/stdlib/tdelete.c
+++ b/lib/libc/stdlib/tdelete.c
@@ -14,7 +14,7 @@
#include <sys/cdefs.h>
#if 0
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: tdelete.c,v 1.6 2012/06/25 22:32:45 abs Exp $");
+__RCSID("$NetBSD: tdelete.c,v 1.2 1999/09/16 11:45:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
__FBSDID("$FreeBSD$");
@@ -25,9 +25,9 @@ __FBSDID("$FreeBSD$");
/*
- * find a node with given key
+ * delete node with given key
*
- * vkey: key to be found
+ * vkey: key to be deleted
* vrootp: address of the root of the tree
* compar: function to carry out node comparisons
*/
@@ -65,8 +65,7 @@ tdelete(const void * __restrict vkey, void ** __restrict vrootp,
q->rlink = (*rootp)->rlink;
}
}
- if (p != *rootp)
- free(*rootp); /* D4: Free node */
+ free(*rootp); /* D4: Free node */
*rootp = q; /* link parent to new node */
return p;
}
diff --git a/lib/libc/string/strlcat.c b/lib/libc/string/strlcat.c
index f5ed6c6..2d13be7 100644
--- a/lib/libc/string/strlcat.c
+++ b/lib/libc/string/strlcat.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: strlcat.c,v 1.15 2015/03/02 21:41:08 millert Exp $ */
+/* $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */
/*
- * Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -23,36 +23,36 @@ __FBSDID("$FreeBSD$");
#include <string.h>
/*
- * Appends src to string dst of size dsize (unlike strncat, dsize is the
- * full size of dst, not space left). At most dsize-1 characters
- * will be copied. Always NUL terminates (unless dsize <= strlen(dst)).
- * Returns strlen(src) + MIN(dsize, strlen(initial dst)).
- * If retval >= dsize, truncation occurred.
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left). At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
*/
size_t
-strlcat(char * __restrict dst, const char * __restrict src, size_t dsize)
+strlcat(char * __restrict dst, const char * __restrict src, size_t siz)
{
- const char *odst = dst;
- const char *osrc = src;
- size_t n = dsize;
+ char *d = dst;
+ const char *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 (n-- != 0 && *dst != '\0')
- dst++;
- dlen = dst - odst;
- n = dsize - dlen;
+ /* Find the end of dst and adjust bytes left but don't go past end */
+ while (n-- != 0 && *d != '\0')
+ d++;
+ dlen = d - dst;
+ n = siz - dlen;
- if (n-- == 0)
- return(dlen + strlen(src));
- while (*src != '\0') {
- if (n != 0) {
- *dst++ = *src;
+ if (n == 0)
+ return(dlen + strlen(s));
+ while (*s != '\0') {
+ if (n != 1) {
+ *d++ = *s;
n--;
}
- src++;
+ s++;
}
- *dst = '\0';
+ *d = '\0';
- return(dlen + (src - osrc)); /* count does not include NUL */
+ return(dlen + (s - src)); /* count does not include NUL */
}
diff --git a/lib/libc/string/strlcpy.c b/lib/libc/string/strlcpy.c
index 019d231..451b6df 100644
--- a/lib/libc/string/strlcpy.c
+++ b/lib/libc/string/strlcpy.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: strlcpy.c,v 1.12 2015/01/15 03:54:12 millert Exp $ */
+/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */
/*
- * Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -23,31 +23,32 @@ __FBSDID("$FreeBSD$");
#include <string.h>
/*
- * Copy string src to buffer dst of size dsize. At most dsize-1
- * chars will be copied. Always NUL terminates (unless dsize == 0).
- * Returns strlen(src); if retval >= dsize, truncation occurred.
+ * Copy src to string dst of size siz. At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
*/
size_t
-strlcpy(char * __restrict dst, const char * __restrict src, size_t dsize)
+strlcpy(char * __restrict dst, const char * __restrict src, size_t siz)
{
- const char *osrc = src;
- size_t nleft = dsize;
+ char *d = dst;
+ const char *s = src;
+ size_t n = siz;
- /* Copy as many bytes as will fit. */
- if (nleft != 0) {
- while (--nleft != 0) {
- if ((*dst++ = *src++) == '\0')
+ /* Copy as many bytes as will fit */
+ if (n != 0) {
+ while (--n != 0) {
+ if ((*d++ = *s++) == '\0')
break;
}
}
- /* Not enough room in dst, add NUL and traverse rest of src. */
- if (nleft == 0) {
- if (dsize != 0)
- *dst = '\0'; /* NUL-terminate dst */
- while (*src++)
+ /* 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(src - osrc - 1); /* count does not include NUL */
+ return(s - src - 1); /* count does not include NUL */
}
diff --git a/lib/libc/string/strspn.3 b/lib/libc/string/strspn.3
index 4a8e3f4..542b190 100644
--- a/lib/libc/string/strspn.3
+++ b/lib/libc/string/strspn.3
@@ -71,7 +71,7 @@ spans the initial part of the null-terminated string
.Fa s
as long as the characters from
.Fa s
-.Sy do not
+.Sy do not
occur in the null-terminated string
.Fa charset
.Po it spans the
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 5162563..c14b351 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -20,62 +20,17 @@ NOASM+= clock_gettime.o gettimeofday.o
PSEUDO+= _clock_gettime.o _gettimeofday.o
# Sources common to both syscall interfaces:
-SRCS+= \
- stack_protector.c \
- stack_protector_compat.c \
- __error.c \
- interposing_table.c
-
-SRCS+= futimens.c utimensat.c
-NOASM+= futimens.o utimensat.o
-PSEUDO+= _futimens.o _utimensat.o
-
-INTERPOSED = \
- accept \
- accept4 \
- aio_suspend \
- close \
- connect \
- fcntl \
- fsync \
- fork \
- kevent \
- msync \
- nanosleep \
- open \
- openat \
- poll \
- ppoll \
- pselect \
- read \
- readv \
- recvfrom \
- recvmsg \
- select \
- sendmsg \
- sendto \
- setcontext \
- sigprocmask \
- sigsuspend \
- sigtimedwait \
- sigwait \
- sigwaitinfo \
- swapcontext \
- wait4 \
- wait6 \
- write \
- writev
-
-.if ${MACHINE_CPUARCH} == "sparc64"
-SRCS+= sigaction.c
-NOASM+= sigaction.o
-.else
-INTERPOSED+= sigaction
+SRCS+= stack_protector.c stack_protector_compat.c __error.c
+.if ${MK_SYSCALL_COMPAT} != "no"
+SYSCALL_COMPAT_SRCS= fcntl.c ftruncate.c lseek.c mmap.c pread.c \
+ pwrite.c truncate.c
+SRCS+= ${SYSCALL_COMPAT_SRCS}
+NOASM+= ${SYSCALL_COMPAT_SRCS:S/.c/.o/}
+PSEUDO+= _fcntl.o
.endif
-
-SRCS+= ${INTERPOSED:S/$/.c/}
-NOASM+= ${INTERPOSED:S/$/.o/}
-PSEUDO+= ${INTERPOSED:C/^.*$/_&.o/}
+SRCS+= sigwait.c
+NOASM+= sigwait.o
+PSEUDO+= _sigwait.o
# Add machine dependent asm sources:
SRCS+=${MDASM}
@@ -311,7 +266,6 @@ MAN+= sctp_generic_recvmsg.2 \
umask.2 \
undelete.2 \
unlink.2 \
- utimensat.2 \
utimes.2 \
utrace.2 \
uuidgen.2 \
@@ -444,7 +398,6 @@ MLINKS+=timer_settime.2 timer_getoverrun.2 \
timer_settime.2 timer_gettime.2
MLINKS+=truncate.2 ftruncate.2
MLINKS+=unlink.2 unlinkat.2
-MLINKS+=utimensat.2 futimens.2
MLINKS+=utimes.2 futimes.2 \
utimes.2 futimesat.2 \
utimes.2 lutimes.2
diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map
index 194aa5b..448bcce 100644
--- a/lib/libc/sys/Symbol.map
+++ b/lib/libc/sys/Symbol.map
@@ -245,6 +245,7 @@ FBSD_1.0 {
setaudit;
setaudit_addr;
setauid;
+ setcontext;
setegid;
seteuid;
setgid;
@@ -285,6 +286,7 @@ FBSD_1.0 {
__stack_chk_guard;
stat;
statfs;
+ swapcontext;
swapoff;
swapon;
symlink;
@@ -349,6 +351,7 @@ FBSD_1.1 {
mkfifoat;
mknodat;
msgctl;
+ openat;
readlinkat;
renameat;
setfib;
@@ -397,9 +400,7 @@ FBSD_1.3 {
};
FBSD_1.4 {
- futimens;
ppoll;
- utimensat;
};
FBSDprivate_1.0 {
@@ -1047,9 +1048,7 @@ FBSDprivate_1.0 {
__sys_write;
_writev;
__sys_writev;
- __set_error_selector;
+ __error_unthreaded;
nlm_syscall;
gssd_syscall;
- __libc_interposing_slot;
- __libc_sigwait;
};
diff --git a/lib/libc/sys/__error.c b/lib/libc/sys/__error.c
index 28cc31d..c3f59f8 100644
--- a/lib/libc/sys/__error.c
+++ b/lib/libc/sys/__error.c
@@ -32,25 +32,14 @@ __FBSDID("$FreeBSD$");
extern int errno;
-static int *
-__error_unthreaded(void)
-{
-
- return (&errno);
-}
-
-static int *(*__error_selector)(void) = __error_unthreaded;
-
-void
-__set_error_selector(int *(*arg)(void))
-{
-
- __error_selector = arg;
-}
+/*
+ * Declare a weak reference in case the application is not linked
+ * with libpthread.
+ */
+__weak_reference(__error_unthreaded, __error);
int *
-__error(void)
+__error_unthreaded(void)
{
-
- return (__error_selector());
+ return(&errno);
}
diff --git a/lib/libc/sys/accept.c b/lib/libc/sys/accept.c
deleted file mode 100644
index 38e32f2..0000000
--- a/lib/libc/sys/accept.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <sys/socket.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_accept, __accept);
-
-#pragma weak accept
-int
-accept(int s, struct sockaddr *addr, socklen_t *addrlen)
-{
-
- return (((int (*)(int, struct sockaddr *, socklen_t *))
- __libc_interposing[INTERPOS_accept])(s, addr, addrlen));
-}
diff --git a/lib/libc/sys/accept4.c b/lib/libc/sys/accept4.c
deleted file mode 100644
index 2907b04..0000000
--- a/lib/libc/sys/accept4.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <sys/socket.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_accept4, __accept4);
-
-#pragma weak accept4
-int
-accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
-{
-
- return (((int (*)(int, struct sockaddr *, socklen_t *, int))
- __libc_interposing[INTERPOS_accept4])(s, addr, addrlen, flags));
-}
diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2
index c70e7a2..46bf948 100644
--- a/lib/libc/sys/access.2
+++ b/lib/libc/sys/access.2
@@ -136,7 +136,7 @@ and
.Fn access ,
.Fn eaccess ,
or
-.Fn faccessat
+.Fn faccessat
will fail if:
.Bl -tag -width Er
.It Bq Er EINVAL
diff --git a/lib/libc/sys/aio_suspend.c b/lib/libc/sys/aio_suspend.c
deleted file mode 100644
index 020edf8..0000000
--- a/lib/libc/sys/aio_suspend.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/aio.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_aio_suspend, __aio_suspend);
-
-#pragma weak aio_suspend
-int
-aio_suspend(const struct aiocb * const iocbs[], int niocb,
- const struct timespec *timeout)
-{
-
- return (((int (*)(const struct aiocb * const[], int,
- const struct timespec *))
- __libc_interposing[INTERPOS_aio_suspend])(iocbs, niocb, timeout));
-}
diff --git a/lib/libc/sys/cap_ioctls_limit.2 b/lib/libc/sys/cap_ioctls_limit.2
index 39f117f..2d1eef9 100644
--- a/lib/libc/sys/cap_ioctls_limit.2
+++ b/lib/libc/sys/cap_ioctls_limit.2
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 6, 2015
+.Dd March 27, 2014
.Dt CAP_IOCTLS_LIMIT 2
.Os
.Sh NAME
@@ -61,8 +61,6 @@ argument specifies the number of elements in the array.
There can be up to
.Va 256
elements in the array.
-Including an element that has been previously revoked will generate an error.
-After a successful call only those listed in the array may be used.
.Pp
The list of allowed ioctl commands for a given file descriptor can be obtained
with the
@@ -94,7 +92,7 @@ system call was never called for this file descriptor), the
.Fn cap_ioctls_get
system call will return
.Dv CAP_IOCTLS_ALL
-and will not modify the buffer pointed to by the
+and won't modify the buffer pointed to by the
.Fa cmds
argument.
.Sh RETURN VALUES
diff --git a/lib/libc/sys/close.c b/lib/libc/sys/close.c
deleted file mode 100644
index 02e74c6..0000000
--- a/lib/libc/sys/close.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/fcntl.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_close, __close);
-
-#pragma weak close
-int
-close(int fd)
-{
-
- return (((int (*)(int))__libc_interposing[INTERPOS_close])(fd));
-}
diff --git a/lib/libc/sys/closefrom.2 b/lib/libc/sys/closefrom.2
index a0b5fc2..ffaa001 100644
--- a/lib/libc/sys/closefrom.2
+++ b/lib/libc/sys/closefrom.2
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2009 Hudson River Trading LLC
+.\" Copyright (c) 2009 Advanced Computing Technologies LLC
.\" Written by: John H. Baldwin <jhb@FreeBSD.org>
.\" All rights reserved.
.\"
diff --git a/lib/libc/sys/connect.c b/lib/libc/sys/connect.c
deleted file mode 100644
index 7969142..0000000
--- a/lib/libc/sys/connect.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <sys/socket.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_connect, __connect);
-
-#pragma weak connect
-int
-connect(int s, const struct sockaddr *addr, socklen_t addrlen)
-{
-
- return (((int (*)(int, const struct sockaddr *, socklen_t))
- __libc_interposing[INTERPOS_connect])(s, addr, addrlen));
-}
diff --git a/lib/libc/sys/cpuset.2 b/lib/libc/sys/cpuset.2
index 8349566..0c32b42 100644
--- a/lib/libc/sys/cpuset.2
+++ b/lib/libc/sys/cpuset.2
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 8, 2015
+.Dd February 14, 2014
.Dt CPUSET 2
.Os
.Sh NAME
@@ -101,7 +101,6 @@ argument may have the following values:
.It Dv CPU_WHICH_JAIL Ta "id is jid (jail id)"
.It Dv CPU_WHICH_CPUSET Ta "id is a cpusetid_t (cpuset id)"
.It Dv CPU_WHICH_IRQ Ta "id is an irq number"
-.It Dv CPU_WHICH_DOMAIN Ta "id is a NUMA domain"
.El
.Pp
An
diff --git a/lib/libc/sys/fcntl.c b/lib/libc/sys/fcntl.c
index e85574a..480cc40 100644
--- a/lib/libc/sys/fcntl.c
+++ b/lib/libc/sys/fcntl.c
@@ -3,12 +3,6 @@
* Authors: Doug Rabson <dfr@rabson.org>
* Developed with Red Inc: Alfred Perlstein <alfred@freebsd.org>
*
- * Copyright (c) 2014-2015 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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:
@@ -40,17 +34,56 @@ __FBSDID("$FreeBSD$");
#include <sys/syscall.h>
#include "libc_private.h"
-#pragma weak fcntl
+__weak_reference(__fcntl_compat, fcntl);
+
int
-fcntl(int fd, int cmd, ...)
+__fcntl_compat(int fd, int cmd, ...)
{
va_list args;
long arg;
+ struct __oflock ofl;
+ struct flock *flp;
+ int res;
va_start(args, cmd);
arg = va_arg(args, long);
va_end(args);
- return (((int (*)(int, int, ...))
- __libc_interposing[INTERPOS_fcntl])(fd, cmd, arg));
+ if (__getosreldate() >= 800028) {
+ return (__sys_fcntl(fd, cmd, arg));
+ } else {
+ if (cmd == F_GETLK || cmd == F_SETLK || cmd == F_SETLKW) {
+ /*
+ * Convert new-style struct flock (which
+ * includes l_sysid) to old-style.
+ */
+ flp = (struct flock *) (uintptr_t) arg;
+ ofl.l_start = flp->l_start;
+ ofl.l_len = flp->l_len;
+ ofl.l_pid = flp->l_pid;
+ ofl.l_type = flp->l_type;
+ ofl.l_whence = flp->l_whence;
+
+ switch (cmd) {
+ case F_GETLK:
+ res = __sys_fcntl(fd, F_OGETLK, &ofl);
+ if (res >= 0) {
+ flp->l_start = ofl.l_start;
+ flp->l_len = ofl.l_len;
+ flp->l_pid = ofl.l_pid;
+ flp->l_type = ofl.l_type;
+ flp->l_whence = ofl.l_whence;
+ flp->l_sysid = 0;
+ }
+ return (res);
+
+ case F_SETLK:
+ return (__sys_fcntl(fd, F_OSETLK, &ofl));
+
+ case F_SETLKW:
+ return (__sys_fcntl(fd, F_OSETLKW, &ofl));
+ }
+ }
+ return (__sys_fcntl(fd, cmd, arg));
+ }
}
diff --git a/lib/libc/sys/fork.2 b/lib/libc/sys/fork.2
index 4fda74d..1ad2052f 100644
--- a/lib/libc/sys/fork.2
+++ b/lib/libc/sys/fork.2
@@ -28,7 +28,7 @@
.\" @(#)fork.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd May 1, 2015
+.Dd May 31, 2013
.Dt FORK 2
.Os
.Sh NAME
@@ -53,10 +53,7 @@ The child process has a unique process ID.
The child process has a different parent
process ID (i.e., the process ID of the parent process).
.It
-The child process has its own copy of the parent's descriptors,
-except for descriptors returned by
-.Xr kqueue 2 ,
-which are not inherited from the parent process.
+The child process has its own copy of the parent's descriptors.
These descriptors reference the same underlying objects, so that,
for instance, file pointers in file objects are shared between
the child and the parent, so that an
diff --git a/lib/libc/sys/fork.c b/lib/libc/sys/fork.c
deleted file mode 100644
index 695540a..0000000
--- a/lib/libc/sys/fork.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <unistd.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_fork, __fork);
-
-#pragma weak fork
-pid_t
-fork(void)
-{
-
- return (((pid_t (*)(void))__libc_interposing[INTERPOS_fork])());
-}
diff --git a/lib/libc/sys/fsync.c b/lib/libc/sys/fsync.c
deleted file mode 100644
index 3fff428..0000000
--- a/lib/libc/sys/fsync.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/fcntl.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_fsync, __fsync);
-
-int
-fsync(int fd)
-{
-
- return (((int (*)(int))__libc_interposing[INTERPOS_fsync])(fd));
-}
diff --git a/lib/libc/sys/ftruncate.c b/lib/libc/sys/ftruncate.c
new file mode 100644
index 0000000..78b5a36
--- /dev/null
+++ b/lib/libc/sys/ftruncate.c
@@ -0,0 +1,55 @@
+/*
+ * 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[] = "@(#)ftruncate.c 8.1 (Berkeley) 6/17/93";
+#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+#include "libc_private.h"
+
+/*
+ * This function provides 64-bit offset padding that
+ * is not supplied by GCC 1.X but is supplied by GCC 2.X.
+ */
+int
+ftruncate(fd, length)
+ int fd;
+ off_t length;
+{
+
+ if (__getosreldate() >= 700051)
+ return(__sys_ftruncate(fd, length));
+ else
+ return(__sys_freebsd6_ftruncate(fd, 0, length));
+}
diff --git a/lib/libc/sys/futimens.c b/lib/libc/sys/futimens.c
deleted file mode 100644
index 2014cc5..0000000
--- a/lib/libc/sys/futimens.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*-
- * Copyright (c) 2015 Jilles Tjoelker
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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 <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "namespace.h"
-#include <sys/stat.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <time.h>
-#include "un-namespace.h"
-
-#include "libc_private.h"
-
-int
-futimens(int fd, const struct timespec times[2])
-{
- struct timeval now, tv[2], *tvp;
- struct stat sb;
-
- if (__getosreldate() >= 1100056)
- return (__sys_futimens(fd, times));
-
- if (times == NULL || (times[0].tv_nsec == UTIME_NOW &&
- times[1].tv_nsec == UTIME_NOW))
- tvp = NULL;
- else if (times[0].tv_nsec == UTIME_OMIT &&
- times[1].tv_nsec == UTIME_OMIT)
- return (0);
- else {
- if ((times[0].tv_nsec < 0 || times[0].tv_nsec > 999999999) &&
- times[0].tv_nsec != UTIME_NOW &&
- times[0].tv_nsec != UTIME_OMIT) {
- errno = EINVAL;
- return (-1);
- }
- if ((times[1].tv_nsec < 0 || times[1].tv_nsec > 999999999) &&
- times[1].tv_nsec != UTIME_NOW &&
- times[1].tv_nsec != UTIME_OMIT) {
- errno = EINVAL;
- return (-1);
- }
- tv[0].tv_sec = times[0].tv_sec;
- tv[0].tv_usec = times[0].tv_nsec / 1000;
- tv[1].tv_sec = times[1].tv_sec;
- tv[1].tv_usec = times[1].tv_nsec / 1000;
- tvp = tv;
- if (times[0].tv_nsec == UTIME_OMIT ||
- times[1].tv_nsec == UTIME_OMIT) {
- if (_fstat(fd, &sb) == -1)
- return (-1);
- if (times[0].tv_nsec == UTIME_OMIT) {
- tv[0].tv_sec = sb.st_atim.tv_sec;
- tv[0].tv_usec = sb.st_atim.tv_nsec / 1000;
- }
- if (times[1].tv_nsec == UTIME_OMIT) {
- tv[1].tv_sec = sb.st_mtim.tv_sec;
- tv[1].tv_usec = sb.st_mtim.tv_nsec / 1000;
- }
- }
- if (times[0].tv_nsec == UTIME_NOW ||
- times[1].tv_nsec == UTIME_NOW) {
- if (gettimeofday(&now, NULL) == -1)
- return (-1);
- if (times[0].tv_nsec == UTIME_NOW)
- tv[0] = now;
- if (times[1].tv_nsec == UTIME_NOW)
- tv[1] = now;
- }
- }
- return (futimes(fd, tvp));
-}
diff --git a/lib/libc/sys/getdirentries.2 b/lib/libc/sys/getdirentries.2
index ab60ed2..3fe1632 100644
--- a/lib/libc/sys/getdirentries.2
+++ b/lib/libc/sys/getdirentries.2
@@ -134,9 +134,8 @@ The current position pointer should only be set to a value returned by
.Xr lseek 2 ,
a value returned in the location pointed to by
.Fa basep
-.Po Fn getdirentries
-only
-.Pc
+.Fn ( getdirentries
+only)
or zero.
.Sh RETURN VALUES
If successful, the number of bytes actually transferred is returned.
diff --git a/lib/libc/sys/getrlimit.2 b/lib/libc/sys/getrlimit.2
index 5fdd58b..1f84bfb 100644
--- a/lib/libc/sys/getrlimit.2
+++ b/lib/libc/sys/getrlimit.2
@@ -194,8 +194,8 @@ raised the maximum limit value, and the caller is not the super-user.
.Xr csh 1 ,
.Xr quota 1 ,
.Xr quotactl 2 ,
-.Xr sigaction 2 ,
.Xr sigaltstack 2 ,
+.Xr sigaction 2 ,
.Xr sysctl 3 ,
.Xr ulimit 3
.Sh HISTORY
diff --git a/lib/libc/sys/interposing_table.c b/lib/libc/sys/interposing_table.c
deleted file mode 100644
index 08dfbb1..0000000
--- a/lib/libc/sys/interposing_table.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include "libc_private.h"
-
-#define SLOT(a, b) \
- [INTERPOS_##a] = (interpos_func_t)b
-interpos_func_t __libc_interposing[INTERPOS_MAX] = {
- SLOT(accept, __sys_accept),
- SLOT(accept4, __sys_accept4),
- SLOT(aio_suspend, __sys_aio_suspend),
- SLOT(close, __sys_close),
- SLOT(connect, __sys_connect),
- SLOT(fcntl, __sys_fcntl),
- SLOT(fsync, __sys_fsync),
- SLOT(fork, __sys_fork),
- SLOT(msync, __sys_msync),
- SLOT(nanosleep, __sys_nanosleep),
- SLOT(openat, __sys_openat),
- SLOT(poll, __sys_poll),
- SLOT(pselect, __sys_pselect),
- SLOT(read, __sys_read),
- SLOT(readv, __sys_readv),
- SLOT(recvfrom, __sys_recvfrom),
- SLOT(recvmsg, __sys_recvmsg),
- SLOT(select, __sys_select),
- SLOT(sendmsg, __sys_sendmsg),
- SLOT(sendto, __sys_sendto),
- SLOT(setcontext, __sys_setcontext),
- SLOT(sigaction, __sys_sigaction),
- SLOT(sigprocmask, __sys_sigprocmask),
- SLOT(sigsuspend, __sys_sigsuspend),
- SLOT(sigwait, __libc_sigwait),
- SLOT(sigtimedwait, __sys_sigtimedwait),
- SLOT(sigwaitinfo, __sys_sigwaitinfo),
- SLOT(swapcontext, __sys_swapcontext),
- SLOT(system, __libc_system),
- SLOT(tcdrain, __libc_tcdrain),
- SLOT(wait4, __sys_wait4),
- SLOT(write, __sys_write),
- SLOT(writev, __sys_writev),
- SLOT(_pthread_mutex_init_calloc_cb, _pthread_mutex_init_calloc_cb_stub),
- SLOT(spinlock, __libc_spinlock_stub),
- SLOT(spinunlock, __libc_spinunlock_stub),
- SLOT(kevent, __sys_kevent),
- SLOT(wait6, __sys_wait6),
- SLOT(ppoll, __sys_ppoll),
-};
-#undef SLOT
-
-interpos_func_t *
-__libc_interposing_slot(int interposno)
-{
-
- return (&__libc_interposing[interposno]);
-}
diff --git a/lib/libc/sys/kevent.c b/lib/libc/sys/kevent.c
deleted file mode 100644
index 5f84ef8..0000000
--- a/lib/libc/sys/kevent.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2015 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/event.h>
-#include <sys/time.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_kevent, __kevent);
-
-#pragma weak kevent
-int
-kevent(int kq, const struct kevent *changelist, int nchanges,
- struct kevent *eventlist, int nevents, const struct timespec *timeout)
-{
-
- return (((int (*)(int, const struct kevent *, int,
- struct kevent *, int, const struct timespec *))
- __libc_interposing[INTERPOS_kevent])(kq, changelist, nchanges,
- eventlist, nevents, timeout));
-}
diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2
index c5e8caf..9a7cc23 100644
--- a/lib/libc/sys/kqueue.2
+++ b/lib/libc/sys/kqueue.2
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 29, 2015
+.Dd July 18, 2014
.Dt KQUEUE 2
.Os
.Sh NAME
@@ -41,7 +41,7 @@
.Fn kqueue "void"
.Ft int
.Fn kevent "int kq" "const struct kevent *changelist" "int nchanges" "struct kevent *eventlist" "int nevents" "const struct timespec *timeout"
-.Fn EV_SET "kev" ident filter flags fflags data udata
+.Fn EV_SET "&kev" ident filter flags fflags data udata
.Sh DESCRIPTION
The
.Fn kqueue
@@ -162,56 +162,56 @@ struct kevent {
The fields of
.Fa struct kevent
are:
-.Bl -tag -width "Fa filter"
-.It Fa ident
+.Bl -tag -width XXXfilter
+.It ident
Value used to identify this event.
The exact interpretation is determined by the attached filter,
but often is a file descriptor.
-.It Fa filter
+.It filter
Identifies the kernel filter used to process this event.
The pre-defined
system filters are described below.
-.It Fa flags
+.It flags
Actions to perform on the event.
-.It Fa fflags
+.It fflags
Filter-specific flags.
-.It Fa data
+.It data
Filter-specific data value.
-.It Fa udata
+.It udata
Opaque user-defined value passed through the kernel unchanged.
.El
.Pp
The
.Va flags
field can contain the following values:
-.Bl -tag -width EV_DISPATCH
-.It Dv EV_ADD
+.Bl -tag -width XXXEV_ONESHOT
+.It EV_ADD
Adds the event to the kqueue.
Re-adding an existing event
will modify the parameters of the original event, and not result
in a duplicate entry.
Adding an event automatically enables it,
unless overridden by the EV_DISABLE flag.
-.It Dv EV_ENABLE
+.It EV_ENABLE
Permit
.Fn kevent
to return the event if it is triggered.
-.It Dv EV_DISABLE
+.It EV_DISABLE
Disable the event so
.Fn kevent
will not return it.
The filter itself is not disabled.
-.It Dv EV_DISPATCH
+.It EV_DISPATCH
Disable the event source immediately after delivery of an event.
See
.Dv EV_DISABLE
above.
-.It Dv EV_DELETE
+.It EV_DELETE
Removes the event from the kqueue.
Events which are attached to
file descriptors are automatically deleted on the last close of
the descriptor.
-.It Dv EV_RECEIPT
+.It EV_RECEIPT
This flag is useful for making bulk changes to a kqueue without draining
any pending events.
When passed as input, it forces
@@ -220,20 +220,20 @@ to always be returned.
When a filter is successfully added the
.Va data
field will be zero.
-.It Dv EV_ONESHOT
+.It EV_ONESHOT
Causes the event to return only the first occurrence of the filter
being triggered.
After the user retrieves the event from the kqueue,
it is deleted.
-.It Dv EV_CLEAR
+.It EV_CLEAR
After the event is retrieved by the user, its state is reset.
This is useful for filters which report state transitions
instead of the current state.
Note that some filters may automatically
set this flag internally.
-.It Dv EV_EOF
+.It EV_EOF
Filters may set this flag to indicate filter-specific EOF condition.
-.It Dv EV_ERROR
+.It EV_ERROR
See
.Sx RETURN VALUES
below.
@@ -245,8 +245,8 @@ Arguments may be passed to and from the filter via the
and
.Va data
fields in the kevent structure.
-.Bl -tag -width "Dv EVFILT_PROCDESC"
-.It Dv EVFILT_READ
+.Bl -tag -width EVFILT_PROCDESC
+.It EVFILT_READ
Takes a descriptor as the identifier, and returns whenever
there is data available to read.
The behavior of the filter is slightly different depending
@@ -265,7 +265,7 @@ subject to the
value of the socket buffer.
This may be overridden with a per-filter low water mark at the
time the filter is added by setting the
-.Dv NOTE_LOWAT
+NOTE_LOWAT
flag in
.Va fflags ,
and specifying the new low water mark in
@@ -275,9 +275,7 @@ On return,
contains the number of bytes of protocol data available to read.
.Pp
If the read direction of the socket has shutdown, then the filter
-also sets
-.Dv EV_EOF
-in
+also sets EV_EOF in
.Va flags ,
and returns the socket error (if any) in
.Va fflags .
@@ -293,13 +291,9 @@ Returns when the there is data to read;
.Va data
contains the number of bytes available.
.Pp
-When the last writer disconnects, the filter will set
-.Dv EV_EOF
-in
+When the last writer disconnects, the filter will set EV_EOF in
.Va flags .
-This may be cleared by passing in
-.Dv EV_CLEAR ,
-at which point the
+This may be cleared by passing in EV_CLEAR, at which point the
filter will resume waiting for data to become available before
returning.
.It "BPF devices"
@@ -310,7 +304,7 @@ enabled and there is any data to read;
.Va data
contains the number of bytes available.
.El
-.It Dv EVFILT_WRITE
+.It EVFILT_WRITE
Takes a descriptor as the identifier, and returns whenever
it is possible to write to the descriptor.
For sockets, pipes
@@ -318,30 +312,23 @@ and fifos,
.Va data
will contain the amount of space remaining in the write buffer.
The filter will set EV_EOF when the reader disconnects, and for
-the fifo case, this may be cleared by use of
-.Dv EV_CLEAR .
+the fifo case, this may be cleared by use of EV_CLEAR.
Note that this filter is not supported for vnodes or BPF devices.
.Pp
For sockets, the low water mark and socket error handling is
-identical to the
-.Dv EVFILT_READ
-case.
-.It Dv EVFILT_AIO
+identical to the EVFILT_READ case.
+.It EVFILT_AIO
The sigevent portion of the AIO request is filled in, with
.Va sigev_notify_kqueue
containing the descriptor of the kqueue that the event should
be attached to,
.Va sigev_notify_kevent_flags
-containing the kevent flags which should be
-.Dv EV_ONESHOT ,
-.Dv EV_CLEAR
-or
-.Dv EV_DISPATCH ,
+containing the kevent flags which should be EV_ONESHOT, EV_CLEAR or
+EV_DISPATCH,
.Va sigev_value
containing the udata value, and
.Va sigev_notify
-set to
-.Dv SIGEV_KEVENT .
+set to SIGEV_KEVENT.
When the
.Fn aio_*
system call is made, the event will be registered
@@ -352,30 +339,29 @@ argument set to the
returned by the
.Fn aio_*
system call.
-The filter returns under the same conditions as
-.Fn aio_error .
-.It Dv EVFILT_VNODE
+The filter returns under the same conditions as aio_error.
+.It EVFILT_VNODE
Takes a file descriptor as the identifier and the events to watch for in
.Va fflags ,
and returns when one or more of the requested events occurs on the descriptor.
The events to monitor are:
-.Bl -tag -width "Dv NOTE_RENAME"
-.It Dv NOTE_DELETE
+.Bl -tag -width XXNOTE_RENAME
+.It NOTE_DELETE
The
.Fn unlink
system call
was called on the file referenced by the descriptor.
-.It Dv NOTE_WRITE
+.It NOTE_WRITE
A write occurred on the file referenced by the descriptor.
-.It Dv NOTE_EXTEND
+.It NOTE_EXTEND
The file referenced by the descriptor was extended.
-.It Dv NOTE_ATTRIB
+.It NOTE_ATTRIB
The file referenced by the descriptor had its attributes changed.
-.It Dv NOTE_LINK
+.It NOTE_LINK
The link count on the file changed.
-.It Dv NOTE_RENAME
+.It NOTE_RENAME
The file referenced by the descriptor was renamed.
-.It Dv NOTE_REVOKE
+.It NOTE_REVOKE
Access to the file was revoked via
.Xr revoke 2
or the underlying file system was unmounted.
@@ -384,26 +370,26 @@ or the underlying file system was unmounted.
On return,
.Va fflags
contains the events which triggered the filter.
-.It Dv EVFILT_PROC
+.It EVFILT_PROC
Takes the process ID to monitor as the identifier and the events to watch for
in
.Va fflags ,
and returns when the process performs one or more of the requested events.
If a process can normally see another process, it can attach an event to it.
The events to monitor are:
-.Bl -tag -width "Dv NOTE_TRACKERR"
-.It Dv NOTE_EXIT
+.Bl -tag -width XXNOTE_TRACKERR
+.It NOTE_EXIT
The process has exited.
The exit status will be stored in
.Va data .
-.It Dv NOTE_FORK
+.It NOTE_FORK
The process has called
.Fn fork .
-.It Dv NOTE_EXEC
+.It NOTE_EXEC
The process has executed a new process via
.Xr execve 2
or a similar call.
-.It Dv NOTE_TRACK
+.It NOTE_TRACK
Follow a process across
.Fn fork
calls.
@@ -411,28 +397,22 @@ The parent process registers a new kevent to monitor the child process
using the same
.Va fflags
as the original event.
-The child process will signal an event with
-.Dv NOTE_CHILD
-set in
+The child process will signal an event with NOTE_CHILD set in
.Va fflags
and the parent PID in
.Va data .
.Pp
If the parent process fails to register a new kevent
.Pq usually due to resource limitations ,
-it will signal an event with
-.Dv NOTE_TRACKERR
-set in
+it will signal an event with NOTE_TRACKERR set in
.Va fflags ,
-and the child process will not signal a
-.Dv NOTE_CHILD
-event.
+and the child process will not signal a NOTE_CHILD event.
.El
.Pp
On return,
.Va fflags
contains the events which triggered the filter.
-.It Dv EVFILT_PROCDESC
+.It EVFILT_PROCDESC
Takes the process descriptor created by
.Xr pdfork 2
to monitor as the identifier and the events to watch for in
@@ -440,8 +420,8 @@ to monitor as the identifier and the events to watch for in
and returns when the associated process performs one or more of the
requested events.
The events to monitor are:
-.Bl -tag -width "Dv NOTE_EXIT"
-.It Dv NOTE_EXIT
+.Bl -tag -width XXNOTE_EXIT
+.It NOTE_EXIT
The process has exited.
The exit status will be stored in
.Va data .
@@ -450,7 +430,7 @@ The exit status will be stored in
On return,
.Va fflags
contains the events which triggered the filter.
-.It Dv EVFILT_SIGNAL
+.It EVFILT_SIGNAL
Takes the signal number to monitor as the identifier and returns
when the given signal is delivered to the process.
This coexists with the
@@ -460,9 +440,7 @@ and
facilities, and has a lower precedence.
The filter will record
all attempts to deliver a signal to a process, even if the signal has
-been marked as
-.Dv SIG_IGN ,
-except for the
+been marked as SIG_IGN, except for the
.Dv SIGCHLD
signal, which, if ignored, won't be recorded by the filter.
Event notification happens after normal
@@ -470,18 +448,14 @@ signal delivery processing.
.Va data
returns the number of times the signal has occurred since the last call to
.Fn kevent .
-This filter automatically sets the
-.Dv EV_CLEAR
-flag internally.
-.It Dv EVFILT_TIMER
+This filter automatically sets the EV_CLEAR flag internally.
+.It EVFILT_TIMER
Establishes an arbitrary timer identified by
.Va ident .
When adding a timer,
.Va data
specifies the timeout period.
-The timer will be periodic unless
-.Dv EV_ONESHOT
-is specified.
+The timer will be periodic unless EV_ONESHOT is specified.
On return,
.Va data
contains the number of times the timeout has expired since the last call to
@@ -491,7 +465,7 @@ There is a system wide limit on the number of timers
which is controlled by the
.Va kern.kq_calloutmax
sysctl.
-.Bl -tag -width "Dv NOTE_USECONDS"
+.Bl -tag -width XXNOTE_USECONDS
.It Dv NOTE_SECONDS
.Va data
is in seconds.
@@ -519,7 +493,7 @@ user level code.
The lower 24 bits of the
.Va fflags
may be used for user defined flags and manipulated using the following:
-.Bl -tag -width "Dv NOTE_FFLAGSMASK"
+.Bl -tag -width XXNOTE_FFLAGSMASK
.It Dv NOTE_FFNOP
Ignore the input
.Va fflags .
@@ -541,7 +515,7 @@ User defined flag mask for
.El
.Pp
A user event is triggered for output with the following:
-.Bl -tag -width "Dv NOTE_FFLAGSMASK"
+.Bl -tag -width XXNOTE_FFLAGSMASK
.It Dv NOTE_TRIGGER
Cause the event to be triggered.
.El
@@ -550,16 +524,6 @@ On return,
.Va fflags
contains the users defined flags in the lower 24 bits.
.El
-.Sh CANCELLATION BEHAVIOUR
-If
-.Fa nevents
-is non-zero, i.e. the function is potentially blocking, the call
-is a cancellation point.
-Otherwise, i.e. if
-.Fa nevents
-is zero, the call is not cancellable.
-Cancellation can only occur before any changes are made to the kqueue,
-or when the call was blocked and no changes to the queue were requested.
.Sh RETURN VALUES
The
.Fn kqueue
@@ -630,8 +594,6 @@ The specified descriptor is invalid.
.It Bq Er EINTR
A signal was delivered before the timeout expired and before any
events were placed on the kqueue for return.
-.It Bq Er EINTR
-A cancellation request was delivered to the thread, but not yet handled.
.It Bq Er EINVAL
The specified time limit or filter is invalid.
.It Bq Er ENOENT
@@ -646,14 +608,6 @@ sysctl.
.It Bq Er ESRCH
The specified process to attach to does not exist.
.El
-.Pp
-When
-.Fn kevent
-call fails with
-.Er EINTR
-error, all changes in the
-.Fa changelist
-have been applied.
.Sh SEE ALSO
.Xr aio_error 2 ,
.Xr aio_read 2 ,
@@ -663,7 +617,6 @@ have been applied.
.Xr select 2 ,
.Xr sigaction 2 ,
.Xr write 2 ,
-.Xr pthread_setcancelstate 3 ,
.Xr signal 3
.Sh HISTORY
The
diff --git a/lib/libc/sys/lseek.c b/lib/libc/sys/lseek.c
new file mode 100644
index 0000000..a086be1
--- /dev/null
+++ b/lib/libc/sys/lseek.c
@@ -0,0 +1,56 @@
+/*
+ * 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[] = "@(#)lseek.c 8.1 (Berkeley) 6/17/93";
+#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+#include "libc_private.h"
+
+/*
+ * This function provides 64-bit offset padding that
+ * is not supplied by GCC 1.X but is supplied by GCC 2.X.
+ */
+off_t
+lseek(fd, offset, whence)
+ int fd;
+ off_t offset;
+ int whence;
+{
+
+ if (__getosreldate() >= 700051)
+ return(__sys_lseek(fd, offset, whence));
+ else
+ return(__sys_freebsd6_lseek(fd, 0, offset, whence));
+}
diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2
index c818342..7380a7f 100644
--- a/lib/libc/sys/mmap.2
+++ b/lib/libc/sys/mmap.2
@@ -28,7 +28,7 @@
.\" @(#)mmap.2 8.4 (Berkeley) 5/11/95
.\" $FreeBSD$
.\"
-.Dd February 18, 2015
+.Dd September 17, 2014
.Dt MMAP 2
.Os
.Sh NAME
@@ -160,7 +160,7 @@ is specified,
must be a multiple of the pagesize.
If
.Dv MAP_EXCL
-is not specified, a successful
+is not specified, a successfull
.Dv MAP_FIXED
request replaces any previous mappings for the process'
pages in the range from
@@ -225,7 +225,7 @@ it.
You can test file fragmentation by observing the KB/t (kilobytes per
transfer) results from an
.Dq Li iostat 1
-while reading a large file sequentially, e.g.,\& using
+while reading a large file sequentially, e.g.\& using
.Dq Li dd if=filename of=/dev/null bs=32k .
.Pp
The
@@ -448,3 +448,17 @@ was specified and insufficient memory was available.
.Xr munmap 2 ,
.Xr getpagesize 3 ,
.Xr getpagesizes 3
+.Sh BUGS
+The
+.Fa len
+argument
+is limited to the maximum file size or available userland address
+space.
+Files may not be able to be made more than 1TB large on 32 bit systems
+due to file systems restrictions and bugs, but address space is far more
+restrictive.
+Larger files may be possible on 64 bit systems.
+.Pp
+The previous documented limit of 2GB was a documentation bug.
+That limit has not existed since
+.Fx 2.2 .
diff --git a/lib/libc/sys/mmap.c b/lib/libc/sys/mmap.c
new file mode 100644
index 0000000..0fa03ba
--- /dev/null
+++ b/lib/libc/sys/mmap.c
@@ -0,0 +1,56 @@
+/*
+ * 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[] = "@(#)mmap.c 8.1 (Berkeley) 6/17/93";
+#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+#include "libc_private.h"
+
+/*
+ * This function provides 64-bit offset padding that
+ * is not supplied by GCC 1.X but is supplied by GCC 2.X.
+ */
+void *
+mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
+{
+
+ if (__getosreldate() >= 700051) {
+ return (__sys_mmap(addr, len, prot, flags, fd, offset));
+ } else {
+ return (__sys_freebsd6_mmap(addr, len, prot, flags, fd, 0,
+ offset));
+ }
+}
diff --git a/lib/libc/sys/mount.2 b/lib/libc/sys/mount.2
index 881d830..57ad428 100644
--- a/lib/libc/sys/mount.2
+++ b/lib/libc/sys/mount.2
@@ -28,7 +28,7 @@
.\" @(#)mount.2 8.3 (Berkeley) 5/24/95
.\" $FreeBSD$
.\"
-.Dd April 13, 2015
+.Dd January 26, 2010
.Dt MOUNT 2
.Os
.Sh NAME
@@ -86,7 +86,7 @@ containing
.Fa niov
elements.
The following options are required by all file systems:
-.Bl -column fstype -offset indent
+.Bl -item -offset indent -compact
.It
.Li fstype Ta file system type name (e.g., Dq Li procfs )
.It
@@ -351,6 +351,11 @@ The
argument
points outside the process's allocated address space.
.El
+.Pp
+A
+.Em ufs
+mount can also fail if the maximum number of file systems are currently
+mounted.
.Sh SEE ALSO
.Xr lsvfs 1 ,
.Xr mksnap_ffs 8 ,
diff --git a/lib/libc/sys/msync.c b/lib/libc/sys/msync.c
deleted file mode 100644
index 3c6879f..0000000
--- a/lib/libc/sys/msync.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/fcntl.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_msync, __msync);
-
-#pragma weak msync
-int
-msync(void *addr, size_t len, int flags)
-{
-
- return (((int (*)(void *, size_t, int))
- __libc_interposing[INTERPOS_msync])(addr, len, flags));
-}
diff --git a/lib/libc/sys/nanosleep.c b/lib/libc/sys/nanosleep.c
deleted file mode 100644
index 412b05e..0000000
--- a/lib/libc/sys/nanosleep.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <time.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_nanosleep, __nanosleep);
-
-#pragma weak nanosleep
-int
-nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
-{
-
- return (((int (*)(const struct timespec *, struct timespec *))
- __libc_interposing[INTERPOS_nanosleep])(rqtp, rmtp));
-}
diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2
index acd376c..41a6c64 100644
--- a/lib/libc/sys/open.2
+++ b/lib/libc/sys/open.2
@@ -28,7 +28,7 @@
.\" @(#)open.2 8.2 (Berkeley) 11/16/93
.\" $FreeBSD$
.\"
-.Dd April 2, 2015
+.Dd February 7, 2013
.Dt OPEN 2
.Os
.Sh NAME
@@ -115,8 +115,8 @@ O_DIRECT eliminate or reduce cache effects
O_FSYNC synchronous writes
O_SYNC synchronous writes
O_NOFOLLOW do not follow symlinks
-O_NOCTTY ignored
-O_TTY_INIT ignored
+O_NOCTTY don't assign controlling terminal
+O_TTY_INIT restore default terminal attributes
O_DIRECTORY error if file is not a directory
O_CLOEXEC set FD_CLOEXEC upon open
.Ed
diff --git a/lib/libc/sys/open.c b/lib/libc/sys/open.c
deleted file mode 100644
index e0273c6..0000000
--- a/lib/libc/sys/open.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/fcntl.h>
-#include <stdarg.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_open, __open);
-
-#pragma weak open
-int
-open(const char *path, int flags, ...)
-{
- va_list ap;
- int mode;
-
- if ((flags & O_CREAT) != 0) {
- va_start(ap, flags);
- mode = va_arg(ap, int);
- va_end(ap);
- } else {
- mode = 0;
- }
- return (((int (*)(int, const char *, int, ...))
- __libc_interposing[INTERPOS_openat])(AT_FDCWD, path, flags, mode));
-}
diff --git a/lib/libc/sys/openat.c b/lib/libc/sys/openat.c
deleted file mode 100644
index 1bd12ea..0000000
--- a/lib/libc/sys/openat.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/fcntl.h>
-#include <stdarg.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_openat, __openat);
-__sym_compat(openat, __impl_openat, FBSD_1.1);
-__weak_reference(openat, __impl_openat);
-__sym_default(openat, openat, FBSD_1.2);
-
-#pragma weak openat
-int
-openat(int fd, const char *path, int flags, ...)
-{
- va_list ap;
- int mode;
-
- if ((flags & O_CREAT) != 0) {
- va_start(ap, flags);
- mode = va_arg(ap, int);
- va_end(ap);
- } else {
- mode = 0;
- }
- return (((int (*)(int, const char *, int, ...))
- __libc_interposing[INTERPOS_openat])(fd, path, flags, mode));
-}
diff --git a/lib/libc/sys/poll.2 b/lib/libc/sys/poll.2
index dbd641f..a1c7ada 100644
--- a/lib/libc/sys/poll.2
+++ b/lib/libc/sys/poll.2
@@ -148,8 +148,8 @@ is zero, then
will return without blocking.
.Pp
The
-.Fn ppoll
-system call, unlike
+.Fn ppoll
+system call, unlike
.Fn poll ,
is used to safely wait until either a set of file descriptors becomes
ready or until a signal is caught.
@@ -174,12 +174,13 @@ used by
A null pointer may be passed to indicate that
.Fn ppoll
should wait indefinitely.
-Finally,
+Finally,
.Fa newsigmask
specifies a signal mask which is set while waiting for input.
-When
+When
.Fn ppoll
returns, the original signal mask is restored.
+.Pp
.Bd -literal
struct timespec {
time_t tv_sec; /* seconds */
@@ -246,11 +247,11 @@ The specified time limit is invalid. One of its components is negative or too la
.Xr write 2
.Sh STANDARDS
The
-.Fn poll
+.Fn poll
function conforms to
.St -p1003.1-2001 .
The
-.Fn ppoll
+.Fn ppoll
is not specified by POSIX.
.Sh HISTORY
The
@@ -261,8 +262,8 @@ This manual page and the core of the implementation was taken from
.Nx .
The
.Fn ppoll
-function first appeared in
-.Fx 11.0
+function first appeared in
+.Fx 11.0
.Sh BUGS
The distinction between some of the fields in the
.Fa events
diff --git a/lib/libc/sys/poll.c b/lib/libc/sys/poll.c
deleted file mode 100644
index 43c17d2..0000000
--- a/lib/libc/sys/poll.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/poll.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_poll, __poll);
-
-#pragma weak poll
-int
-poll(struct pollfd pfd[], nfds_t nfds, int timeout)
-{
-
- return (((int (*)(struct pollfd *, nfds_t, int))
- __libc_interposing[INTERPOS_poll])(pfd, nfds, timeout));
-}
diff --git a/lib/libc/sys/posix_openpt.2 b/lib/libc/sys/posix_openpt.2
index b7e345c..916e75a 100644
--- a/lib/libc/sys/posix_openpt.2
+++ b/lib/libc/sys/posix_openpt.2
@@ -110,8 +110,8 @@ is not valid.
Out of pseudo-terminal resources.
.El
.Sh SEE ALSO
-.Xr ptsname 3 ,
.Xr pts 4 ,
+.Xr ptsname 3 ,
.Xr tty 4
.Sh STANDARDS
The
@@ -137,4 +137,4 @@ is included for compatibility; in
opening a terminal does not cause it to become a process's controlling
terminal.
.Sh AUTHORS
-.An \&Ed Schouten Aq Mt ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/sys/ppoll.c b/lib/libc/sys/ppoll.c
deleted file mode 100644
index f62fd19..0000000
--- a/lib/libc/sys/ppoll.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2015 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/poll.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_ppoll, __ppoll);
-
-#pragma weak ppoll
-int
-ppoll(struct pollfd pfd[], nfds_t nfds, const struct timespec *__restrict
- timeout, const sigset_t *__restrict newsigmask)
-{
-
- return (((int (*)(struct pollfd *, nfds_t, const struct timespec *,
- const sigset_t *)) __libc_interposing[INTERPOS_ppoll])(pfd, nfds,
- timeout, newsigmask));
-}
diff --git a/lib/libc/sys/pread.c b/lib/libc/sys/pread.c
new file mode 100644
index 0000000..7566566
--- /dev/null
+++ b/lib/libc/sys/pread.c
@@ -0,0 +1,57 @@
+/*
+ * 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[] = "@(#)mmap.c 8.1 (Berkeley) 6/17/93";
+#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+#include "libc_private.h"
+
+/*
+ * This function provides 64-bit offset padding that
+ * is not supplied by GCC 1.X but is supplied by GCC 2.X.
+ */
+ssize_t
+pread(fd, buf, nbyte, offset)
+ int fd;
+ void *buf;
+ size_t nbyte;
+ off_t offset;
+{
+
+ if (__getosreldate() >= 700051)
+ return (__sys_pread(fd, buf, nbyte, offset));
+ else
+ return (__sys_freebsd6_pread(fd, buf, nbyte, 0, offset));
+}
diff --git a/lib/libc/sys/procctl.2 b/lib/libc/sys/procctl.2
index 76a3cef..6ad0590 100644
--- a/lib/libc/sys/procctl.2
+++ b/lib/libc/sys/procctl.2
@@ -1,11 +1,7 @@
-.\" Copyright (c) 2013 Hudson River Trading LLC
+.\" Copyright (c) 2013 Advanced Computing Technologies LLC
.\" Written by: John H. Baldwin <jhb@FreeBSD.org>
.\" All rights reserved.
.\"
-.\" Copyright (c) 2014 The FreeBSD Foundation
-.\" Portions of this documentation were written by Konstantin Belousov
-.\" 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:
@@ -29,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 29, 2014
+.Dd September 19, 2013
.Dt PROCCTL 2
.Os
.Sh NAME
@@ -71,7 +67,7 @@ The control request to perform is specified by the
.Fa cmd
argument.
The following commands are supported:
-.Bl -tag -width "Dv PROC_REAP_GETPIDS"
+.Bl -tag -width "Dv PROC_SPROTECT"
.It Dv PROC_SPROTECT
Set process protection state.
This is used to mark a process as protected from being killed if the system
@@ -99,237 +95,7 @@ When used with
mark all future child processes of each selected process as protected.
Future child processes will also mark all of their future child processes.
.El
-.It Dv PROC_REAP_ACQUIRE
-Acquires the reaper status for the current process.
-The status means that children orphaned by the reaper's descendants
-that were forked after the acquisition of the status are reparented to the
-reaper.
-After the system initialization,
-.Xr init 8
-is the default reaper.
-.It Dv PROC_REAP_RELEASE
-Releases the reaper state for the current process.
-The reaper of the current process becomes the new reaper of the
-current process's descendants.
-.It Dv PROC_REAP_STATUS
-Provides the information about the reaper of the specified process,
-or the process itself when it is a reaper.
-The
-.Fa data
-argument must point to a
-.Vt procctl_reaper_status
-structure which is filled in by the syscall on successful return.
-.Bd -literal
-struct procctl_reaper_status {
- u_int rs_flags;
- u_int rs_children;
- u_int rs_descendants;
- pid_t rs_reaper;
- pid_t rs_pid;
-};
-.Ed
-The
-.Fa rs_flags
-may have the following flags returned:
-.Bl -tag -width "Dv REAPER_STATUS_REALINIT"
-.It Dv REAPER_STATUS_OWNED
-The specified process has acquired the reaper status and has not
-released it.
-When the flag is returned, the specified process
-.Fa id ,
-pid, identifies the reaper, otherwise the
-.Fa rs_reaper
-field of the structure is set to the pid of the reaper
-for the specified process id.
-.It Dv REAPER_STATUS_REALINIT
-The specified process is the root of the reaper tree, i.e.
-.Xr init 8 .
-.El
-.Pp
-The
-.Fa rs_children
-field returns the number of children of the reaper.
-The
-.Fa rs_descendants
-field returns the total number of descendants of the reaper(s),
-not counting descendants of the reaper in the subtree.
-The
-.Fa rs_reaper
-field returns the reaper pid.
-The
-.Fa rs_pid
-returns the pid of one reaper child if there are any descendants.
-.It Dv PROC_REAP_GETPIDS
-Queries the list of descendants of the reaper of the specified process.
-The request takes a pointer to a
-.Vt procctl_reaper_pids
-structure in the
-.Fa data
-parameter.
-.Bd -literal
-struct procctl_reaper_pids {
- u_int rp_count;
- struct procctl_reaper_pidinfo *rp_pids;
-};
-.Ed
-When called, the
-.Fa rp_pids
-field must point to an array of
-.Vt procctl_reaper_pidinfo
-structures, to be filled in on return,
-and the
-.Fa rp_count
-field must specify the size of the array,
-into which no more than
-.Fa rp_count
-elements will be filled in by the kernel.
-.Pp
-The
-.Vt "struct procctl_reaper_pidinfo"
-structure provides some information about one of the reaper's descendants.
-Note that for a descendant that is not a child, it may be incorrectly
-identified because of a race in which the original child process exited
-and the exited process's pid was reused for an unrelated process.
-.Bd -literal
-struct procctl_reaper_pidinfo {
- pid_t pi_pid;
- pid_t pi_subtree;
- u_int pi_flags;
-};
-.Ed
-The
-.Fa pi_pid
-field is the process id of the descendant.
-The
-.Fa pi_subtree
-field provides the pid of the child of the reaper, which is the (grand-)parent
-of the process.
-The
-.Fa pi_flags
-field returns the following flags, further describing the descendant:
-.Bl -tag -width "Dv REAPER_PIDINFO_VALID"
-.It Dv REAPER_PIDINFO_VALID
-Set to indicate that the
-.Vt procctl_reaper_pidinfo
-structure was filled in by the kernel.
-Zero-filling the
-.Fa rp_pids
-array and testing the
-.Dv REAPER_PIDINFO_VALID
-flag allows the caller to detect the end
-of the returned array.
-.It Dv REAPER_PIDINFO_CHILD
-The
-.Fa pi_pid
-field identifies the direct child of the reaper.
-.El
-.It Dv PROC_REAP_KILL
-Request to deliver a signal to some subset of the descendants of the reaper.
-The
-.Fa data
-parameter must point to a
-.Vt procctl_reaper_kill
-structure, which is used both for parameters and status return.
-.Bd -literal
-struct procctl_reaper_kill {
- int rk_sig;
- u_int rk_flags;
- pid_t rk_subtree;
- u_int rk_killed;
- pid_t rk_fpid;
-};
-.Ed
-The
-.Fa rk_sig
-field specifies the signal to be delivered.
-Zero is not a valid signal number, unlike
-.Xr kill 2 .
-The
-.Fa rk_flags
-field further directs the operation.
-It is or-ed from the following flags:
-.Bl -tag -width "Dv REAPER_KILL_CHILDREN"
-.It Dv REAPER_KILL_CHILDREN
-Deliver the specified signal only to direct children of the reaper.
-.It Dv REAPER_KILL_SUBTREE
-Deliver the specified signal only to descendants that were forked by
-the direct child with pid specified in the
-.Fa rk_subtree
-field.
-.El
-If neither the
-.Dv REAPER_KILL_CHILDREN
-nor the
-.Dv REAPER_KILL_SUBTREE
-flags are specified, all current descendants of the reaper are signalled.
-.Pp
-If a signal was delivered to any process, the return value from the request
-is zero.
-In this case, the
-.Fa rk_killed
-field identifies the number of processes signalled.
-The
-.Fa rk_fpid
-field is set to the pid of the first process for which signal
-delivery failed, e.g. due to the permission problems.
-If no such process exist, the
-.Fa rk_fpid
-field is set to -1.
-.It Dv PROC_TRACE_CTL
-Enable or disable tracing of the specified process(es), according to the
-value of the integer argument.
-Tracing includes attachment to the process using
-.Xr ptrace 2
-and
-.Xr ktrace 2 ,
-debugging sysctls,
-.Xr hwpmc 4 ,
-.Xr dtrace 1
-and core dumping.
-Possible values for the
-.Fa data
-argument are:
-.Bl -tag -width "Dv PROC_TRACE_CTL_DISABLE_EXEC"
-.It Dv PROC_TRACE_CTL_ENABLE
-Enable tracing, after it was disabled by
-.Dv PROC_TRACE_CTL_DISABLE .
-Only allowed for self.
-.It Dv PROC_TRACE_CTL_DISABLE
-Disable tracing for the specified process.
-Tracing is re-enabled when the process changes the executing
-program with
-.Xr execve 2
-syscall.
-A child inherits the trace settings from the parent on
-.Xr fork 2 .
-.It Dv PROC_TRACE_CTL_DISABLE_EXEC
-Same as
-.Dv PROC_TRACE_CTL_DISABLE ,
-but the setting persist for the process even after
-.Xr execve 2 .
-.El
-.It Dv PROC_TRACE_STATUS
-Returns the current tracing status for the specified process in
-the integer variable pointed to by
-.Fa data .
-If tracing is disabled,
-.Fa data
-is set to -1.
-If tracing is enabled, but no debugger is attached by
-.Xr ptrace 2
-syscall,
-.Fa data
-is set to 0.
-If a debugger is attached,
-.Fa data
-is set to the pid of the debugger process.
.El
-.Sh NOTES
-Disabling tracing on a process should not be considered a security
-feature, as it is bypassable both by the kernel and privileged processes,
-and via other system mechanisms.
-As such, it should not be relied on to reliably protect cryptographic
-keying material or other confidential data.
.Sh RETURN VALUES
If an error occurs, a value of -1 is returned and
.Va errno
@@ -343,7 +109,7 @@ will fail if:
.It Bq Er EFAULT
The
.Fa arg
-parameter points outside the process's allocated address space.
+points outside the process's allocated address space.
.It Bq Er EINVAL
The
.Fa cmd
@@ -366,71 +132,11 @@ An invalid operation or flag was passed in
for a
.Dv PROC_SPROTECT
command.
-.It Bq Er EPERM
-The
-.Fa idtype
-argument is not equal to
-.Dv P_PID ,
-or
-.Fa id
-is not equal to the pid of the calling process, for
-.Dv PROC_REAP_ACQUIRE
-or
-.Dv PROC_REAP_RELEASE
-requests.
-.It Bq Er EINVAL
-Invalid or undefined flags were passed to a
-.Dv PROC_REAP_KILL
-request.
-.It Bq Er EINVAL
-An invalid or zero signal number was requested for a
-.Dv PROC_REAP_KILL
-request.
-.It Bq Er EINVAL
-The
-.Dv PROC_REAP_RELEASE
-request was issued by the
-.Xr init 8
-process.
-.It Bq Er EBUSY
-The
-.Dv PROC_REAP_ACQUIRE
-request was issued by a process that had already acquired reaper status
-and has not yet released it.
-.It Bq Er EBUSY
-The
-.Dv PROC_TRACE_CTL
-request was issued for a process already being traced.
-.It Bq Er EPERM
-The
-.Dv PROC_TRACE_CTL
-request to re-enable tracing of the process (
-.Dv PROC_TRACE_CTL_ENABLE ) ,
-or to disable persistence of the
-.Dv PROC_TRACE_CTL_DISABLE
-on
-.Xr execve 2
-was issued for a non-current process.
-.It Bq Er EINVAL
-The value of the integer
-.Fa data
-parameter for the
-.Dv PROC_TRACE_CTL
-request is invalid.
.El
.Sh SEE ALSO
-.Xr dtrace 1 ,
-.Xr kill 2 ,
-.Xr ktrace 2 ,
-.Xr ptrace 2 ,
-.Xr wait 2 ,
-.Xr hwpmc 4 ,
-.Xr init 8
+.Xr ptrace 2
.Sh HISTORY
The
.Fn procctl
function appeared in
.Fx 10.0 .
-The reaper facility is based on a similar feature of Linux and
-DragonflyBSD, and first appeared in
-.Fx 10.2 .
diff --git a/lib/libc/sys/pselect.c b/lib/libc/sys/pselect.c
deleted file mode 100644
index a623a7d..0000000
--- a/lib/libc/sys/pselect.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/select.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_pselect, __pselect);
-
-#pragma weak pselect
-int
-pselect(int n, fd_set *rs, fd_set *ws, fd_set *es, const struct timespec *t,
- const sigset_t *s)
-{
-
- return (((int (*)(int, fd_set *, fd_set *, fd_set *,
- const struct timespec *, const sigset_t *))
- __libc_interposing[INTERPOS_pselect])(n, rs, ws, es, t, s));
-}
diff --git a/lib/libc/sys/pwrite.c b/lib/libc/sys/pwrite.c
new file mode 100644
index 0000000..d17ed29
--- /dev/null
+++ b/lib/libc/sys/pwrite.c
@@ -0,0 +1,56 @@
+/*
+ * 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[] = "@(#)mmap.c 8.1 (Berkeley) 6/17/93";
+#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+#include "libc_private.h"
+
+/*
+ * This function provides 64-bit offset padding that
+ * is not supplied by GCC 1.X but is supplied by GCC 2.X.
+ */
+ssize_t
+pwrite(fd, buf, nbyte, offset)
+ int fd;
+ const void *buf;
+ size_t nbyte;
+ off_t offset;
+{
+ if (__getosreldate() >= 700051)
+ return (__sys_pwrite(fd, buf, nbyte, offset));
+ else
+ return (__sys_freebsd6_pwrite(fd, buf, nbyte, 0, offset));
+}
diff --git a/lib/libc/sys/read.c b/lib/libc/sys/read.c
deleted file mode 100644
index ab30189..0000000
--- a/lib/libc/sys/read.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_read, __read);
-
-#pragma weak read
-ssize_t
-read(int fd, void *buf, size_t nbytes)
-{
-
- return (((ssize_t (*)(int, void *, size_t))
- __libc_interposing[INTERPOS_read])(fd, buf, nbytes));
-}
diff --git a/lib/libc/sys/readv.c b/lib/libc/sys/readv.c
deleted file mode 100644
index 8c82040..0000000
--- a/lib/libc/sys/readv.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_readv, __readv);
-
-#pragma weak readv
-ssize_t
-readv(int fd, const struct iovec *iov, int iovcnt)
-{
-
- return (((ssize_t (*)(int, const struct iovec *, int))
- __libc_interposing[INTERPOS_readv])(fd, iov, iovcnt));
-}
diff --git a/lib/libc/sys/recvfrom.c b/lib/libc/sys/recvfrom.c
deleted file mode 100644
index aa6ef3f..0000000
--- a/lib/libc/sys/recvfrom.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <sys/socket.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_recvfrom, __recvfrom);
-
-#pragma weak recvfrom
-ssize_t
-recvfrom(int s, void *buf, size_t len, int flags,
- struct sockaddr * __restrict from, socklen_t * __restrict fromlen)
-{
-
- return (((ssize_t (*)(int, void *, size_t, int,
- struct sockaddr *, socklen_t *))
- __libc_interposing[INTERPOS_recvfrom])(s, buf, len, flags,
- from, fromlen));
-}
diff --git a/lib/libc/sys/recvmsg.c b/lib/libc/sys/recvmsg.c
deleted file mode 100644
index 282ede9..0000000
--- a/lib/libc/sys/recvmsg.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <sys/socket.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_recvmsg, __recvmsg);
-
-#pragma weak recvmsg
-ssize_t
-recvmsg(int s, struct msghdr *msg, int flags)
-{
-
- return (((int (*)(int, struct msghdr *, int))
- __libc_interposing[INTERPOS_recvmsg])(s, msg, flags));
-}
diff --git a/lib/libc/sys/revoke.2 b/lib/libc/sys/revoke.2
index 482cbf6..57abdbb 100644
--- a/lib/libc/sys/revoke.2
+++ b/lib/libc/sys/revoke.2
@@ -97,8 +97,8 @@ operation on the named file.
The caller is neither the owner of the file nor the super user.
.El
.Sh SEE ALSO
-.Xr revoke 1 ,
-.Xr close 2
+.Xr close 2 ,
+.Xr revoke 1
.Sh HISTORY
The
.Fn revoke
diff --git a/lib/libc/sys/sched_setscheduler.2 b/lib/libc/sys/sched_setscheduler.2
index b84c1a1..3e7c42b 100644
--- a/lib/libc/sys/sched_setscheduler.2
+++ b/lib/libc/sys/sched_setscheduler.2
@@ -151,9 +151,9 @@ argument is invalid, or one or more of the parameters contained in
is outside the valid range for the specified scheduling policy.
.El
.Sh SEE ALSO
+.Xr sched_getparam 2 ,
.Xr sched_get_priority_max 2 ,
.Xr sched_get_priority_min 2 ,
-.Xr sched_getparam 2 ,
.Xr sched_rr_get_interval 2 ,
.Xr sched_setparam 2 ,
.Xr sched_yield 2
diff --git a/lib/libc/sys/select.c b/lib/libc/sys/select.c
deleted file mode 100644
index 3990496..0000000
--- a/lib/libc/sys/select.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/select.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_select, __select);
-
-#pragma weak select
-int
-select(int n, fd_set *rs, fd_set *ws, fd_set *es, struct timeval *t)
-{
-
- return (((int (*)(int, fd_set *, fd_set *, fd_set *, struct timeval *))
- __libc_interposing[INTERPOS_select])(n, rs, ws, es, t));
-}
diff --git a/lib/libc/sys/sendmsg.c b/lib/libc/sys/sendmsg.c
deleted file mode 100644
index 7944643..0000000
--- a/lib/libc/sys/sendmsg.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <sys/socket.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_sendmsg, __sendmsg);
-
-#pragma weak sendmsg
-ssize_t
-sendmsg(int s, const struct msghdr *msg, int flags)
-{
-
- return (((int (*)(int, const struct msghdr *, int))
- __libc_interposing[INTERPOS_sendmsg])(s, msg, flags));
-}
diff --git a/lib/libc/sys/sendto.c b/lib/libc/sys/sendto.c
deleted file mode 100644
index ecf98ee..0000000
--- a/lib/libc/sys/sendto.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <sys/socket.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_sendto, __sendto);
-
-#pragma weak sendto
-ssize_t
-sendto(int s, const void *msg, size_t len, int flags,
- const struct sockaddr *to, socklen_t tolen)
-{
-
- return (((ssize_t (*)(int, const void *, size_t, int,
- const struct sockaddr *, socklen_t))
- __libc_interposing[INTERPOS_sendto])(s, msg, len, flags,
- to, tolen));
-}
diff --git a/lib/libc/sys/setcontext.c b/lib/libc/sys/setcontext.c
deleted file mode 100644
index 31b888f..0000000
--- a/lib/libc/sys/setcontext.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <ucontext.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_setcontext, __setcontext);
-__sym_compat(setcontext, __impl_setcontext, FBSD_1.0);
-__weak_reference(setcontext, __impl_setcontext);
-__sym_default(setcontext, setcontext, FBSD_1.2);
-
-#pragma weak setcontext
-int
-setcontext(const ucontext_t *uc)
-{
-
- return (((int (*)(const ucontext_t *))
- __libc_interposing[INTERPOS_setcontext])(uc));
-}
diff --git a/lib/libc/sys/setresuid.2 b/lib/libc/sys/setresuid.2
index 602166f..08d07f3 100644
--- a/lib/libc/sys/setresuid.2
+++ b/lib/libc/sys/setresuid.2
@@ -19,7 +19,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 7, 2015
+.Dd April 13, 2001
.Dt SETRESUID 2
.Os
.Sh NAME
@@ -90,5 +90,10 @@ was invalid.
.Xr setregid 2 ,
.Xr setreuid 2 ,
.Xr setuid 2
+.Sh STANDARDS
+These system calls are not available on many platforms.
+They exist in
+.Fx
+to support Linux binaries linked against GNU libc2.
.Sh HISTORY
These functions first appeared in HP-UX.
diff --git a/lib/libc/sys/sigaction.c b/lib/libc/sys/sigaction.c
deleted file mode 100644
index 7645538..0000000
--- a/lib/libc/sys/sigaction.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <signal.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_sigaction, __sigaction);
-
-#pragma weak sigaction
-int
-sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
-{
-
- return (((int (*)(int, const struct sigaction *, struct sigaction *))
- __libc_interposing[INTERPOS_sigaction])(sig, act, oact));
-}
diff --git a/lib/libc/sys/sigprocmask.c b/lib/libc/sys/sigprocmask.c
deleted file mode 100644
index 40dba95..0000000
--- a/lib/libc/sys/sigprocmask.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <signal.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_sigprocmask, __sigprocmask);
-
-#pragma weak sigprocmask
-int
-sigprocmask(int how, const sigset_t *set, sigset_t *oset)
-{
-
- return (((int (*)(int, const sigset_t *, sigset_t *))
- __libc_interposing[INTERPOS_sigprocmask])(how, set, oset));
-}
diff --git a/lib/libc/sys/sigsuspend.c b/lib/libc/sys/sigsuspend.c
deleted file mode 100644
index 6e47368..0000000
--- a/lib/libc/sys/sigsuspend.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <signal.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_sigsuspend, __sigsuspend);
-
-#pragma weak sigsuspend
-int
-sigsuspend(const sigset_t *set)
-{
-
- return (((int (*)(const sigset_t *))
- __libc_interposing[INTERPOS_sigsuspend])(set));
-}
diff --git a/lib/libc/sys/sigtimedwait.c b/lib/libc/sys/sigtimedwait.c
deleted file mode 100644
index 4e06719..0000000
--- a/lib/libc/sys/sigtimedwait.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <signal.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_sigtimedwait, __sigtimedwait);
-
-#pragma weak sigtimedwait
-int
-sigtimedwait(const sigset_t * __restrict set, siginfo_t * __restrict info,
- const struct timespec * __restrict t)
-{
-
- return (((int (*)(const sigset_t *, siginfo_t *,
- const struct timespec *))
- __libc_interposing[INTERPOS_sigtimedwait])(set, info, t));
-}
diff --git a/lib/libc/sys/sigwait.c b/lib/libc/sys/sigwait.c
index b21cabd..2fdffdd 100644
--- a/lib/libc/sys/sigwait.c
+++ b/lib/libc/sys/sigwait.c
@@ -28,21 +28,13 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include <signal.h>
-#include "libc_private.h"
-__weak_reference(__libc_sigwait, __sigwait);
+int __sys_sigwait(const sigset_t * restrict, int * restrict);
-#pragma weak sigwait
-int
-sigwait(const sigset_t *set, int *sig)
-{
-
- return (((int (*)(const sigset_t *, int *))
- __libc_interposing[INTERPOS_sigwait])(set, sig));
-}
+__weak_reference(__sigwait, sigwait);
int
-__libc_sigwait(const sigset_t *set, int *sig)
+__sigwait(const sigset_t * restrict set, int * restrict sig)
{
int ret;
diff --git a/lib/libc/sys/sigwaitinfo.2 b/lib/libc/sys/sigwaitinfo.2
index b497592..9109759 100644
--- a/lib/libc/sys/sigwaitinfo.2
+++ b/lib/libc/sys/sigwaitinfo.2
@@ -172,8 +172,8 @@ system calls fail if:
.Bl -tag -width Er
.It Bq Er EINTR
The wait was interrupted by an unblocked, caught signal.
-.El
.Pp
+.El
The
.Fn sigtimedwait
system call may also fail if:
diff --git a/lib/libc/sys/sigwaitinfo.c b/lib/libc/sys/sigwaitinfo.c
deleted file mode 100644
index b9cdc79..0000000
--- a/lib/libc/sys/sigwaitinfo.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <signal.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_sigwaitinfo, __sigwaitinfo);
-
-#pragma weak sigwaitinfo
-int
-sigwaitinfo(const sigset_t * __restrict set, siginfo_t * __restrict info)
-{
-
- return (((int (*)(const sigset_t *, siginfo_t *))
- __libc_interposing[INTERPOS_sigwaitinfo])(set, info));
-}
diff --git a/lib/libc/sys/socketpair.2 b/lib/libc/sys/socketpair.2
index b15553a..d3a47eb 100644
--- a/lib/libc/sys/socketpair.2
+++ b/lib/libc/sys/socketpair.2
@@ -28,7 +28,7 @@
.\" @(#)socketpair.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd May 4, 2015
+.Dd September 11, 2013
.Dt SOCKETPAIR 2
.Os
.Sh NAME
@@ -40,13 +40,13 @@
.In sys/types.h
.In sys/socket.h
.Ft int
-.Fn socketpair "int domain" "int type" "int protocol" "int *sv"
+.Fn socketpair "int fd" "int type" "int protocol" "int *sv"
.Sh DESCRIPTION
The
.Fn socketpair
system call creates an unnamed pair of connected sockets in
-the specified communications
-.Fa domain ,
+the specified domain
+.Fa fd ,
of the specified
.Fa type ,
and using the optionally specified
diff --git a/lib/libc/sys/truncate.2 b/lib/libc/sys/truncate.2
index 0734464..f06c1eb 100644
--- a/lib/libc/sys/truncate.2
+++ b/lib/libc/sys/truncate.2
@@ -28,7 +28,7 @@
.\" @(#)truncate.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd May 4, 2015
+.Dd December 13, 2006
.Dt TRUNCATE 2
.Os
.Sh NAME
@@ -60,18 +60,9 @@ is lost.
If the file was smaller than this size,
it will be extended as if by writing bytes
with the value zero.
-.Pp
-The
-.Fn ftruncate
-system call causes the file or shared memory object backing the file descriptor
-.Fa fd
-to be truncated or extended to
-.Fa length
-bytes in size.
-The file descriptor must be a valid file descriptor open for writing.
-The file position pointer associated with the file descriptor
-.Fa fd
-will not be modified.
+With
+.Fn ftruncate ,
+the file must be open for writing.
.Sh RETURN VALUES
.Rv -std
If the file to be modified is not a directory or
@@ -138,7 +129,7 @@ is not a valid descriptor.
The
.Fa fd
argument
-references a file descriptor that is not a regular file or shared memory object.
+references a socket, not a file.
.It Bq Er EINVAL
The
.Fa fd
@@ -147,14 +138,11 @@ is not open for writing.
.El
.Sh SEE ALSO
.Xr chflags 2 ,
-.Xr open 2 ,
-.Xr shm_open 2
+.Xr open 2
.Sh HISTORY
The
.Fn truncate
-and
-.Fn ftruncate
-system calls appeared in
+system call appeared in
.Bx 4.2 .
.Sh BUGS
These calls should be generalized to allow ranges
diff --git a/lib/libc/sys/truncate.c b/lib/libc/sys/truncate.c
new file mode 100644
index 0000000..375c9d9
--- /dev/null
+++ b/lib/libc/sys/truncate.c
@@ -0,0 +1,55 @@
+/*
+ * 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[] = "@(#)truncate.c 8.1 (Berkeley) 6/17/93";
+#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+#include "libc_private.h"
+
+/*
+ * This function provides 64-bit offset padding that
+ * is not supplied by GCC 1.X but is supplied by GCC 2.X.
+ */
+int
+truncate(path, length)
+ const char *path;
+ off_t length;
+{
+
+ if (__getosreldate() >= 700051)
+ return(__sys_truncate(path, length));
+ else
+ return(__sys_freebsd6_truncate(path, 0, length));
+}
diff --git a/lib/libc/sys/utimensat.2 b/lib/libc/sys/utimensat.2
deleted file mode 100644
index 0f397c6..0000000
--- a/lib/libc/sys/utimensat.2
+++ /dev/null
@@ -1,292 +0,0 @@
-.\" $NetBSD: utimes.2,v 1.13 1999/03/22 19:45:11 garbled Exp $
-.\"
-.\" Copyright (c) 1990, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\" Copyright (c) 2012, Jilles Tjoelker
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)utimes.2 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD$
-.\"
-.Dd January 23, 2015
-.Dt UTIMENSAT 2
-.Os
-.Sh NAME
-.Nm futimens ,
-.Nm utimensat
-.Nd set file access and modification times
-.Sh LIBRARY
-.Lb libc
-.Sh SYNOPSIS
-.In sys/stat.h
-.Ft int
-.Fn futimens "int fd" "const struct timespec times[2]"
-.Ft int
-.Fo utimensat
-.Fa "int fd"
-.Fa "const char *path"
-.Fa "const struct timespec times[2]"
-.Fa "int flag"
-.Fc
-.Sh DESCRIPTION
-The access and modification times of the file named by
-.Fa path
-or referenced by
-.Fa fd
-are changed as specified by the argument
-.Fa times .
-The inode-change-time of the file is set to the current time.
-.Pp
-If
-.Fa path
-specifies a relative path,
-it is relative to the current working directory if
-.Fa fd
-is
-.Dv AT_FDCWD
-and otherwise relative to the directory associated with the file descriptor
-.Fa fd .
-.Pp
-The
-.Va tv_nsec
-field of a
-.Vt timespec
-structure
-can be set to the special value
-.Dv UTIME_NOW
-to set the current time, or to
-.Dv UTIME_OMIT
-to leave the time unchanged.
-In either case, the
-.Va tv_sec
-field is ignored.
-.Pp
-If
-.Fa times
-is
-.No non- Ns Dv NULL ,
-it is assumed to point to an array of two timespec 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.
-For file systems that support file birth (creation) times (such as
-.Dv UFS2 ) ,
-the birth time will be set to the value of the second element
-if the second element is older than the currently set birth time.
-To set both a birth time and a modification time,
-two calls are required; the first to set the birth time
-and the second to set the (presumably newer) modification time.
-Ideally a new system call will be added that allows the setting
-of all three times at once.
-If
-.Fa times
-is
-.Dv NULL ,
-this is equivalent to passing
-a pointer to an array of two timespec structures
-with both
-.Va tv_nsec
-fields set to
-.Dv UTIME_NOW .
-.Pp
-If both
-.Va tv_nsec
-fields are
-.Dv UTIME_OMIT ,
-the timestamps remain unchanged and
-no permissions are needed for the file itself,
-although search permissions may be required for the path prefix.
-The call may or may not succeed if the named file does not exist.
-.Pp
-If both
-.Va tv_nsec
-fields are
-.Dv UTIME_NOW ,
-the caller must be the owner of the file, have permission to
-write the file, or be the super-user.
-.Pp
-For all other values of the timestamps,
-the caller must be the owner of the file or be the super-user.
-.Pp
-The values for the
-.Fa flag
-argument of the
-.Fn utimensat
-system call
-are constructed by a bitwise-inclusive OR of flags from the following list,
-defined in
-.In fcntl.h :
-.Bl -tag -width indent
-.It Dv AT_SYMLINK_NOFOLLOW
-If
-.Fa path
-names a symbolic link, the symbolic link's times are changed.
-By default,
-.Fn utimensat
-changes the times of the file referenced by the symbolic link.
-.El
-.Sh RETURN VALUES
-.Rv -std
-.Sh COMPATIBILITY
-If the running kernel does not support this system call,
-a wrapper emulates it using
-.Xr fstatat 2 ,
-.Xr futimesat 2
-and
-.Xr lutimes 2 .
-As a result, timestamps will be rounded down to the nearest microsecond,
-.Dv UTIME_OMIT
-is not atomic and
-.Dv AT_SYMLINK_NOFOLLOW
-is not available with a path relative to a file descriptor.
-.Sh ERRORS
-These system calls will fail if:
-.Bl -tag -width Er
-.It Bq Er EACCES
-The
-.Fa times
-argument is
-.Dv NULL ,
-or both
-.Va tv_nsec
-values are
-.Dv UTIME_NOW ,
-and the effective user ID of the process does not
-match the owner of the file, and is not the super-user, and write
-access is denied.
-.It Bq Er EFAULT
-The
-.Fa times
-argument
-points outside the process's allocated address space.
-.It Bq Er EINVAL
-The
-.Va tv_usec
-component of at least one of the values specified by the
-.Fa times
-argument has a value less than 0 or greater than 999999.
-.It Bq Er EIO
-An I/O error occurred while reading or writing the affected inode.
-.It Bq Er EPERM
-The
-.Fa times
-argument is not
-.Dv NULL
-nor are both
-.Va tv_nsec
-values
-.Dv UTIME_NOW ,
-nor are both
-.Va tv_nsec
-values
-.Dv UTIME_OMIT
-and the calling process's effective user ID
-does not match the owner of the file and is not the super-user.
-.It Bq Er EPERM
-The named file has its immutable or append-only flag set, see the
-.Xr chflags 2
-manual page for more information.
-.It Bq Er EROFS
-The file system containing the file is mounted read-only.
-.El
-.Pp
-The
-.Fn futimens
-system call
-will fail if:
-.Bl -tag -width Er
-.It Bq Er EBADF
-The
-.Fa fd
-argument
-does not refer to a valid descriptor.
-.El
-.Pp
-The
-.Fn utimensat
-system call
-will fail if:
-.Bl -tag -width Er
-.It Bq Er EACCES
-Search permission is denied for a component of the path prefix.
-.It Bq Er EBADF
-The
-.Fa path
-argument does not specify an absolute path and the
-.Fa fd
-argument is neither
-.Dv AT_FDCWD
-nor a valid file descriptor.
-.It Bq Er EFAULT
-The
-.Fa path
-argument
-points outside the process's allocated address space.
-.It Bq Er ELOOP
-Too many symbolic links were encountered in translating the pathname.
-.It Bq Er ENAMETOOLONG
-A component of a pathname exceeded
-.Dv NAME_MAX
-characters, or an entire path name exceeded
-.Dv 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.
-.It Bq Er ENOTDIR
-The
-.Fa path
-argument is not an absolute path and
-.Fa fd
-is neither
-.Dv AT_FDCWD
-nor a file descriptor associated with a directory.
-.It Bq Er ENOTSUP
-The running kernel does not support this system call and
-.Dv AT_SYMLINK_NOFOLLOW
-is used with a path relative to a file descriptor.
-.El
-.Sh SEE ALSO
-.Xr chflags 2 ,
-.Xr stat 2 ,
-.Xr symlink 2 ,
-.Xr utimes 2 ,
-.Xr utime 3 ,
-.Xr symlink 7
-.Sh STANDARDS
-The
-.Fn futimens
-and
-.Fn utimensat
-system calls are expected to conform to
-.St -p1003.1-2008 .
-.Sh HISTORY
-The
-.Fn futimens
-and
-.Fn utimensat
-system calls appeared in
-.Fx 11.0 .
diff --git a/lib/libc/sys/utimensat.c b/lib/libc/sys/utimensat.c
deleted file mode 100644
index 67d19cb..0000000
--- a/lib/libc/sys/utimensat.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * Copyright (c) 2015 Jilles Tjoelker
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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 <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "namespace.h"
-#include <sys/stat.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <time.h>
-#include "un-namespace.h"
-
-#include "libc_private.h"
-
-int
-utimensat(int fd, const char *path, const struct timespec times[2], int flag)
-{
- struct timeval now, tv[2], *tvp;
- struct stat sb;
-
- if (__getosreldate() >= 1100056)
- return (__sys_utimensat(fd, path, times, flag));
-
- if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) {
- errno = EINVAL;
- return (-1);
- }
- if (times == NULL || (times[0].tv_nsec == UTIME_NOW &&
- times[1].tv_nsec == UTIME_NOW))
- tvp = NULL;
- else if (times[0].tv_nsec == UTIME_OMIT &&
- times[1].tv_nsec == UTIME_OMIT)
- return (0);
- else {
- if ((times[0].tv_nsec < 0 || times[0].tv_nsec > 999999999) &&
- times[0].tv_nsec != UTIME_NOW &&
- times[0].tv_nsec != UTIME_OMIT) {
- errno = EINVAL;
- return (-1);
- }
- if ((times[1].tv_nsec < 0 || times[1].tv_nsec > 999999999) &&
- times[1].tv_nsec != UTIME_NOW &&
- times[1].tv_nsec != UTIME_OMIT) {
- errno = EINVAL;
- return (-1);
- }
- tv[0].tv_sec = times[0].tv_sec;
- tv[0].tv_usec = times[0].tv_nsec / 1000;
- tv[1].tv_sec = times[1].tv_sec;
- tv[1].tv_usec = times[1].tv_nsec / 1000;
- tvp = tv;
- if (times[0].tv_nsec == UTIME_OMIT ||
- times[1].tv_nsec == UTIME_OMIT) {
- if (fstatat(fd, path, &sb, flag) == -1)
- return (-1);
- if (times[0].tv_nsec == UTIME_OMIT) {
- tv[0].tv_sec = sb.st_atim.tv_sec;
- tv[0].tv_usec = sb.st_atim.tv_nsec / 1000;
- }
- if (times[1].tv_nsec == UTIME_OMIT) {
- tv[1].tv_sec = sb.st_mtim.tv_sec;
- tv[1].tv_usec = sb.st_mtim.tv_nsec / 1000;
- }
- }
- if (times[0].tv_nsec == UTIME_NOW ||
- times[1].tv_nsec == UTIME_NOW) {
- if (gettimeofday(&now, NULL) == -1)
- return (-1);
- if (times[0].tv_nsec == UTIME_NOW)
- tv[0] = now;
- if (times[1].tv_nsec == UTIME_NOW)
- tv[1] = now;
- }
- }
- if ((flag & AT_SYMLINK_NOFOLLOW) == 0)
- return (futimesat(fd, path, tvp));
- else if ((flag & AT_SYMLINK_NOFOLLOW) != 0 &&
- (fd == AT_FDCWD || path[0] == '/'))
- return (lutimes(path, tvp));
- else {
- errno = ENOTSUP;
- return (-1);
- }
-}
diff --git a/lib/libc/sys/vfork.2 b/lib/libc/sys/vfork.2
index 0518262..1cfaa61 100644
--- a/lib/libc/sys/vfork.2
+++ b/lib/libc/sys/vfork.2
@@ -28,7 +28,7 @@
.\" @(#)vfork.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd April 6, 2015
+.Dd November 13, 2009
.Dt VFORK 2
.Os
.Sh NAME
@@ -100,8 +100,8 @@ since buffered data would then be flushed twice.)
Same as for
.Xr fork 2 .
.Sh SEE ALSO
-.Xr _exit 2 ,
.Xr execve 2 ,
+.Xr _exit 2 ,
.Xr fork 2 ,
.Xr rfork 2 ,
.Xr sigaction 2 ,
@@ -111,7 +111,7 @@ Same as for
The
.Fn vfork
system call appeared in
-.Bx 3 .
+.Bx 2.9 .
.Sh BUGS
To avoid a possible deadlock situation,
processes that are children in the middle
diff --git a/lib/libc/sys/wait4.c b/lib/libc/sys/wait4.c
deleted file mode 100644
index a5dbd0f..0000000
--- a/lib/libc/sys/wait4.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/wait.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_wait4, __wait4);
-
-#pragma weak wait4
-pid_t
-wait4(pid_t pid, int *status, int options, struct rusage *ru)
-{
-
- return (((pid_t (*)(pid_t, int *, int, struct rusage *))
- __libc_interposing[INTERPOS_wait4])(pid, status, options, ru));
-}
diff --git a/lib/libc/sys/wait6.c b/lib/libc/sys/wait6.c
deleted file mode 100644
index d280a76..0000000
--- a/lib/libc/sys/wait6.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2015 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_wait6, __wait6);
-
-#pragma weak wait6
-pid_t
-wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *ru,
- siginfo_t *infop)
-{
-
- return (((pid_t (*)(idtype_t, id_t, int *, int, struct __wrusage *,
- siginfo_t *))__libc_interposing[INTERPOS_wait6])(idtype, id,
- status, options, ru, infop));
-}
diff --git a/lib/libc/sys/write.c b/lib/libc/sys/write.c
deleted file mode 100644
index ffb1aa5..0000000
--- a/lib/libc/sys/write.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_write, __write);
-
-#pragma weak write
-ssize_t
-write(int fd, const void *buf, size_t nbytes)
-{
-
- return (((ssize_t (*)(int, const void *, size_t))
- __libc_interposing[INTERPOS_write])(fd, buf, nbytes));
-}
diff --git a/lib/libc/sys/writev.c b/lib/libc/sys/writev.c
deleted file mode 100644
index 6be74b3..0000000
--- a/lib/libc/sys/writev.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Konstantin Belousov
- * 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(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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-#include "libc_private.h"
-
-__weak_reference(__sys_writev, __writev);
-
-#pragma weak writev
-ssize_t
-writev(int fd, const struct iovec *iov, int iovcnt)
-{
-
- return (((ssize_t (*)(int, const struct iovec *, int))
- __libc_interposing[INTERPOS_writev])(fd, iov, iovcnt));
-}
diff --git a/lib/libc/tests/c063/Makefile b/lib/libc/tests/c063/Makefile
index 5f4e1ca..b743165 100644
--- a/lib/libc/tests/c063/Makefile
+++ b/lib/libc/tests/c063/Makefile
@@ -2,26 +2,23 @@
TESTSDIR= ${TESTSBASE}/lib/libc/c063
-#TODO: t_o_search
+#TODO: t_o_search, t_utimensat
-NETBSD_ATF_TESTS_C= faccessat
-NETBSD_ATF_TESTS_C+= fchmodat
-NETBSD_ATF_TESTS_C+= fchownat
-NETBSD_ATF_TESTS_C+= fexecve
-NETBSD_ATF_TESTS_C+= fstatat
-NETBSD_ATF_TESTS_C+= linkat
-NETBSD_ATF_TESTS_C+= mkdirat
-NETBSD_ATF_TESTS_C+= mkfifoat
-NETBSD_ATF_TESTS_C+= mknodat
-NETBSD_ATF_TESTS_C+= openat
-NETBSD_ATF_TESTS_C+= readlinkat
-NETBSD_ATF_TESTS_C+= renameat
-NETBSD_ATF_TESTS_C+= symlinkat
-NETBSD_ATF_TESTS_C+= unlinkat
-NETBSD_ATF_TESTS_C+= utimensat
+NETBSD_ATF_TESTS_C= t_faccessat
+NETBSD_ATF_TESTS_C+= t_fchmodat
+NETBSD_ATF_TESTS_C+= t_fchownat
+NETBSD_ATF_TESTS_C+= t_fexecve
+NETBSD_ATF_TESTS_C+= t_fstatat
+NETBSD_ATF_TESTS_C+= t_linkat
+NETBSD_ATF_TESTS_C+= t_mkdirat
+NETBSD_ATF_TESTS_C+= t_mkfifoat
+NETBSD_ATF_TESTS_C+= t_mknodat
+NETBSD_ATF_TESTS_C+= t_openat
+NETBSD_ATF_TESTS_C+= t_readlinkat
+NETBSD_ATF_TESTS_C+= t_renameat
+NETBSD_ATF_TESTS_C+= t_symlinkat
+NETBSD_ATF_TESTS_C+= t_unlinkat
CFLAGS+= -D_INCOMPLETE_XOPEN_C063
-.include "../Makefile.netbsd-tests"
-
.include <bsd.test.mk>
diff --git a/lib/libc/tests/db/Makefile b/lib/libc/tests/db/Makefile
index ed1d6ca..323a9f0 100644
--- a/lib/libc/tests/db/Makefile
+++ b/lib/libc/tests/db/Makefile
@@ -11,7 +11,6 @@ FILESDIR= ${TESTSDIR}
FILES= README
NETBSD_ATF_TESTS_SH+= db_test
-ATF_TESTS_SH_SED_db_test= -e 's,/bin/csh,/bin/cat,g'
.include "../Makefile.netbsd-tests"
diff --git a/lib/libc/tests/hash/Makefile b/lib/libc/tests/hash/Makefile
index 52fd569..df9d6d9 100644
--- a/lib/libc/tests/hash/Makefile
+++ b/lib/libc/tests/hash/Makefile
@@ -1,14 +1,8 @@
# $FreeBSD$
-.include <src.opts.mk>
-
TESTSDIR= ${TESTSBASE}/lib/libc/hash
-NETBSD_ATF_TESTS_C=
-
-.if ${MK_OPENSSL} != "no"
-NETBSD_ATF_TESTS_C+= sha2_test
-.endif
+NETBSD_ATF_TESTS_C= sha2_test
NETBSD_ATF_TESTS_SH= hash_test
diff --git a/lib/libc/tests/ssp/Makefile b/lib/libc/tests/ssp/Makefile
index 7bc8660..cf767ce 100644
--- a/lib/libc/tests/ssp/Makefile
+++ b/lib/libc/tests/ssp/Makefile
@@ -26,11 +26,7 @@ PROGS+= h_getcwd
PROGS+= h_memcpy
PROGS+= h_memmove
PROGS+= h_memset
-# This testcase doesn't run properly when not compiled with -fsantize=bounds
-# with clang, which is currently contingent on a compiler_rt update
-.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30500
PROGS+= h_raw
-.endif
PROGS+= h_read
PROGS+= h_readlink
PROGS+= h_snprintf
diff --git a/lib/libc/tests/sys/Makefile b/lib/libc/tests/sys/Makefile
index 5e457fd..89431bc 100644
--- a/lib/libc/tests/sys/Makefile
+++ b/lib/libc/tests/sys/Makefile
@@ -12,9 +12,7 @@ NETBSD_ATF_TESTS_C+= clock_gettime_test
NETBSD_ATF_TESTS_C+= connect_test
NETBSD_ATF_TESTS_C+= dup_test
NETBSD_ATF_TESTS_C+= fsync_test
-.if ${MACHINE} != "arm64" # ARM64TODO: Missing makecontext
NETBSD_ATF_TESTS_C+= getcontext_test
-.endif
NETBSD_ATF_TESTS_C+= getgroups_test
NETBSD_ATF_TESTS_C+= getitimer_test
NETBSD_ATF_TESTS_C+= getlogin_test
diff --git a/lib/libc/xdr/xdr_float.c b/lib/libc/xdr/xdr_float.c
index 1d3bb61..1135806 100644
--- a/lib/libc/xdr/xdr_float.c
+++ b/lib/libc/xdr/xdr_float.c
@@ -64,8 +64,7 @@ __FBSDID("$FreeBSD$");
#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
defined(__arm__) || defined(__ppc__) || \
- defined(__arm26__) || defined(__sparc64__) || defined(__amd64__) || \
- defined(__aarch64__)
+ defined(__arm26__) || defined(__sparc64__) || defined(__amd64__)
#include <machine/endian.h>
#define IEEEFP
#endif
diff --git a/lib/libc_nonshared/Makefile.depend b/lib/libc_nonshared/Makefile.depend
new file mode 100644
index 0000000..639d45d
--- /dev/null
+++ b/lib/libc_nonshared/Makefile.depend
@@ -0,0 +1,14 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libcalendar/Makefile.depend b/lib/libcalendar/Makefile.depend
new file mode 100644
index 0000000..7cedd5f
--- /dev/null
+++ b/lib/libcalendar/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libcam/Makefile b/lib/libcam/Makefile
index c448369..1621fe6 100644
--- a/lib/libcam/Makefile
+++ b/lib/libcam/Makefile
@@ -6,7 +6,8 @@ SRCS= camlib.c scsi_cmdparse.c scsi_all.c scsi_da.c scsi_sa.c cam.c \
ata_all.c smp_all.c
INCS= camlib.h
-LIBADD= sbuf
+DPADD= ${LIBSBUF}
+LDADD= -lsbuf
MAN= cam.3 cam_cdbparse.3
diff --git a/lib/libcam/Makefile.depend b/lib/libcam/Makefile.depend
new file mode 100644
index 0000000..f976a9c
--- /dev/null
+++ b/lib/libcam/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libsbuf \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libcapsicum/Makefile b/lib/libcapsicum/Makefile
index 6ee5bb8..061edfc 100644
--- a/lib/libcapsicum/Makefile
+++ b/lib/libcapsicum/Makefile
@@ -21,7 +21,8 @@ INCS+= libcapsicum_random.h
INCS+= libcapsicum_service.h
INCS+= libcapsicum_sysctl.h
-LIBADD= nv
+DPADD= ${LIBNV}
+LDADD= -lnv
CFLAGS+=-I${.CURDIR}
CFLAGS+=-I${.CURDIR}/../libnv
diff --git a/lib/libcapsicum/Makefile.depend b/lib/libcapsicum/Makefile.depend
new file mode 100644
index 0000000..ab84fcc
--- /dev/null
+++ b/lib/libcapsicum/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libnv \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libcapsicum/libcapsicum.3 b/lib/libcapsicum/libcapsicum.3
index cbfd214..9df565a 100644
--- a/lib/libcapsicum/libcapsicum.3
+++ b/lib/libcapsicum/libcapsicum.3
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 2, 2015
+.Dd April 14, 2014
.Dt LIBCAPSICUM 3
.Os
.Sh NAME
@@ -68,9 +68,9 @@
.Ft "int"
.Fn cap_send_nvlist "const cap_channel_t *chan" "const nvlist_t *nvl"
.Ft "nvlist_t *"
-.Fn cap_recv_nvlist "const cap_channel_t *chan" "int flags"
+.Fn cap_recv_nvlist "const cap_channel_t *chan"
.Ft "nvlist_t *"
-.Fn cap_xfer_nvlist "const cap_channel_t *chan" "nvlist_t *nvl" "int flags"
+.Fn cap_xfer_nvlist "const cap_channel_t *chan" "nvlist_t *nvl"
.In libcapsicum_service.h
.Ft "cap_channel_t *"
.Fn cap_service_open "const cap_channel_t *chan" "const char *name"
@@ -171,23 +171,11 @@ Most services should provide higher level API.
The
.Fn cap_recv_nvlist
function receives the given nvlist over the given capability.
-The
-.Fa flags
-argument defines what type the top nvlist is expected to be.
-If the nvlist flags do not match the flags passed to
-.Fn cap_recv_nvlist ,
-the nvlist will not be returned.
.Pp
The
.Fn cap_xfer_nvlist
function sends the given nvlist, destroys it and receives new nvlist in
response over the given capability.
-The
-.Fa flags
-argument defines what type the top nvlist is expected to be.
-If the nvlist flags do not match the flags passed to
-.Fn cap_xfer_nvlist ,
-the nvlist will not be returned.
It does not matter if the function succeeds or fails, the nvlist given
for sending will always be destroyed once the function returns.
.Pp
diff --git a/lib/libcapsicum/libcapsicum.c b/lib/libcapsicum/libcapsicum.c
index 79c570f..79ca871 100644
--- a/lib/libcapsicum/libcapsicum.c
+++ b/lib/libcapsicum/libcapsicum.c
@@ -142,7 +142,7 @@ cap_clone(const cap_channel_t *chan)
nvl = nvlist_create(0);
nvlist_add_string(nvl, "cmd", "clone");
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL)
return (NULL);
if (nvlist_get_number(nvl, "error") != 0) {
@@ -195,7 +195,7 @@ cap_limit_set(const cap_channel_t *chan, nvlist_t *limits)
nvlmsg = nvlist_create(0);
nvlist_add_string(nvlmsg, "cmd", "limit_set");
nvlist_add_nvlist(nvlmsg, "limits", limits);
- nvlmsg = cap_xfer_nvlist(chan, nvlmsg, 0);
+ nvlmsg = cap_xfer_nvlist(chan, nvlmsg);
if (nvlmsg == NULL) {
nvlist_destroy(limits);
return (-1);
@@ -218,7 +218,7 @@ cap_limit_get(const cap_channel_t *chan, nvlist_t **limitsp)
nvlmsg = nvlist_create(0);
nvlist_add_string(nvlmsg, "cmd", "limit_get");
- nvlmsg = cap_xfer_nvlist(chan, nvlmsg, 0);
+ nvlmsg = cap_xfer_nvlist(chan, nvlmsg);
if (nvlmsg == NULL)
return (-1);
error = (int)nvlist_get_number(nvlmsg, "error");
@@ -246,21 +246,21 @@ cap_send_nvlist(const cap_channel_t *chan, const nvlist_t *nvl)
}
nvlist_t *
-cap_recv_nvlist(const cap_channel_t *chan, int flags)
+cap_recv_nvlist(const cap_channel_t *chan)
{
assert(chan != NULL);
assert(chan->cch_magic == CAP_CHANNEL_MAGIC);
- return (nvlist_recv(chan->cch_sock, flags));
+ return (nvlist_recv(chan->cch_sock));
}
nvlist_t *
-cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl, int flags)
+cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl)
{
assert(chan != NULL);
assert(chan->cch_magic == CAP_CHANNEL_MAGIC);
- return (nvlist_xfer(chan->cch_sock, nvl, flags));
+ return (nvlist_xfer(chan->cch_sock, nvl));
}
diff --git a/lib/libcapsicum/libcapsicum.h b/lib/libcapsicum/libcapsicum.h
index c7110d8..4f8c597 100644
--- a/lib/libcapsicum/libcapsicum.h
+++ b/lib/libcapsicum/libcapsicum.h
@@ -105,11 +105,11 @@ int cap_send_nvlist(const cap_channel_t *chan, const nvlist_t *nvl);
/*
* Function receives nvlist over the given capability.
*/
-nvlist_t *cap_recv_nvlist(const cap_channel_t *chan, int flags);
+nvlist_t *cap_recv_nvlist(const cap_channel_t *chan);
/*
* Function sends the given nvlist, destroys it and receives new nvlist in
* response over the given capability.
*/
-nvlist_t *cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl, int flags);
+nvlist_t *cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl);
#endif /* !_LIBCAPSICUM_H_ */
diff --git a/lib/libcapsicum/libcapsicum_dns.c b/lib/libcapsicum/libcapsicum_dns.c
index a180b6b..113f8dc 100644
--- a/lib/libcapsicum/libcapsicum_dns.c
+++ b/lib/libcapsicum/libcapsicum_dns.c
@@ -30,7 +30,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <assert.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
@@ -68,8 +67,6 @@ static struct hostent *
hostent_unpack(const nvlist_t *nvl, struct hostent *hp)
{
unsigned int ii, nitems;
- char nvlname[64];
- int n;
hostent_free(hp);
@@ -84,10 +81,8 @@ hostent_unpack(const nvlist_t *nvl, struct hostent *hp)
if (hp->h_aliases == NULL)
goto fail;
for (ii = 0; ii < nitems; ii++) {
- n = snprintf(nvlname, sizeof(nvlname), "alias%u", ii);
- assert(n > 0 && n < (int)sizeof(nvlname));
hp->h_aliases[ii] =
- strdup(nvlist_get_string(nvl, nvlname));
+ strdup(nvlist_getf_string(nvl, "alias%u", ii));
if (hp->h_aliases[ii] == NULL)
goto fail;
}
@@ -101,9 +96,7 @@ hostent_unpack(const nvlist_t *nvl, struct hostent *hp)
hp->h_addr_list[ii] = malloc(hp->h_length);
if (hp->h_addr_list[ii] == NULL)
goto fail;
- n = snprintf(nvlname, sizeof(nvlname), "addr%u", ii);
- assert(n > 0 && n < (int)sizeof(nvlname));
- bcopy(nvlist_get_binary(nvl, nvlname, NULL),
+ bcopy(nvlist_getf_binary(nvl, NULL, "addr%u", ii),
hp->h_addr_list[ii], hp->h_length);
}
hp->h_addr_list[ii] = NULL;
@@ -132,7 +125,7 @@ cap_gethostbyname2(cap_channel_t *chan, const char *name, int type)
nvlist_add_string(nvl, "cmd", "gethostbyname");
nvlist_add_number(nvl, "family", (uint64_t)type);
nvlist_add_string(nvl, "name", name);
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL) {
h_errno = NO_RECOVERY;
return (NULL);
@@ -159,7 +152,7 @@ cap_gethostbyaddr(cap_channel_t *chan, const void *addr, socklen_t len,
nvlist_add_string(nvl, "cmd", "gethostbyaddr");
nvlist_add_binary(nvl, "addr", addr, (size_t)len);
nvlist_add_number(nvl, "family", (uint64_t)type);
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL) {
h_errno = NO_RECOVERY;
return (NULL);
@@ -215,9 +208,8 @@ cap_getaddrinfo(cap_channel_t *chan, const char *hostname, const char *servname,
struct addrinfo *firstai, *prevai, *curai;
unsigned int ii;
const nvlist_t *nvlai;
- char nvlname[64];
nvlist_t *nvl;
- int error, n;
+ int error;
nvl = nvlist_create(0);
nvlist_add_string(nvl, "cmd", "getaddrinfo");
@@ -233,7 +225,7 @@ cap_getaddrinfo(cap_channel_t *chan, const char *hostname, const char *servname,
nvlist_add_number(nvl, "hints.ai_protocol",
(uint64_t)hints->ai_protocol);
}
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL)
return (EAI_MEMORY);
if (nvlist_get_number(nvl, "error") != 0) {
@@ -245,11 +237,9 @@ cap_getaddrinfo(cap_channel_t *chan, const char *hostname, const char *servname,
nvlai = NULL;
firstai = prevai = curai = NULL;
for (ii = 0; ; ii++) {
- n = snprintf(nvlname, sizeof(nvlname), "res%u", ii);
- assert(n > 0 && n < (int)sizeof(nvlname));
- if (!nvlist_exists_nvlist(nvl, nvlname))
+ if (!nvlist_existsf_nvlist(nvl, "res%u", ii))
break;
- nvlai = nvlist_get_nvlist(nvl, nvlname);
+ nvlai = nvlist_getf_nvlist(nvl, "res%u", ii);
curai = addrinfo_unpack(nvlai);
if (curai == NULL)
break;
@@ -283,7 +273,7 @@ cap_getnameinfo(cap_channel_t *chan, const struct sockaddr *sa, socklen_t salen,
nvlist_add_number(nvl, "servlen", (uint64_t)servlen);
nvlist_add_binary(nvl, "sa", sa, (size_t)salen);
nvlist_add_number(nvl, "flags", (uint64_t)flags);
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL)
return (EAI_MEMORY);
if (nvlist_get_number(nvl, "error") != 0) {
@@ -324,8 +314,6 @@ cap_dns_type_limit(cap_channel_t *chan, const char * const *types,
{
nvlist_t *limits;
unsigned int i;
- char nvlname[64];
- int n;
if (cap_limit_get(chan, &limits) < 0)
return (-1);
@@ -333,11 +321,8 @@ cap_dns_type_limit(cap_channel_t *chan, const char * const *types,
limits = nvlist_create(0);
else
limit_remove(limits, "type");
- for (i = 0; i < ntypes; i++) {
- n = snprintf(nvlname, sizeof(nvlname), "type%u", i);
- assert(n > 0 && n < (int)sizeof(nvlname));
- nvlist_add_string(limits, nvlname, types[i]);
- }
+ for (i = 0; i < ntypes; i++)
+ nvlist_addf_string(limits, types[i], "type%u", i);
return (cap_limit_set(chan, limits));
}
@@ -347,8 +332,6 @@ cap_dns_family_limit(cap_channel_t *chan, const int *families,
{
nvlist_t *limits;
unsigned int i;
- char nvlname[64];
- int n;
if (cap_limit_get(chan, &limits) < 0)
return (-1);
@@ -357,9 +340,8 @@ cap_dns_family_limit(cap_channel_t *chan, const int *families,
else
limit_remove(limits, "family");
for (i = 0; i < nfamilies; i++) {
- n = snprintf(nvlname, sizeof(nvlname), "family%u", i);
- assert(n > 0 && n < (int)sizeof(nvlname));
- nvlist_add_number(limits, nvlname, (uint64_t)families[i]);
+ nvlist_addf_number(limits, (uint64_t)families[i],
+ "family%u", i);
}
return (cap_limit_set(chan, limits));
}
diff --git a/lib/libcapsicum/libcapsicum_grp.c b/lib/libcapsicum/libcapsicum_grp.c
index 267ac68..c679ce9 100644
--- a/lib/libcapsicum/libcapsicum_grp.c
+++ b/lib/libcapsicum/libcapsicum_grp.c
@@ -94,10 +94,9 @@ group_unpack_members(const nvlist_t *nvl, char ***fieldp, char **bufferp,
size_t *bufsizep)
{
const char *mem;
- char **outstrs, *str, nvlname[64];
+ char **outstrs, *str;
size_t nmem, datasize, strsize;
unsigned int ii;
- int n;
if (!nvlist_exists_number(nvl, "gr_nmem")) {
datasize = _ALIGNBYTES + sizeof(char *);
@@ -114,9 +113,7 @@ group_unpack_members(const nvlist_t *nvl, char ***fieldp, char **bufferp,
nmem = (size_t)nvlist_get_number(nvl, "gr_nmem");
datasize = _ALIGNBYTES + sizeof(char *) * (nmem + 1);
for (ii = 0; ii < nmem; ii++) {
- n = snprintf(nvlname, sizeof(nvlname), "gr_mem[%u]", ii);
- assert(n > 0 && n < (int)sizeof(nvlname));
- mem = dnvlist_get_string(nvl, nvlname, NULL);
+ mem = dnvlist_getf_string(nvl, NULL, "gr_mem[%u]", ii);
if (mem == NULL)
return (EINVAL);
datasize += strlen(mem) + 1;
@@ -128,9 +125,7 @@ group_unpack_members(const nvlist_t *nvl, char ***fieldp, char **bufferp,
outstrs = (char **)_ALIGN(*bufferp);
str = (char *)outstrs + sizeof(char *) * (nmem + 1);
for (ii = 0; ii < nmem; ii++) {
- n = snprintf(nvlname, sizeof(nvlname), "gr_mem[%u]", ii);
- assert(n > 0 && n < (int)sizeof(nvlname));
- mem = nvlist_get_string(nvl, nvlname);
+ mem = nvlist_getf_string(nvl, "gr_mem[%u]", ii);
strsize = strlen(mem) + 1;
memcpy(str, mem, strsize);
outstrs[ii] = str;
@@ -195,7 +190,7 @@ cap_getgrcommon_r(cap_channel_t *chan, const char *cmd, const char *name,
} else {
abort();
}
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL) {
assert(errno != 0);
*result = NULL;
@@ -319,7 +314,7 @@ cap_setgroupent(cap_channel_t *chan, int stayopen)
nvl = nvlist_create(0);
nvlist_add_string(nvl, "cmd", "setgroupent");
nvlist_add_bool(nvl, "stayopen", stayopen != 0);
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL)
return (0);
if (nvlist_get_number(nvl, "error") != 0) {
@@ -339,7 +334,7 @@ cap_setgrent(cap_channel_t *chan)
nvl = nvlist_create(0);
nvlist_add_string(nvl, "cmd", "setgrent");
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL)
return (0);
if (nvlist_get_number(nvl, "error") != 0) {
@@ -360,7 +355,7 @@ cap_endgrent(cap_channel_t *chan)
nvl = nvlist_create(0);
nvlist_add_string(nvl, "cmd", "endgrent");
/* Ignore any errors, we have no way to report them. */
- nvlist_destroy(cap_xfer_nvlist(chan, nvl, 0));
+ nvlist_destroy(cap_xfer_nvlist(chan, nvl));
}
int
@@ -412,8 +407,6 @@ cap_grp_limit_groups(cap_channel_t *chan, const char * const *names,
{
nvlist_t *limits, *groups;
unsigned int i;
- char nvlname[64];
- int n;
if (cap_limit_get(chan, &limits) < 0)
return (-1);
@@ -424,16 +417,10 @@ cap_grp_limit_groups(cap_channel_t *chan, const char * const *names,
nvlist_free_nvlist(limits, "groups");
}
groups = nvlist_create(0);
- for (i = 0; i < ngids; i++) {
- n = snprintf(nvlname, sizeof(nvlname), "gid%u", i);
- assert(n > 0 && n < (int)sizeof(nvlname));
- nvlist_add_number(groups, nvlname, (uint64_t)gids[i]);
- }
- for (i = 0; i < nnames; i++) {
- n = snprintf(nvlname, sizeof(nvlname), "gid%u", i);
- assert(n > 0 && n < (int)sizeof(nvlname));
- nvlist_add_string(groups, nvlname, names[i]);
- }
+ for (i = 0; i < ngids; i++)
+ nvlist_addf_number(groups, (uint64_t)gids[i], "gid%u", i);
+ for (i = 0; i < nnames; i++)
+ nvlist_addf_string(groups, names[i], "name%u", i);
nvlist_move_nvlist(limits, "groups", groups);
return (cap_limit_set(chan, limits));
}
diff --git a/lib/libcapsicum/libcapsicum_pwd.c b/lib/libcapsicum/libcapsicum_pwd.c
index 32eeeb0..792fb66 100644
--- a/lib/libcapsicum/libcapsicum_pwd.c
+++ b/lib/libcapsicum/libcapsicum_pwd.c
@@ -154,7 +154,7 @@ cap_getpwcommon_r(cap_channel_t *chan, const char *cmd, const char *login,
} else {
abort();
}
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL) {
assert(errno != 0);
*result = NULL;
@@ -278,7 +278,7 @@ cap_setpassent(cap_channel_t *chan, int stayopen)
nvl = nvlist_create(0);
nvlist_add_string(nvl, "cmd", "setpassent");
nvlist_add_bool(nvl, "stayopen", stayopen != 0);
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL)
return (0);
if (nvlist_get_number(nvl, "error") != 0) {
@@ -299,7 +299,7 @@ cap_set_end_pwent(cap_channel_t *chan, const char *cmd)
nvl = nvlist_create(0);
nvlist_add_string(nvl, "cmd", cmd);
/* Ignore any errors, we have no way to report them. */
- nvlist_destroy(cap_xfer_nvlist(chan, nvl, 0));
+ nvlist_destroy(cap_xfer_nvlist(chan, nvl));
}
void
@@ -364,9 +364,7 @@ cap_pwd_limit_users(cap_channel_t *chan, const char * const *names,
size_t nnames, uid_t *uids, size_t nuids)
{
nvlist_t *limits, *users;
- char nvlname[64];
unsigned int i;
- int n;
if (cap_limit_get(chan, &limits) < 0)
return (-1);
@@ -377,16 +375,10 @@ cap_pwd_limit_users(cap_channel_t *chan, const char * const *names,
nvlist_free_nvlist(limits, "users");
}
users = nvlist_create(0);
- for (i = 0; i < nuids; i++) {
- n = snprintf(nvlname, sizeof(nvlname), "uid%u", i);
- assert(n > 0 && n < (int)sizeof(nvlname));
- nvlist_add_number(users, nvlname, (uint64_t)uids[i]);
- }
- for (i = 0; i < nnames; i++) {
- n = snprintf(nvlname, sizeof(nvlname), "name%u", i);
- assert(n > 0 && n < (int)sizeof(nvlname));
- nvlist_add_string(users, nvlname, names[i]);
- }
+ for (i = 0; i < nuids; i++)
+ nvlist_addf_number(users, (uint64_t)uids[i], "uid%u", i);
+ for (i = 0; i < nnames; i++)
+ nvlist_addf_string(users, names[i], "name%u", i);
nvlist_move_nvlist(limits, "users", users);
return (cap_limit_set(chan, limits));
}
diff --git a/lib/libcapsicum/libcapsicum_random.c b/lib/libcapsicum/libcapsicum_random.c
index 2c3eb36..eed97e2 100644
--- a/lib/libcapsicum/libcapsicum_random.c
+++ b/lib/libcapsicum/libcapsicum_random.c
@@ -57,7 +57,7 @@ cap_random_buf(cap_channel_t *chan, void *buf, size_t nbytes)
nvlist_add_string(nvl, "cmd", "generate");
nvlist_add_number(nvl, "size",
(uint64_t)(left > MAXSIZE ? MAXSIZE : left));
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL)
return (-1);
if (nvlist_get_number(nvl, "error") != 0) {
diff --git a/lib/libcapsicum/libcapsicum_service.c b/lib/libcapsicum/libcapsicum_service.c
index edfde8c..4127668 100644
--- a/lib/libcapsicum/libcapsicum_service.c
+++ b/lib/libcapsicum/libcapsicum_service.c
@@ -56,7 +56,7 @@ cap_service_open(const cap_channel_t *chan, const char *name)
nvlist_add_string(nvl, "service", name);
if (fd_is_valid(STDERR_FILENO))
nvlist_add_descriptor(nvl, "stderrfd", STDERR_FILENO);
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL)
return (NULL);
error = (int)nvlist_get_number(nvl, "error");
diff --git a/lib/libcapsicum/libcapsicum_sysctl.c b/lib/libcapsicum/libcapsicum_sysctl.c
index fc69113..6ea951b 100644
--- a/lib/libcapsicum/libcapsicum_sysctl.c
+++ b/lib/libcapsicum/libcapsicum_sysctl.c
@@ -63,7 +63,7 @@ cap_sysctlbyname(cap_channel_t *chan, const char *name, void *oldp,
nvlist_add_number(nvl, "oldlen", (uint64_t)*oldlenp);
if (newp != NULL)
nvlist_add_binary(nvl, "newp", newp, newlen);
- nvl = cap_xfer_nvlist(chan, nvl, 0);
+ nvl = cap_xfer_nvlist(chan, nvl);
if (nvl == NULL)
return (-1);
if (nvlist_get_number(nvl, "error") != 0) {
diff --git a/lib/libcasper/Makefile b/lib/libcasper/Makefile
index e57accd..ddcfba5 100644
--- a/lib/libcasper/Makefile
+++ b/lib/libcasper/Makefile
@@ -8,7 +8,8 @@ SHLIBDIR?= /lib
SRCS= libcasper.c
INCS= libcasper.h
-LIBADD= capsicum nv pjdlog
+DPADD= ${LIBCAPSICUM} ${LIBNV} ${LIBPJDLOG}
+LDADD= -lcapsicum -lnv -lpjdlog
CFLAGS+=-I${.CURDIR}
CFLAGS+=-I${.CURDIR}/../libpjdlog
diff --git a/lib/libcasper/libcasper.c b/lib/libcasper/libcasper.c
index cb95346..7545baa 100644
--- a/lib/libcasper/libcasper.c
+++ b/lib/libcasper/libcasper.c
@@ -279,7 +279,7 @@ casper_message(const cap_channel_t *capcas, struct service *service)
const char *cmd;
nvlist_t *nvl;
- nvl = cap_recv_nvlist(capcas, 0);
+ nvl = cap_recv_nvlist(capcas);
if (nvl == NULL)
pjdlog_exit(1, "Unable to receive message from Casper");
cmd = nvlist_get_string(nvl, "cmd");
@@ -297,7 +297,7 @@ service_message(struct service *service, struct service_connection *sconn)
const char *cmd;
int error;
- nvlin = cap_recv_nvlist(service_connection_get_chan(sconn), 0);
+ nvlin = cap_recv_nvlist(service_connection_get_chan(sconn));
if (nvlin == NULL) {
if (errno == ENOTCONN) {
pjdlog_debug(1, "Connection closed by the client.");
diff --git a/lib/libclang_rt/Makefile b/lib/libclang_rt/Makefile
deleted file mode 100644
index b082e38..0000000
--- a/lib/libclang_rt/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# $FreeBSD$
-
-.include <src.opts.mk>
-
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-SUBDIR+= asan\
- asan_cxx\
- san\
- ubsan\
- ubsan_cxx
-.endif
-
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \
- (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb")
-SUBDIR+= profile
-.endif
-
-.include <bsd.subdir.mk>
diff --git a/lib/libclang_rt/Makefile.inc b/lib/libclang_rt/Makefile.inc
deleted file mode 100644
index be0122e..0000000
--- a/lib/libclang_rt/Makefile.inc
+++ /dev/null
@@ -1,26 +0,0 @@
-# $FreeBSD$
-
-.include <src.opts.mk>
-
-CRTARCH=${MACHINE_CPUARCH:C/amd64/x86_64/}
-CRTSRC=${.CURDIR}/../../../contrib/compiler-rt
-
-LIBDIR=/usr/lib/clang/3.6.0/lib/freebsd
-
-NO_PIC=
-MK_PROFILE=no
-
-WARNS?=0
-
-SSP_CFLAGS=
-CFLAGS+=-DNDEBUG
-CFLAGS+=${PICFLAG}
-CFLAGS+=-fno-builtin
-CFLAGS+=-fno-exceptions
-CFLAGS+=-fno-rtti
-CFLAGS+=-fno-stack-protector
-CFLAGS+=-funwind-tables
-CFLAGS+=-fvisibility-inlines-hidden
-CFLAGS+=-fvisibility=hidden
-CFLAGS+=-I${CRTSRC}/lib
-CXXFLAGS+=-std=c++11
diff --git a/lib/libclang_rt/asan/Makefile b/lib/libclang_rt/asan/Makefile
deleted file mode 100644
index e751970..0000000
--- a/lib/libclang_rt/asan/Makefile
+++ /dev/null
@@ -1,80 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.init.mk>
-
-LIB= clang_rt.asan-${CRTARCH}
-
-.PATH: ${CRTSRC}/lib/asan\
- ${CRTSRC}/lib/interception\
- ${CRTSRC}/lib/sanitizer_common\
- ${CRTSRC}/lib/lsan
-
-SRCS= asan_preinit.cc\
- asan_allocator.cc\
- asan_activation.cc\
- asan_debugging.cc\
- asan_fake_stack.cc\
- asan_flags.cc\
- asan_globals.cc\
- asan_interceptors.cc\
- asan_linux.cc\
- asan_mac.cc\
- asan_malloc_linux.cc\
- asan_malloc_mac.cc\
- asan_malloc_win.cc\
- asan_poisoning.cc\
- asan_posix.cc\
- asan_report.cc\
- asan_rtl.cc\
- asan_stack.cc\
- asan_stats.cc\
- asan_suppressions.cc\
- asan_thread.cc\
- asan_win.cc\
- interception_linux.cc\
- interception_mac.cc\
- interception_win.cc\
- interception_type_test.cc\
- sanitizer_allocator.cc\
- sanitizer_common.cc\
- sanitizer_deadlock_detector1.cc\
- sanitizer_deadlock_detector2.cc\
- sanitizer_flags.cc\
- sanitizer_flag_parser.cc\
- sanitizer_libc.cc\
- sanitizer_libignore.cc\
- sanitizer_linux.cc\
- sanitizer_mac.cc\
- sanitizer_persistent_allocator.cc\
- sanitizer_platform_limits_linux.cc\
- sanitizer_platform_limits_posix.cc\
- sanitizer_posix.cc\
- sanitizer_printf.cc\
- sanitizer_procmaps_common.cc\
- sanitizer_procmaps_freebsd.cc\
- sanitizer_procmaps_linux.cc\
- sanitizer_procmaps_mac.cc\
- sanitizer_stackdepot.cc\
- sanitizer_stacktrace.cc\
- sanitizer_stacktrace_printer.cc\
- sanitizer_suppressions.cc\
- sanitizer_symbolizer.cc\
- sanitizer_symbolizer_libbacktrace.cc\
- sanitizer_symbolizer_win.cc\
- sanitizer_tls_get_addr.cc\
- sanitizer_thread_registry.cc\
- sanitizer_win.cc\
- sanitizer_common_libcdep.cc\
- sanitizer_coverage_libcdep.cc\
- sanitizer_coverage_mapping_libcdep.cc\
- sanitizer_linux_libcdep.cc\
- sanitizer_posix_libcdep.cc\
- sanitizer_stacktrace_libcdep.cc\
- sanitizer_stoptheworld_linux_libcdep.cc\
- sanitizer_symbolizer_libcdep.cc\
- sanitizer_symbolizer_posix_libcdep.cc\
- sanitizer_unwind_posix_libcdep.cc\
- lsan_common.cc\
- lsan_common_linux.cc
-
-.include <bsd.lib.mk>
diff --git a/lib/libclang_rt/asan_cxx/Makefile b/lib/libclang_rt/asan_cxx/Makefile
deleted file mode 100644
index 9763c16..0000000
--- a/lib/libclang_rt/asan_cxx/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.init.mk>
-
-LIB= clang_rt.asan_cxx-${CRTARCH}
-
-.PATH: ${CRTSRC}/lib/asan
-
-SRCS= asan_new_delete.cc
-
-.include <bsd.lib.mk>
diff --git a/lib/libclang_rt/profile/Makefile b/lib/libclang_rt/profile/Makefile
deleted file mode 100644
index 058a8f1..0000000
--- a/lib/libclang_rt/profile/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.init.mk>
-
-LIB= clang_rt.profile-${CRTARCH}
-
-.PATH: ${CRTSRC}/lib/profile
-
-SRCS= GCDAProfiling.c\
- InstrProfiling.c\
- InstrProfilingBuffer.c\
- InstrProfilingFile.c\
- InstrProfilingPlatformDarwin.c\
- InstrProfilingPlatformOther.c\
- InstrProfilingRuntime.cc\
-
-.include <bsd.lib.mk>
diff --git a/lib/libclang_rt/san/Makefile b/lib/libclang_rt/san/Makefile
deleted file mode 100644
index da8fe13..0000000
--- a/lib/libclang_rt/san/Makefile
+++ /dev/null
@@ -1,49 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.init.mk>
-
-LIB= clang_rt.san-${CRTARCH}
-
-.PATH: ${CRTSRC}/lib/sanitizer_common\
-
-SRCS= sanitizer_allocator.cc\
- sanitizer_common.cc\
- sanitizer_deadlock_detector1.cc\
- sanitizer_deadlock_detector2.cc\
- sanitizer_flags.cc\
- sanitizer_flag_parser.cc\
- sanitizer_libc.cc\
- sanitizer_libignore.cc\
- sanitizer_linux.cc\
- sanitizer_mac.cc\
- sanitizer_persistent_allocator.cc\
- sanitizer_platform_limits_linux.cc\
- sanitizer_platform_limits_posix.cc\
- sanitizer_posix.cc\
- sanitizer_printf.cc\
- sanitizer_procmaps_common.cc\
- sanitizer_procmaps_freebsd.cc\
- sanitizer_procmaps_linux.cc\
- sanitizer_procmaps_mac.cc\
- sanitizer_stackdepot.cc\
- sanitizer_stacktrace.cc\
- sanitizer_stacktrace_printer.cc\
- sanitizer_suppressions.cc\
- sanitizer_symbolizer.cc\
- sanitizer_symbolizer_libbacktrace.cc\
- sanitizer_symbolizer_win.cc\
- sanitizer_tls_get_addr.cc\
- sanitizer_thread_registry.cc\
- sanitizer_win.cc\
- sanitizer_common_libcdep.cc\
- sanitizer_coverage_libcdep.cc\
- sanitizer_coverage_mapping_libcdep.cc\
- sanitizer_linux_libcdep.cc\
- sanitizer_posix_libcdep.cc\
- sanitizer_stacktrace_libcdep.cc\
- sanitizer_stoptheworld_linux_libcdep.cc\
- sanitizer_symbolizer_libcdep.cc\
- sanitizer_symbolizer_posix_libcdep.cc\
- sanitizer_unwind_posix_libcdep.cc
-
-.include <bsd.lib.mk>
diff --git a/lib/libclang_rt/ubsan/Makefile b/lib/libclang_rt/ubsan/Makefile
deleted file mode 100644
index 34bca81..0000000
--- a/lib/libclang_rt/ubsan/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.init.mk>
-
-LIB= clang_rt.ubsan-${CRTARCH}
-
-.PATH: ${CRTSRC}/lib/ubsan
-
-SRCS= ubsan_diag.cc\
- ubsan_init.cc\
- ubsan_flags.cc\
- ubsan_handlers.cc\
- ubsan_value.cc
-
-.include <bsd.lib.mk>
-
-
diff --git a/lib/libclang_rt/ubsan_cxx/Makefile b/lib/libclang_rt/ubsan_cxx/Makefile
deleted file mode 100644
index e577a15..0000000
--- a/lib/libclang_rt/ubsan_cxx/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.init.mk>
-
-LIB= clang_rt.ubsan_cxx-${CRTARCH}
-
-CXXFLAGS+=-frtti
-
-.PATH: ${CRTSRC}/lib/ubsan
-
-SRCS= ubsan_handlers_cxx.cc\
- ubsan_type_hash.cc
-
-.include <bsd.lib.mk>
diff --git a/lib/libcom_err/Makefile b/lib/libcom_err/Makefile
index 72260fe..78014ad 100644
--- a/lib/libcom_err/Makefile
+++ b/lib/libcom_err/Makefile
@@ -10,6 +10,8 @@ CFLAGS+= -I${COM_ERRDIR}
LDFLAGS= -Wl,--no-undefined
VERSION_MAP= ${COM_ERRDIR}/version-script.map
+SUBDIR= doc
+
.include <bsd.lib.mk>
.PATH: ${COM_ERRDIR}
diff --git a/lib/libcom_err/Makefile.depend b/lib/libcom_err/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libcom_err/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libcom_err/doc/Makefile b/lib/libcom_err/doc/Makefile
new file mode 100644
index 0000000..4c3c0bb
--- /dev/null
+++ b/lib/libcom_err/doc/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+INFO= com_err
+INFOSECTION= "Programming & development tools."
+INFOENTRY_com_err= "* libcom_err: (com_err). A Common Error Description Library for UNIX."
+
+.include <bsd.info.mk>
diff --git a/lib/libcom_err/doc/com_err.texinfo b/lib/libcom_err/doc/com_err.texinfo
new file mode 100644
index 0000000..6c71da8
--- /dev/null
+++ b/lib/libcom_err/doc/com_err.texinfo
@@ -0,0 +1,615 @@
+\input texinfo @c -*-texinfo-*-
+
+@c $FreeBSD$
+
+@c Note that although this source file is in texinfo format (more
+@c or less), it is not yet suitable for turning into an ``info''
+@c file. Sorry, maybe next time.
+@c
+@c In order to produce hardcopy documentation from a texinfo file,
+@c run ``tex com_err.texinfo'' which will load in texinfo.tex,
+@c provided in this distribution. (texinfo.tex is from the Free
+@c Software Foundation, and is under different copyright restrictions
+@c from the rest of this package.)
+
+@ifinfo
+@barfo
+@end ifinfo
+
+@iftex
+@tolerance 10000
+
+@c Mutate section headers...
+@begingroup
+ @catcode#=6
+ @gdef@secheading#1#2#3{@secheadingi {#3@enspace #1}}
+@endgroup
+@end iftex
+
+@c %**start of header (This is for running Texinfo on a region.)
+@setfilename com_err
+@settitle A Common Error Description Library for UNIX
+@c %**end of header (This is for running Texinfo on a region.)
+
+@ifinfo
+This file documents the use of the Common Error Description library.
+
+Copyright (C) 1987, 1988 Student Information Processing Board of the
+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 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 names of M.I.T. and the M.I.T. S.I.P.B. not be
+used in advertising or publicity pertaining to distribution of the software
+without specific, written prior permission. M.I.T. and the M.I.T. S.I.P.B.
+make no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+
+Note that the file texinfo.tex, provided with this distribution, is from
+the Free Software Foundation, and is under different copyright restrictions
+from the remainder of this package.
+
+@end ifinfo
+
+@ignore
+Permission is granted to process this file through Tex and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+
+@end ignore
+
+@setchapternewpage odd
+
+@titlepage
+@center @titlefont{A Common Error Description}
+@center @titlefont{Library for UNIX}
+@sp 2
+@center Ken Raeburn
+@center Bill Sommerfeld
+@sp 1
+@center MIT Student Information Processing Board
+@sp 3
+@center last updated 1 January 1989
+@center for version 1.2
+@center ***DRAFT COPY ONLY***
+
+@vskip 2in
+
+@center @b{Abstract}
+
+UNIX has always had a clean and simple system call interface, with a
+standard set of error codes passed between the kernel and user
+programs. Unfortunately, the same cannot be said of many of the
+libraries layered on top of the primitives provided by the kernel.
+Typically, each one has used a different style of indicating errors to
+their callers, leading to a total hodgepodge of error handling, and
+considerable amounts of work for the programmer. This paper describes
+a library and associated utilities which allows a more uniform way for
+libraries to return errors to their callers, and for programs to
+describe errors and exceptional conditions to their users.
+
+@page
+@vskip 0pt plus 1filll
+
+Copyright @copyright{} 1987, 1988 by the Student Information Processing
+Board of the 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 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 names of M.I.T. and the M.I.T. S.I.P.B. not be
+used in advertising or publicity pertaining to distribution of the software
+without specific, written prior permission. M.I.T. and the M.I.T. S.I.P.B.
+make no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+
+Note that the file texinfo.tex, provided with this distribution, is from
+the Free Software Foundation, and is under different copyright restrictions
+from the remainder of this package.
+
+@end titlepage
+
+@ifinfo
+@node Top, Why com_err?, (dir), (dir)
+@comment node-name, next, previous, up
+@top General Introduction
+
+@menu
+* Why com_err?:: What is all this for?
+* Error codes:: What's an error code, anyway?
+* Error table source file:: How to describe an error table.
+* The error-table compiler:: How to compile the table.
+* Run-time support routines:: How to use from within your program.
+* Coding Conventions:: Stylistic issues.
+* Building and Installation:: How to build and install.
+* Bug Reports:: You have found a bug? Report it.
+* Acknowledgements:: Whom to thank...
+
+@end menu
+
+@end ifinfo
+
+@page
+
+@ifinfo
+@node Why com_err?, Error codes, Top, (dir)
+@comment node-name, next, previous, up
+@end ifinfo
+
+@section Why com_err?
+
+In building application software packages, a programmer often has to
+deal with a number of libraries, each of which can use a different
+error-reporting mechanism. Sometimes one of two values is returned,
+indicating simply SUCCESS or FAILURE, with no description of errors
+encountered. Sometimes it is an index into a table of text strings,
+where the name of the table used is dependent on the library being
+used when the error is generated; since each table starts numbering at
+0 or 1, additional information as to the source of the error code is
+needed to determine which table to look at. Sometimes no text messages are
+supplied at all, and the programmer must supply them at any point at which
+he may wish to report error conditions.
+Often, a global variable is assigned some value describing the error, but
+the programmer has to know in each case whether to look at @code{errno},
+@code{h_errno}, the return value from @code{hes_err()}, or whatever other
+variables or routines are specified.
+And what happens if something
+in the procedure of
+examining or reporting the error changes the same variable?
+
+The package we have developed is an attempt to present a common
+error-handling mechanism to manipulate the most common form of error code
+in a fashion that does not have the problems listed above.
+
+A list of up to 256 text messages is supplied to a translator we have
+written, along with the three- to four-character ``name'' of the error
+table. The library using this error table need only call a routine
+generated from this error-table source to make the table ``known'' to the
+com_err library, and any error code the library generates can be converted
+to the corresponding error message. There is also a default format for
+error codes accidentally returned before making the table known, which is
+of the form @samp{unknown code foo 32}, where @samp{foo} would be the name
+of the table.
+
+@ifinfo
+@node Error codes, Error table source file, Why com_err?, (dir)
+@comment node-name, next, previous, up
+@end ifinfo
+
+@section Error codes
+
+Error codes themselves are 32 bit (signed) integers, of which the high
+order 24 bits are an identifier of which error table the error code is
+from, and the low order 8 bits are a sequential error number within
+the table. An error code may thus be easily decomposed into its component
+parts. Only the lowest 32 bits of an error code are considered significant
+on systems which support wider values.
+
+Error table 0 is defined to match the UNIX system call error table
+(@code{sys_errlist}); this allows @code{errno} values to be used directly
+in the library (assuming that @code{errno} is of a type with the same width
+as @t{long}). Other error table numbers are formed by compacting together
+the first four characters of the error table name. The mapping between
+characters in the name and numeric values in the error code are defined in
+a system-independent fashion, so that two systems that can pass integral
+values between them can reliably pass error codes without loss of meaning;
+this should work even if the character sets used are not the same.
+(However, if this is to be done, error table 0 should be avoided, since the
+local system call error tables may differ.)
+
+Any variable which is to contain an error code should be declared @t{long}.
+The draft proposed American National Standard for C (as of May, 1988)
+requires that @t{long} variables be at least 32 bits; any system which does
+not support 32-bit @t{long} values cannot make use of this package (nor
+much other software that assumes an ANSI-C environment base) without
+significant effort.
+
+@ifinfo
+@node Error table source file, The error-table compiler, Error codes, (dir)
+@comment node-name, next, previous, up
+@end ifinfo
+
+@section Error table source file
+
+The error table source file begins with the declaration of the table name,
+as
+
+@example
+error_table @var{tablename}
+@end example
+
+Individual error codes are
+specified with
+
+@example
+error_code @var{ERROR_NAME}, @var{"text message"}
+@end example
+
+where @samp{ec} can also be used as a short form of @samp{error_code}. To
+indicate the end of the table, use @samp{end}. Thus, a (short) sample
+error table might be:
+
+@example
+
+ error_table dsc
+
+ error_code DSC_DUP_MTG_NAME,
+ "Meeting already exists"
+
+ ec DSC_BAD_PATH,
+ "A bad meeting pathname was given"
+
+ ec DSC_BAD_MODES,
+ "Invalid mode for this access control list"
+
+ end
+
+@end example
+
+@ifinfo
+@node The error-table compiler, Run-time support routines, Error table source file, (dir)
+@comment node-name, next, previous, up
+@end ifinfo
+
+@section The error-table compiler
+
+The error table compiler is named @code{compile_et}. It takes one
+argument, the pathname of a file (ending in @samp{.et}, e.g.,
+@samp{dsc_err.et}) containing an error table source file. It parses the
+error table, and generates two output files -- a C header file
+(@samp{discuss_err.h}) which contains definitions of the numerical values
+of the error codes defined in the error table, and a C source file which
+should be compiled and linked with the executable. The header file must be
+included in the source of a module which wishes to reference the error
+codes defined; the object module generated from the C code may be linked in
+to a program which wishes to use the printed forms of the error codes.
+
+This translator accepts a @kbd{-language @var{lang}} argument, which
+determines for which language (or language variant) the output should be
+written. At the moment, @var{lang} is currently limited to @kbd{ANSI-C}
+and @kbd{K&R-C}, and some abbreviated forms of each. Eventually, this will
+be extended to include some support for C++. The default is currently
+@kbd{K&R-C}, though the generated sources will have ANSI-C code
+conditionalized on the symbol @t{__STDC__}.
+
+@ifinfo
+@node Run-time support routines, Coding Conventions, The error-table compiler, (dir)
+@comment node-name, next, previous, up
+@end ifinfo
+
+@section Run-time support routines
+
+Any source file which uses the routines supplied with or produced by the
+com_err package should include the header file @file{<com_err.h>}. It
+contains declarations and definitions which may be needed on some systems.
+(Some functions cannot be referenced properly without the return type
+declarations in this file. Some functions may work properly on most
+architectures even without the header file, but relying on this is not
+recommended.)
+
+The run-time support routines and variables provided via this package
+include the following:
+
+@example
+void initialize_@var{xxxx}_error_table (void);
+@end example
+
+One of these routines is built by the error compiler for each error table.
+It makes the @var{xxxx} error table ``known'' to the error reporting
+system. By convention, this routine should be called in the initialization
+routine of the @var{xxxx} library. If the library has no initialization
+routine, some combination of routines which form the core of the library
+should ensure that this routine is called. It is not advised to leave it
+the caller to make this call.
+
+There is no harm in calling this routine more than once.
+
+@example
+#define ERROR_TABLE_BASE_@var{xxxx} @var{nnnnn}L
+@end example
+
+This symbol contains the value of the first error code entry in the
+specified table.
+This rarely needs be used by the
+programmer.
+
+@example
+const char *error_message (long code);
+@end example
+
+This routine returns the character string error message associated
+with @code{code}; if this is associated with an unknown error table, or
+if the code is associated with a known error table but the code is not
+in the table, a string of the form @samp{Unknown code @var{xxxx nn}} is
+returned, where @var{xxxx} is the error table name produced by
+reversing the compaction performed on the error table number implied
+by that error code, and @var{nn} is the offset from that base value.
+
+Although this routine is available for use when needed, its use should be
+left to circumstances which render @code{com_err} (below) unusable.
+
+@example
+void com_err (const char *whoami, /* module reporting error */
+ long code, /* error code */
+ const char *format, /* format for additional detail */
+ ...); /* (extra parameters) */
+@end example
+
+This routine provides an alternate way to print error messages to
+standard error; it allows the error message to be passed in as a
+parameter, rather than in an external variable. @emph{Provide grammatical
+context for ``message.''}
+
+If @var{format} is @code{(char *)NULL}, the formatted message will not be
+printed. @var{format} may not be omitted.
+
+@example
+#include <stdarg.h>
+
+void com_err_va (const char *whoami,
+ long code,
+ const char *format,
+ va_list args);
+@end example
+
+This routine provides an interface, equivalent to @code{com_err} above,
+which may be used by higher-level variadic functions (functions which
+accept variable numbers of arguments).
+
+@example
+#include <stdarg.h>
+
+void (*set_com_err_hook (void (*proc) ())) ();
+
+void (*@var{proc}) (const char *whoami, long code, va_list args);
+
+void reset_com_err_hook ();
+@end example
+
+These two routines allow a routine to be dynamically substituted for
+@samp{com_err}. After @samp{set_com_err_hook} has been called,
+calls to @samp{com_err} will turn into calls to the new hook routine.
+@samp{reset_com_err_hook} turns off this hook. This may intended to
+be used in daemons (to use a routine which calls @var{syslog(3)}), or
+in a window system application (which could pop up a dialogue box).
+
+If a program is to be used in an environment in which simply printing
+messages to the @code{stderr} stream would be inappropriate (such as in a
+daemon program which runs without a terminal attached),
+@code{set_com_err_hook} may be used to redirect output from @code{com_err}.
+The following is an example of an error handler which uses @var{syslog(3)}
+as supplied in BSD 4.3:
+
+@example
+#include <stdio.h>
+#include <stdarg.h>
+#include <syslog.h>
+
+/* extern openlog (const char * name, int logopt, int facility); */
+/* extern syslog (int priority, char * message, ...); */
+
+void hook (const char * whoami, long code,
+ const char * format, va_list args)
+@{
+ char buffer[BUFSIZ];
+ static int initialized = 0;
+ if (!initialized) @{
+ openlog (whoami,
+ LOG_NOWAIT|LOG_CONS|LOG_PID|LOG_NDELAY,
+ LOG_DAEMON);
+ initialized = 1;
+ @}
+ vsprintf (buffer, format, args);
+ syslog (LOG_ERR, "%s %s", error_message (code), buffer);
+@}
+@end example
+
+After making the call
+@code{set_com_err_hook (hook);},
+any calls to @code{com_err} will result in messages being sent to the
+@var{syslogd} daemon for logging.
+The name of the program, @samp{whoami}, is supplied to the
+@samp{openlog()} call, and the message is formatted into a buffer and
+passed to @code{syslog}.
+
+Note that since the extra arguments to @code{com_err} are passed by
+reference via the @code{va_list} value @code{args}, the hook routine may
+place any form of interpretation on them, including ignoring them. For
+consistency, @code{printf}-style interpretation is suggested, via
+@code{vsprintf} (or @code{_doprnt} on BSD systems without full support for
+the ANSI C library).
+
+@ifinfo
+@node Coding Conventions, Building and Installation, Run-time support routines, (dir)
+@comment node-name, next, previous, up
+@end ifinfo
+
+@section Coding Conventions
+
+The following conventions are just some general stylistic conventions
+to follow when writing robust libraries and programs. Conventions
+similar to this are generally followed inside the UNIX kernel and most
+routines in the Multics operating system. In general, a routine
+either succeeds (returning a zero error code, and doing some side
+effects in the process), or it fails, doing minimal side effects; in
+any event, any invariant which the library assumes must be maintained.
+
+In general, it is not in the domain of non user-interface library
+routines to write error messages to the user's terminal, or halt the
+process. Such forms of ``error handling'' should be reserved for
+failures of internal invariants and consistancy checks only, as it
+provides the user of the library no way to clean up for himself in the
+event of total failure.
+
+Library routines which can fail should be set up to return an error
+code. This should usually be done as the return value of the
+function; if this is not acceptable, the routine should return a
+``null'' value, and put the error code into a parameter passed by
+reference.
+
+Routines which use the first style of interface can be used from
+user-interface levels of a program as follows:
+
+@example
+@{
+ if ((code = initialize_world(getuid(), random())) != 0) @{
+ com_err("demo", code,
+ "when trying to initialize world");
+ exit(1);
+ @}
+ if ((database = open_database("my_secrets", &code))==NULL) @{
+ com_err("demo", code,
+ "while opening my_secrets");
+ exit(1);
+ @}
+@}
+@end example
+
+A caller which fails to check the return status is in error. It is
+possible to look for code which ignores error returns by using lint;
+look for error messages of the form ``foobar returns value which is
+sometimes ignored'' or ``foobar returns value which is always
+ignored.''
+
+Since libraries may be built out of other libraries, it is often necessary
+for the success of one routine to depend on another. When a lower level
+routine returns an error code, the middle level routine has a few possible
+options. It can simply return the error code to its caller after doing
+some form of cleanup, it can substitute one of its own, or it can take
+corrective action of its own and continue normally. For instance, a
+library routine which makes a ``connect'' system call to make a network
+connection may reflect the system error code @code{ECONNREFUSED}
+(Connection refused) to its caller, or it may return a ``server not
+available, try again later,'' or it may try a different server.
+
+Cleanup which is typically necessary may include, but not be limited
+to, freeing allocated memory which will not be needed any more,
+unlocking concurrancy locks, dropping reference counts, closing file
+descriptors, or otherwise undoing anything which the procedure did up
+to this point. When there are a lot of things which can go wrong, it
+is generally good to write one block of error-handling code which is
+branched to, using a goto, in the event of failure. A common source
+of errors in UNIX programs is failing to close file descriptors on
+error returns; this leaves a number of ``zombied'' file descriptors
+open, which eventually causes the process to run out of file
+descriptors and fall over.
+
+@example
+@{
+ FILE *f1=NULL, *f2=NULL, *f3=NULL;
+ int status = 0;
+
+ if ( (f1 = fopen(FILE1, "r")) == NULL) @{
+ status = errno;
+ goto error;
+ @}
+
+ /*
+ * Crunch for a while
+ */
+
+ if ( (f2 = fopen(FILE2, "w")) == NULL) @{
+ status = errno;
+ goto error;
+ @}
+
+ if ( (f3 = fopen(FILE3, "a+")) == NULL) @{
+ status = errno;
+ goto error;
+ @}
+
+ /*
+ * Do more processing.
+ */
+ fclose(f1);
+ fclose(f2);
+ fclose(f3);
+ return 0;
+
+error:
+ if (f1) fclose(f1);
+ if (f2) fclose(f2);
+ if (f3) fclose(f3);
+ return status;
+@}
+@end example
+
+@ifinfo
+@node Building and Installation, Bug Reports, Coding Conventions, (dir)
+@comment node-name, next, previous, up
+@end ifinfo
+
+@section Building and Installation
+
+The distribution of this package will probably be done as a compressed
+``tar''-format file available via anonymous FTP from SIPB.MIT.EDU.
+Retrieve @samp{pub/com_err.tar.Z} and extract the contents. A subdirectory
+@t{profiled} should be created to hold objects compiled for profiling.
+Running ``make all'' should then be sufficient to build the library and
+error-table compiler. The files @samp{libcom_err.a},
+@samp{libcom_err_p.a}, @samp{com_err.h}, and @samp{compile_et} should be
+installed for use; @samp{com_err.3} and @samp{compile_et.1} can also be
+installed as manual pages.
+
+Potential problems:
+
+@itemize @bullet
+
+@item Use of @code{strcasecmp}, a routine provided in BSD for
+case-insensitive string comparisons. If an equivalent routine is
+available, you can modify @code{CFLAGS} in the makefile to define
+@code{strcasecmp} to the name of that routine.
+
+@item Compilers that defined @code{__STDC__} without providing the header
+file @code{<stdarg.h>}. One such example is Metaware's High ``C''
+compiler, as provided at Project Athena on the IBM RT/PC workstation; if
+@code{__HIGHC__} is defined, it is assumed that @code{<stdarg.h>} is not
+available, and therefore @code{<varargs.h>} must be used. If the symbol
+@code{VARARGS} is defined (e.g., in the makefile), @code{<varargs.h>} will
+be used.
+
+@item If your linker rejects symbols that are simultaneously defined in two
+library files, edit @samp{Makefile} to remove @samp{perror.c} from the
+library. This file contains a version of @var{perror(3)} which calls
+@code{com_err} instead of calling @code{write} directly.
+
+@end itemize
+
+As I do not have access to non-BSD systems, there are probably
+bugs present that may interfere with building or using this package on
+other systems. If they are reported to me, they can probably be fixed for
+the next version.
+
+@ifinfo
+@node Bug Reports, Acknowledgements, Building and Installation, (dir)
+@comment node-name, next, previous, up
+@end ifinfo
+
+@section Bug Reports
+
+Please send any comments or bug reports to the principal author: Ken
+Raeburn, @t{Raeburn@@Athena.MIT.EDU}.
+
+@ifinfo
+@node Acknowledgements, , Bug Reports, (dir)
+@comment node-name, next, previous, up
+@end ifinfo
+
+@section Acknowledgements
+
+I would like to thank: Bill Sommerfeld, for his help with some of this
+documentation, and catching some of the bugs the first time around;
+Honeywell Information Systems, for not killing off the @emph{Multics}
+operating system before I had an opportunity to use it; Honeywell's
+customers, who persuaded them not to do so, for a while; Ted Anderson of
+CMU, for catching some problems before version 1.2 left the nest; Stan
+Zanarotti and several others of MIT's Student Information Processing Board,
+for getting us started with ``discuss,'' for which this package was
+originally written; and everyone I've talked into --- I mean, asked to read
+this document and the ``man'' pages.
+
+@bye
diff --git a/lib/libcompat/4.3/rexec.c b/lib/libcompat/4.3/rexec.c
index 92357aa..4e01eb6 100644
--- a/lib/libcompat/4.3/rexec.c
+++ b/lib/libcompat/4.3/rexec.c
@@ -332,10 +332,10 @@ retry:
perror(hp->h_name);
return (-1);
}
- port = 0;
- if (fd2p == 0)
- (void) write(s, "", 1);
- else {
+ if (fd2p == 0) {
+ (void) write(s, "", 1);
+ port = 0;
+ } else {
char num[8];
int s2, sin2len;
diff --git a/lib/libcompat/Makefile.depend b/lib/libcompat/Makefile.depend
new file mode 100644
index 0000000..639d45d
--- /dev/null
+++ b/lib/libcompat/Makefile.depend
@@ -0,0 +1,14 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile
index 5e21883..c31eced 100644
--- a/lib/libcompiler_rt/Makefile
+++ b/lib/libcompiler_rt/Makefile
@@ -7,7 +7,6 @@ NO_PIC=
WARNS?= 2
CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN
-CFLAGS+=-I${.CURDIR}/../../contrib/libcxxrt
.if ${MACHINE_CPUARCH} == "amd64"
CRTARCH=x86_64
@@ -15,7 +14,7 @@ CRTARCH=x86_64
CRTARCH=${MACHINE_CPUARCH}
.endif
-CRTSRC=${.CURDIR}/../../contrib/compiler-rt/lib/builtins
+CRTSRC=${.CURDIR}/../../contrib/compiler-rt/lib
.PATH: ${CRTSRC}/${CRTARCH} ${CRTSRC}
@@ -25,7 +24,6 @@ SRCF= absvdi2 \
addvdi3 \
addvsi3 \
addvti3 \
- apple_versioning \
ashldi3 \
ashlti3 \
ashrdi3 \
@@ -36,6 +34,8 @@ SRCF= absvdi2 \
clzti2 \
cmpdi2 \
cmpti2 \
+ comparedf2 \
+ comparesf2 \
ctzdi2 \
ctzsi2 \
ctzti2 \
@@ -67,22 +67,18 @@ SRCF= absvdi2 \
fixxfti \
floatdidf \
floatdisf \
- floatditf \
floatdixf \
- floatsitf \
floattidf \
floattisf \
floattixf \
floatundidf \
floatundisf \
- floatunditf \
floatundixf \
floatunsidf \
floatunsisf \
floatuntidf \
floatuntisf \
floatuntixf \
- gcc_personality_v0 \
int_util \
lshrdi3 \
lshrti3 \
@@ -98,7 +94,6 @@ SRCF= absvdi2 \
mulvdi3 \
mulvsi3 \
mulvti3 \
- multc3 \
mulxc3 \
negdf2 \
negdi2 \
@@ -131,26 +126,6 @@ SRCF= absvdi2 \
umoddi3 \
umodti3
-# 128-bit quad precision long double support, only used on arm64
-.if ${MACHINE_CPUARCH} == "aarch64"
-SRCF+= addtf3 \
- comparetf2 \
- divtf3 \
- extenddftf2 \
- extendsftf2 \
- fixtfdi \
- fixtfsi \
- fixtfti \
- fixunstfdi \
- fixunstfsi \
- fixunstfti \
- floatunsitf \
- multf3 \
- subtf3 \
- trunctfdf2 \
- trunctfsf2
-.endif
-
# These are already shipped by libc.a on arm and mips
.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
SRCF+= adddf3 \
@@ -169,11 +144,6 @@ SRCF+= adddf3 \
truncdfsf2
.endif
-.if ${MACHINE_CPUARCH} != "arm"
-SRCF+= comparedf2 \
- comparesf2
-.endif
-
.if ${MACHINE_CPUARCH} != "mips"
SRCF+= divsi3 \
modsi3 \
@@ -204,22 +174,14 @@ SRCS+= ${file}.c
.endfor
.if ${MACHINE_CPUARCH} == "arm"
-SRCS+= aeabi_div0.c \
- aeabi_idivmod.S \
+SRCS+= aeabi_idivmod.S \
aeabi_ldivmod.S \
aeabi_memcmp.S \
aeabi_memcpy.S \
aeabi_memmove.S \
aeabi_memset.S \
aeabi_uidivmod.S \
- aeabi_uldivmod.S \
- bswapdi2.S \
- bswapsi2.S \
- switch16.S \
- switch32.S \
- switch8.S \
- switchu8.S \
- sync_synchronize.S
+ aeabi_uldivmod.S
.endif
.if ${MK_INSTALLLIB} != "no"
diff --git a/lib/libcompiler_rt/Makefile.depend b/lib/libcompiler_rt/Makefile.depend
new file mode 100644
index 0000000..7d982eb
--- /dev/null
+++ b/lib/libcompiler_rt/Makefile.depend
@@ -0,0 +1,13 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libcrypt/Makefile.depend b/lib/libcrypt/Makefile.depend
new file mode 100644
index 0000000..807c0a4
--- /dev/null
+++ b/lib/libcrypt/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libcrypt/tests/Makefile b/lib/libcrypt/tests/Makefile
index 6f98b53a..20993e2 100644
--- a/lib/libcrypt/tests/Makefile
+++ b/lib/libcrypt/tests/Makefile
@@ -7,6 +7,7 @@ TESTSDIR= ${TESTSBASE}/lib/libcrypt
ATF_TESTS_C= crypt_tests
CFLAGS+= -I${.CURDIR:H}
-LIBADD= crypt
+DPADD+= ${LIBCRYPT}
+LDADD+= -lcrypt
.include <bsd.test.mk>
diff --git a/lib/libcrypt/tests/Makefile.depend b/lib/libcrypt/tests/Makefile.depend
new file mode 100644
index 0000000..cef7a1f
--- /dev/null
+++ b/lib/libcrypt/tests/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/atf/libatf-c \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libcrypt/tests/crypt_tests.c b/lib/libcrypt/tests/crypt_tests.c
index 426d10e..2b2f9e6 100644
--- a/lib/libcrypt/tests/crypt_tests.c
+++ b/lib/libcrypt/tests/crypt_tests.c
@@ -2,10 +2,9 @@
__FBSDID("$FreeBSD$");
#include <sys/types.h>
-#include <crypt.h>
#include <unistd.h>
-#include <atf-c.h>
+#include <atf-c/atf-c.h>
#define LEET "0.s0.l33t"
diff --git a/lib/libcuse/Makefile b/lib/libcuse/Makefile
index a232fa2..2d1ded5 100644
--- a/lib/libcuse/Makefile
+++ b/lib/libcuse/Makefile
@@ -30,12 +30,14 @@ SHLIB_MINOR= 0
SRCS= cuse_lib.c
INCS= cuse.h
MAN= cuse.3
+PTHREAD_LIBS?= -lpthread
CFLAGS+= -D_GNU_SOURCE
.if defined(HAVE_DEBUG)
CFLAGS+= -g
CFLAGS+= -DHAVE_DEBUG
.endif
-LIBADD= pthread
+DPADD+= ${LIBPTHREAD}
+LDADD+= ${PTHREAD_LIBS}
MLINKS=
MLINKS+= cuse.3 cuse_alloc_unit_number.3
diff --git a/lib/libcuse/Makefile.depend b/lib/libcuse/Makefile.depend
new file mode 100644
index 0000000..37acbe0
--- /dev/null
+++ b/lib/libcuse/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libthr \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libcxxrt/Makefile.depend b/lib/libcxxrt/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libcxxrt/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libdevctl/Makefile b/lib/libdevctl/Makefile
deleted file mode 100644
index 74687ec..0000000
--- a/lib/libdevctl/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# $FreeBSD$
-
-LIB= devctl
-SRCS= devctl.c
-INCS= devctl.h
-MAN= devctl.3
-
-.include <bsd.lib.mk>
diff --git a/lib/libdevctl/devctl.3 b/lib/libdevctl/devctl.3
deleted file mode 100644
index be869f9..0000000
--- a/lib/libdevctl/devctl.3
+++ /dev/null
@@ -1,295 +0,0 @@
-.\"
-.\" Copyright (c) 2014 John Baldwin <jhb@FreeBSD.org>
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must 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 December 26, 2014
-.Dt DEVCTL 3
-.Os
-.Sh NAME
-.Nm devctl ,
-.Nm devctl_attach ,
-.Nm devctl_detach ,
-.Nm devctl_disable ,
-.Nm devctl_enable ,
-.Nm devctl_resume ,
-.Nm devctl_suspend
-.Nd device control library
-.Sh LIBRARY
-.Lb libdevctl
-.Sh SYNOPSIS
-.In devctl.h
-.Ft int
-.Fn devctl_attach "const char *device"
-.Ft int
-.Fn devctl_detach "const char *device" "bool force"
-.Ft int
-.Fn devctl_disable "const char *device" "bool force_detach"
-.Ft int
-.Fn devctl_enable "const char *device"
-.Ft int
-.Fn devctl_resume "const char *device"
-.Ft int
-.Fn devctl_suspend "const char *device"
-.Ft int
-.Fn devctl_set_driver "const char *device" "const char *driver" "bool force"
-.Sh DESCRIPTION
-The
-.Nm
-library adjusts the state of devices in the kernel's internal device
-hierarchy.
-Each control operation accepts a
-.Fa device
-argument that identifies the device to adjust.
-The
-.Fa device
-may be specified as either the name of an existing device or as a
-bus-specific address.
-The following bus-specific address formats are currently supported:
-.Bl -tag -offset indent
-.It Sy pci Ns Fa domain Ns : Ns Fa bus Ns : Ns Fa slot Ns : Ns Fa function
-A PCI device with the specified
-.Fa domain ,
-.Fa bus ,
-.Fa slot ,
-and
-.Fa function .
-.It Sy pci Ns Fa bus Ns : Ns Fa slot Ns : Ns Fa function
-A PCI device in domain zero with the specified
-.Fa bus ,
-.Fa slot ,
-and
-.Fa function .
-.It Fa handle
-A device with an ACPI handle of
-.Fa handle .
-The handle must be specified as an absolute path and must begin with a
-.Dq \e .
-.El
-.Pp
-The
-.Fn devctl_attach
-function probes a device and attaches a suitable device driver if one is
-found.
-.Pp
-The
-.Fn devctl_detach
-function detaches a device from its current device driver.
-The device is left detached until either a new driver for its parent
-bus is loaded or the device is explicitly probed via
-.Fn devctl_attach .
-If
-.Fa force
-is true,
-the current device driver will be detached even if the device is busy.
-.Pp
-The
-.Fn devctl_disable
-function disables a device.
-If the device is currently attached to a device driver,
-the device driver will be detached from the device,
-but the device will retain its current name.
-If
-.Fa force_detach
-is true,
-the current device driver will be detached even if the device is busy.
-The device will remain disabled and detached until it is explicitly enabled
-via
-.Fn devctl_enable .
-.Pp
-The
-.Fn devctl_enable
-function re-enables a disabled device.
-The device will probe and attach if a suitable device driver is found.
-.Pp
-The
-.Fn devctl_suspend
-function suspends a device.
-This may include placing the device in a reduced power state,
-but any device driver currently attached to the device will remain attached.
-.Pp
-The
-.Fn devctl_resume
-function resumes a suspended device to a fully working state.
-.Pp
-The
-.Fn devctl_set_driver
-function attaches a device driver named
-.Fa driver
-to a device.
-If the device is already attached and
-.Fa force
-is false,
-the request will fail.
-If the device is already attached and
-.Fa force
-is true,
-the device will be detached from its current device driver before it is
-attached to the new device driver.
-.Sh RETURN VALUES
-.Rv -std devctl_attach devctl_detach devctl_disable devctl_enable \
-devctl_suspend devctl_resume devctl_set_driver
-.Sh ERRORS
-In addition to specific errors noted below,
-all of the
-.Nm
-functions may fail for any of the errors described in
-.Xr open 2
-as well as:
-.Bl -tag -width Er
-.It Bq Er EINVAL
-The device name is too long.
-.It Bq Er ENOENT
-No existing device matches the specified name or location.
-.It Bq Er EPERM
-The current process is not permitted to adjust the state of
-.Fa device .
-.El
-.Pp
-The
-.Fn devctl_attach
-function may fail if:
-.Bl -tag -width Er
-.It Bq Er EBUSY
-The device is already attached.
-.It Bq Er ENOMEM
-An internal memory allocation request failed.
-.It Bq Er ENXIO
-The device is disabled.
-.It Bq Er ENXIO
-No suitable driver for the device could be found,
-or the driver failed to attach.
-.El
-.Pp
-The
-.Fn devctl_detach
-function may fail if:
-.Bl -tag -width Er
-.It Bq Er EBUSY
-The current device driver for
-.Fa device
-is busy and cannot detach at this time.
-Note that some drivers may return this even if
-.Fa force
-is true.
-.It Bq Er ENXIO
-The device is not attached to a driver.
-.It Bq Er ENXIO
-The current device driver for
-.Fa device
-does not support detaching.
-.El
-.Pp
-The
-.Fn devctl_enable
-function may fail if:
-.Bl -tag -width Er
-.It Bq Er EBUSY
-The device is already enabled.
-.It Bq Er ENOMEM
-An internal memory allocation request failed.
-.It Bq Er ENXIO
-No suitable driver for the device could be found,
-or the driver failed to attach.
-.El
-.Pp
-The
-.Fn devctl_disable
-function may fail if:
-.Bl -tag -width Er
-.It Bq Er EBUSY
-The current device driver for
-.Fa device
-is busy and cannot detach at this time.
-Note that some drivers may return this even if
-.Fa force_detach
-is true.
-.It Bq Er ENXIO
-The device is already disabled.
-.It Bq Er ENXIO
-The current device driver for
-.Fa device
-does not support detaching.
-.El
-.Pp
-The
-.Fn devctl_suspend
-function may fail if:
-.Bl -tag -width Er
-.It Bq Er EBUSY
-The device is already suspended.
-.It Bq Er EINVAL
-The device to be suspended is the root bus device.
-.El
-.Pp
-The
-.Fn devctl_resume
-function may fail if:
-.Bl -tag -width Er
-.It Bq Er EINVAL
-The device is not suspended.
-.It Bq Er EINVAL
-The device to be resumed is the root bus device.
-.El
-.Pp
-The
-.Fn devctl_set_driver
-function may fail if:
-.Bl -tag -width Er
-.It Bq Er EBUSY
-The device is currently attached to a device driver and
-.Fa force
-is false.
-.It Bq Er EBUSY
-The current device driver for
-.Fa device
-is busy and cannot detach at this time.
-.It Bq Er EFAULT
-The
-.Fa driver
-argument points outside the process' allocated address space.
-.It Bq Er ENOENT
-No device driver with the requested name exists.
-.It Bq Er ENOMEM
-An internal memory allocation request failed.
-.It Bq Er ENXIO
-The device is disabled.
-.It Bq Er ENXIO
-The new device driver failed to attach.
-.El
-.Sh SEE ALSO
-.Xr devinfo 3 ,
-.Xr devstat 3 ,
-.Xr devctl 8
-.Sh HISTORY
-The
-.Nm
-library first appeared in
-.Fx 11.0 .
-.Sh BUGS
-If a device is suspended individually via
-.Fn devctl_suspend
-and the entire machine is subsequently suspended,
-the device will be resumed when the machine resumes.
diff --git a/lib/libdevctl/devctl.c b/lib/libdevctl/devctl.c
deleted file mode 100644
index 7be431e..0000000
--- a/lib/libdevctl/devctl.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * Copyright (c) 2014 John Baldwin <jhb@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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 <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/bus.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include "devctl.h"
-
-static int
-devctl_request(u_long cmd, struct devreq *req)
-{
- static int devctl2_fd = -1;
-
- if (devctl2_fd == -1) {
- devctl2_fd = open("/dev/devctl2", O_RDONLY);
- if (devctl2_fd == -1)
- return (-1);
- }
- return (ioctl(devctl2_fd, cmd, req));
-}
-
-static int
-devctl_simple_request(u_long cmd, const char *name, int flags)
-{
- struct devreq req;
-
- memset(&req, 0, sizeof(req));
- if (strlcpy(req.dr_name, name, sizeof(req.dr_name)) >=
- sizeof(req.dr_name)) {
- errno = EINVAL;
- return (-1);
- }
- req.dr_flags = flags;
- return (devctl_request(cmd, &req));
-}
-
-int
-devctl_attach(const char *device)
-{
-
- return (devctl_simple_request(DEV_ATTACH, device, 0));
-}
-
-int
-devctl_detach(const char *device, bool force)
-{
-
- return (devctl_simple_request(DEV_DETACH, device, force ?
- DEVF_FORCE_DETACH : 0));
-}
-
-int
-devctl_enable(const char *device)
-{
-
- return (devctl_simple_request(DEV_ENABLE, device, 0));
-}
-
-int
-devctl_disable(const char *device, bool force_detach)
-{
-
- return (devctl_simple_request(DEV_DISABLE, device, force_detach ?
- DEVF_FORCE_DETACH : 0));
-}
-
-int
-devctl_suspend(const char *device)
-{
-
- return (devctl_simple_request(DEV_SUSPEND, device, 0));
-}
-
-int
-devctl_resume(const char *device)
-{
-
- return (devctl_simple_request(DEV_RESUME, device, 0));
-}
-
-int
-devctl_set_driver(const char *device, const char *driver, bool force)
-{
- struct devreq req;
-
- memset(&req, 0, sizeof(req));
- if (strlcpy(req.dr_name, device, sizeof(req.dr_name)) >=
- sizeof(req.dr_name)) {
- errno = EINVAL;
- return (-1);
- }
- req.dr_data = __DECONST(char *, driver);
- if (force)
- req.dr_flags |= DEVF_SET_DRIVER_DETACH;
- return (devctl_request(DEV_SET_DRIVER, &req));
-}
diff --git a/lib/libdevinfo/Makefile.depend b/lib/libdevinfo/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libdevinfo/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libdevinfo/devinfo.h b/lib/libdevinfo/devinfo.h
index b0b8cec..c8990a6 100644
--- a/lib/libdevinfo/devinfo.h
+++ b/lib/libdevinfo/devinfo.h
@@ -50,7 +50,7 @@ struct devinfo_dev {
char *dd_location; /* Where bus thinks dev at */
uint32_t dd_devflags; /* API flags */
uint16_t dd_flags; /* internal dev flags */
- devinfo_state_t dd_state; /* attachment state of dev */
+ devinfo_state_t dd_state; /* attacement state of dev */
};
struct devinfo_rman {
diff --git a/lib/libdevstat/Makefile b/lib/libdevstat/Makefile
index dcda3c2..aeb07b9 100644
--- a/lib/libdevstat/Makefile
+++ b/lib/libdevstat/Makefile
@@ -7,7 +7,8 @@ SHLIB_MAJOR= 7
SRCS= devstat.c
INCS= devstat.h
-LIBADD= kvm
+DPADD= ${LIBKVM}
+LDADD= -lkvm
MAN= devstat.3
diff --git a/lib/libdevstat/Makefile.depend b/lib/libdevstat/Makefile.depend
new file mode 100644
index 0000000..46488c9
--- /dev/null
+++ b/lib/libdevstat/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libkvm \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libdevstat/devstat.c b/lib/libdevstat/devstat.c
index d52332b..ade8738 100644
--- a/lib/libdevstat/devstat.c
+++ b/lib/libdevstat/devstat.c
@@ -1487,9 +1487,22 @@ devstat_compute_statistics(struct devstat *current, struct devstat *previous,
*destld = 0.0;
break;
/*
- * Some devstat callers update the duration and some don't.
- * So this will only be accurate if they provide the
- * duration.
+ * This calculation is somewhat bogus. It simply divides
+ * the elapsed time by the total number of transactions
+ * completed. While that does give the caller a good
+ * picture of the average rate of transaction completion,
+ * it doesn't necessarily give the caller a good view of
+ * how long transactions took to complete on average.
+ * Those two numbers will be different for a device that
+ * can handle more than one transaction at a time. e.g.
+ * SCSI disks doing tagged queueing.
+ *
+ * The only way to accurately determine the real average
+ * time per transaction would be to compute and store the
+ * time on a per-transaction basis. That currently isn't
+ * done in the kernel, and would only be desireable if it
+ * could be implemented in a somewhat non-intrusive and high
+ * performance way.
*/
case DSM_MS_PER_TRANSACTION:
if (totaltransfers > 0) {
@@ -1499,6 +1512,11 @@ devstat_compute_statistics(struct devstat *current, struct devstat *previous,
} else
*destld = 0.0;
break;
+ /*
+ * As above, these next two really only give the average
+ * rate of completion for read and write transactions, not
+ * the average time the transaction took to complete.
+ */
case DSM_MS_PER_TRANSACTION_READ:
if (totaltransfersread > 0) {
*destld = totaldurationread;
diff --git a/lib/libdpv/Makefile b/lib/libdpv/Makefile
index f2dc481..8096cc9 100644
--- a/lib/libdpv/Makefile
+++ b/lib/libdpv/Makefile
@@ -6,7 +6,8 @@ INCS= dpv.h
MAN= dpv.3
MLINKS= dpv.3 dpv_free.3
-LIBADD= dialog figpar util ncursesw
+DPADD= ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSESW} ${LIBUTIL}
+LDADD= -ldialog -lfigpar -lncursesw -lutil
SRCS= dialog_util.c dialogrc.c dprompt.c dpv.c status.c util.c
diff --git a/lib/libdpv/dpv.3 b/lib/libdpv/dpv.3
index d16e649..8c04ac3 100644
--- a/lib/libdpv/dpv.3
+++ b/lib/libdpv/dpv.3
@@ -435,8 +435,8 @@ or desired values.
.El
.Sh SEE ALSO
.Xr dialog 1 ,
-.Xr Xdialog 1 ,
-.Xr dialog 3
+.Xr dialog 3 ,
+.Xr Xdialog 1
.Sh HISTORY
The
.Nm
@@ -502,7 +502,7 @@ This does not effect
.Xr Xdialog 1 ,
which renders the color escape sequences as plain text.
See
-.Do
+.Do Li
embedded "\\Z" sequences
.Dc
in
diff --git a/lib/libdwarf/Makefile b/lib/libdwarf/Makefile
index 590aab3..9d4df83 100644
--- a/lib/libdwarf/Makefile
+++ b/lib/libdwarf/Makefile
@@ -46,7 +46,6 @@ SRCS= \
dwarf_pubtypes.c \
dwarf_ranges.c \
dwarf_reloc.c \
- dwarf_sections.c \
dwarf_seterror.c \
dwarf_str.c \
dwarf_types.c \
@@ -97,7 +96,8 @@ sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET}
mkdir -p ${.OBJDIR}/sys
ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET}
-LIBADD+= elf
+LDADD+= -lelf
+DPADD+= ${LIBELF}
SHLIB_MAJOR= 4
@@ -131,7 +131,6 @@ MAN= dwarf.3 \
dwarf_add_weakname.3 \
dwarf_attr.3 \
dwarf_attrlist.3 \
- dwarf_attroffset.3 \
dwarf_attrval_signed.3 \
dwarf_child.3 \
dwarf_dealloc.3 \
@@ -171,7 +170,6 @@ MAN= dwarf.3 \
dwarf_get_cie_info.3 \
dwarf_get_cie_of_fde.3 \
dwarf_get_cu_die_offset.3 \
- dwarf_get_die_infotypes_flag.3 \
dwarf_get_elf.3 \
dwarf_get_fde_at_pc.3 \
dwarf_get_fde_info_for_all_regs.3 \
@@ -193,7 +191,6 @@ MAN= dwarf.3 \
dwarf_get_relocation_info.3 \
dwarf_get_relocation_info_count.3 \
dwarf_get_section_bytes.3 \
- dwarf_get_section_max_offsets.3 \
dwarf_get_str.3 \
dwarf_get_types.3 \
dwarf_get_vars.3 \
@@ -211,7 +208,6 @@ MAN= dwarf.3 \
dwarf_new_expr.3 \
dwarf_new_fde.3 \
dwarf_next_cu_header.3 \
- dwarf_next_types_section.3 \
dwarf_object_init.3 \
dwarf_producer_init.3 \
dwarf_producer_set_isa.3 \
@@ -240,9 +236,7 @@ MLINKS+= \
dwarf_attrval_signed.3 dwarf_attrval_string.3 \
dwarf_attrval_signed.3 dwarf_attrval_unsigned.3 \
dwarf_child.3 dwarf_offdie.3 \
- dwarf_child.3 dwarf_offdie_b.3 \
dwarf_child.3 dwarf_siblingof.3 \
- dwarf_child.3 dwarf_siblingof_b.3 \
dwarf_dealloc.3 dwarf_fde_cie_list_dealloc.3 \
dwarf_dealloc.3 dwarf_funcs_dealloc.3 \
dwarf_dealloc.3 dwarf_globals_dealloc.3 \
@@ -256,7 +250,6 @@ MLINKS+= \
dwarf_dieoffset.3 dwarf_die_CU_offset.3 \
dwarf_dieoffset.3 dwarf_die_CU_offset_range.3 \
dwarf_dieoffset.3 dwarf_get_cu_die_offset_given_cu_header_offset.3 \
- dwarf_dieoffset.3 dwarf_get_cu_die_offset_given_cu_header_offset_b.3 \
dwarf_finish.3 dwarf_object_finish.3 \
dwarf_formref.3 dwarf_global_formref.3 \
dwarf_formudata.3 dwarf_formsdata.3 \
@@ -296,7 +289,6 @@ MLINKS+= \
dwarf_get_pubtypes.3 dwarf_pubtype_name_offsets.3 \
dwarf_get_pubtypes.3 dwarf_pubtypename.3 \
dwarf_get_ranges.3 dwarf_get_ranges_a.3 \
- dwarf_get_section_max_offsets.3 dwarf_get_section_max_offsets_b.3 \
dwarf_get_types.3 dwarf_type_die_offset.3 \
dwarf_get_types.3 dwarf_type_cu_offset.3 \
dwarf_get_types.3 dwarf_type_name_offsets.3 \
@@ -315,7 +307,6 @@ MLINKS+= \
dwarf_highpc.3 dwarf_bitoffset.3 \
dwarf_highpc.3 dwarf_bitsize.3 \
dwarf_highpc.3 dwarf_bytesize.3 \
- dwarf_highpc.3 dwarf_highpc_b.3 \
dwarf_highpc.3 dwarf_lowpc.3 \
dwarf_highpc.3 dwarf_srclang.3 \
dwarf_lineno.3 dwarf_lineaddr.3 \
@@ -327,9 +318,6 @@ MLINKS+= \
dwarf_lineno.3 dwarf_line_srcfileno.3 \
dwarf_loclist.3 dwarf_loclist_n.3 \
dwarf_loclist_from_expr.3 dwarf_loclist_from_expr_a.3 \
- dwarf_loclist_from_expr.3 dwarf_loclist_from_expr_b.3 \
- dwarf_next_cu_header.3 dwarf_next_cu_header_b.3 \
- dwarf_next_cu_header.3 dwarf_next_cu_header_c.3 \
dwarf_producer_init.3 dwarf_producer_init_b.3 \
dwarf_seterrarg.3 dwarf_seterrhand.3 \
dwarf_set_frame_cfa_value.3 dwarf_set_frame_rule_initial_value.3 \
diff --git a/lib/libdwarf/Makefile.depend b/lib/libdwarf/Makefile.depend
new file mode 100644
index 0000000..07e629e
--- /dev/null
+++ b/lib/libdwarf/Makefile.depend
@@ -0,0 +1,54 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libelf \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+dwarf_funcs.So: dwarf_funcs.c
+dwarf_funcs.o: dwarf_funcs.c
+dwarf_funcs.po: dwarf_funcs.c
+dwarf_pro_funcs.So: dwarf_pro_funcs.c
+dwarf_pro_funcs.o: dwarf_pro_funcs.c
+dwarf_pro_funcs.po: dwarf_pro_funcs.c
+dwarf_pro_pubnames.So: dwarf_pro_pubnames.c
+dwarf_pro_pubnames.o: dwarf_pro_pubnames.c
+dwarf_pro_pubnames.po: dwarf_pro_pubnames.c
+dwarf_pro_types.So: dwarf_pro_types.c
+dwarf_pro_types.o: dwarf_pro_types.c
+dwarf_pro_types.po: dwarf_pro_types.c
+dwarf_pro_vars.So: dwarf_pro_vars.c
+dwarf_pro_vars.o: dwarf_pro_vars.c
+dwarf_pro_vars.po: dwarf_pro_vars.c
+dwarf_pro_weaks.So: dwarf_pro_weaks.c
+dwarf_pro_weaks.o: dwarf_pro_weaks.c
+dwarf_pro_weaks.po: dwarf_pro_weaks.c
+dwarf_pubnames.So: dwarf_pubnames.c
+dwarf_pubnames.o: dwarf_pubnames.c
+dwarf_pubnames.po: dwarf_pubnames.c
+dwarf_pubtypes.So: dwarf_pubtypes.c
+dwarf_pubtypes.o: dwarf_pubtypes.c
+dwarf_pubtypes.po: dwarf_pubtypes.c
+dwarf_types.So: dwarf_types.c
+dwarf_types.o: dwarf_types.c
+dwarf_types.po: dwarf_types.c
+dwarf_vars.So: dwarf_vars.c
+dwarf_vars.o: dwarf_vars.c
+dwarf_vars.po: dwarf_vars.c
+dwarf_weaks.So: dwarf_weaks.c
+dwarf_weaks.o: dwarf_weaks.c
+dwarf_weaks.po: dwarf_weaks.c
+.endif
diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile
index 8a97ce0..df86778 100644
--- a/lib/libedit/Makefile
+++ b/lib/libedit/Makefile
@@ -7,10 +7,11 @@ SHLIB_MAJOR= 7
SHLIBDIR?= /lib
OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \
- hist.c keymacro.c map.c chartype.c \
- parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c
+ hist.c key.c map.c \
+ parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c
-LIBADD= ncursesw
+DPADD= ${LIBNCURSESW}
+LDADD= -lncursesw
MAN= editline.3 editrc.5
@@ -34,10 +35,7 @@ CLEANFILES+= common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h
INCS= histedit.h
-OSRCS+= eln.c
-SRCS+= tokenizern.c historyn.c
-CLEANFILES+= tokenizern.c historyn.c
-CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit -DWIDECHAR
+CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit
CFLAGS+= #-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH
CFLAGS+= #-DDEBUG_PASTE -DDEBUG_EDIT
@@ -68,12 +66,6 @@ help.h: ${ASRC} makelist
editline.c: ${OSRCS}
sh ${.CURDIR}/makelist -e ${.ALLSRC:T} > ${.TARGET}
-tokenizern.c: makelist Makefile
- sh ${.CURDIR}/makelist -n tokenizer.c > ${.TARGET}
-
-historyn.c: makelist Makefile
- sh ${.CURDIR}/makelist -n history.c > ${.TARGET}
-
# minimal dependency to make "make depend" optional
editline.o editline.po editline.So editline.ln: \
common.h emacs.h fcns.c fcns.h help.c help.h vi.h
diff --git a/lib/libedit/Makefile.depend b/lib/libedit/Makefile.depend
new file mode 100644
index 0000000..918d492
--- /dev/null
+++ b/lib/libedit/Makefile.depend
@@ -0,0 +1,61 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/ncurses/ncursesw \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+editline.So: common.h
+editline.So: editline.c
+editline.So: emacs.h
+editline.So: fcns.c
+editline.So: fcns.h
+editline.So: help.c
+editline.So: help.h
+editline.So: vi.h
+editline.o: common.h
+editline.o: editline.c
+editline.o: emacs.h
+editline.o: fcns.c
+editline.o: fcns.h
+editline.o: help.c
+editline.o: help.h
+editline.o: vi.h
+editline.po: common.h
+editline.po: editline.c
+editline.po: emacs.h
+editline.po: fcns.c
+editline.po: fcns.h
+editline.po: help.c
+editline.po: help.h
+editline.po: vi.h
+readline.So: common.h
+readline.So: emacs.h
+readline.So: fcns.h
+readline.So: help.h
+readline.So: vi.h
+readline.o: common.h
+readline.o: emacs.h
+readline.o: fcns.h
+readline.o: help.h
+readline.o: vi.h
+readline.po: common.h
+readline.po: emacs.h
+readline.po: fcns.h
+readline.po: help.h
+readline.po: vi.h
+.endif
diff --git a/lib/libedit/TEST/rl1.c b/lib/libedit/TEST/rl1.c
deleted file mode 100644
index 79050cc..0000000
--- a/lib/libedit/TEST/rl1.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* $NetBSD: rl1.c,v 1.1 2010/09/16 20:08:51 christos Exp $ */
-
-/*-
- * Copyright (c) 2010 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 <sys/cdefs.h>
-#if !defined(lint)
-__RCSID("$NetBSD: rl1.c,v 1.1 2010/09/16 20:08:51 christos Exp $");
-#endif /* not lint */
-__FBSDID("$FreeBSD$");
-
-/*
- * test.c: A little test program
- */
-#include <stdio.h>
-#include <readline/readline.h>
-
-int
-main(int argc, char *argv[])
-{
- char *p;
- while ((p = readline("hi$")) != NULL) {
- add_history(p);
- printf("%d %s\n", history_length, p);
- }
- return 0;
-}
diff --git a/lib/libedit/TEST/tc1.c b/lib/libedit/TEST/tc1.c
index 1969973..a60aa75 100644
--- a/lib/libedit/TEST/tc1.c
+++ b/lib/libedit/TEST/tc1.c
@@ -1,5 +1,3 @@
-/* $NetBSD: tc1.c,v 1.6 2014/06/18 20:12:15 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,24 +30,22 @@
* SUCH DAMAGE.
*/
-#include "config.h"
+#include <sys/cdefs.h>
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)test.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: tc1.c,v 1.6 2014/06/18 20:12:15 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
+__RCSID("$NetBSD: test.c,v 1.3 2009/07/17 12:25:52 christos Exp $");
__FBSDID("$FreeBSD$");
/*
* test.c: A little test program
*/
+#include "sys.h"
#include <stdio.h>
#include <string.h>
#include <signal.h>
@@ -58,7 +54,6 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
-#include <locale.h>
#include "histedit.h"
@@ -73,7 +68,7 @@ static void sig(int);
static char *
prompt(EditLine *el)
{
- static char a[] = "\1\033[7m\1Edit$\1\033[0m\1 ";
+ static char a[] = "\1\e[7m\1Edit$\1\e[0m\1 ";
static char b[] = "Edit> ";
return (continuation ? b : a);
@@ -93,7 +88,6 @@ complete(EditLine *el, int ch)
const char* ptr;
const LineInfo *lf = el_line(el);
int len;
- int res = CC_ERROR;
/*
* Find the last word
@@ -107,16 +101,16 @@ complete(EditLine *el, int ch)
if (len > strlen(dp->d_name))
continue;
if (strncmp(dp->d_name, ptr, len) == 0) {
+ closedir(dd);
if (el_insertstr(el, &dp->d_name[len]) == -1)
- res = CC_ERROR;
+ return (CC_ERROR);
else
- res = CC_REFRESH;
- break;
+ return (CC_REFRESH);
}
}
closedir(dd);
- return res;
+ return (CC_ERROR);
}
int
@@ -133,7 +127,6 @@ main(int argc, char *argv[])
History *hist;
HistEvent ev;
- (void) setlocale(LC_CTYPE, "");
(void) signal(SIGINT, sig);
(void) signal(SIGQUIT, sig);
(void) signal(SIGHUP, sig);
diff --git a/lib/libedit/TEST/wtc1.c b/lib/libedit/TEST/wtc1.c
deleted file mode 100644
index ec5574b..0000000
--- a/lib/libedit/TEST/wtc1.c
+++ /dev/null
@@ -1,281 +0,0 @@
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stdio.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <err.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <limits.h>
-#include <locale.h>
-
-#include "../histedit.h"
-
-
-static int continuation;
-volatile sig_atomic_t gotsig;
-static const char hfile[] = ".whistory";
-
-static wchar_t *
-prompt(EditLine *el)
-{
- static wchar_t a[] = L"\1\033[7m\1Edit$\1\033[0m\1 ";
- static wchar_t b[] = L"Edit> ";
-
- return continuation ? b : a;
-}
-
-
-static void
-sig(int i)
-{
- gotsig = i;
-}
-
-const char *
-my_wcstombs(const wchar_t *wstr)
-{
- static struct {
- char *str;
- int len;
- } buf;
-
- int needed = wcstombs(0, wstr, 0) + 1;
- if (needed > buf.len) {
- buf.str = malloc(needed);
- buf.len = needed;
- }
- wcstombs(buf.str, wstr, needed);
- buf.str[needed - 1] = 0;
-
- return buf.str;
-}
-
-
-static unsigned char
-complete(EditLine *el, int ch)
-{
- DIR *dd = opendir(".");
- struct dirent *dp;
- const wchar_t *ptr;
- char *buf, *bptr;
- const LineInfoW *lf = el_wline(el);
- int len, mblen, i;
- unsigned char res = 0;
- wchar_t dir[1024];
-
- /* Find the last word */
- for (ptr = lf->cursor -1; !iswspace(*ptr) && ptr > lf->buffer; --ptr)
- continue;
- len = lf->cursor - ++ptr;
-
- /* Convert last word to multibyte encoding, so we can compare to it */
- wctomb(NULL, 0); /* Reset shift state */
- mblen = MB_LEN_MAX * len + 1;
- buf = bptr = malloc(mblen);
- if (buf == NULL)
- err(1, "malloc");
- for (i = 0; i < len; ++i) {
- /* Note: really should test for -1 return from wctomb */
- bptr += wctomb(bptr, ptr[i]);
- }
- *bptr = 0; /* Terminate multibyte string */
- mblen = bptr - buf;
-
- /* Scan directory for matching name */
- for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
- if (mblen > strlen(dp->d_name))
- continue;
- if (strncmp(dp->d_name, buf, mblen) == 0) {
- mbstowcs(dir, &dp->d_name[mblen],
- sizeof(dir) / sizeof(*dir));
- if (el_winsertstr(el, dir) == -1)
- res = CC_ERROR;
- else
- res = CC_REFRESH;
- break;
- }
- }
-
- closedir(dd);
- free(buf);
- return res;
-}
-
-
-int
-main(int argc, char *argv[])
-{
- EditLine *el = NULL;
- int numc, ncontinuation;
- const wchar_t *line;
- TokenizerW *tok;
- HistoryW *hist;
- HistEventW ev;
-#ifdef DEBUG
- int i;
-#endif
-
- setlocale(LC_ALL, "");
-
- (void)signal(SIGINT, sig);
- (void)signal(SIGQUIT, sig);
- (void)signal(SIGHUP, sig);
- (void)signal(SIGTERM, sig);
-
- hist = history_winit(); /* Init built-in history */
- history_w(hist, &ev, H_SETSIZE, 100); /* Remember 100 events */
- history_w(hist, &ev, H_LOAD, hfile);
-
- tok = tok_winit(NULL); /* Init the tokenizer */
-
- el = el_init(argv[0], stdin, stdout, stderr);
-
- el_wset(el, EL_EDITOR, L"vi"); /* Default editor is vi */
- el_wset(el, EL_SIGNAL, 1); /* Handle signals gracefully */
- el_wset(el, EL_PROMPT_ESC, prompt, '\1'); /* Set the prompt function */
-
- el_wset(el, EL_HIST, history_w, hist); /* FIXME - history_w? */
-
- /* Add a user-defined function */
- el_wset(el, EL_ADDFN, L"ed-complete", L"Complete argument", complete);
-
- /* Bind <tab> to it */
- el_wset(el, EL_BIND, L"^I", L"ed-complete", NULL);
-
- /*
- * Bind j, k in vi command mode to previous and next line, instead
- * of previous and next history.
- */
- el_wset(el, EL_BIND, L"-a", L"k", L"ed-prev-line", NULL);
- el_wset(el, EL_BIND, L"-a", L"j", L"ed-next-line", NULL);
-
- /* Source the user's defaults file. */
- el_source(el, NULL);
-
- while((line = el_wgets(el, &numc)) != NULL && numc != 0) {
- int ac, cc, co, rc;
- const wchar_t **av;
-
- const LineInfoW *li;
- li = el_wline(el);
-
-#ifdef DEBUG
- (void)fwprintf(stderr, L"==> got %d %ls", numc, line);
- (void)fwprintf(stderr, L" > li `%.*ls_%.*ls'\n",
- (li->cursor - li->buffer), li->buffer,
- (li->lastchar - 1 - li->cursor),
- (li->cursor >= li->lastchar) ? L"" : li->cursor);
-#endif
-
- if (gotsig) {
- (void)fprintf(stderr, "Got signal %d.\n", (int)gotsig);
- gotsig = 0;
- el_reset(el);
- }
-
- if(!continuation && numc == 1)
- continue; /* Only got a linefeed */
-
- ac = cc = co = 0;
- ncontinuation = tok_wline(tok, li, &ac, &av, &cc, &co);
- if (ncontinuation < 0) {
- (void) fprintf(stderr, "Internal error\n");
- continuation = 0;
- continue;
- }
-
-#ifdef DEBUG
- (void)fprintf(stderr, " > nc %d ac %d cc %d co %d\n",
- ncontinuation, ac, cc, co);
-#endif
- history_w(hist, &ev, continuation ? H_APPEND : H_ENTER, line);
-
- continuation = ncontinuation;
- ncontinuation = 0;
- if(continuation)
- continue;
-
-#ifdef DEBUG
- for (i = 0; i < ac; ++i) {
- (void)fwprintf(stderr, L" > arg# %2d ", i);
- if (i != cc)
- (void)fwprintf(stderr, L"`%ls'\n", av[i]);
- else
- (void)fwprintf(stderr, L"`%.*ls_%ls'\n",
- co, av[i], av[i] + co);
- }
-#endif
-
- if (wcscmp (av[0], L"history") == 0) {
- switch(ac) {
- case 1:
- for(rc = history_w(hist, &ev, H_LAST);
- rc != -1;
- rc = history_w(hist, &ev, H_PREV))
- (void)fwprintf(stdout, L"%4d %ls",
- ev.num, ev.str);
- break;
- case 2:
- if (wcscmp(av[1], L"clear") == 0)
- history_w(hist, &ev, H_CLEAR);
- else
- goto badhist;
- break;
- case 3:
- if (wcscmp(av[1], L"load") == 0)
- history_w(hist, &ev, H_LOAD,
- my_wcstombs(av[2]));
- else if (wcscmp(av[1], L"save") == 0)
- history_w(hist, &ev, H_SAVE,
- my_wcstombs(av[2]));
- else
- goto badhist;
- break;
- badhist:
- default:
- (void)fprintf(stderr,
- "Bad history arguments\n");
- break;
- }
- } else if (el_wparse(el, ac, av) == -1) {
- switch (fork()) {
- case 0: {
- Tokenizer *ntok = tok_init(NULL);
- int nargc;
- const char **nav;
- tok_str(ntok, my_wcstombs(line), &nargc, &nav);
- execvp(nav[0],(char **)nav);
- perror(nav[0]);
- _exit(1);
- /* NOTREACHED */
- break;
- }
- case -1:
- perror("fork");
- break;
- default:
- if (wait(&rc) == -1)
- perror("wait");
- (void)fprintf(stderr, "Exit %x\n", rc);
- break;
- }
- }
-
- tok_wreset(tok);
- }
-
- el_end(el);
- tok_wend(tok);
- history_w(hist, &ev, H_SAVE, hfile);
- history_wend(hist);
-
- fprintf(stdout, "\n");
- return 0;
-}
-
-
diff --git a/lib/libedit/chared.c b/lib/libedit/chared.c
index 2b57051..6a4f3f6 100644
--- a/lib/libedit/chared.c
+++ b/lib/libedit/chared.c
@@ -1,5 +1,3 @@
-/* $NetBSD: chared.c,v 1.40 2014/06/18 18:12:28 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: chared.c,v 1.27 2009/02/15 21:55:23 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: chared.c,v 1.40 2014/06/18 18:12:28 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -46,10 +41,12 @@ __FBSDID("$FreeBSD$");
/*
* chared.c: Character editor utilities
*/
+#include "sys.h"
+
#include <stdlib.h>
#include "el.h"
-private void ch__clearmacro (EditLine *);
+private void ch__clearmacro(EditLine *);
/* value to leave unused in line buffer */
#define EL_LEAVE 2
@@ -65,10 +62,10 @@ cv_undo(EditLine *el)
size_t size;
/* Save entire line for undo */
- size = (size_t)(el->el_line.lastchar - el->el_line.buffer);
- vu->len = (ssize_t)size;
+ size = el->el_line.lastchar - el->el_line.buffer;
+ vu->len = size;
vu->cursor = (int)(el->el_line.cursor - el->el_line.buffer);
- (void)memcpy(vu->buf, el->el_line.buffer, size * sizeof(*vu->buf));
+ memcpy(vu->buf, el->el_line.buffer, size);
/* save command info for redo */
r->count = el->el_state.doingarg ? el->el_state.argument : 0;
@@ -82,11 +79,11 @@ cv_undo(EditLine *el)
* Save yank/delete data for paste
*/
protected void
-cv_yank(EditLine *el, const Char *ptr, int size)
+cv_yank(EditLine *el, const char *ptr, int size)
{
c_kill_t *k = &el->el_chared.c_kill;
- (void)memcpy(k->buf, ptr, (size_t)size * sizeof(*k->buf));
+ memcpy(k->buf, ptr, (size_t)size);
k->last = k->buf + size;
}
@@ -97,7 +94,7 @@ cv_yank(EditLine *el, const Char *ptr, int size)
protected void
c_insert(EditLine *el, int num)
{
- Char *cp;
+ char *cp;
if (el->el_line.lastchar + num >= el->el_line.limit) {
if (!ch_enlargebufs(el, (size_t)num))
@@ -129,7 +126,7 @@ c_delafter(EditLine *el, int num)
}
if (num > 0) {
- Char *cp;
+ char *cp;
for (cp = el->el_line.cursor; cp <= el->el_line.lastchar; cp++)
*cp = cp[num];
@@ -145,7 +142,7 @@ c_delafter(EditLine *el, int num)
protected void
c_delafter1(EditLine *el)
{
- Char *cp;
+ char *cp;
for (cp = el->el_line.cursor; cp <= el->el_line.lastchar; cp++)
*cp = cp[1];
@@ -170,7 +167,7 @@ c_delbefore(EditLine *el, int num)
}
if (num > 0) {
- Char *cp;
+ char *cp;
for (cp = el->el_line.cursor - num;
cp <= el->el_line.lastchar;
@@ -188,7 +185,7 @@ c_delbefore(EditLine *el, int num)
protected void
c_delbefore1(EditLine *el)
{
- Char *cp;
+ char *cp;
for (cp = el->el_line.cursor - 1; cp <= el->el_line.lastchar; cp++)
*cp = cp[1];
@@ -201,9 +198,9 @@ c_delbefore1(EditLine *el)
* Return if p is part of a word according to emacs
*/
protected int
-ce__isword(Int p)
+ce__isword(int p)
{
- return Isalnum(p) || Strchr(STR("*?_-.[]~="), p) != NULL;
+ return (isalnum(p) || strchr("*?_-.[]~=", p) != NULL);
}
@@ -211,11 +208,11 @@ ce__isword(Int p)
* Return if p is part of a word according to vi
*/
protected int
-cv__isword(Int p)
+cv__isword(int p)
{
- if (Isalnum(p) || p == '_')
+ if (isalnum(p) || p == '_')
return 1;
- if (Isgraph(p))
+ if (isgraph(p))
return 2;
return 0;
}
@@ -225,24 +222,24 @@ cv__isword(Int p)
* Return if p is part of a big word according to vi
*/
protected int
-cv__isWord(Int p)
+cv__isWord(int p)
{
- return !Isspace(p);
+ return (!isspace(p));
}
/* c__prev_word():
* Find the previous word
*/
-protected Char *
-c__prev_word(Char *p, Char *low, int n, int (*wtest)(Int))
+protected char *
+c__prev_word(char *p, char *low, int n, int (*wtest)(int))
{
p--;
while (n--) {
- while ((p >= low) && !(*wtest)(*p))
+ while ((p >= low) && !(*wtest)((unsigned char) *p))
p--;
- while ((p >= low) && (*wtest)(*p))
+ while ((p >= low) && (*wtest)((unsigned char) *p))
p--;
}
@@ -251,83 +248,117 @@ c__prev_word(Char *p, Char *low, int n, int (*wtest)(Int))
if (p < low)
p = low;
/* cp now points where we want it */
- return p;
+ return (p);
}
/* c__next_word():
* Find the next word
*/
-protected Char *
-c__next_word(Char *p, Char *high, int n, int (*wtest)(Int))
+protected char *
+c__next_word(char *p, char *high, int n, int (*wtest)(int))
{
while (n--) {
- while ((p < high) && !(*wtest)(*p))
+ while ((p < high) && !(*wtest)((unsigned char) *p))
p++;
- while ((p < high) && (*wtest)(*p))
+ while ((p < high) && (*wtest)((unsigned char) *p))
p++;
}
if (p > high)
p = high;
/* p now points where we want it */
- return p;
+ return (p);
}
/* cv_next_word():
* Find the next word vi style
*/
-protected Char *
-cv_next_word(EditLine *el, Char *p, Char *high, int n, int (*wtest)(Int))
+protected char *
+cv_next_word(EditLine *el, char *p, char *high, int n, int (*wtest)(int))
{
int test;
while (n--) {
- test = (*wtest)(*p);
- while ((p < high) && (*wtest)(*p) == test)
+ test = (*wtest)((unsigned char) *p);
+ while ((p < high) && (*wtest)((unsigned char) *p) == test)
p++;
/*
* vi historically deletes with cw only the word preserving the
* trailing whitespace! This is not what 'w' does..
*/
if (n || el->el_chared.c_vcmd.action != (DELETE|INSERT))
- while ((p < high) && Isspace(*p))
+ while ((p < high) && isspace((unsigned char) *p))
p++;
}
/* p now points where we want it */
if (p > high)
- return high;
+ return (high);
else
- return p;
+ return (p);
}
/* cv_prev_word():
* Find the previous word vi style
*/
-protected Char *
-cv_prev_word(Char *p, Char *low, int n, int (*wtest)(Int))
+protected char *
+cv_prev_word(char *p, char *low, int n, int (*wtest)(int))
{
int test;
p--;
while (n--) {
- while ((p > low) && Isspace(*p))
+ while ((p > low) && isspace((unsigned char) *p))
p--;
- test = (*wtest)(*p);
- while ((p >= low) && (*wtest)(*p) == test)
+ test = (*wtest)((unsigned char) *p);
+ while ((p >= low) && (*wtest)((unsigned char) *p) == test)
p--;
}
p++;
/* p now points where we want it */
if (p < low)
- return low;
+ return (low);
else
- return p;
+ return (p);
}
+#ifdef notdef
+/* c__number():
+ * Ignore character p points to, return number appearing after that.
+ * A '$' by itself means a big number; "$-" is for negative; '^' means 1.
+ * Return p pointing to last char used.
+ */
+protected char *
+c__number(
+ char *p, /* character position */
+ int *num, /* Return value */
+ int dval) /* dval is the number to subtract from like $-3 */
+{
+ int i;
+ int sign = 1;
+
+ if (*++p == '^') {
+ *num = 1;
+ return (p);
+ }
+ if (*p == '$') {
+ if (*++p != '-') {
+ *num = 0x7fffffff; /* Handle $ */
+ return (--p);
+ }
+ sign = -1; /* Handle $- */
+ ++p;
+ }
+ for (i = 0; isdigit((unsigned char) *p); i = 10 * i + *p++ - '0')
+ continue;
+ *num = (sign < 0 ? dval - i : i);
+ return (--p);
+}
+#endif
+
/* cv_delfini():
* Finish vi delete action
*/
@@ -366,26 +397,48 @@ cv_delfini(EditLine *el)
}
+#ifdef notdef
+/* ce__endword():
+ * Go to the end of this word according to emacs
+ */
+protected char *
+ce__endword(char *p, char *high, int n)
+{
+ p++;
+
+ while (n--) {
+ while ((p < high) && isspace((unsigned char) *p))
+ p++;
+ while ((p < high) && !isspace((unsigned char) *p))
+ p++;
+ }
+
+ p--;
+ return (p);
+}
+#endif
+
+
/* cv__endword():
* Go to the end of this word according to vi
*/
-protected Char *
-cv__endword(Char *p, Char *high, int n, int (*wtest)(Int))
+protected char *
+cv__endword(char *p, char *high, int n, int (*wtest)(int))
{
int test;
p++;
while (n--) {
- while ((p < high) && Isspace(*p))
+ while ((p < high) && isspace((unsigned char) *p))
p++;
- test = (*wtest)(*p);
- while ((p < high) && (*wtest)(*p) == test)
+ test = (*wtest)((unsigned char) *p);
+ while ((p < high) && (*wtest)((unsigned char) *p) == test)
p++;
}
p--;
- return p;
+ return (p);
}
/* ch_init():
@@ -396,29 +449,24 @@ ch_init(EditLine *el)
{
c_macro_t *ma = &el->el_chared.c_macro;
- el->el_line.buffer = el_malloc(EL_BUFSIZ *
- sizeof(*el->el_line.buffer));
+ el->el_line.buffer = (char *) el_malloc(EL_BUFSIZ);
if (el->el_line.buffer == NULL)
- return -1;
+ return (-1);
- (void) memset(el->el_line.buffer, 0, EL_BUFSIZ *
- sizeof(*el->el_line.buffer));
+ (void) memset(el->el_line.buffer, 0, EL_BUFSIZ);
el->el_line.cursor = el->el_line.buffer;
el->el_line.lastchar = el->el_line.buffer;
el->el_line.limit = &el->el_line.buffer[EL_BUFSIZ - EL_LEAVE];
- el->el_chared.c_undo.buf = el_malloc(EL_BUFSIZ *
- sizeof(*el->el_chared.c_undo.buf));
+ el->el_chared.c_undo.buf = (char *) el_malloc(EL_BUFSIZ);
if (el->el_chared.c_undo.buf == NULL)
- return -1;
- (void) memset(el->el_chared.c_undo.buf, 0, EL_BUFSIZ *
- sizeof(*el->el_chared.c_undo.buf));
+ return (-1);
+ (void) memset(el->el_chared.c_undo.buf, 0, EL_BUFSIZ);
el->el_chared.c_undo.len = -1;
el->el_chared.c_undo.cursor = 0;
- el->el_chared.c_redo.buf = el_malloc(EL_BUFSIZ *
- sizeof(*el->el_chared.c_redo.buf));
+ el->el_chared.c_redo.buf = (char *) el_malloc(EL_BUFSIZ);
if (el->el_chared.c_redo.buf == NULL)
- return -1;
+ return (-1);
el->el_chared.c_redo.pos = el->el_chared.c_redo.buf;
el->el_chared.c_redo.lim = el->el_chared.c_redo.buf + EL_BUFSIZ;
el->el_chared.c_redo.cmd = ED_UNASSIGNED;
@@ -426,18 +474,12 @@ ch_init(EditLine *el)
el->el_chared.c_vcmd.action = NOP;
el->el_chared.c_vcmd.pos = el->el_line.buffer;
- el->el_chared.c_kill.buf = el_malloc(EL_BUFSIZ *
- sizeof(*el->el_chared.c_kill.buf));
+ el->el_chared.c_kill.buf = (char *) el_malloc(EL_BUFSIZ);
if (el->el_chared.c_kill.buf == NULL)
- return -1;
- (void) memset(el->el_chared.c_kill.buf, 0, EL_BUFSIZ *
- sizeof(*el->el_chared.c_kill.buf));
+ return (-1);
+ (void) memset(el->el_chared.c_kill.buf, 0, EL_BUFSIZ);
el->el_chared.c_kill.mark = el->el_line.buffer;
el->el_chared.c_kill.last = el->el_chared.c_kill.buf;
- el->el_chared.c_resizefun = NULL;
- el->el_chared.c_resizearg = NULL;
- el->el_chared.c_aliasfun = NULL;
- el->el_chared.c_aliasarg = NULL;
el->el_map.current = el->el_map.key;
@@ -449,10 +491,10 @@ ch_init(EditLine *el)
ma->level = -1;
ma->offset = 0;
- ma->macro = el_malloc(EL_MAXMACRO * sizeof(*ma->macro));
+ ma->macro = (char **) el_malloc(EL_MAXMACRO * sizeof(char *));
if (ma->macro == NULL)
- return -1;
- return 0;
+ return (-1);
+ return (0);
}
/* ch_reset():
@@ -491,7 +533,7 @@ ch__clearmacro(EditLine *el)
{
c_macro_t *ma = &el->el_chared.c_macro;
while (ma->level >= 0)
- el_free(ma->macro[ma->level--]);
+ el_free((ptr_t)ma->macro[ma->level--]);
}
/* ch_enlargebufs():
@@ -502,9 +544,9 @@ protected int
ch_enlargebufs(EditLine *el, size_t addlen)
{
size_t sz, newsz;
- Char *newbuffer, *oldbuf, *oldkbuf;
+ char *newbuffer, *oldbuf, *oldkbuf;
- sz = (size_t)(el->el_line.limit - el->el_line.buffer + EL_LEAVE);
+ sz = el->el_line.limit - el->el_line.buffer + EL_LEAVE;
newsz = sz * 2;
/*
* If newly required length is longer than current buffer, we need
@@ -518,12 +560,12 @@ ch_enlargebufs(EditLine *el, size_t addlen)
/*
* Reallocate line buffer.
*/
- newbuffer = el_realloc(el->el_line.buffer, newsz * sizeof(*newbuffer));
+ newbuffer = el_realloc(el->el_line.buffer, newsz);
if (!newbuffer)
return 0;
/* zero the newly added memory, leave old data in */
- (void) memset(&newbuffer[sz], 0, (newsz - sz) * sizeof(*newbuffer));
+ (void) memset(&newbuffer[sz], 0, newsz - sz);
oldbuf = el->el_line.buffer;
@@ -536,13 +578,12 @@ ch_enlargebufs(EditLine *el, size_t addlen)
/*
* Reallocate kill buffer.
*/
- newbuffer = el_realloc(el->el_chared.c_kill.buf, newsz *
- sizeof(*newbuffer));
+ newbuffer = el_realloc(el->el_chared.c_kill.buf, newsz);
if (!newbuffer)
return 0;
/* zero the newly added memory, leave old data in */
- (void) memset(&newbuffer[sz], 0, (newsz - sz) * sizeof(*newbuffer));
+ (void) memset(&newbuffer[sz], 0, newsz - sz);
oldkbuf = el->el_chared.c_kill.buf;
@@ -555,17 +596,15 @@ ch_enlargebufs(EditLine *el, size_t addlen)
/*
* Reallocate undo buffer.
*/
- newbuffer = el_realloc(el->el_chared.c_undo.buf,
- newsz * sizeof(*newbuffer));
+ newbuffer = el_realloc(el->el_chared.c_undo.buf, newsz);
if (!newbuffer)
return 0;
/* zero the newly added memory, leave old data in */
- (void) memset(&newbuffer[sz], 0, (newsz - sz) * sizeof(*newbuffer));
+ (void) memset(&newbuffer[sz], 0, newsz - sz);
el->el_chared.c_undo.buf = newbuffer;
- newbuffer = el_realloc(el->el_chared.c_redo.buf,
- newsz * sizeof(*newbuffer));
+ newbuffer = el_realloc(el->el_chared.c_redo.buf, newsz);
if (!newbuffer)
return 0;
el->el_chared.c_redo.pos = newbuffer +
@@ -579,8 +618,6 @@ ch_enlargebufs(EditLine *el, size_t addlen)
/* Safe to set enlarged buffer size */
el->el_line.limit = &el->el_line.buffer[newsz - EL_LEAVE];
- if (el->el_chared.c_resizefun)
- (*el->el_chared.c_resizefun)(el, el->el_chared.c_resizearg);
return 1;
}
@@ -590,20 +627,20 @@ ch_enlargebufs(EditLine *el, size_t addlen)
protected void
ch_end(EditLine *el)
{
- el_free(el->el_line.buffer);
+ el_free((ptr_t) el->el_line.buffer);
el->el_line.buffer = NULL;
el->el_line.limit = NULL;
- el_free(el->el_chared.c_undo.buf);
+ el_free((ptr_t) el->el_chared.c_undo.buf);
el->el_chared.c_undo.buf = NULL;
- el_free(el->el_chared.c_redo.buf);
+ el_free((ptr_t) el->el_chared.c_redo.buf);
el->el_chared.c_redo.buf = NULL;
el->el_chared.c_redo.pos = NULL;
el->el_chared.c_redo.lim = NULL;
el->el_chared.c_redo.cmd = ED_UNASSIGNED;
- el_free(el->el_chared.c_kill.buf);
+ el_free((ptr_t) el->el_chared.c_kill.buf);
el->el_chared.c_kill.buf = NULL;
ch_reset(el, 1);
- el_free(el->el_chared.c_macro.macro);
+ el_free((ptr_t) el->el_chared.c_macro.macro);
el->el_chared.c_macro.macro = NULL;
}
@@ -612,21 +649,21 @@ ch_end(EditLine *el)
* Insert string at cursorI
*/
public int
-FUN(el,insertstr)(EditLine *el, const Char *s)
+el_insertstr(EditLine *el, const char *s)
{
size_t len;
- if (s == NULL || (len = Strlen(s)) == 0)
- return -1;
+ if ((len = strlen(s)) == 0)
+ return (-1);
if (el->el_line.lastchar + len >= el->el_line.limit) {
if (!ch_enlargebufs(el, len))
- return -1;
+ return (-1);
}
c_insert(el, (int)len);
while (*s)
*el->el_line.cursor++ = *s++;
- return 0;
+ return (0);
}
@@ -648,38 +685,19 @@ el_deletestr(EditLine *el, int n)
el->el_line.cursor = el->el_line.buffer;
}
-/* el_cursor():
- * Move the cursor to the left or the right of the current position
- */
-public int
-el_cursor(EditLine *el, int n)
-{
- if (n == 0)
- goto out;
-
- el->el_line.cursor += n;
-
- if (el->el_line.cursor < el->el_line.buffer)
- el->el_line.cursor = el->el_line.buffer;
- if (el->el_line.cursor > el->el_line.lastchar)
- el->el_line.cursor = el->el_line.lastchar;
-out:
- return (int)(el->el_line.cursor - el->el_line.buffer);
-}
-
/* c_gets():
* Get a string
*/
protected int
-c_gets(EditLine *el, Char *buf, const Char *prompt)
+c_gets(EditLine *el, char *buf, const char *prompt)
{
- Char ch;
+ char ch;
ssize_t len;
- Char *cp = el->el_line.buffer;
+ char *cp = el->el_line.buffer;
if (prompt) {
- len = (ssize_t)Strlen(prompt);
- (void)memcpy(cp, prompt, (size_t)len * sizeof(*cp));
+ len = strlen(prompt);
+ memcpy(cp, prompt, (size_t)len);
cp += len;
}
len = 0;
@@ -690,7 +708,7 @@ c_gets(EditLine *el, Char *buf, const Char *prompt)
el->el_line.lastchar = cp + 1;
re_refresh(el);
- if (FUN(el,getc)(el, &ch) != 1) {
+ if (el_getc(el, &ch) != 1) {
ed_end_of_file(el, 0);
len = -1;
break;
@@ -698,8 +716,8 @@ c_gets(EditLine *el, Char *buf, const Char *prompt)
switch (ch) {
- case 0010: /* Delete and backspace */
- case 0177:
+ case '\010': /* Delete and backspace */
+ case '\177':
if (len == 0) {
len = -1;
break;
@@ -707,15 +725,15 @@ c_gets(EditLine *el, Char *buf, const Char *prompt)
cp--;
continue;
- case 0033: /* ESC */
+ case '\033': /* ESC */
case '\r': /* Newline */
case '\n':
buf[len] = ch;
break;
default:
- if (len >= (ssize_t)(EL_BUFSIZ - 16))
- terminal_beep(el);
+ if (len >= EL_BUFSIZ - 16)
+ term_beep(el);
else {
buf[len++] = ch;
*cp++ = ch;
@@ -738,13 +756,13 @@ c_gets(EditLine *el, Char *buf, const Char *prompt)
protected int
c_hpos(EditLine *el)
{
- Char *ptr;
+ char *ptr;
/*
* Find how many characters till the beginning of this line.
*/
if (el->el_line.cursor == el->el_line.buffer)
- return 0;
+ return (0);
else {
for (ptr = el->el_line.cursor - 1;
ptr >= el->el_line.buffer && *ptr != '\n';
@@ -753,19 +771,3 @@ c_hpos(EditLine *el)
return (int)(el->el_line.cursor - ptr - 1);
}
}
-
-protected int
-ch_resizefun(EditLine *el, el_zfunc_t f, void *a)
-{
- el->el_chared.c_resizefun = f;
- el->el_chared.c_resizearg = a;
- return 0;
-}
-
-protected int
-ch_aliasfun(EditLine *el, el_afunc_t f, void *a)
-{
- el->el_chared.c_aliasfun = f;
- el->el_chared.c_aliasarg = a;
- return 0;
-}
diff --git a/lib/libedit/chared.h b/lib/libedit/chared.h
index 909adac..153fceb 100644
--- a/lib/libedit/chared.h
+++ b/lib/libedit/chared.h
@@ -1,5 +1,3 @@
-/* $NetBSD: chared.h,v 1.22 2014/06/18 18:12:28 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +30,7 @@
* SUCH DAMAGE.
*
* @(#)chared.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: chared.h,v 1.18 2009/02/15 21:55:23 christos Exp $
* $FreeBSD$
*/
@@ -64,7 +63,7 @@
typedef struct c_macro_t {
int level;
int offset;
- Char **macro;
+ char **macro;
} c_macro_t;
/*
@@ -73,16 +72,16 @@ typedef struct c_macro_t {
typedef struct c_undo_t {
ssize_t len; /* length of saved line */
int cursor; /* position of saved cursor */
- Char *buf; /* full saved text */
+ char *buf; /* full saved text */
} c_undo_t;
/* redo for vi */
typedef struct c_redo_t {
- Char *buf; /* redo insert key sequence */
- Char *pos;
- Char *lim;
+ char *buf; /* redo insert key sequence */
+ char *pos;
+ char *lim;
el_action_t cmd; /* command to redo */
- Char ch; /* char that invoked it */
+ char ch; /* char that invoked it */
int count;
int action; /* from cv_action() */
} c_redo_t;
@@ -92,21 +91,18 @@ typedef struct c_redo_t {
*/
typedef struct c_vcmd_t {
int action;
- Char *pos;
+ char *pos;
} c_vcmd_t;
/*
* Kill buffer for emacs
*/
typedef struct c_kill_t {
- Char *buf;
- Char *last;
- Char *mark;
+ char *buf;
+ char *last;
+ char *mark;
} c_kill_t;
-typedef void (*el_zfunc_t)(EditLine *, void *);
-typedef const char *(*el_afunc_t)(void *, const char *);
-
/*
* Note that we use both data structures because the user can bind
* commands from both editors!
@@ -117,16 +113,13 @@ typedef struct el_chared_t {
c_redo_t c_redo;
c_vcmd_t c_vcmd;
c_macro_t c_macro;
- el_zfunc_t c_resizefun;
- el_afunc_t c_aliasfun;
- void * c_resizearg;
- void * c_aliasarg;
} el_chared_t;
#define STRQQ "\"\""
#define isglob(a) (strchr("*[]?", (a)) != NULL)
+#define isword(a) (isprint(a))
#define NOP 0x00
#define DELETE 0x01
@@ -147,29 +140,27 @@ typedef struct el_chared_t {
#include "fcns.h"
-protected int cv__isword(Int);
-protected int cv__isWord(Int);
+protected int cv__isword(int);
+protected int cv__isWord(int);
protected void cv_delfini(EditLine *);
-protected Char *cv__endword(Char *, Char *, int, int (*)(Int));
-protected int ce__isword(Int);
+protected char *cv__endword(char *, char *, int, int (*)(int));
+protected int ce__isword(int);
protected void cv_undo(EditLine *);
-protected void cv_yank(EditLine *, const Char *, int);
-protected Char *cv_next_word(EditLine*, Char *, Char *, int, int (*)(Int));
-protected Char *cv_prev_word(Char *, Char *, int, int (*)(Int));
-protected Char *c__next_word(Char *, Char *, int, int (*)(Int));
-protected Char *c__prev_word(Char *, Char *, int, int (*)(Int));
+protected void cv_yank(EditLine *, const char *, int);
+protected char *cv_next_word(EditLine*, char *, char *, int, int (*)(int));
+protected char *cv_prev_word(char *, char *, int, int (*)(int));
+protected char *c__next_word(char *, char *, int, int (*)(int));
+protected char *c__prev_word(char *, char *, int, int (*)(int));
protected void c_insert(EditLine *, int);
protected void c_delbefore(EditLine *, int);
protected void c_delbefore1(EditLine *);
protected void c_delafter(EditLine *, int);
protected void c_delafter1(EditLine *);
-protected int c_gets(EditLine *, Char *, const Char *);
+protected int c_gets(EditLine *, char *, const char *);
protected int c_hpos(EditLine *);
protected int ch_init(EditLine *);
protected void ch_reset(EditLine *, int);
-protected int ch_resizefun(EditLine *, el_zfunc_t, void *);
-protected int ch_aliasfun(EditLine *, el_afunc_t, void *);
protected int ch_enlargebufs(EditLine *, size_t);
protected void ch_end(EditLine *);
diff --git a/lib/libedit/chartype.c b/lib/libedit/chartype.c
deleted file mode 100644
index c240c8c..0000000
--- a/lib/libedit/chartype.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/* $NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $ */
-
-/*-
- * Copyright (c) 2009 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.
- */
-
-/*
- * chartype.c: character classification and meta information
- */
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $");
-#endif /* not lint && not SCCSID */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "el.h"
-#include <stdlib.h>
-
-#define CT_BUFSIZ ((size_t)1024)
-
-#ifdef WIDECHAR
-protected int
-ct_conv_cbuff_resize(ct_buffer_t *conv, size_t csize)
-{
- void *p;
-
- if (csize <= conv->csize)
- return 0;
-
- conv->csize = csize;
-
- p = el_realloc(conv->cbuff, conv->csize * sizeof(*conv->cbuff));
- if (p == NULL) {
- conv->csize = 0;
- el_free(conv->cbuff);
- conv->cbuff = NULL;
- return -1;
- }
- conv->cbuff = p;
- return 0;
-}
-
-protected int
-ct_conv_wbuff_resize(ct_buffer_t *conv, size_t wsize)
-{
- void *p;
-
- if (wsize <= conv->wsize)
- return 0;
-
- conv->wsize = wsize;
-
- p = el_realloc(conv->wbuff, conv->wsize * sizeof(*conv->wbuff));
- if (p == NULL) {
- conv->wsize = 0;
- el_free(conv->wbuff);
- conv->wbuff = NULL;
- return -1;
- }
- conv->wbuff = p;
- return 0;
-}
-
-
-public char *
-ct_encode_string(const Char *s, ct_buffer_t *conv)
-{
- char *dst;
- ssize_t used;
-
- if (!s)
- return NULL;
-
- dst = conv->cbuff;
- for (;;) {
- used = (ssize_t)(dst - conv->cbuff);
- if ((conv->csize - (size_t)used) < 5) {
- if (ct_conv_cbuff_resize(conv,
- conv->csize + CT_BUFSIZ) == -1)
- return NULL;
- dst = conv->cbuff + used;
- }
- if (!*s)
- break;
- used = ct_encode_char(dst, (size_t)5, *s);
- if (used == -1) /* failed to encode, need more buffer space */
- abort();
- ++s;
- dst += used;
- }
- *dst = '\0';
- return conv->cbuff;
-}
-
-public Char *
-ct_decode_string(const char *s, ct_buffer_t *conv)
-{
- size_t len;
-
- if (!s)
- return NULL;
-
- len = ct_mbstowcs(NULL, s, (size_t)0);
- if (len == (size_t)-1)
- return NULL;
-
- if (conv->wsize < ++len)
- if (ct_conv_wbuff_resize(conv, len + CT_BUFSIZ) == -1)
- return NULL;
-
- ct_mbstowcs(conv->wbuff, s, conv->wsize);
- return conv->wbuff;
-}
-
-
-protected Char **
-ct_decode_argv(int argc, const char *argv[], ct_buffer_t *conv)
-{
- size_t bufspace;
- int i;
- Char *p;
- Char **wargv;
- ssize_t bytes;
-
- /* Make sure we have enough space in the conversion buffer to store all
- * the argv strings. */
- for (i = 0, bufspace = 0; i < argc; ++i)
- bufspace += argv[i] ? strlen(argv[i]) + 1 : 0;
- if (conv->wsize < ++bufspace)
- if (ct_conv_wbuff_resize(conv, bufspace + CT_BUFSIZ) == -1)
- return NULL;
-
- wargv = el_malloc((size_t)argc * sizeof(*wargv));
-
- for (i = 0, p = conv->wbuff; i < argc; ++i) {
- if (!argv[i]) { /* don't pass null pointers to mbstowcs */
- wargv[i] = NULL;
- continue;
- } else {
- wargv[i] = p;
- bytes = (ssize_t)mbstowcs(p, argv[i], bufspace);
- }
- if (bytes == -1) {
- el_free(wargv);
- return NULL;
- } else
- bytes++; /* include '\0' in the count */
- bufspace -= (size_t)bytes;
- p += bytes;
- }
-
- return wargv;
-}
-
-
-protected size_t
-ct_enc_width(Char c)
-{
- /* UTF-8 encoding specific values */
- if (c < 0x80)
- return 1;
- else if (c < 0x0800)
- return 2;
- else if (c < 0x10000)
- return 3;
- else if (c < 0x110000)
- return 4;
- else
- return 0; /* not a valid codepoint */
-}
-
-protected ssize_t
-ct_encode_char(char *dst, size_t len, Char c)
-{
- ssize_t l = 0;
- if (len < ct_enc_width(c))
- return -1;
- l = ct_wctomb(dst, c);
-
- if (l < 0) {
- ct_wctomb_reset;
- l = 0;
- }
- return l;
-}
-#endif
-
-protected const Char *
-ct_visual_string(const Char *s)
-{
- static Char *buff = NULL;
- static size_t buffsize = 0;
- void *p;
- Char *dst;
- ssize_t used = 0;
-
- if (!s)
- return NULL;
- if (!buff) {
- buffsize = CT_BUFSIZ;
- buff = el_malloc(buffsize * sizeof(*buff));
- }
- dst = buff;
- while (*s) {
- used = ct_visual_char(dst, buffsize - (size_t)(dst - buff), *s);
- if (used == -1) { /* failed to encode, need more buffer space */
- used = dst - buff;
- buffsize += CT_BUFSIZ;
- p = el_realloc(buff, buffsize * sizeof(*buff));
- if (p == NULL)
- goto out;
- buff = p;
- dst = buff + used;
- /* don't increment s here - we want to retry it! */
- }
- else
- ++s;
- dst += used;
- }
- if (dst >= (buff + buffsize)) { /* sigh */
- buffsize += 1;
- p = el_realloc(buff, buffsize * sizeof(*buff));
- if (p == NULL)
- goto out;
- buff = p;
- dst = buff + buffsize - 1;
- }
- *dst = 0;
- return buff;
-out:
- el_free(buff);
- buffsize = 0;
- return NULL;
-}
-
-
-
-protected int
-ct_visual_width(Char c)
-{
- int t = ct_chr_class(c);
- switch (t) {
- case CHTYPE_ASCIICTL:
- return 2; /* ^@ ^? etc. */
- case CHTYPE_TAB:
- return 1; /* Hmm, this really need to be handled outside! */
- case CHTYPE_NL:
- return 0; /* Should this be 1 instead? */
-#ifdef WIDECHAR
- case CHTYPE_PRINT:
- return wcwidth(c);
- case CHTYPE_NONPRINT:
- if (c > 0xffff) /* prefer standard 4-byte display over 5-byte */
- return 8; /* \U+12345 */
- else
- return 7; /* \U+1234 */
-#else
- case CHTYPE_PRINT:
- return 1;
- case CHTYPE_NONPRINT:
- return 4; /* \123 */
-#endif
- default:
- return 0; /* should not happen */
- }
-}
-
-
-protected ssize_t
-ct_visual_char(Char *dst, size_t len, Char c)
-{
- int t = ct_chr_class(c);
- switch (t) {
- case CHTYPE_TAB:
- case CHTYPE_NL:
- case CHTYPE_ASCIICTL:
- if (len < 2)
- return -1; /* insufficient space */
- *dst++ = '^';
- if (c == '\177')
- *dst = '?'; /* DEL -> ^? */
- else
- *dst = c | 0100; /* uncontrolify it */
- return 2;
- case CHTYPE_PRINT:
- if (len < 1)
- return -1; /* insufficient space */
- *dst = c;
- return 1;
- case CHTYPE_NONPRINT:
- /* we only use single-width glyphs for display,
- * so this is right */
- if ((ssize_t)len < ct_visual_width(c))
- return -1; /* insufficient space */
-#ifdef WIDECHAR
- *dst++ = '\\';
- *dst++ = 'U';
- *dst++ = '+';
-#define tohexdigit(v) "0123456789ABCDEF"[v]
- if (c > 0xffff) /* prefer standard 4-byte display over 5-byte */
- *dst++ = tohexdigit(((unsigned int) c >> 16) & 0xf);
- *dst++ = tohexdigit(((unsigned int) c >> 12) & 0xf);
- *dst++ = tohexdigit(((unsigned int) c >> 8) & 0xf);
- *dst++ = tohexdigit(((unsigned int) c >> 4) & 0xf);
- *dst = tohexdigit(((unsigned int) c ) & 0xf);
- return c > 0xffff ? 8 : 7;
-#else
- *dst++ = '\\';
-#define tooctaldigit(v) ((v) + '0')
- *dst++ = tooctaldigit(((unsigned int) c >> 6) & 0x7);
- *dst++ = tooctaldigit(((unsigned int) c >> 3) & 0x7);
- *dst++ = tooctaldigit(((unsigned int) c ) & 0x7);
-#endif
- /*FALLTHROUGH*/
- /* these two should be handled outside this function */
- default: /* we should never hit the default */
- return 0;
- }
-}
-
-
-
-
-protected int
-ct_chr_class(Char c)
-{
- if (c == '\t')
- return CHTYPE_TAB;
- else if (c == '\n')
- return CHTYPE_NL;
- else if (IsASCII(c) && Iscntrl(c))
- return CHTYPE_ASCIICTL;
- else if (Isprint(c))
- return CHTYPE_PRINT;
- else
- return CHTYPE_NONPRINT;
-}
diff --git a/lib/libedit/chartype.h b/lib/libedit/chartype.h
index 17ca5f3..c8b2b14 100644
--- a/lib/libedit/chartype.h
+++ b/lib/libedit/chartype.h
@@ -1,4 +1,4 @@
-/* $NetBSD: chartype.h,v 1.15 2015/05/17 13:14:41 christos Exp $ */
+/* $NetBSD: chartype.h,v 1.6 2010/04/20 02:01:13 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
* supports non-BMP code points without requiring UTF-16, but nothing
* seems to actually advertise this properly, despite Unicode 3.1 having
* been around since 2001... */
-#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
+#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__))
#ifndef __STDC_ISO_10646__
/* In many places it is assumed that the first 127 code points are ASCII
* compatible, so ensure wchar_t indeed does ISO 10646 and not some other
@@ -56,7 +56,7 @@
#endif
#define ct_mbtowc mbtowc
-#define ct_mbtowc_reset mbtowc(0,0,(size_t)0)
+#define ct_mbtowc_reset mbtowc(0,0,0)
#define ct_wctomb wctomb
#define ct_wctomb_reset wctomb(0,0)
#define ct_wcstombs wcstombs
@@ -67,7 +67,6 @@
#define FUN(prefix,rest) prefix ## _w ## rest
#define FUNW(type) type ## _w
#define TYPE(type) type ## W
-#define FCHAR "%lc"
#define FSTR "%ls"
#define STR(x) L ## x
#define UC(c) c
@@ -101,12 +100,7 @@
#define Strtol(p,e,b) wcstol(p,e,b)
-static inline int
-Width(wchar_t c)
-{
- int w = wcwidth(c);
- return w < 0 ? 0 : w;
-}
+#define Width(c) wcwidth(c)
#else /* NARROW */
@@ -122,7 +116,6 @@ Width(wchar_t c)
#define FUN(prefix,rest) prefix ## _ ## rest
#define FUNW(type) type
#define TYPE(type) type
-#define FCHAR "%c"
#define FSTR "%s"
#define STR(x) x
#define UC(c) (unsigned char)(c)
@@ -174,11 +167,11 @@ typedef struct ct_buffer_t {
} ct_buffer_t;
#define ct_encode_string __ct_encode_string
-/* Encode a wide-character string and return the UTF-8 encoded result. */
+/* Encode a wide character string and return the UTF-8 encoded result. */
public char *ct_encode_string(const Char *, ct_buffer_t *);
#define ct_decode_string __ct_decode_string
-/* Decode a (multi)?byte string and return the wide-character string result. */
+/* Decode a (multi)?byte string and return the wide character string result. */
public Char *ct_decode_string(const char *, ct_buffer_t *);
/* Decode a (multi)?byte argv string array.
@@ -186,8 +179,7 @@ public Char *ct_decode_string(const char *, ct_buffer_t *);
protected Char **ct_decode_argv(int, const char *[], ct_buffer_t *);
/* Resizes the conversion buffer(s) if needed. */
-protected int ct_conv_cbuff_resize(ct_buffer_t *, size_t);
-protected int ct_conv_wbuff_resize(ct_buffer_t *, size_t);
+protected void ct_conv_buff_resize(ct_buffer_t *, size_t, size_t);
protected ssize_t ct_encode_char(char *, size_t, Char);
protected size_t ct_enc_width(Char);
@@ -197,8 +189,7 @@ protected size_t ct_enc_width(Char);
#define ct_encode_string(s, b) (s)
#define ct_decode_string(s, b) (s)
#define ct_decode_argv(l, s, b) (s)
-#define ct_conv_cbuff_resize(b, s) ((s) == (0))
-#define ct_conv_wbuff_resize(b, s) ((s) == (0))
+#define ct_conv_buff_resize(b, os, ns)
#define ct_encode_char(d, l, s) (*d = s, 1)
#define ct_free_argv(s)
#endif
@@ -210,7 +201,7 @@ protected size_t ct_enc_width(Char);
/* The maximum buffer size to hold the most unwieldly visual representation,
* in this case \U+nnnnn. */
-#define VISUAL_WIDTH_MAX ((size_t)8)
+#define VISUAL_WIDTH_MAX 8
/* The terminal is thought of in terms of X columns by Y lines. In the cases
* where a wide character takes up more than one column, the adjacent
diff --git a/lib/libedit/common.c b/lib/libedit/common.c
index fc09a9b..64490c9 100644
--- a/lib/libedit/common.c
+++ b/lib/libedit/common.c
@@ -1,5 +1,3 @@
-/* $NetBSD: common.c,v 1.29 2012/03/24 20:08:43 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: common.c,v 1.23 2009/02/27 04:18:45 msaitoh Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: common.c,v 1.29 2012/03/24 20:08:43 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -46,6 +41,7 @@ __FBSDID("$FreeBSD$");
/*
* common.c: Common Editor functions
*/
+#include "sys.h"
#include "el.h"
/* ed_end_of_file():
@@ -54,12 +50,12 @@ __FBSDID("$FreeBSD$");
*/
protected el_action_t
/*ARGSUSED*/
-ed_end_of_file(EditLine *el, Int c __attribute__((__unused__)))
+ed_end_of_file(EditLine *el, int c __unused)
{
re_goto_bottom(el);
*el->el_line.lastchar = '\0';
- return CC_EOF;
+ return (CC_EOF);
}
@@ -68,12 +64,12 @@ ed_end_of_file(EditLine *el, Int c __attribute__((__unused__)))
* Insert a character [bound to all insert keys]
*/
protected el_action_t
-ed_insert(EditLine *el, Int c)
+ed_insert(EditLine *el, int c)
{
int count = el->el_state.argument;
if (c == '\0')
- return CC_ERROR;
+ return (CC_ERROR);
if (el->el_line.lastchar + el->el_state.argument >=
el->el_line.limit) {
@@ -101,7 +97,7 @@ ed_insert(EditLine *el, Int c)
if (el->el_state.inputmode == MODE_REPLACE_1)
return vi_command_mode(el, 0);
- return CC_NORM;
+ return (CC_NORM);
}
@@ -111,12 +107,12 @@ ed_insert(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_prev_word(EditLine *el, Int c __attribute__((__unused__)))
+ed_delete_prev_word(EditLine *el, int c __unused)
{
- Char *cp, *p, *kp;
+ char *cp, *p, *kp;
if (el->el_line.cursor == el->el_line.buffer)
- return CC_ERROR;
+ return (CC_ERROR);
cp = c__prev_word(el->el_line.cursor, el->el_line.buffer,
el->el_state.argument, ce__isword);
@@ -129,7 +125,7 @@ ed_delete_prev_word(EditLine *el, Int c __attribute__((__unused__)))
el->el_line.cursor = cp;
if (el->el_line.cursor < el->el_line.buffer)
el->el_line.cursor = el->el_line.buffer; /* bounds check */
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -139,9 +135,9 @@ ed_delete_prev_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_next_char(EditLine *el, Int c __attribute__((__unused__)))
+ed_delete_next_char(EditLine *el, int c)
{
-#ifdef DEBUG_EDIT
+#ifdef notdef /* XXX */
#define EL el->el_line
(void) fprintf(el->el_errlfile,
"\nD(b: %x(%s) c: %x(%s) last: %x(%s) limit: %x(%s)\n",
@@ -154,21 +150,21 @@ ed_delete_next_char(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_line.cursor == el->el_line.buffer) {
/* if I'm also at the beginning */
#ifdef KSHVI
- return CC_ERROR;
+ return (CC_ERROR);
#else
/* then do an EOF */
- terminal_writec(el, c);
- return CC_EOF;
+ term_writechar(el, c);
+ return (CC_EOF);
#endif
} else {
#ifdef KSHVI
el->el_line.cursor--;
#else
- return CC_ERROR;
+ return (CC_ERROR);
#endif
}
} else
- return CC_ERROR;
+ return (CC_ERROR);
}
c_delafter(el, el->el_state.argument); /* delete after dot */
if (el->el_map.type == MAP_VI &&
@@ -176,7 +172,7 @@ ed_delete_next_char(EditLine *el, Int c __attribute__((__unused__)))
el->el_line.cursor > el->el_line.buffer)
/* bounds check */
el->el_line.cursor = el->el_line.lastchar - 1;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -186,9 +182,9 @@ ed_delete_next_char(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_kill_line(EditLine *el, Int c __attribute__((__unused__)))
+ed_kill_line(EditLine *el, int c __unused)
{
- Char *kp, *cp;
+ char *kp, *cp;
cp = el->el_line.cursor;
kp = el->el_chared.c_kill.buf;
@@ -197,7 +193,7 @@ ed_kill_line(EditLine *el, Int c __attribute__((__unused__)))
el->el_chared.c_kill.last = kp;
/* zap! -- delete to end */
el->el_line.lastchar = el->el_line.cursor;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -207,20 +203,17 @@ ed_kill_line(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_move_to_end(EditLine *el, Int c __attribute__((__unused__)))
+ed_move_to_end(EditLine *el, int c __unused)
{
el->el_line.cursor = el->el_line.lastchar;
if (el->el_map.type == MAP_VI) {
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
-#ifdef VI_MOVE
- el->el_line.cursor--;
-#endif
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -230,21 +223,21 @@ ed_move_to_end(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_move_to_beg(EditLine *el, Int c __attribute__((__unused__)))
+ed_move_to_beg(EditLine *el, int c __unused)
{
el->el_line.cursor = el->el_line.buffer;
if (el->el_map.type == MAP_VI) {
/* We want FIRST non space character */
- while (Isspace(*el->el_line.cursor))
+ while (isspace((unsigned char) *el->el_line.cursor))
el->el_line.cursor++;
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -253,12 +246,12 @@ ed_move_to_beg(EditLine *el, Int c __attribute__((__unused__)))
* [^T] [^T]
*/
protected el_action_t
-ed_transpose_chars(EditLine *el, Int c)
+ed_transpose_chars(EditLine *el, int c)
{
if (el->el_line.cursor < el->el_line.lastchar) {
if (el->el_line.lastchar <= &el->el_line.buffer[1])
- return CC_ERROR;
+ return (CC_ERROR);
else
el->el_line.cursor++;
}
@@ -267,9 +260,9 @@ ed_transpose_chars(EditLine *el, Int c)
c = el->el_line.cursor[-2];
el->el_line.cursor[-2] = el->el_line.cursor[-1];
el->el_line.cursor[-1] = c;
- return CC_REFRESH;
+ return (CC_REFRESH);
} else
- return CC_ERROR;
+ return (CC_ERROR);
}
@@ -279,15 +272,15 @@ ed_transpose_chars(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-ed_next_char(EditLine *el, Int c __attribute__((__unused__)))
+ed_next_char(EditLine *el, int c __unused)
{
- Char *lim = el->el_line.lastchar;
+ char *lim = el->el_line.lastchar;
if (el->el_line.cursor >= lim ||
(el->el_line.cursor == lim - 1 &&
el->el_map.type == MAP_VI &&
el->el_chared.c_vcmd.action == NOP))
- return CC_ERROR;
+ return (CC_ERROR);
el->el_line.cursor += el->el_state.argument;
if (el->el_line.cursor > lim)
@@ -296,9 +289,9 @@ ed_next_char(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_map.type == MAP_VI)
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -308,11 +301,11 @@ ed_next_char(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_prev_word(EditLine *el, Int c __attribute__((__unused__)))
+ed_prev_word(EditLine *el, int c __unused)
{
if (el->el_line.cursor == el->el_line.buffer)
- return CC_ERROR;
+ return (CC_ERROR);
el->el_line.cursor = c__prev_word(el->el_line.cursor,
el->el_line.buffer,
@@ -322,9 +315,9 @@ ed_prev_word(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_map.type == MAP_VI)
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -334,7 +327,7 @@ ed_prev_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+ed_prev_char(EditLine *el, int c __unused)
{
if (el->el_line.cursor > el->el_line.buffer) {
@@ -345,11 +338,11 @@ ed_prev_char(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_map.type == MAP_VI)
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- return CC_CURSOR;
+ return (CC_CURSOR);
} else
- return CC_ERROR;
+ return (CC_ERROR);
}
@@ -358,19 +351,19 @@ ed_prev_char(EditLine *el, Int c __attribute__((__unused__)))
* [^V] [^V]
*/
protected el_action_t
-ed_quoted_insert(EditLine *el, Int c)
+ed_quoted_insert(EditLine *el, int c)
{
int num;
- Char tc;
+ char tc;
tty_quotemode(el);
- num = FUN(el,getc)(el, &tc);
- c = tc;
+ num = el_getc(el, &tc);
+ c = (unsigned char) tc;
tty_noquotemode(el);
if (num == 1)
- return ed_insert(el, c);
+ return (ed_insert(el, c));
else
- return ed_end_of_file(el, 0);
+ return (ed_end_of_file(el, 0));
}
@@ -378,11 +371,11 @@ ed_quoted_insert(EditLine *el, Int c)
* Adds to argument or enters a digit
*/
protected el_action_t
-ed_digit(EditLine *el, Int c)
+ed_digit(EditLine *el, int c)
{
- if (!Isdigit(c))
- return CC_ERROR;
+ if (!isdigit((unsigned char) c))
+ return (CC_ERROR);
if (el->el_state.doingarg) {
/* if doing an arg, add this in... */
@@ -390,11 +383,11 @@ ed_digit(EditLine *el, Int c)
el->el_state.argument = c - '0';
else {
if (el->el_state.argument > 1000000)
- return CC_ERROR;
+ return (CC_ERROR);
el->el_state.argument =
(el->el_state.argument * 10) + (c - '0');
}
- return CC_ARGHACK;
+ return (CC_ARGHACK);
}
return ed_insert(el, c);
@@ -406,22 +399,22 @@ ed_digit(EditLine *el, Int c)
* For ESC-n
*/
protected el_action_t
-ed_argument_digit(EditLine *el, Int c)
+ed_argument_digit(EditLine *el, int c)
{
- if (!Isdigit(c))
- return CC_ERROR;
+ if (!isdigit((unsigned char) c))
+ return (CC_ERROR);
if (el->el_state.doingarg) {
if (el->el_state.argument > 1000000)
- return CC_ERROR;
+ return (CC_ERROR);
el->el_state.argument = (el->el_state.argument * 10) +
(c - '0');
} else { /* else starting an argument */
el->el_state.argument = c - '0';
el->el_state.doingarg = 1;
}
- return CC_ARGHACK;
+ return (CC_ARGHACK);
}
@@ -431,11 +424,10 @@ ed_argument_digit(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-ed_unassigned(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ed_unassigned(EditLine *el, int c __unused)
{
- return CC_ERROR;
+ return (CC_ERROR);
}
@@ -449,11 +441,11 @@ ed_unassigned(EditLine *el __attribute__((__unused__)),
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_sigint(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ed_tty_sigint(EditLine *el __unused,
+ int c __unused)
{
- return CC_NORM;
+ return (CC_NORM);
}
@@ -463,11 +455,11 @@ ed_tty_sigint(EditLine *el __attribute__((__unused__)),
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_dsusp(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ed_tty_dsusp(EditLine *el __unused,
+ int c __unused)
{
- return CC_NORM;
+ return (CC_NORM);
}
@@ -477,11 +469,11 @@ ed_tty_dsusp(EditLine *el __attribute__((__unused__)),
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_flush_output(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ed_tty_flush_output(EditLine *el __unused,
+ int c __unused)
{
- return CC_NORM;
+ return (CC_NORM);
}
@@ -491,11 +483,11 @@ ed_tty_flush_output(EditLine *el __attribute__((__unused__)),
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_sigquit(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ed_tty_sigquit(EditLine *el __unused,
+ int c __unused)
{
- return CC_NORM;
+ return (CC_NORM);
}
@@ -505,11 +497,11 @@ ed_tty_sigquit(EditLine *el __attribute__((__unused__)),
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_sigtstp(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ed_tty_sigtstp(EditLine *el __unused,
+ int c __unused)
{
- return CC_NORM;
+ return (CC_NORM);
}
@@ -519,11 +511,11 @@ ed_tty_sigtstp(EditLine *el __attribute__((__unused__)),
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_stop_output(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ed_tty_stop_output(EditLine *el __unused,
+ int c __unused)
{
- return CC_NORM;
+ return (CC_NORM);
}
@@ -533,11 +525,11 @@ ed_tty_stop_output(EditLine *el __attribute__((__unused__)),
*/
protected el_action_t
/*ARGSUSED*/
-ed_tty_start_output(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ed_tty_start_output(EditLine *el __unused,
+ int c __unused)
{
- return CC_NORM;
+ return (CC_NORM);
}
@@ -547,13 +539,13 @@ ed_tty_start_output(EditLine *el __attribute__((__unused__)),
*/
protected el_action_t
/*ARGSUSED*/
-ed_newline(EditLine *el, Int c __attribute__((__unused__)))
+ed_newline(EditLine *el, int c __unused)
{
re_goto_bottom(el);
*el->el_line.lastchar++ = '\n';
*el->el_line.lastchar = '\0';
- return CC_NEWLINE;
+ return (CC_NEWLINE);
}
@@ -563,17 +555,17 @@ ed_newline(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+ed_delete_prev_char(EditLine *el, int c __unused)
{
if (el->el_line.cursor <= el->el_line.buffer)
- return CC_ERROR;
+ return (CC_ERROR);
c_delbefore(el, el->el_state.argument);
el->el_line.cursor -= el->el_state.argument;
if (el->el_line.cursor < el->el_line.buffer)
el->el_line.cursor = el->el_line.buffer;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -583,12 +575,12 @@ ed_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_clear_screen(EditLine *el, Int c __attribute__((__unused__)))
+ed_clear_screen(EditLine *el, int c __unused)
{
- terminal_clear_screen(el); /* clear the whole real screen */
+ term_clear_screen(el); /* clear the whole real screen */
re_clear_display(el); /* reset everything */
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -598,11 +590,11 @@ ed_clear_screen(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_redisplay(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ed_redisplay(EditLine *el __unused,
+ int c __unused)
{
- return CC_REDISPLAY;
+ return (CC_REDISPLAY);
}
@@ -612,11 +604,11 @@ ed_redisplay(EditLine *el __attribute__((__unused__)),
*/
protected el_action_t
/*ARGSUSED*/
-ed_start_over(EditLine *el, Int c __attribute__((__unused__)))
+ed_start_over(EditLine *el, int c __unused)
{
ch_reset(el, 0);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -626,11 +618,11 @@ ed_start_over(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_sequence_lead_in(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ed_sequence_lead_in(EditLine *el __unused,
+ int c __unused)
{
- return CC_NORM;
+ return (CC_NORM);
}
@@ -640,7 +632,7 @@ ed_sequence_lead_in(EditLine *el __attribute__((__unused__)),
*/
protected el_action_t
/*ARGSUSED*/
-ed_prev_history(EditLine *el, Int c __attribute__((__unused__)))
+ed_prev_history(EditLine *el, int c __unused)
{
char beep = 0;
int sv_event = el->el_history.eventno;
@@ -650,7 +642,7 @@ ed_prev_history(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_history.eventno == 0) { /* save the current buffer
* away */
- (void) Strncpy(el->el_history.buf, el->el_line.buffer,
+ (void) strncpy(el->el_history.buf, el->el_line.buffer,
EL_BUFSIZ);
el->el_history.last = el->el_history.buf +
(el->el_line.lastchar - el->el_line.buffer);
@@ -660,7 +652,7 @@ ed_prev_history(EditLine *el, Int c __attribute__((__unused__)))
if (hist_get(el) == CC_ERROR) {
if (el->el_map.type == MAP_VI) {
el->el_history.eventno = sv_event;
-
+ return CC_ERROR;
}
beep = 1;
/* el->el_history.eventno was fixed by first call */
@@ -678,7 +670,7 @@ ed_prev_history(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_next_history(EditLine *el, Int c __attribute__((__unused__)))
+ed_next_history(EditLine *el, int c __unused)
{
el_action_t beep = CC_REFRESH, rval;
@@ -705,9 +697,9 @@ ed_next_history(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_search_prev_history(EditLine *el, Int c __attribute__((__unused__)))
+ed_search_prev_history(EditLine *el, int c __unused)
{
- const Char *hp;
+ const char *hp;
int h;
bool_t found = 0;
@@ -720,20 +712,20 @@ ed_search_prev_history(EditLine *el, Int c __attribute__((__unused__)))
"e_prev_search_hist(): eventno < 0;\n");
#endif
el->el_history.eventno = 0;
- return CC_ERROR;
+ return (CC_ERROR);
}
if (el->el_history.eventno == 0) {
- (void) Strncpy(el->el_history.buf, el->el_line.buffer,
+ (void) strncpy(el->el_history.buf, el->el_line.buffer,
EL_BUFSIZ);
el->el_history.last = el->el_history.buf +
(el->el_line.lastchar - el->el_line.buffer);
}
if (el->el_history.ref == NULL)
- return CC_ERROR;
+ return (CC_ERROR);
hp = HIST_FIRST(el);
if (hp == NULL)
- return CC_ERROR;
+ return (CC_ERROR);
c_setpat(el); /* Set search pattern !! */
@@ -744,7 +736,7 @@ ed_search_prev_history(EditLine *el, Int c __attribute__((__unused__)))
#ifdef SDEBUG
(void) fprintf(el->el_errfile, "Comparing with \"%s\"\n", hp);
#endif
- if ((Strncmp(hp, el->el_line.buffer, (size_t)
+ if ((strncmp(hp, el->el_line.buffer, (size_t)
(el->el_line.lastchar - el->el_line.buffer)) ||
hp[el->el_line.lastchar - el->el_line.buffer]) &&
c_hmatch(el, hp)) {
@@ -759,11 +751,11 @@ ed_search_prev_history(EditLine *el, Int c __attribute__((__unused__)))
#ifdef SDEBUG
(void) fprintf(el->el_errfile, "not found\n");
#endif
- return CC_ERROR;
+ return (CC_ERROR);
}
el->el_history.eventno = h;
- return hist_get(el);
+ return (hist_get(el));
}
@@ -773,9 +765,9 @@ ed_search_prev_history(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_search_next_history(EditLine *el, Int c __attribute__((__unused__)))
+ed_search_next_history(EditLine *el, int c __unused)
{
- const Char *hp;
+ const char *hp;
int h;
bool_t found = 0;
@@ -784,14 +776,14 @@ ed_search_next_history(EditLine *el, Int c __attribute__((__unused__)))
*el->el_line.lastchar = '\0'; /* just in case */
if (el->el_history.eventno == 0)
- return CC_ERROR;
+ return (CC_ERROR);
if (el->el_history.ref == NULL)
- return CC_ERROR;
+ return (CC_ERROR);
hp = HIST_FIRST(el);
if (hp == NULL)
- return CC_ERROR;
+ return (CC_ERROR);
c_setpat(el); /* Set search pattern !! */
@@ -799,7 +791,7 @@ ed_search_next_history(EditLine *el, Int c __attribute__((__unused__)))
#ifdef SDEBUG
(void) fprintf(el->el_errfile, "Comparing with \"%s\"\n", hp);
#endif
- if ((Strncmp(hp, el->el_line.buffer, (size_t)
+ if ((strncmp(hp, el->el_line.buffer, (size_t)
(el->el_line.lastchar - el->el_line.buffer)) ||
hp[el->el_line.lastchar - el->el_line.buffer]) &&
c_hmatch(el, hp))
@@ -812,12 +804,12 @@ ed_search_next_history(EditLine *el, Int c __attribute__((__unused__)))
#ifdef SDEBUG
(void) fprintf(el->el_errfile, "not found\n");
#endif
- return CC_ERROR;
+ return (CC_ERROR);
}
}
el->el_history.eventno = found;
- return hist_get(el);
+ return (hist_get(el));
}
@@ -827,9 +819,9 @@ ed_search_next_history(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_prev_line(EditLine *el, Int c __attribute__((__unused__)))
+ed_prev_line(EditLine *el, int c __unused)
{
- Char *ptr;
+ char *ptr;
int nchars = c_hpos(el);
/*
@@ -843,7 +835,7 @@ ed_prev_line(EditLine *el, Int c __attribute__((__unused__)))
break;
if (el->el_state.argument > 0)
- return CC_ERROR;
+ return (CC_ERROR);
/*
* Move to the beginning of the line
@@ -860,7 +852,7 @@ ed_prev_line(EditLine *el, Int c __attribute__((__unused__)))
continue;
el->el_line.cursor = ptr;
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -870,9 +862,9 @@ ed_prev_line(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_next_line(EditLine *el, Int c __attribute__((__unused__)))
+ed_next_line(EditLine *el, int c __unused)
{
- Char *ptr;
+ char *ptr;
int nchars = c_hpos(el);
/*
@@ -883,7 +875,7 @@ ed_next_line(EditLine *el, Int c __attribute__((__unused__)))
break;
if (el->el_state.argument > 0)
- return CC_ERROR;
+ return (CC_ERROR);
/*
* Move to the character requested
@@ -894,7 +886,7 @@ ed_next_line(EditLine *el, Int c __attribute__((__unused__)))
continue;
el->el_line.cursor = ptr;
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -904,16 +896,16 @@ ed_next_line(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_command(EditLine *el, Int c __attribute__((__unused__)))
+ed_command(EditLine *el, int c __unused)
{
- Char tmpbuf[EL_BUFSIZ];
+ char tmpbuf[EL_BUFSIZ];
int tmplen;
- tmplen = c_gets(el, tmpbuf, STR("\n: "));
- terminal__putc(el, '\n');
+ tmplen = c_gets(el, tmpbuf, "\n: ");
+ term__putc(el, '\n');
if (tmplen < 0 || (tmpbuf[tmplen] = 0, parse_line(el, tmpbuf)) == -1)
- terminal_beep(el);
+ term_beep(el);
el->el_map.current = el->el_map.key;
re_clear_display(el);
diff --git a/lib/libedit/config.h b/lib/libedit/config.h
deleted file mode 100644
index 526869f..0000000
--- a/lib/libedit/config.h
+++ /dev/null
@@ -1,290 +0,0 @@
-/* $FreeBSD$ */
-/* config.h. Generated from config.h.in by configure. */
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* Define to 1 if the `closedir' function returns void instead of `int'. */
-/* #undef CLOSEDIR_VOID */
-
-/* Define to 1 if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
- */
-#define HAVE_DIRENT_H 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the `endpwent' function. */
-#define HAVE_ENDPWENT 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define to 1 if you have the `fgetln' function. */
-#define HAVE_FGETLN 1
-
-/* Define to 1 if you have the `fork' function. */
-#define HAVE_FORK 1
-
-/* Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1
- versions. */
-/* #undef HAVE_GETPW_R_DRAFT */
-
-/* Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1
- compatible. */
-#define HAVE_GETPW_R_POSIX 1
-
-/* Define to 1 if you have the <inttypes.h> 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 `issetugid' function. */
-#define HAVE_ISSETUGID 1
-
-/* Define to 1 if you have the `curses' library (-lcurses). */
-/* #undef HAVE_LIBCURSES */
-
-/* Define to 1 if you have the `ncurses' library (-lncurses). */
-#define HAVE_LIBNCURSES 1
-
-/* Define to 1 if you have the `termcap' library (-ltermcap). */
-/* #undef HAVE_LIBTERMCAP */
-
-/* Define to 1 if you have the `terminfo' library (-lterminfo). */
-/* #undef HAVE_LIBTERMINFO */
-
-/* Define to 1 if you have the `termlib' library (-ltermlib). */
-/* #undef HAVE_LIBTERMLIB */
-
-/* Define to 1 if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define to 1 if you have the <malloc.h> header file. */
-#define HAVE_MALLOC_H 1
-
-/* Define to 1 if you have the `memchr' function. */
-#define HAVE_MEMCHR 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `memset' function. */
-#define HAVE_MEMSET 1
-
-/* Define to 1 if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
-/* #undef HAVE_NDIR_H */
-
-/* Define to 1 if you have the `regcomp' function. */
-#define HAVE_REGCOMP 1
-
-/* Define to 1 if you have the `re_comp' function. */
-/* #undef HAVE_RE_COMP */
-
-/* Define to 1 if `stat' has the bug that it succeeds when given the
- zero-length file name argument. */
-/* #undef HAVE_STAT_EMPTY_STRING_BUG */
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the `strcasecmp' function. */
-#define HAVE_STRCASECMP 1
-
-/* Define to 1 if you have the `strchr' function. */
-#define HAVE_STRCHR 1
-
-/* Define to 1 if you have the `strcspn' function. */
-#define HAVE_STRCSPN 1
-
-/* Define to 1 if you have the `strdup' function. */
-#define HAVE_STRDUP 1
-
-/* Define to 1 if you have the `strerror' function. */
-#define HAVE_STRERROR 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the `strlcat' function. */
-#define HAVE_STRLCAT 1
-
-/* Define to 1 if you have the `strlcpy' function. */
-#define HAVE_STRLCPY 1
-
-/* Define to 1 if you have the `strrchr' function. */
-#define HAVE_STRRCHR 1
-
-/* Define to 1 if you have the `strstr' function. */
-#define HAVE_STRSTR 1
-
-/* Define to 1 if you have the `strtol' function. */
-#define HAVE_STRTOL 1
-
-/* Define to 1 if struct dirent has member d_namlen */
-#define HAVE_STRUCT_DIRENT_D_NAMLEN 1
-
-/* Define to 1 if you have the `strunvis' function. */
-#define HAVE_STRUNVIS 1
-
-/* Define to 1 if you have the `strvis' function. */
-#define HAVE_STRVIS 1
-
-/* Define to 1 if you have the <sys/cdefs.h> header file. */
-#define HAVE_SYS_CDEFS_H 1
-
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
- */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
- */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define to 1 if you have the <termcap.h> header file. */
-#define HAVE_TERMCAP_H 1
-
-/* Define to 1 if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 if the system has the type `u_int32_t'. */
-#define HAVE_U_INT32_T 1
-
-/* Define to 1 if you have the `vfork' function. */
-#define HAVE_VFORK 1
-
-/* Define to 1 if you have the <vfork.h> header file. */
-/* #undef HAVE_VFORK_H */
-
-/* Define to 1 if you have the `vis' function. */
-#define HAVE_VIS 1
-
-/* Define to 1 if you have the `wcsdup' function. */
-#define HAVE_WCSDUP 1
-
-/* Define to 1 if `fork' works. */
-#define HAVE_WORKING_FORK 1
-
-/* Define to 1 if `vfork' works. */
-#define HAVE_WORKING_VFORK 1
-
-/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
- slash. */
-#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#define LT_OBJDIR ".libs/"
-
-/* Name of package */
-#define PACKAGE "libedit-20110729"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "libedit"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libedit 3.0"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "libedit-20110729"
-
-/* Define to the home page for this package. */
-#define PACKAGE_URL ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "3.0"
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#define RETSIGTYPE void
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Enable extensions on AIX 3, Interix. */
-#ifndef _ALL_SOURCE
-# define _ALL_SOURCE 1
-#endif
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-/* Enable threading extensions on Solaris. */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# define _POSIX_PTHREAD_SEMANTICS 1
-#endif
-/* Enable extensions on HP NonStop. */
-#ifndef _TANDEM_SOURCE
-# define _TANDEM_SOURCE 1
-#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# define __EXTENSIONS__ 1
-#endif
-
-
-/* Version number of package */
-#define VERSION "3.0"
-
-/* Define to 1 if you want wide-character code */
-/* #undef WIDECHAR */
-
-/* Define to 1 if on MINIX. */
-/* #undef _MINIX */
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
- this defined. */
-/* #undef _POSIX_1_SOURCE */
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to `int' if <sys/types.h> does not define. */
-/* #undef pid_t */
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-/* #undef size_t */
-
-/* Define as `fork' if `vfork' does not work. */
-/* #undef vfork */
-
-
-#include "sys.h"
-#undef SCCSID
-#undef LIBC_SCCS
-#undef lint
-#undef SIZE_T_MAX
diff --git a/lib/libedit/edit/readline/Makefile.depend b/lib/libedit/edit/readline/Makefile.depend
new file mode 100644
index 0000000..57b7e10
--- /dev/null
+++ b/lib/libedit/edit/readline/Makefile.depend
@@ -0,0 +1,12 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libedit/edit/readline/readline.h b/lib/libedit/edit/readline/readline.h
index 4371457..5b9c39d 100644
--- a/lib/libedit/edit/readline/readline.h
+++ b/lib/libedit/edit/readline/readline.h
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.h,v 1.34 2013/05/28 00:10:34 christos Exp $ */
+/* $NetBSD: readline.h,v 1.31 2010/08/04 20:29:18 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -111,7 +111,6 @@ extern char *rl_basic_word_break_characters;
extern char *rl_completer_word_break_characters;
extern char *rl_completer_quote_characters;
extern Function *rl_completion_entry_function;
-extern char *(*rl_completion_word_break_hook)(void);
extern CPPFunction *rl_attempted_completion_function;
extern int rl_attempted_completion_over;
extern int rl_completion_type;
@@ -127,8 +126,6 @@ extern char *rl_prompt;
/*
* The following is not implemented
*/
-extern int rl_catch_signals;
-extern int rl_catch_sigwinch;
extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
emacs_meta_keymap,
emacs_ctlx_keymap;
@@ -156,6 +153,7 @@ int where_history(void);
HIST_ENTRY *current_history(void);
HIST_ENTRY *history_get(int);
HIST_ENTRY *remove_history(int);
+/*###152 [lint] syntax error 'histdata_t' [249]%%%*/
HIST_ENTRY *replace_history_entry(int, const char *, histdata_t);
int history_total_bytes(void);
int history_set_pos(int);
@@ -202,7 +200,6 @@ void rl_get_screen_size(int *, int *);
void rl_set_screen_size(int, int);
char *rl_filename_completion_function (const char *, int);
int _rl_abort_internal(void);
-int _rl_qsort_string_compare(char **, char **);
char **rl_completion_matches(const char *, rl_compentry_func_t *);
void rl_forced_update_display(void);
int rl_set_prompt(const char *);
diff --git a/lib/libedit/editline.3 b/lib/libedit/editline.3
index 1e0ff5d..df7cd87 100644
--- a/lib/libedit/editline.3
+++ b/lib/libedit/editline.3
@@ -1,6 +1,6 @@
-.\" $NetBSD: editline.3,v 1.84 2014/12/25 13:39:41 wiz Exp $
+.\" $NetBSD: editline.3,v 1.70 2009/07/05 21:55:24 perry Exp $
.\"
-.\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc.
+.\" Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This file was contributed to The NetBSD Foundation by Luke Mewburn.
@@ -28,52 +28,33 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 25, 2014
+.Dd July 5, 2009
.Dt EDITLINE 3
.Os
.Sh NAME
.Nm editline ,
.Nm el_init ,
-.Nm el_init_fd ,
.Nm el_end ,
.Nm el_reset ,
.Nm el_gets ,
-.Nm el_wgets ,
.Nm el_getc ,
-.Nm el_wgetc ,
.Nm el_push ,
-.Nm el_wpush ,
.Nm el_parse ,
-.Nm el_wparse ,
.Nm el_set ,
-.Nm el_wset ,
.Nm el_get ,
-.Nm el_wget ,
.Nm el_source ,
.Nm el_resize ,
-.Nm el_cursor ,
.Nm el_line ,
-.Nm el_wline ,
.Nm el_insertstr ,
-.Nm el_winsertstr ,
.Nm el_deletestr ,
-.Nm el_wdeletestr ,
.Nm history_init ,
-.Nm history_winit ,
.Nm history_end ,
-.Nm history_wend ,
.Nm history ,
-.Nm history_w ,
.Nm tok_init ,
-.Nm tok_winit ,
.Nm tok_end ,
-.Nm tok_wend ,
.Nm tok_reset ,
-.Nm tok_wreset ,
.Nm tok_line ,
-.Nm tok_wline ,
.Nm tok_str
-.Nm tok_wstr
.Nd line editor, history and tokenization functions
.Sh LIBRARY
.Lb libedit
@@ -81,86 +62,51 @@
.In histedit.h
.Ft EditLine *
.Fn el_init "const char *prog" "FILE *fin" "FILE *fout" "FILE *ferr"
-.Ft EditLine *
-.Fn el_init_fd "const char *prog" "FILE *fin" "FILE *fout" "FILE *ferr" "int fdin" "int fdout" "int fderr"
.Ft void
.Fn el_end "EditLine *e"
.Ft void
.Fn el_reset "EditLine *e"
.Ft const char *
.Fn el_gets "EditLine *e" "int *count"
-.Ft const wchar_t *
-.Fn el_wgets "EditLine *e" "int *count"
.Ft int
.Fn el_getc "EditLine *e" "char *ch"
-.Ft int
-.Fn el_wgetc "EditLine *e" "wchar_t *ch"
-.Ft void
-.Fn el_push "EditLine *e" "const char *str"
.Ft void
-.Fn el_wpush "EditLine *e" "const wchar_t *str"
+.Fn el_push "EditLine *e" "char *str"
.Ft int
.Fn el_parse "EditLine *e" "int argc" "const char *argv[]"
.Ft int
-.Fn el_wparse "EditLine *e" "int argc" "const wchar_t *argv[]"
-.Ft int
.Fn el_set "EditLine *e" "int op" "..."
.Ft int
-.Fn el_wset "EditLine *e" "int op" "..."
-.Ft int
.Fn el_get "EditLine *e" "int op" "..."
.Ft int
-.Fn el_wget "EditLine *e" "int op" "..."
-.Ft int
.Fn el_source "EditLine *e" "const char *file"
.Ft void
.Fn el_resize "EditLine *e"
-.Fn int
-.Fn el_cursor "EditLine *e" "int count"
.Ft const LineInfo *
.Fn el_line "EditLine *e"
-.Ft const LineInfoW *
-.Fn el_wline "EditLine *e"
.Ft int
.Fn el_insertstr "EditLine *e" "const char *str"
-.Ft int
-.Fn el_winsertstr "EditLine *e" "const wchar_t *str"
.Ft void
.Fn el_deletestr "EditLine *e" "int count"
-.Ft void
-.Fn el_wdeletestr "EditLine *e" "int count"
.Ft History *
.Fn history_init
-.Ft HistoryW *
-.Fn history_winit
.Ft void
.Fn history_end "History *h"
-.Ft void
-.Fn history_wend "HistoryW *h"
.Ft int
.Fn history "History *h" "HistEvent *ev" "int op" "..."
-.Ft int
-.Fn history_w "HistoryW *h" "HistEventW *ev" "int op" "..."
.Ft Tokenizer *
.Fn tok_init "const char *IFS"
-.Ft TokenizerW *
-.Fn tok_winit "const wchar_t *IFS"
.Ft void
.Fn tok_end "Tokenizer *t"
.Ft void
-.Fn tok_wend "TokenizerW *t"
-.Ft void
.Fn tok_reset "Tokenizer *t"
-.Ft void
-.Fn tok_wreset "TokenizerW *t"
.Ft int
-.Fn tok_line "Tokenizer *t" "const LineInfo *li" "int *argc" "const char **argv[]" "int *cursorc" "int *cursoro"
-.Ft int
-.Fn tok_wline "TokenizerW *t" "const LineInfoW *li" "int *argc" "const wchar_t **argv[]" "int *cursorc" "int *cursoro"
+.Fo tok_line
+.Fa "Tokenizer *t" "const LineInfo *li" "int *argc" "const char **argv[]"
+.Fa "int *cursorc" "int *cursoro"
+.Fc
.Ft int
.Fn tok_str "Tokenizer *t" "const char *str" "int *argc" "const char **argv[]"
-.Ft int
-.Fn tok_wstr "TokenizerW *t" "const wchar_t *str" "int *argc" "const wchar_t **argv[]"
.Sh DESCRIPTION
The
.Nm
@@ -180,21 +126,14 @@ The line editing functions use a common data structure,
.Fa EditLine ,
which is created by
.Fn el_init
-or
-.Fn el_init_fd
and freed by
.Fn el_end .
.Pp
-The wide-character functions behave the same way as their narrow
-counterparts.
-.Pp
The following functions are available:
.Bl -tag -width 4n
.It Fn el_init
Initialise the line editor, and return a data structure
-to be used by all other line editing functions, or
-.Dv NULL
-on failure.
+to be used by all other line editing functions.
.Fa prog
is the name of the invoking program, used when reading the
.Xr editrc 5
@@ -207,20 +146,11 @@ are the input, output, and error streams (respectively) to use.
In this documentation, references to
.Dq the tty
are actually to this input/output stream combination.
-.It Fn el_init_fd
-Like
-.Fn el_init
-but allows specifying file descriptors for the
-.Xr stdio 3
-corresponding streams, in case those were created with
-.Xr funopen 3 .
.It Fn el_end
Clean up and finish with
.Fa e ,
assumed to have been created with
-.Fn el_init
-or
-.Fn el_init_fd .
+.Fn el_init .
.It Fn el_reset
Reset the tty and the parser.
This should be called after an error which may have upset the tty's
@@ -244,10 +174,7 @@ and must be copied if the data is to be retained.
Read a character from the tty.
.Fa ch
is modified to contain the character read.
-Returns the number of characters read if successful, \-1 otherwise,
-in which case
-.Dv errno
-can be inspected for the cause.
+Returns the number of characters read if successful, \-1 otherwise.
.It Fn el_push
Pushes
.Fa str
@@ -269,7 +196,7 @@ to execute builtin
.Nm
commands.
If the command is prefixed with
-.Dq prog :
+.Dq prog:
then
.Fn el_parse
will only execute the command if
@@ -282,7 +209,7 @@ The return value is
\-1 if the command is unknown,
0 if there was no error or
.Dq prog
-didn't match, or
+did not match, or
1 if the command returned an error.
Refer to
.Xr editrc 5
@@ -294,7 +221,6 @@ parameters.
.Fa op
determines which parameter to set, and each operation has its
own parameter list.
-Returns 0 on success, \-1 on failure.
.Pp
The following values for
.Fa op
@@ -459,14 +385,6 @@ check this
(using
.Fn el_get )
to determine if editing should be enabled or not.
-.It Dv EL_UNBUFFERED , Fa "int flag"
-If
-.Fa flag
-is zero,
-unbuffered mode is disabled (the default).
-In unbuffered mode,
-.Fn el_gets
-will return immediately after processing a single character.
.It Dv EL_GETCFN , Fa "int (*f)(EditLine *, char *c)"
Define the character reading function as
.Fa f ,
@@ -478,7 +396,7 @@ and
.Fn el_getc .
The builtin function can be set or restored with the special function
name
-.Dq Dv EL_BUILTIN_GETCFN .
+.Dv EL_BUILTIN_GETCFN .
.It Dv EL_CLIENTDATA , Fa "void *data"
Register
.Fa data
@@ -536,7 +454,7 @@ If
is not
.Dv NULL ,
return the start/stop literal prompt character in it.
-.It Dv EL_EDITOR , Fa "const char **"
+.It Dv EL_EDITOR , Fa "const char *"
Return the name of the editor, which will be one of
.Dq emacs
or
@@ -560,7 +478,7 @@ above).
Return non-zero if editing is enabled.
.It Dv EL_GETCFN , Fa "int (**f)(EditLine *, char *)"
Return a pointer to the function that read characters, which is equal to
-.Dq Dv EL_BUILTIN_GETCFN
+.Dv EL_BUILTIN_GETCFN
in the case of the default builtin function.
.It Dv EL_CLIENTDATA , Fa "void **data"
Retrieve
@@ -569,7 +487,10 @@ previously registered with the corresponding
.Fn el_set
call.
.It Dv EL_UNBUFFERED , Fa "int"
-Return non-zero if unbuffered mode is enabled.
+Sets or clears unbuffered mode.
+In this mode,
+.Fn el_gets
+will return immediately after processing a single character.
.It Dv EL_PREP_TERM , Fa "int"
Sets or clears terminal editing mode.
.It Dv EL_GETFP , Fa "int fd", Fa "FILE **fp"
@@ -610,8 +531,6 @@ Refer to
.Xr editrc 5
for details on the format of
.Fa file .
-.Fn el_source
-returns 0 on success and \-1 on error.
.It Fn el_resize
Must be called if the terminal size changes.
If
@@ -619,14 +538,9 @@ If
has been set with
.Fn el_set ,
then this is done automatically.
-Otherwise, it's the responsibility of the application to call
+Otherwise, it is the responsibility of the application to call
.Fn el_resize
on the appropriate occasions.
-.It Fn el_cursor
-Move the cursor to the right (if positive) or to the left (if negative)
-.Fa count
-characters.
-Returns the resulting offset of the cursor from the beginning of the line.
.It Fn el_line
Return the editing information for the current line in a
.Fa LineInfo
@@ -654,7 +568,7 @@ Insert
into the line at the cursor.
Returns \-1 if
.Fa str
-is empty or won't fit, and 0 otherwise.
+is empty or will not fit, and 0 otherwise.
.It Fn el_deletestr
Delete
.Fa count
@@ -672,9 +586,7 @@ The following functions are available:
.Bl -tag -width 4n
.It Fn history_init
Initialise the history list, and return a data structure
-to be used by all other history list functions, or
-.Dv NULL
-on failure.
+to be used by all other history list functions.
.It Fn history_end
Clean up and finish with
.Fa h ,
@@ -711,7 +623,7 @@ Fa "history_sfun_t set" , Fa "history_vfun_t clear" , \
Fa "history_efun_t enter" , Fa "history_efun_t add"
Define functions to perform various history operations.
.Fa ptr
-is the argument given to a function when it's invoked.
+is the argument given to a function when it is invoked.
.It Dv H_FIRST
Return the first element in the history.
.It Dv H_LAST
@@ -743,12 +655,12 @@ as a new element to the history, and, if necessary,
removing the oldest entry to keep the list to the created size.
If
.Dv H_SETUNIQUE
-has been called with a non-zero argument, the element
+was has been called with a non-zero arguments, the element
will not be entered into the history if its contents match
the ones of the current history element.
If the element is entered
.Fn history
-returns 1; if it is ignored as a duplicate returns 0.
+returns 1, if it is ignored as a duplicate returns 0.
Finally
.Fn history
returns \-1 if an error occurred.
@@ -770,11 +682,9 @@ Load the history list stored in
.It Dv H_SAVE , Fa "const char *file"
Save the history list to
.Fa file .
-.It Dv H_SAVE_FP , Fa "FILE *fp"
+.It Dv H_SAVE_FP , Fa "FILE*"
Save the history list to the opened
-.Ft FILE
-pointer
-.Fa fp .
+.Fa FILE* .
.It Dv H_SETUNIQUE , Fa "int unique"
Set flag that adjacent identical event strings should not be entered
into the history.
@@ -791,8 +701,9 @@ The caller is responsible for free'ing the string in the returned
.Fa HistEvent .
.El
.Pp
+The
.Fn history
-returns \*[Gt]= 0 if the operation
+function returns \*[Ge] 0 if the operation
.Fa op
succeeds.
Otherwise, \-1 is returned and
@@ -836,7 +747,7 @@ and before a new line is to be tokenized.
.It Fn tok_line
Tokenize
.Fa li ,
-If successful, modify:
+if successful, modify
.Fa argv
to contain the words,
.Fa argc
@@ -863,14 +774,12 @@ and
.Aq newline .
A positive exit code indicates that another line should be read
and tokenization attempted again.
-.
.It Fn tok_str
A simpler form of
.Fn tok_line ;
.Fa str
is a NUL terminated string to tokenize.
.El
-.
.\"XXX.Sh EXAMPLES
.\"XXX: provide some examples
.Sh SEE ALSO
@@ -887,9 +796,10 @@ library first appeared in
.Dv CC_REDISPLAY
appeared in
.Nx 1.3 .
-.Dv CC_REFRESH_BEEP ,
+.Dv CC_REFRESH_BEEP
+and
.Dv EL_EDITMODE
-and the readline emulation appeared in
+appeared in
.Nx 1.4 .
.Dv EL_RPROMPT
appeared in
@@ -907,10 +817,6 @@ wrote this manual and implemented
.Dv EL_EDITMODE ,
and
.Dv EL_RPROMPT .
-.An Jaromir Dolecek
-implemented the readline emulation.
-.An Johny Mattsson
-implemented wide-character support.
.Sh BUGS
At this time, it is the responsibility of the caller to
check the result of the
diff --git a/lib/libedit/editrc.5 b/lib/libedit/editrc.5
index 139f573..6e04ea1 100644
--- a/lib/libedit/editrc.5
+++ b/lib/libedit/editrc.5
@@ -1,4 +1,4 @@
-.\" $NetBSD: editrc.5,v 1.29 2014/12/25 13:39:41 wiz Exp $
+.\" $NetBSD: editrc.5,v 1.24 2009/04/11 22:17:52 wiz Exp $
.\"
.\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 25, 2014
+.Dd October 18, 2003
.Dt EDITRC 5
.Os
.Sh NAME
@@ -44,8 +44,7 @@ file defines various settings to be used by the
library.
.Pp
The format of each line is:
-.Pp
-.Dl [prog:]command [arg ...]
+.Dl [prog:]command [arg [...]]
.Pp
.Ar command
is one of the
@@ -106,12 +105,16 @@ to
.Ar key .
Options include:
.Bl -tag -width 4n
+.It Fl e
+Bind all keys to the standard GNU Emacs-like bindings.
+.It Fl v
+Bind all keys to the standard
+.Xr vi 1 Ns -like
+bindings.
.It Fl a
List or change key bindings in the
.Xr vi 1
mode alternate (command mode) key map.
-.It Fl e
-Bind all keys to the standard GNU Emacs-like bindings.
.It Fl k
.Ar key
is interpreted as a symbolic arrow key name, which may be one of
@@ -133,10 +136,6 @@ Bound keys in
.Ar command
are themselves reinterpreted, and this continues for ten levels of
interpretation.
-.It Fl v
-Bind all keys to the standard
-.Xr vi 1 Ns -like
-bindings.
.El
.Pp
.Ar command
@@ -151,10 +150,8 @@ can contain control characters of the form
.Sm off
.Sq No ^ Ar character
.Sm on
-.Po
-e.g.\&
-.Sq ^A
-.Pc ,
+(e.g.\&
+.Sq ^A ) ,
and the following backslashed escape sequences:
.Pp
.Bl -tag -compact -offset indent -width 4n
@@ -189,7 +186,7 @@ and
.Sq ^ .
.It Ic echotc Oo Fl sv Oc Ar arg Ar ...
Exercise terminal capabilities given in
-.Ar arg ... .
+.Ar arg Ar ... .
If
.Ar arg
is
@@ -197,8 +194,7 @@ is
.Sq cols ,
.Sq lines ,
.Sq rows ,
-.Sq meta ,
-or
+.Sq meta or
.Sq tabs ,
the value of that capability is printed, with
.Dq yes
@@ -211,7 +207,7 @@ returns an empty string for non-existent capabilities, rather than
causing an error.
.Fl v
causes messages to be verbose.
-.It Ic edit Op Li on | Li off
+.It Ic edit Op Cm on | off
Enable or disable the
.Nm editline
functionality in a program.
@@ -233,6 +229,9 @@ is non zero, only keep unique history entries.
If
.Dv n
is zero, then keep all entries (the default).
+.It Ic telltc
+List the values of all the terminal capabilities (see
+.Xr termcap 5 ) .
.It Ic settc Ar cap Ar val
Set the terminal capability
.Ar cap
@@ -263,13 +262,9 @@ set of tty modes respectively; defaulting to
Without other arguments,
.Ic setty
lists the modes in the chosen set which are fixed on
-.Po
-.Sq +mode
-.Pc
+.Pq Sq +mode
or off
-.Po
-.Sq -mode
-.Pc .
+.Pq Sq -mode .
.Fl a
lists all tty modes in the chosen set regardless of the setting.
With
@@ -291,9 +286,6 @@ If
is empty
then the character is set to
.Dv _POSIX_VDISABLE .
-.It Ic telltc
-List the values of all the terminal capabilities (see
-.Xr termcap 5 ) .
.El
.Sh EDITOR COMMANDS
The following editor commands are available for use in key bindings:
@@ -303,11 +295,11 @@ The following editor commands are available for use in key bindings:
Vi paste previous deletion to the right of the cursor.
.It Ic vi-paste-prev
Vi paste previous deletion to the left of the cursor.
-.It Ic vi-prev-big-word
+.It Ic vi-prev-space-word
Vi move to the previous space delimited word.
.It Ic vi-prev-word
Vi move to the previous word.
-.It Ic vi-next-big-word
+.It Ic vi-next-space-word
Vi move to the next space delimited word.
.It Ic vi-next-word
Vi move to the next word.
@@ -335,9 +327,9 @@ Vi enter insert mode after the cursor.
Vi enter insert mode at end of line.
.It Ic vi-delete-meta
Vi delete prefix command.
-.It Ic vi-end-big-word
-Vi move to the end of the current space delimited word.
.It Ic vi-end-word
+Vi move to the end of the current space delimited word.
+.It Ic vi-to-end-word
Vi move to the end of the current word.
.It Ic vi-undo
Vi undo last change.
@@ -371,28 +363,6 @@ Vi move up to the character specified previous.
Vi repeat current character search in the same search direction.
.It Ic vi-repeat-prev-char
Vi repeat current character search in the opposite search direction.
-.It Ic vi-match
-Vi go to matching () {} or [].
-.It Ic vi-undo-line
-Vi undo all changes to line.
-.It Ic vi-to-column
-Vi go to specified column.
-.It Ic vi-yank-end
-Vi yank to end of line.
-.It Ic vi-yank
-Vi yank.
-.It Ic vi-comment-out
-Vi comment out current command.
-.It Ic vi-alias
-Vi include shell alias.
-.It Ic vi-to-history-line
-Vi go to specified history file line..
-.It Ic vi-histedit
-Vi edit history line with vi.
-.It Ic vi-history-word
-Vi append word from previous input line.
-.It Ic vi-redo
-Vi redo last non-motion command.
.It Ic em-delete-or-list
Delete character under cursor or list completions if at end of line.
.It Ic em-delete-next-word
diff --git a/lib/libedit/el.c b/lib/libedit/el.c
index 57ea6e5..d6cfb2d 100644
--- a/lib/libedit/el.c
+++ b/lib/libedit/el.c
@@ -1,5 +1,3 @@
-/* $NetBSD: el.c,v 1.73 2014/06/18 18:12:28 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: el.c,v 1.55 2009/07/25 21:19:23 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94";
-#else
-__RCSID("$NetBSD: el.c,v 1.73 2014/06/18 18:12:28 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -46,34 +41,29 @@ __FBSDID("$FreeBSD$");
/*
* el.c: EditLine interface functions
*/
+#include "sys.h"
+
#include <sys/types.h>
#include <sys/param.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
-#include <locale.h>
-#include <langinfo.h>
#include "el.h"
+#define HAVE_ISSETUGID
+
/* el_init():
* Initialize editline and set default parameters.
*/
public EditLine *
el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr)
{
- return el_init_fd(prog, fin, fout, ferr, fileno(fin), fileno(fout),
- fileno(ferr));
-}
-public EditLine *
-el_init_fd(const char *prog, FILE *fin, FILE *fout, FILE *ferr,
- int fdin, int fdout, int fderr)
-{
- EditLine *el = el_malloc(sizeof(*el));
+ EditLine *el = (EditLine *) el_malloc(sizeof(EditLine));
if (el == NULL)
- return NULL;
+ return (NULL);
memset(el, 0, sizeof(EditLine));
@@ -81,12 +71,9 @@ el_init_fd(const char *prog, FILE *fin, FILE *fout, FILE *ferr,
el->el_outfile = fout;
el->el_errfile = ferr;
- el->el_infd = fdin;
- el->el_outfd = fdout;
- el->el_errfd = fderr;
+ el->el_infd = fileno(fin);
- el->el_prog = Strdup(ct_decode_string(prog, &el->el_scratch));
- if (el->el_prog == NULL) {
+ if ((el->el_prog = el_strdup(prog)) == NULL) {
el_free(el);
return NULL;
}
@@ -95,19 +82,13 @@ el_init_fd(const char *prog, FILE *fin, FILE *fout, FILE *ferr,
* Initialize all the modules. Order is important!!!
*/
el->el_flags = 0;
-#ifdef WIDECHAR
- if (setlocale(LC_CTYPE, NULL) != NULL){
- if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0)
- el->el_flags |= CHARSET_IS_UTF8;
- }
-#endif
- if (terminal_init(el) == -1) {
+ if (term_init(el) == -1) {
el_free(el->el_prog);
el_free(el);
return NULL;
}
- (void) keymacro_init(el);
+ (void) key_init(el);
(void) map_init(el);
if (tty_init(el) == -1)
el->el_flags |= NO_TTY;
@@ -118,7 +99,7 @@ el_init_fd(const char *prog, FILE *fin, FILE *fout, FILE *ferr,
(void) sig_init(el);
(void) read_init(el);
- return el;
+ return (el);
}
@@ -134,8 +115,8 @@ el_end(EditLine *el)
el_reset(el);
- terminal_end(el);
- keymacro_end(el);
+ term_end(el);
+ key_end(el);
map_end(el);
tty_end(el);
ch_end(el);
@@ -144,14 +125,8 @@ el_end(EditLine *el)
prompt_end(el);
sig_end(el);
- el_free(el->el_prog);
-#ifdef WIDECHAR
- el_free(el->el_scratch.cbuff);
- el_free(el->el_scratch.wbuff);
- el_free(el->el_lgcyconv.cbuff);
- el_free(el->el_lgcyconv.wbuff);
-#endif
- el_free(el);
+ el_free((ptr_t) el->el_prog);
+ el_free((ptr_t) el);
}
@@ -171,13 +146,13 @@ el_reset(EditLine *el)
* set the editline parameters
*/
public int
-FUN(el,set)(EditLine *el, int op, ...)
+el_set(EditLine *el, int op, ...)
{
va_list ap;
int rv = 0;
if (el == NULL)
- return -1;
+ return (-1);
va_start(ap, op);
switch (op) {
@@ -185,39 +160,25 @@ FUN(el,set)(EditLine *el, int op, ...)
case EL_RPROMPT: {
el_pfunc_t p = va_arg(ap, el_pfunc_t);
- rv = prompt_set(el, p, 0, op, 1);
- break;
- }
-
- case EL_RESIZE: {
- el_zfunc_t p = va_arg(ap, el_zfunc_t);
- void *arg = va_arg(ap, void *);
- rv = ch_resizefun(el, p, arg);
- break;
- }
-
- case EL_ALIAS_TEXT: {
- el_afunc_t p = va_arg(ap, el_afunc_t);
- void *arg = va_arg(ap, void *);
- rv = ch_aliasfun(el, p, arg);
+ rv = prompt_set(el, p, 0, op);
break;
}
case EL_PROMPT_ESC:
case EL_RPROMPT_ESC: {
el_pfunc_t p = va_arg(ap, el_pfunc_t);
- int c = va_arg(ap, int);
+ char c = va_arg(ap, int);
- rv = prompt_set(el, p, c, op, 1);
+ rv = prompt_set(el, p, c, op);
break;
}
case EL_TERMINAL:
- rv = terminal_set(el, va_arg(ap, char *));
+ rv = term_set(el, va_arg(ap, char *));
break;
case EL_EDITOR:
- rv = map_set_editor(el, va_arg(ap, Char *));
+ rv = map_set_editor(el, va_arg(ap, char *));
break;
case EL_SIGNAL:
@@ -230,39 +191,40 @@ FUN(el,set)(EditLine *el, int op, ...)
case EL_BIND:
case EL_TELLTC:
case EL_SETTC:
+ case EL_GETTC:
case EL_ECHOTC:
case EL_SETTY:
{
- const Char *argv[20];
+ const char *argv[20];
int i;
- for (i = 1; i < (int)__arraycount(argv); i++)
- if ((argv[i] = va_arg(ap, Char *)) == NULL)
+ for (i = 1; i < 20; i++)
+ if ((argv[i] = va_arg(ap, char *)) == NULL)
break;
switch (op) {
case EL_BIND:
- argv[0] = STR("bind");
+ argv[0] = "bind";
rv = map_bind(el, i, argv);
break;
case EL_TELLTC:
- argv[0] = STR("telltc");
- rv = terminal_telltc(el, i, argv);
+ argv[0] = "telltc";
+ rv = term_telltc(el, i, argv);
break;
case EL_SETTC:
- argv[0] = STR("settc");
- rv = terminal_settc(el, i, argv);
+ argv[0] = "settc";
+ rv = term_settc(el, i, argv);
break;
case EL_ECHOTC:
- argv[0] = STR("echotc");
- rv = terminal_echotc(el, i, argv);
+ argv[0] = "echotc";
+ rv = term_echotc(el, i, argv);
break;
case EL_SETTY:
- argv[0] = STR("setty");
+ argv[0] = "setty";
rv = tty_stty(el, i, argv);
break;
@@ -276,8 +238,8 @@ FUN(el,set)(EditLine *el, int op, ...)
case EL_ADDFN:
{
- Char *name = va_arg(ap, Char *);
- Char *help = va_arg(ap, Char *);
+ char *name = va_arg(ap, char *);
+ char *help = va_arg(ap, char *);
el_func_t func = va_arg(ap, el_func_t);
rv = map_addfunc(el, name, help, func);
@@ -287,11 +249,9 @@ FUN(el,set)(EditLine *el, int op, ...)
case EL_HIST:
{
hist_fun_t func = va_arg(ap, hist_fun_t);
- void *ptr = va_arg(ap, void *);
+ ptr_t ptr = va_arg(ap, char *);
rv = hist_set(el, func, ptr);
- if (!(el->el_flags & CHARSET_IS_UTF8))
- el->el_flags &= ~NARROW_HISTORY;
break;
}
@@ -307,7 +267,6 @@ FUN(el,set)(EditLine *el, int op, ...)
{
el_rfunc_t rc = va_arg(ap, el_rfunc_t);
rv = el_read_setfn(el, rc);
- el->el_flags &= ~NARROW_READ;
break;
}
@@ -352,11 +311,9 @@ FUN(el,set)(EditLine *el, int op, ...)
break;
case 1:
el->el_outfile = fp;
- el->el_outfd = fileno(fp);
break;
case 2:
el->el_errfile = fp;
- el->el_errfd = fileno(fp);
break;
default:
rv = -1;
@@ -368,7 +325,7 @@ FUN(el,set)(EditLine *el, int op, ...)
case EL_REFRESH:
re_clear_display(el);
re_refresh(el);
- terminal__flush(el);
+ term__flush(el);
break;
default:
@@ -377,7 +334,7 @@ FUN(el,set)(EditLine *el, int op, ...)
}
va_end(ap);
- return rv;
+ return (rv);
}
@@ -385,7 +342,7 @@ FUN(el,set)(EditLine *el, int op, ...)
* retrieve the editline parameters
*/
public int
-FUN(el,get)(EditLine *el, int op, ...)
+el_get(EditLine *el, int op, ...)
{
va_list ap;
int rv;
@@ -399,20 +356,14 @@ FUN(el,get)(EditLine *el, int op, ...)
case EL_PROMPT:
case EL_RPROMPT: {
el_pfunc_t *p = va_arg(ap, el_pfunc_t *);
- rv = prompt_get(el, p, 0, op);
- break;
- }
- case EL_PROMPT_ESC:
- case EL_RPROMPT_ESC: {
- el_pfunc_t *p = va_arg(ap, el_pfunc_t *);
- Char *c = va_arg(ap, Char *);
+ char *c = va_arg(ap, char *);
rv = prompt_get(el, p, c, op);
break;
}
case EL_EDITOR:
- rv = map_get_editor(el, va_arg(ap, const Char **));
+ rv = map_get_editor(el, va_arg(ap, const char **));
break;
case EL_SIGNAL:
@@ -426,7 +377,7 @@ FUN(el,get)(EditLine *el, int op, ...)
break;
case EL_TERMINAL:
- terminal_get(el, va_arg(ap, const char **));
+ term_get(el, va_arg(ap, const char **));
rv = 0;
break;
@@ -436,15 +387,44 @@ FUN(el,get)(EditLine *el, int op, ...)
char *argv[20];
int i;
- for (i = 1; i < (int)__arraycount(argv); i++)
+ for (i = 1; i < (int)(sizeof(argv) / sizeof(argv[0])); i++)
if ((argv[i] = va_arg(ap, char *)) == NULL)
break;
- argv[0] = name;
- rv = terminal_gettc(el, i, argv);
+ switch (op) {
+ case EL_GETTC:
+ argv[0] = name;
+ rv = term_gettc(el, i, argv);
+ break;
+
+ default:
+ rv = -1;
+ EL_ABORT((el->el_errfile, "Bad op %d\n", op));
+ break;
+ }
break;
}
+#if 0 /* XXX */
+ case EL_ADDFN:
+ {
+ char *name = va_arg(ap, char *);
+ char *help = va_arg(ap, char *);
+ el_func_t func = va_arg(ap, el_func_t);
+
+ rv = map_addfunc(el, name, help, func);
+ break;
+ }
+
+ case EL_HIST:
+ {
+ hist_fun_t func = va_arg(ap, hist_fun_t);
+ ptr_t ptr = va_arg(ap, char *);
+ rv = hist_set(el, func, ptr);
+ }
+ break;
+#endif /* XXX */
+
case EL_GETCFN:
*va_arg(ap, el_rfunc_t *) = el_read_getfn(el);
rv = 0;
@@ -456,7 +436,7 @@ FUN(el,get)(EditLine *el, int op, ...)
break;
case EL_UNBUFFERED:
- *va_arg(ap, int *) = (el->el_flags & UNBUFFERED) != 0;
+ *va_arg(ap, int *) = (!(el->el_flags & UNBUFFERED));
rv = 0;
break;
@@ -490,18 +470,18 @@ FUN(el,get)(EditLine *el, int op, ...)
}
va_end(ap);
- return rv;
+ return (rv);
}
/* el_line():
* Return editing info
*/
-public const TYPE(LineInfo) *
-FUN(el,line)(EditLine *el)
+public const LineInfo *
+el_line(EditLine *el)
{
- return (const TYPE(LineInfo) *)(void *)&el->el_line;
+ return (const LineInfo *) (void *) &el->el_line;
}
@@ -514,24 +494,23 @@ el_source(EditLine *el, const char *fname)
FILE *fp;
size_t len;
char *ptr;
- char *path = NULL;
- const Char *dptr;
- int error = 0;
+#ifdef HAVE_ISSETUGID
+ char path[MAXPATHLEN];
+#endif
fp = NULL;
if (fname == NULL) {
#ifdef HAVE_ISSETUGID
static const char elpath[] = "/.editrc";
- size_t plen = sizeof(elpath);
if (issetugid())
- return -1;
+ return (-1);
if ((ptr = getenv("HOME")) == NULL)
- return -1;
- plen += strlen(ptr);
- if ((path = el_malloc(plen * sizeof(*path))) == NULL)
- return -1;
- (void)snprintf(path, plen, "%s%s", ptr, elpath);
+ return (-1);
+ if (strlcpy(path, ptr, sizeof(path)) >= sizeof(path))
+ return (-1);
+ if (strlcat(path, elpath, sizeof(path)) >= sizeof(path))
+ return (-1);
fname = path;
#else
/*
@@ -539,37 +518,33 @@ el_source(EditLine *el, const char *fname)
* to keep from inadvertently opening up the user to a security
* hole.
*/
- return -1;
+ return (-1);
#endif
}
if (fp == NULL)
fp = fopen(fname, "r");
- if (fp == NULL) {
- el_free(path);
- return -1;
- }
+ if (fp == NULL)
+ return (-1);
while ((ptr = fgetln(fp, &len)) != NULL) {
- if (*ptr == '\n')
- continue; /* Empty line. */
- dptr = ct_decode_string(ptr, &el->el_scratch);
- if (!dptr)
- continue;
- if (len > 0 && dptr[len - 1] == '\n')
+ if (len > 0 && ptr[len - 1] == '\n')
--len;
+ ptr[len] = '\0';
/* loop until first non-space char or EOL */
- while (*dptr != '\0' && Isspace(*dptr))
- dptr++;
- if (*dptr == '#')
+ while (*ptr != '\0' && isspace((unsigned char)*ptr))
+ ptr++;
+ if (*ptr == '#')
continue; /* ignore, this is a comment line */
- if ((error = parse_line(el, dptr)) == -1)
- break;
+
+ if (parse_line(el, ptr) == -1) {
+ (void) fclose(fp);
+ return (-1);
+ }
}
- el_free(path);
(void) fclose(fp);
- return error;
+ return (0);
}
@@ -587,8 +562,8 @@ el_resize(EditLine *el)
(void) sigprocmask(SIG_BLOCK, &nset, &oset);
/* get the correct window size */
- if (terminal_get_size(el, &lins, &cols))
- terminal_change_size(el, lins, cols);
+ if (term_get_size(el, &lins, &cols))
+ term_change_size(el, lins, cols);
(void) sigprocmask(SIG_SETMASK, &oset, NULL);
}
@@ -601,7 +576,7 @@ public void
el_beep(EditLine *el)
{
- terminal_beep(el);
+ term_beep(el);
}
@@ -610,25 +585,24 @@ el_beep(EditLine *el)
*/
protected int
/*ARGSUSED*/
-el_editmode(EditLine *el, int argc, const Char **argv)
+el_editmode(EditLine *el, int argc, const char **argv)
{
- const Char *how;
+ const char *how;
if (argv == NULL || argc != 2 || argv[1] == NULL)
- return -1;
+ return (-1);
how = argv[1];
- if (Strcmp(how, STR("on")) == 0) {
+ if (strcmp(how, "on") == 0) {
el->el_flags &= ~EDIT_DISABLED;
tty_rawmode(el);
- } else if (Strcmp(how, STR("off")) == 0) {
+ } else if (strcmp(how, "off") == 0) {
tty_cookedmode(el);
el->el_flags |= EDIT_DISABLED;
}
else {
- (void) fprintf(el->el_errfile, "edit: Bad value `" FSTR "'.\n",
- how);
- return -1;
+ (void) fprintf(el->el_errfile, "edit: Bad value `%s'.\n", how);
+ return (-1);
}
- return 0;
+ return (0);
}
diff --git a/lib/libedit/el.h b/lib/libedit/el.h
index ed3d2ef..67d01ff 100644
--- a/lib/libedit/el.h
+++ b/lib/libedit/el.h
@@ -1,5 +1,3 @@
-/* $NetBSD: el.h,v 1.25 2011/07/29 23:44:44 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +30,7 @@
* SUCH DAMAGE.
*
* @(#)el.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: el.h,v 1.17 2006/12/15 22:13:33 christos Exp $
* $FreeBSD$
*/
@@ -47,21 +46,15 @@
#define VIDEFAULT
#define ANCHOR
-#include "histedit.h"
-#include "chartype.h"
#include <stdio.h>
#include <sys/types.h>
-#define EL_BUFSIZ ((size_t)1024) /* Maximum line size */
+#define EL_BUFSIZ 1024 /* Maximum line size */
#define HANDLE_SIGNALS 0x01
#define NO_TTY 0x02
#define EDIT_DISABLED 0x04
#define UNBUFFERED 0x08
-#define CHARSET_IS_UTF8 0x10
-#define IGNORE_EXTCHARS 0x20 /* Ignore characters read > 0xff */
-#define NARROW_HISTORY 0x40
-#define NARROW_READ 0x80
typedef int bool_t; /* True or not */
@@ -73,10 +66,10 @@ typedef struct coord_t { /* Position on the screen */
} coord_t;
typedef struct el_line_t {
- Char *buffer; /* Input line */
- Char *cursor; /* Cursor position */
- Char *lastchar; /* Last character */
- const Char *limit; /* Max position */
+ char *buffer; /* Input line */
+ char *cursor; /* Cursor position */
+ char *lastchar; /* Last character */
+ const char *limit; /* Max position */
} el_line_t;
/*
@@ -89,20 +82,21 @@ typedef struct el_state_t {
int metanext; /* Is the next char a meta char */
el_action_t lastcmd; /* Previous command */
el_action_t thiscmd; /* this command */
- Char thisch; /* char that generated it */
+ char thisch; /* char that generated it */
} el_state_t;
/*
* Until we come up with something better...
*/
+#define el_strdup(a) strdup(a)
#define el_malloc(a) malloc(a)
#define el_realloc(a,b) realloc(a, b)
#define el_free(a) free(a)
#include "tty.h"
#include "prompt.h"
-#include "keymacro.h"
-#include "terminal.h"
+#include "key.h"
+#include "term.h"
#include "refresh.h"
#include "chared.h"
#include "common.h"
@@ -115,41 +109,34 @@ typedef struct el_state_t {
#include "read.h"
struct editline {
- Char *el_prog; /* the program name */
+ char *el_prog; /* the program name */
FILE *el_infile; /* Stdio stuff */
FILE *el_outfile; /* Stdio stuff */
FILE *el_errfile; /* Stdio stuff */
int el_infd; /* Input file descriptor */
- int el_outfd; /* Output file descriptor */
- int el_errfd; /* Error file descriptor */
int el_flags; /* Various flags. */
int el_errno; /* Local copy of errno */
coord_t el_cursor; /* Cursor location */
- Char **el_display; /* Real screen image = what is there */
- Char **el_vdisplay; /* Virtual screen image = what we see */
+ char **el_display; /* Real screen image = what is there */
+ char **el_vdisplay; /* Virtual screen image = what we see */
void *el_data; /* Client data */
el_line_t el_line; /* The current line information */
el_state_t el_state; /* Current editor state */
- el_terminal_t el_terminal; /* Terminal dependent stuff */
+ el_term_t el_term; /* Terminal dependent stuff */
el_tty_t el_tty; /* Tty dependent stuff */
el_refresh_t el_refresh; /* Refresh stuff */
el_prompt_t el_prompt; /* Prompt stuff */
el_prompt_t el_rprompt; /* Prompt stuff */
el_chared_t el_chared; /* Characted editor stuff */
el_map_t el_map; /* Key mapping stuff */
- el_keymacro_t el_keymacro; /* Key binding stuff */
+ el_key_t el_key; /* Key binding stuff */
el_history_t el_history; /* History stuff */
el_search_t el_search; /* Search stuff */
el_signal_t el_signal; /* Signal handling stuff */
el_read_t el_read; /* Character reading stuff */
-#ifdef WIDECHAR
- ct_buffer_t el_scratch; /* Scratch conversion buffer */
- ct_buffer_t el_lgcyconv; /* Buffer for legacy wrappers */
- LineInfo el_lgcylinfo; /* Legacy LineInfo buffer */
-#endif
};
-protected int el_editmode(EditLine *, int, const Char **);
+protected int el_editmode(EditLine *, int, const char **);
#ifdef DEBUG
#define EL_ABORT(a) do { \
diff --git a/lib/libedit/eln.c b/lib/libedit/eln.c
deleted file mode 100644
index 013aa3e..0000000
--- a/lib/libedit/eln.c
+++ /dev/null
@@ -1,401 +0,0 @@
-/* $NetBSD: eln.c,v 1.19 2015/05/18 15:07:04 christos Exp $ */
-
-/*-
- * Copyright (c) 2009 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.
- * 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.
- */
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: eln.c,v 1.19 2015/05/18 15:07:04 christos Exp $");
-#endif /* not lint && not SCCSID */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "histedit.h"
-#include "el.h"
-#include "read.h"
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-public int
-el_getc(EditLine *el, char *cp)
-{
- int num_read;
- wchar_t wc = 0;
-
- if (!(el->el_flags & CHARSET_IS_UTF8))
- el->el_flags |= IGNORE_EXTCHARS;
- num_read = el_wgetc (el, &wc);
- if (!(el->el_flags & CHARSET_IS_UTF8))
- el->el_flags &= ~IGNORE_EXTCHARS;
-
- if (num_read > 0)
- *cp = (char)wc;
- return num_read;
-}
-
-
-public void
-el_push(EditLine *el, const char *str)
-{
- /* Using multibyte->wide string decoding works fine under single-byte
- * character sets too, and Does The Right Thing. */
- el_wpush(el, ct_decode_string(str, &el->el_lgcyconv));
-}
-
-
-public const char *
-el_gets(EditLine *el, int *nread)
-{
- const wchar_t *tmp;
-
- if (!(el->el_flags & CHARSET_IS_UTF8))
- el->el_flags |= IGNORE_EXTCHARS;
- tmp = el_wgets(el, nread);
- if (tmp != NULL) {
- size_t nwread = 0;
- for (int i = 0; i < *nread; i++)
- nwread += ct_enc_width(tmp[i]);
- *nread = (int)nwread;
- }
- if (!(el->el_flags & CHARSET_IS_UTF8))
- el->el_flags &= ~IGNORE_EXTCHARS;
- return ct_encode_string(tmp, &el->el_lgcyconv);
-}
-
-
-public int
-el_parse(EditLine *el, int argc, const char *argv[])
-{
- int ret;
- const wchar_t **wargv;
-
- wargv = (const wchar_t **)
- ct_decode_argv(argc, argv, &el->el_lgcyconv);
- if (!wargv)
- return -1;
- ret = el_wparse(el, argc, wargv);
- ct_free_argv(wargv);
-
- return ret;
-}
-
-
-public int
-el_set(EditLine *el, int op, ...)
-{
- va_list ap;
- int ret;
-
- if (!el)
- return -1;
- va_start(ap, op);
-
- switch (op) {
- case EL_PROMPT: /* el_pfunc_t */
- case EL_RPROMPT: {
- el_pfunc_t p = va_arg(ap, el_pfunc_t);
- ret = prompt_set(el, p, 0, op, 0);
- break;
- }
-
- case EL_RESIZE: {
- el_zfunc_t p = va_arg(ap, el_zfunc_t);
- void *arg = va_arg(ap, void *);
- ret = ch_resizefun(el, p, arg);
- break;
- }
-
- case EL_ALIAS_TEXT: {
- el_afunc_t p = va_arg(ap, el_afunc_t);
- void *arg = va_arg(ap, void *);
- ret = ch_aliasfun(el, p, arg);
- break;
- }
-
- case EL_PROMPT_ESC:
- case EL_RPROMPT_ESC: {
- el_pfunc_t p = va_arg(ap, el_pfunc_t);
- int c = va_arg(ap, int);
-
- ret = prompt_set(el, p, c, op, 0);
- break;
- }
-
- case EL_TERMINAL: /* const char * */
- ret = el_wset(el, op, va_arg(ap, char *));
- break;
-
- case EL_EDITOR: /* const wchar_t * */
- ret = el_wset(el, op, ct_decode_string(va_arg(ap, char *),
- &el->el_lgcyconv));
- break;
-
- case EL_SIGNAL: /* int */
- case EL_EDITMODE:
- case EL_UNBUFFERED:
- case EL_PREP_TERM:
- ret = el_wset(el, op, va_arg(ap, int));
- break;
-
- case EL_BIND: /* const char * list -> const wchar_t * list */
- case EL_TELLTC:
- case EL_SETTC:
- case EL_ECHOTC:
- case EL_SETTY: {
- const char *argv[20];
- int i;
- const wchar_t **wargv;
- for (i = 1; i < (int)__arraycount(argv) - 1; ++i)
- if ((argv[i] = va_arg(ap, const char *)) == NULL)
- break;
- argv[0] = argv[i] = NULL;
- wargv = (const wchar_t **)
- ct_decode_argv(i + 1, argv, &el->el_lgcyconv);
- if (!wargv) {
- ret = -1;
- goto out;
- }
- /*
- * AFAIK we can't portably pass through our new wargv to
- * el_wset(), so we have to reimplement the body of
- * el_wset() for these ops.
- */
- switch (op) {
- case EL_BIND:
- wargv[0] = STR("bind");
- ret = map_bind(el, i, wargv);
- break;
- case EL_TELLTC:
- wargv[0] = STR("telltc");
- ret = terminal_telltc(el, i, wargv);
- break;
- case EL_SETTC:
- wargv[0] = STR("settc");
- ret = terminal_settc(el, i, wargv);
- break;
- case EL_ECHOTC:
- wargv[0] = STR("echotc");
- ret = terminal_echotc(el, i, wargv);
- break;
- case EL_SETTY:
- wargv[0] = STR("setty");
- ret = tty_stty(el, i, wargv);
- break;
- default:
- ret = -1;
- }
- ct_free_argv(wargv);
- break;
- }
-
- /* XXX: do we need to change el_func_t too? */
- case EL_ADDFN: { /* const char *, const char *, el_func_t */
- const char *args[2];
- el_func_t func;
- wchar_t **wargv;
-
- args[0] = va_arg(ap, const char *);
- args[1] = va_arg(ap, const char *);
- func = va_arg(ap, el_func_t);
-
- wargv = ct_decode_argv(2, args, &el->el_lgcyconv);
- if (!wargv) {
- ret = -1;
- goto out;
- }
- // XXX: The two strdup's leak
- ret = map_addfunc(el, Strdup(wargv[0]), Strdup(wargv[1]),
- func);
- ct_free_argv(wargv);
- break;
- }
- case EL_HIST: { /* hist_fun_t, const char * */
- hist_fun_t fun = va_arg(ap, hist_fun_t);
- void *ptr = va_arg(ap, void *);
- ret = hist_set(el, fun, ptr);
- el->el_flags |= NARROW_HISTORY;
- break;
- }
-
- /* XXX: do we need to change el_rfunc_t? */
- case EL_GETCFN: /* el_rfunc_t */
- ret = el_wset(el, op, va_arg(ap, el_rfunc_t));
- el->el_flags |= NARROW_READ;
- break;
-
- case EL_CLIENTDATA: /* void * */
- ret = el_wset(el, op, va_arg(ap, void *));
- break;
-
- case EL_SETFP: { /* int, FILE * */
- int what = va_arg(ap, int);
- FILE *fp = va_arg(ap, FILE *);
- ret = el_wset(el, op, what, fp);
- break;
- }
-
- case EL_REFRESH:
- re_clear_display(el);
- re_refresh(el);
- terminal__flush(el);
- ret = 0;
- break;
-
- default:
- ret = -1;
- break;
- }
-
-out:
- va_end(ap);
- return ret;
-}
-
-
-public int
-el_get(EditLine *el, int op, ...)
-{
- va_list ap;
- int ret;
-
- if (!el)
- return -1;
-
- va_start(ap, op);
-
- switch (op) {
- case EL_PROMPT: /* el_pfunc_t * */
- case EL_RPROMPT: {
- el_pfunc_t *p = va_arg(ap, el_pfunc_t *);
- ret = prompt_get(el, p, 0, op);
- break;
- }
-
- case EL_PROMPT_ESC: /* el_pfunc_t *, char **/
- case EL_RPROMPT_ESC: {
- el_pfunc_t *p = va_arg(ap, el_pfunc_t *);
- char *c = va_arg(ap, char *);
- wchar_t wc = 0;
- ret = prompt_get(el, p, &wc, op);
- *c = (char)wc;
- break;
- }
-
- case EL_EDITOR: {
- const char **p = va_arg(ap, const char **);
- const wchar_t *pw;
- ret = el_wget(el, op, &pw);
- *p = ct_encode_string(pw, &el->el_lgcyconv);
- if (!el->el_lgcyconv.csize)
- ret = -1;
- break;
- }
-
- case EL_TERMINAL: /* const char ** */
- ret = el_wget(el, op, va_arg(ap, const char **));
- break;
-
- case EL_SIGNAL: /* int * */
- case EL_EDITMODE:
- case EL_UNBUFFERED:
- case EL_PREP_TERM:
- ret = el_wget(el, op, va_arg(ap, int *));
- break;
-
- case EL_GETTC: {
- char *argv[20];
- static char gettc[] = "gettc";
- int i;
- for (i = 1; i < (int)__arraycount(argv); ++i)
- if ((argv[i] = va_arg(ap, char *)) == NULL)
- break;
- argv[0] = gettc;
- ret = terminal_gettc(el, i, argv);
- break;
- }
-
- /* XXX: do we need to change el_rfunc_t? */
- case EL_GETCFN: /* el_rfunc_t */
- ret = el_wget(el, op, va_arg(ap, el_rfunc_t *));
- break;
-
- case EL_CLIENTDATA: /* void ** */
- ret = el_wget(el, op, va_arg(ap, void **));
- break;
-
- case EL_GETFP: { /* int, FILE ** */
- int what = va_arg(ap, int);
- FILE **fpp = va_arg(ap, FILE **);
- ret = el_wget(el, op, what, fpp);
- break;
- }
-
- default:
- ret = -1;
- break;
- }
-
- va_end(ap);
- return ret;
-}
-
-
-const LineInfo *
-el_line(EditLine *el)
-{
- const LineInfoW *winfo = el_wline(el);
- LineInfo *info = &el->el_lgcylinfo;
- size_t offset;
- const Char *p;
-
- info->buffer = ct_encode_string(winfo->buffer, &el->el_lgcyconv);
-
- offset = 0;
- for (p = winfo->buffer; p < winfo->cursor; p++)
- offset += ct_enc_width(*p);
- info->cursor = info->buffer + offset;
-
- offset = 0;
- for (p = winfo->buffer; p < winfo->lastchar; p++)
- offset += ct_enc_width(*p);
- info->lastchar = info->buffer + offset;
-
- return info;
-}
-
-
-int
-el_insertstr(EditLine *el, const char *str)
-{
- return el_winsertstr(el, ct_decode_string(str, &el->el_lgcyconv));
-}
diff --git a/lib/libedit/emacs.c b/lib/libedit/emacs.c
index c1c30d6..edcc84b 100644
--- a/lib/libedit/emacs.c
+++ b/lib/libedit/emacs.c
@@ -1,5 +1,3 @@
-/* $NetBSD: emacs.c,v 1.25 2011/07/29 15:16:33 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: emacs.c,v 1.22 2009/02/15 21:55:23 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)emacs.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: emacs.c,v 1.25 2011/07/29 15:16:33 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -46,6 +41,7 @@ __FBSDID("$FreeBSD$");
/*
* emacs.c: Emacs functions
*/
+#include "sys.h"
#include "el.h"
/* em_delete_or_list():
@@ -54,22 +50,22 @@ __FBSDID("$FreeBSD$");
*/
protected el_action_t
/*ARGSUSED*/
-em_delete_or_list(EditLine *el, Int c)
+em_delete_or_list(EditLine *el, int c)
{
if (el->el_line.cursor == el->el_line.lastchar) {
/* if I'm at the end */
if (el->el_line.cursor == el->el_line.buffer) {
/* and the beginning */
- terminal_writec(el, c); /* then do an EOF */
- return CC_EOF;
+ term_writec(el, c); /* then do an EOF */
+ return (CC_EOF);
} else {
/*
* Here we could list completions, but it is an
* error right now
*/
- terminal_beep(el);
- return CC_ERROR;
+ term_beep(el);
+ return (CC_ERROR);
}
} else {
if (el->el_state.doingarg)
@@ -79,7 +75,7 @@ em_delete_or_list(EditLine *el, Int c)
if (el->el_line.cursor > el->el_line.lastchar)
el->el_line.cursor = el->el_line.lastchar;
/* bounds check */
- return CC_REFRESH;
+ return (CC_REFRESH);
}
}
@@ -90,12 +86,12 @@ em_delete_or_list(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-em_delete_next_word(EditLine *el, Int c __attribute__((__unused__)))
+em_delete_next_word(EditLine *el, int c __unused)
{
- Char *cp, *p, *kp;
+ char *cp, *p, *kp;
if (el->el_line.cursor == el->el_line.lastchar)
- return CC_ERROR;
+ return (CC_ERROR);
cp = c__next_word(el->el_line.cursor, el->el_line.lastchar,
el->el_state.argument, ce__isword);
@@ -109,7 +105,7 @@ em_delete_next_word(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_line.cursor > el->el_line.lastchar)
el->el_line.cursor = el->el_line.lastchar;
/* bounds check */
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -119,17 +115,17 @@ em_delete_next_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_yank(EditLine *el, Int c __attribute__((__unused__)))
+em_yank(EditLine *el, int c __unused)
{
- Char *kp, *cp;
+ char *kp, *cp;
if (el->el_chared.c_kill.last == el->el_chared.c_kill.buf)
- return CC_NORM;
+ return (CC_NORM);
if (el->el_line.lastchar +
(el->el_chared.c_kill.last - el->el_chared.c_kill.buf) >=
el->el_line.limit)
- return CC_ERROR;
+ return (CC_ERROR);
el->el_chared.c_kill.mark = el->el_line.cursor;
cp = el->el_line.cursor;
@@ -145,7 +141,7 @@ em_yank(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_state.argument == 1)
el->el_line.cursor = cp;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -155,9 +151,9 @@ em_yank(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_kill_line(EditLine *el, Int c __attribute__((__unused__)))
+em_kill_line(EditLine *el, int c __unused)
{
- Char *kp, *cp;
+ char *kp, *cp;
cp = el->el_line.buffer;
kp = el->el_chared.c_kill.buf;
@@ -167,7 +163,7 @@ em_kill_line(EditLine *el, Int c __attribute__((__unused__)))
/* zap! -- delete all of it */
el->el_line.lastchar = el->el_line.buffer;
el->el_line.cursor = el->el_line.buffer;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -177,12 +173,12 @@ em_kill_line(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_kill_region(EditLine *el, Int c __attribute__((__unused__)))
+em_kill_region(EditLine *el, int c __unused)
{
- Char *kp, *cp;
+ char *kp, *cp;
if (!el->el_chared.c_kill.mark)
- return CC_ERROR;
+ return (CC_ERROR);
if (el->el_chared.c_kill.mark > el->el_line.cursor) {
cp = el->el_line.cursor;
@@ -200,7 +196,7 @@ em_kill_region(EditLine *el, Int c __attribute__((__unused__)))
c_delbefore(el, (int)(cp - el->el_chared.c_kill.mark));
el->el_line.cursor = el->el_chared.c_kill.mark;
}
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -210,12 +206,12 @@ em_kill_region(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_copy_region(EditLine *el, Int c __attribute__((__unused__)))
+em_copy_region(EditLine *el, int c __unused)
{
- Char *kp, *cp;
+ char *kp, *cp;
if (!el->el_chared.c_kill.mark)
- return CC_ERROR;
+ return (CC_ERROR);
if (el->el_chared.c_kill.mark > el->el_line.cursor) {
cp = el->el_line.cursor;
@@ -230,7 +226,7 @@ em_copy_region(EditLine *el, Int c __attribute__((__unused__)))
*kp++ = *cp++; /* copy it */
el->el_chared.c_kill.last = kp;
}
- return CC_NORM;
+ return (CC_NORM);
}
@@ -239,7 +235,7 @@ em_copy_region(EditLine *el, Int c __attribute__((__unused__)))
* Gosling emacs transpose chars [^T]
*/
protected el_action_t
-em_gosmacs_transpose(EditLine *el, Int c)
+em_gosmacs_transpose(EditLine *el, int c)
{
if (el->el_line.cursor > &el->el_line.buffer[1]) {
@@ -247,9 +243,9 @@ em_gosmacs_transpose(EditLine *el, Int c)
c = el->el_line.cursor[-2];
el->el_line.cursor[-2] = el->el_line.cursor[-1];
el->el_line.cursor[-1] = c;
- return CC_REFRESH;
+ return (CC_REFRESH);
} else
- return CC_ERROR;
+ return (CC_ERROR);
}
@@ -259,10 +255,10 @@ em_gosmacs_transpose(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-em_next_word(EditLine *el, Int c __attribute__((__unused__)))
+em_next_word(EditLine *el, int c __unused)
{
if (el->el_line.cursor == el->el_line.lastchar)
- return CC_ERROR;
+ return (CC_ERROR);
el->el_line.cursor = c__next_word(el->el_line.cursor,
el->el_line.lastchar,
@@ -272,9 +268,9 @@ em_next_word(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_map.type == MAP_VI)
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -284,21 +280,21 @@ em_next_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_upper_case(EditLine *el, Int c __attribute__((__unused__)))
+em_upper_case(EditLine *el, int c __unused)
{
- Char *cp, *ep;
+ char *cp, *ep;
ep = c__next_word(el->el_line.cursor, el->el_line.lastchar,
el->el_state.argument, ce__isword);
for (cp = el->el_line.cursor; cp < ep; cp++)
- if (Islower(*cp))
- *cp = Toupper(*cp);
+ if (islower((unsigned char)*cp))
+ *cp = toupper((unsigned char)*cp);
el->el_line.cursor = ep;
if (el->el_line.cursor > el->el_line.lastchar)
el->el_line.cursor = el->el_line.lastchar;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -308,29 +304,29 @@ em_upper_case(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_capitol_case(EditLine *el, Int c __attribute__((__unused__)))
+em_capitol_case(EditLine *el, int c __unused)
{
- Char *cp, *ep;
+ char *cp, *ep;
ep = c__next_word(el->el_line.cursor, el->el_line.lastchar,
el->el_state.argument, ce__isword);
for (cp = el->el_line.cursor; cp < ep; cp++) {
- if (Isalpha(*cp)) {
- if (Islower(*cp))
- *cp = Toupper(*cp);
+ if (isalpha((unsigned char)*cp)) {
+ if (islower((unsigned char)*cp))
+ *cp = toupper((unsigned char)*cp);
cp++;
break;
}
}
for (; cp < ep; cp++)
- if (Isupper(*cp))
- *cp = Tolower(*cp);
+ if (isupper((unsigned char)*cp))
+ *cp = tolower((unsigned char)*cp);
el->el_line.cursor = ep;
if (el->el_line.cursor > el->el_line.lastchar)
el->el_line.cursor = el->el_line.lastchar;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -340,21 +336,21 @@ em_capitol_case(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_lower_case(EditLine *el, Int c __attribute__((__unused__)))
+em_lower_case(EditLine *el, int c __unused)
{
- Char *cp, *ep;
+ char *cp, *ep;
ep = c__next_word(el->el_line.cursor, el->el_line.lastchar,
el->el_state.argument, ce__isword);
for (cp = el->el_line.cursor; cp < ep; cp++)
- if (Isupper(*cp))
- *cp = Tolower(*cp);
+ if (isupper((unsigned char)*cp))
+ *cp = tolower((unsigned char)*cp);
el->el_line.cursor = ep;
if (el->el_line.cursor > el->el_line.lastchar)
el->el_line.cursor = el->el_line.lastchar;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -364,11 +360,11 @@ em_lower_case(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_set_mark(EditLine *el, Int c __attribute__((__unused__)))
+em_set_mark(EditLine *el, int c __unused)
{
el->el_chared.c_kill.mark = el->el_line.cursor;
- return CC_NORM;
+ return (CC_NORM);
}
@@ -378,14 +374,14 @@ em_set_mark(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_exchange_mark(EditLine *el, Int c __attribute__((__unused__)))
+em_exchange_mark(EditLine *el, int c __unused)
{
- Char *cp;
+ char *cp;
cp = el->el_line.cursor;
el->el_line.cursor = el->el_chared.c_kill.mark;
el->el_chared.c_kill.mark = cp;
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -395,14 +391,14 @@ em_exchange_mark(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_universal_argument(EditLine *el, Int c __attribute__((__unused__)))
+em_universal_argument(EditLine *el, int c __unused)
{ /* multiply current argument by 4 */
if (el->el_state.argument > 1000000)
- return CC_ERROR;
+ return (CC_ERROR);
el->el_state.doingarg = 1;
el->el_state.argument *= 4;
- return CC_ARGHACK;
+ return (CC_ARGHACK);
}
@@ -412,11 +408,11 @@ em_universal_argument(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_meta_next(EditLine *el, Int c __attribute__((__unused__)))
+em_meta_next(EditLine *el, int c __unused)
{
el->el_state.metanext = 1;
- return CC_ARGHACK;
+ return (CC_ARGHACK);
}
@@ -425,12 +421,12 @@ em_meta_next(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_toggle_overwrite(EditLine *el, Int c __attribute__((__unused__)))
+em_toggle_overwrite(EditLine *el, int c __unused)
{
el->el_state.inputmode = (el->el_state.inputmode == MODE_INSERT) ?
MODE_REPLACE : MODE_INSERT;
- return CC_NORM;
+ return (CC_NORM);
}
@@ -439,12 +435,12 @@ em_toggle_overwrite(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_copy_prev_word(EditLine *el, Int c __attribute__((__unused__)))
+em_copy_prev_word(EditLine *el, int c __unused)
{
- Char *cp, *oldc, *dp;
+ char *cp, *oldc, *dp;
if (el->el_line.cursor == el->el_line.buffer)
- return CC_ERROR;
+ return (CC_ERROR);
oldc = el->el_line.cursor;
/* does a bounds check */
@@ -457,7 +453,7 @@ em_copy_prev_word(EditLine *el, Int c __attribute__((__unused__)))
el->el_line.cursor = dp;/* put cursor at end */
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -466,11 +462,11 @@ em_copy_prev_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_inc_search_next(EditLine *el, Int c __attribute__((__unused__)))
+em_inc_search_next(EditLine *el, int c __unused)
{
el->el_search.patlen = 0;
- return ce_inc_search(el, ED_SEARCH_NEXT_HISTORY);
+ return (ce_inc_search(el, ED_SEARCH_NEXT_HISTORY));
}
@@ -479,11 +475,11 @@ em_inc_search_next(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_inc_search_prev(EditLine *el, Int c __attribute__((__unused__)))
+em_inc_search_prev(EditLine *el, int c __unused)
{
el->el_search.patlen = 0;
- return ce_inc_search(el, ED_SEARCH_PREV_HISTORY);
+ return (ce_inc_search(el, ED_SEARCH_PREV_HISTORY));
}
@@ -493,11 +489,11 @@ em_inc_search_prev(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+em_delete_prev_char(EditLine *el, int c __unused)
{
if (el->el_line.cursor <= el->el_line.buffer)
- return CC_ERROR;
+ return (CC_ERROR);
if (el->el_state.doingarg)
c_delbefore(el, el->el_state.argument);
@@ -506,5 +502,5 @@ em_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
el->el_line.cursor -= el->el_state.argument;
if (el->el_line.cursor < el->el_line.buffer)
el->el_line.cursor = el->el_line.buffer;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
diff --git a/lib/libedit/filecomplete.c b/lib/libedit/filecomplete.c
index 10d44e4..bf0d759 100644
--- a/lib/libedit/filecomplete.c
+++ b/lib/libedit/filecomplete.c
@@ -1,5 +1,3 @@
-/* $NetBSD: filecomplete.c,v 1.34 2014/10/18 15:07:02 riz Exp $ */
-
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -27,12 +25,10 @@
* CONTRACT, STRICT LIABILITY, OR TORT (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: filecomplete.c,v 1.19 2010/06/01 18:20:26 christos Exp $
*/
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: filecomplete.c,v 1.34 2014/10/18 15:07:02 riz Exp $");
-#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -48,16 +44,16 @@ __FBSDID("$FreeBSD$");
#include <limits.h>
#include <errno.h>
#include <fcntl.h>
-
+#include <vis.h>
#include "el.h"
#include "fcns.h" /* for EL_NUM_FCNS */
#include "histedit.h"
#include "filecomplete.h"
-static const Char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@',
- '$', '>', '<', '=', ';', '|', '&', '{', '(', '\0' };
+static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`',
+ '>', '<', '=', ';', '|', '&', '{', '(', '\0' };
/* Tilde is deliberately omitted here, we treat it specially. */
-static const Char extra_quote_chars[] = { ')', '}', '*', '?', '[', '$', '\0' };
+static char extra_quote_chars[] = { ')', '}', '*', '?', '[', '$', '\0' };
/********************************/
@@ -68,21 +64,18 @@ static const Char extra_quote_chars[] = { ')', '}', '*', '?', '[', '$', '\0' };
* if ``user'' isn't valid user name or ``txt'' doesn't start
* w/ '~', returns pointer to strdup()ed copy of ``txt''
*
- * it's the caller's responsibility to free() the returned string
+ * it's callers's responsibility to free() returned string
*/
char *
fn_tilde_expand(const char *txt)
{
-#if defined(HAVE_GETPW_R_POSIX) || defined(HAVE_GETPW_R_DRAFT)
- struct passwd pwres;
- char pwbuf[1024];
-#endif
- struct passwd *pass;
+ struct passwd pwres, *pass;
char *temp;
size_t len = 0;
+ char pwbuf[1024];
if (txt[0] != '~')
- return strdup(txt);
+ return (strdup(txt));
temp = strchr(txt + 1, '/');
if (temp == NULL) {
@@ -90,49 +83,34 @@ fn_tilde_expand(const char *txt)
if (temp == NULL)
return NULL;
} else {
- /* text until string after slash */
- len = (size_t)(temp - txt + 1);
- temp = el_malloc(len * sizeof(*temp));
+ len = temp - txt + 1; /* text until string after slash */
+ temp = malloc(len);
if (temp == NULL)
return NULL;
(void)strncpy(temp, txt + 1, len - 2);
temp[len - 2] = '\0';
}
if (temp[0] == 0) {
-#ifdef HAVE_GETPW_R_POSIX
- if (getpwuid_r(getuid(), &pwres, pwbuf, sizeof(pwbuf),
- &pass) != 0)
- pass = NULL;
-#elif HAVE_GETPW_R_DRAFT
- pass = getpwuid_r(getuid(), &pwres, pwbuf, sizeof(pwbuf));
-#else
- pass = getpwuid(getuid());
-#endif
+ if (getpwuid_r(getuid(), &pwres, pwbuf, sizeof(pwbuf), &pass) != 0)
+ pass = NULL;
} else {
-#ifdef HAVE_GETPW_R_POSIX
if (getpwnam_r(temp, &pwres, pwbuf, sizeof(pwbuf), &pass) != 0)
pass = NULL;
-#elif HAVE_GETPW_R_DRAFT
- pass = getpwnam_r(temp, &pwres, pwbuf, sizeof(pwbuf));
-#else
- pass = getpwnam(temp);
-#endif
}
- el_free(temp); /* value no more needed */
+ free(temp); /* value no more needed */
if (pass == NULL)
- return strdup(txt);
+ return (strdup(txt));
- /* update pointer txt to point at string immedially following */
+ /* update pointer txt to point at string immediately following */
/* first slash */
txt += len;
- len = strlen(pass->pw_dir) + 1 + strlen(txt) + 1;
- temp = el_malloc(len * sizeof(*temp));
+ temp = malloc(strlen(pass->pw_dir) + 1 + strlen(txt) + 1);
if (temp == NULL)
return NULL;
- (void)snprintf(temp, len, "%s/%s", pass->pw_dir, txt);
+ (void)sprintf(temp, "%s/%s", pass->pw_dir, txt);
- return temp;
+ return (temp);
}
@@ -141,7 +119,7 @@ fn_tilde_expand(const char *txt)
* such file can be found
* value of ``state'' is ignored
*
- * it's the caller's responsibility to free the returned string
+ * it's caller's responsibility to free returned string
*/
char *
fn_filename_completion_function(const char *text, int state)
@@ -158,21 +136,19 @@ fn_filename_completion_function(const char *text, int state)
if (temp) {
char *nptr;
temp++;
- nptr = el_realloc(filename, (strlen(temp) + 1) *
- sizeof(*nptr));
+ nptr = realloc(filename, strlen(temp) + 1);
if (nptr == NULL) {
- el_free(filename);
+ free(filename);
filename = NULL;
return NULL;
}
filename = nptr;
(void)strcpy(filename, temp);
- len = (size_t)(temp - text); /* including last slash */
+ len = temp - text; /* including last slash */
- nptr = el_realloc(dirname, (len + 1) *
- sizeof(*nptr));
+ nptr = realloc(dirname, len + 1);
if (nptr == NULL) {
- el_free(dirname);
+ free(dirname);
dirname = NULL;
return NULL;
}
@@ -180,7 +156,7 @@ fn_filename_completion_function(const char *text, int state)
(void)strncpy(dirname, text, len);
dirname[len] = '\0';
} else {
- el_free(filename);
+ free(filename);
if (*text == 0)
filename = NULL;
else {
@@ -188,7 +164,7 @@ fn_filename_completion_function(const char *text, int state)
if (filename == NULL)
return NULL;
}
- el_free(dirname);
+ free(dirname);
dirname = NULL;
}
@@ -199,7 +175,7 @@ fn_filename_completion_function(const char *text, int state)
/* support for ``~user'' syntax */
- el_free(dirpath);
+ free(dirpath);
dirpath = NULL;
if (dirname == NULL) {
if ((dirname = strdup("")) == NULL)
@@ -215,7 +191,7 @@ fn_filename_completion_function(const char *text, int state)
dir = opendir(dirpath);
if (!dir)
- return NULL; /* cannot open the directory */
+ return (NULL); /* cannot open the directory */
/* will be used in cycle */
filename_len = filename ? strlen(filename) : 0;
@@ -232,36 +208,26 @@ fn_filename_completion_function(const char *text, int state)
/* otherwise, get first entry where first */
/* filename_len characters are equal */
if (entry->d_name[0] == filename[0]
-#if HAVE_STRUCT_DIRENT_D_NAMLEN
&& entry->d_namlen >= filename_len
-#else
- && strlen(entry->d_name) >= filename_len
-#endif
&& strncmp(entry->d_name, filename,
filename_len) == 0)
break;
}
if (entry) { /* match found */
-
-#if HAVE_STRUCT_DIRENT_D_NAMLEN
len = entry->d_namlen;
-#else
- len = strlen(entry->d_name);
-#endif
- len = strlen(dirname) + len + 1;
- temp = el_malloc(len * sizeof(*temp));
+ temp = malloc(strlen(dirname) + len + 1);
if (temp == NULL)
return NULL;
- (void)snprintf(temp, len, "%s%s", dirname, entry->d_name);
+ (void)sprintf(temp, "%s%s", dirname, entry->d_name);
} else {
(void)closedir(dir);
dir = NULL;
temp = NULL;
}
- return temp;
+ return (temp);
}
@@ -278,9 +244,11 @@ append_char_function(const char *name)
rs = "/";
out:
if (expname)
- el_free(expname);
+ free(expname);
return rs;
}
+
+
/*
* returns list of completions for text given
* non-static for readline.
@@ -301,10 +269,10 @@ completion_matches(const char *text, char *(*genfunc)(const char *, int))
char **nmatch_list;
while (matches + 3 >= match_list_len)
match_list_len <<= 1;
- nmatch_list = el_realloc(match_list,
- match_list_len * sizeof(*nmatch_list));
+ nmatch_list = realloc(match_list,
+ match_list_len * sizeof(char *));
if (nmatch_list == NULL) {
- el_free(match_list);
+ free(match_list);
return NULL;
}
match_list = nmatch_list;
@@ -327,9 +295,9 @@ completion_matches(const char *text, char *(*genfunc)(const char *, int))
max_equal = i;
}
- retstr = el_malloc((max_equal + 1) * sizeof(*retstr));
+ retstr = malloc(max_equal + 1);
if (retstr == NULL) {
- el_free(match_list);
+ free(match_list);
return NULL;
}
(void)strncpy(retstr, match_list[1], max_equal);
@@ -337,11 +305,12 @@ completion_matches(const char *text, char *(*genfunc)(const char *, int))
match_list[0] = retstr;
/* add NULL as last pointer to the array */
- match_list[matches + 1] = NULL;
+ match_list[matches + 1] = (char *) NULL;
- return match_list;
+ return (match_list);
}
+
/*
* Sort function for qsort(). Just wrapper around strcasecmp().
*/
@@ -354,53 +323,47 @@ _fn_qsort_string_compare(const void *i1, const void *i2)
return strcasecmp(s1, s2);
}
+
/*
* Display list of strings in columnar format on readline's output stream.
- * 'matches' is list of strings, 'num' is number of strings in 'matches',
- * 'width' is maximum length of string in 'matches'.
- *
- * matches[0] is not one of the match strings, but it is counted in
- * num, so the strings are matches[1] *through* matches[num-1].
+ * 'matches' is list of strings, 'len' is number of strings in 'matches',
+ * 'max' is maximum length of string in 'matches'.
*/
void
-fn_display_match_list (EditLine *el, char **matches, size_t num, size_t width)
+fn_display_match_list(EditLine *el, char **matches, size_t len, size_t max)
{
- size_t line, lines, col, cols, thisguy;
- int screenwidth = el->el_terminal.t_size.h;
-
- /* Ignore matches[0]. Avoid 1-based array logic below. */
- matches++;
- num--;
-
- /*
- * Find out how many entries can be put on one line; count
- * with one space between strings the same way it's printed.
- */
- cols = (size_t)screenwidth / (width + 1);
- if (cols == 0)
- cols = 1;
-
- /* how many lines of output, rounded up */
- lines = (num + cols - 1) / cols;
-
- /* Sort the items. */
- qsort(matches, num, sizeof(char *), _fn_qsort_string_compare);
+ size_t i, idx, limit, count;
+ int screenwidth = el->el_term.t_size.h;
/*
- * On the ith line print elements i, i+lines, i+lines*2, etc.
+ * Find out how many entries can be put on one line, count
+ * with two spaces between strings.
*/
- for (line = 0; line < lines; line++) {
- for (col = 0; col < cols; col++) {
- thisguy = line + col * lines;
- if (thisguy >= num)
- break;
- (void)fprintf(el->el_outfile, "%s%-*s",
- col == 0 ? "" : " ", (int)width, matches[thisguy]);
+ limit = screenwidth / (max + 2);
+ if (limit == 0)
+ limit = 1;
+
+ /* how many lines of output */
+ count = len / limit;
+ if (count * limit < len)
+ count++;
+
+ /* Sort the items if they are not already sorted. */
+ qsort(&matches[1], len, sizeof(char *), _fn_qsort_string_compare);
+
+ idx = 1;
+ for(; count > 0; count--) {
+ int more = limit > 0 && matches[0];
+ for(i = 0; more; idx++) {
+ more = ++i < limit && matches[idx + 1];
+ (void)fprintf(el->el_outfile, "%-*s%s", (int)max,
+ matches[idx], more ? " " : "");
}
(void)fprintf(el->el_outfile, "\n");
}
}
+
/*
* Complete the word at or before point,
* 'what_to_do' says what to do with the completion.
@@ -417,18 +380,18 @@ int
fn_complete(EditLine *el,
char *(*complet_func)(const char *, int),
char **(*attempted_completion_function)(const char *, int, int),
- const Char *word_break, const Char *special_prefixes,
+ const char *word_break, const char *special_prefixes,
const char *(*app_func)(const char *), size_t query_items,
int *completion_type, int *over, int *point, int *end,
- const Char *(*find_word_start_func)(const Char *, const Char *),
- Char *(*dequoting_func)(const Char *),
+ const char *(*find_word_start_func)(const char *, const char *),
+ char *(*dequoting_func)(const char *),
char *(*quoting_func)(const char *))
{
- const TYPE(LineInfo) *li;
- Char *temp;
- Char *dequoted_temp;
- char **matches;
- const Char *ctemp;
+ const LineInfo *li;
+ char *temp;
+ char *dequoted_temp;
+ char **matches;
+ const char *ctemp;
size_t len;
int what_to_do = '\t';
int retval = CC_NORM;
@@ -446,20 +409,26 @@ fn_complete(EditLine *el,
app_func = append_char_function;
/* We now look backwards for the start of a filename/variable word */
- li = FUN(el,line)(el);
+ li = el_line(el);
if (find_word_start_func)
ctemp = find_word_start_func(li->buffer, li->cursor);
else {
ctemp = li->cursor;
while (ctemp > li->buffer
- && !Strchr(word_break, ctemp[-1])
- && (!special_prefixes || !Strchr(special_prefixes, ctemp[-1]) ) )
+ && !strchr(word_break, ctemp[-1])
+ && (!special_prefixes || !strchr(special_prefixes, ctemp[-1]) ) )
ctemp--;
}
- len = (size_t)(li->cursor - ctemp);
- temp = el_malloc((len + 1) * sizeof(*temp));
- (void)Strncpy(temp, ctemp, len);
+ len = li->cursor - ctemp;
+#if defined(__SSP__) || defined(__SSP_ALL__)
+ temp = malloc(sizeof(*temp) * (len + 1));
+ if (temp == NULL)
+ return retval;
+#else
+ temp = alloca(sizeof(*temp) * (len + 1));
+#endif
+ (void)strncpy(temp, ctemp, len);
temp[len] = '\0';
if (dequoting_func) {
@@ -478,17 +447,13 @@ fn_complete(EditLine *el,
if (attempted_completion_function) {
int cur_off = (int)(li->cursor - li->buffer);
- matches = (*attempted_completion_function)(
- ct_encode_string(dequoted_temp ? dequoted_temp : temp,
- &el->el_scratch),
- cur_off - (int)len, cur_off);
+ matches = (*attempted_completion_function) (dequoted_temp ? dequoted_temp : temp,
+ (int)(cur_off - len), cur_off);
} else
matches = 0;
if (!attempted_completion_function ||
(over != NULL && !*over && !matches))
- matches = completion_matches(
- ct_encode_string(dequoted_temp ? dequoted_temp : temp,
- &el->el_scratch), complet_func);
+ matches = completion_matches(dequoted_temp ? dequoted_temp : temp, complet_func);
if (over != NULL)
*over = 0;
@@ -510,25 +475,23 @@ fn_complete(EditLine *el,
goto free_matches;
} else
quoted_match = NULL;
+
el_deletestr(el, (int) len);
- FUN(el,insertstr)(el,
- ct_decode_string(quoted_match ? quoted_match :
- matches[0] , &el->el_scratch));
+ el_insertstr(el, quoted_match ? quoted_match : matches[0]);
+
+ free(quoted_match);
}
if (what_to_do == '?')
goto display_matches;
- if (matches[2] == NULL &&
- (matches[1] == NULL || strcmp(matches[0], matches[1]) == 0)) {
+ if (matches[2] == NULL && strcmp(matches[0], matches[1]) == 0) {
/*
* We found exact match. Add a space after
* it, unless we do filename completion and the
* object is a directory.
*/
- FUN(el,insertstr)(el,
- ct_decode_string((*app_func)(matches[0]),
- &el->el_scratch));
+ el_insertstr(el, (*app_func)(matches[0]));
} else if (what_to_do == '!') {
display_matches:
/*
@@ -541,8 +504,7 @@ fn_complete(EditLine *el,
if (match_len > maxlen)
maxlen = match_len;
}
- /* matches[1] through matches[i-1] are available */
- matches_num = (size_t)(i - 1);
+ matches_num = i - 1;
/* newline to get on next line from command line */
(void)fprintf(el->el_outfile, "\n");
@@ -561,17 +523,9 @@ fn_complete(EditLine *el,
(void)fprintf(el->el_outfile, "\n");
}
- if (match_display) {
- /*
- * Interface of this function requires the
- * strings be matches[1..num-1] for compat.
- * We have matches_num strings not counting
- * the prefix in matches[0], so we need to
- * add 1 to matches_num for the call.
- */
- fn_display_match_list(el, matches,
- matches_num+1, maxlen);
- }
+ if (match_display)
+ fn_display_match_list(el, matches, matches_num,
+ maxlen);
retval = CC_REDISPLAY;
} else if (matches[0][0]) {
/*
@@ -590,15 +544,18 @@ fn_complete(EditLine *el,
free_matches:
/* free elements of array and the array itself */
for (i = 0; matches[i]; i++)
- el_free(matches[i]);
- el_free(matches);
+ free(matches[i]);
+ free(matches);
matches = NULL;
}
free(dequoted_temp);
- el_free(temp);
+#if defined(__SSP__) || defined(__SSP_ALL__)
+ free(temp);
+#endif
return retval;
}
+
/*
* el-compatible wrapper around rl_complete; needed for key binding
*/
@@ -607,26 +564,30 @@ unsigned char
_el_fn_complete(EditLine *el, int ch __attribute__((__unused__)))
{
return (unsigned char)fn_complete(el, NULL, NULL,
- break_chars, NULL, NULL, (size_t)100,
+ break_chars, NULL, NULL, 100,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL);
}
-static const Char *
-sh_find_word_start(const Char *buffer, const Char *cursor)
+
+static const char *
+sh_find_word_start(const char *buffer, const char *cursor)
{
- const Char *word_start = buffer;
+ const char *word_start = buffer;
while (buffer < cursor) {
if (*buffer == '\\')
buffer++;
- else if (Strchr(break_chars, *buffer))
+ else if (strchr(break_chars, *buffer))
word_start = buffer + 1;
+
buffer++;
}
+
return word_start;
}
+
static char *
sh_quote(const char *str)
{
@@ -634,20 +595,24 @@ sh_quote(const char *str)
int extra_len = 0;
char *quoted_str, *dst;
- for (src = str; *src != '\0'; src++)
- if (Strchr(break_chars, *src) ||
- Strchr(extra_quote_chars, *src))
+ if (*str == '-' || *str == '+')
+ extra_len += 2;
+ for (src = str; *src != '\0'; src++)
+ if (strchr(break_chars, *src) ||
+ strchr(extra_quote_chars, *src))
extra_len++;
quoted_str = malloc(sizeof(*quoted_str) *
- (strlen(str) + extra_len + 1));
+ (strlen(str) + extra_len + 1));
if (quoted_str == NULL)
return NULL;
dst = quoted_str;
+ if (*str == '-' || *str == '+')
+ *dst++ = '.', *dst++ = '/';
for (src = str; *src != '\0'; src++) {
- if (Strchr(break_chars, *src) ||
- Strchr(extra_quote_chars, *src))
+ if (strchr(break_chars, *src) ||
+ strchr(extra_quote_chars, *src))
*dst++ = '\\';
*dst++ = *src;
}
@@ -656,13 +621,14 @@ sh_quote(const char *str)
return quoted_str;
}
-static Char *
-sh_dequote(const Char *str)
+
+static char *
+sh_dequote(const char *str)
{
- Char *dequoted_str, *dst;
+ char *dequoted_str, *dst;
/* save extra space to replace \~ with ./~ */
- dequoted_str = malloc(sizeof(*dequoted_str) * (Strlen(str) + 1 + 1));
+ dequoted_str = malloc(sizeof(*dequoted_str) * (strlen(str) + 1 + 1));
if (dequoted_str == NULL)
return NULL;
@@ -686,6 +652,7 @@ sh_dequote(const Char *str)
return dequoted_str;
}
+
/*
* completion function using sh quoting rules; for key binding
*/
diff --git a/lib/libedit/filecomplete.h b/lib/libedit/filecomplete.h
index 3666686..215cf7d 100644
--- a/lib/libedit/filecomplete.h
+++ b/lib/libedit/filecomplete.h
@@ -1,5 +1,3 @@
-/* $NetBSD: filecomplete.h,v 1.9 2009/12/30 22:37:40 christos Exp $ */
-
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -28,6 +26,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
+ * $NetBSD: filecomplete.h,v 1.8 2009/02/16 00:15:45 christos Exp $
* $FreeBSD$
*/
#ifndef _FILECOMPLETE_H_
@@ -36,10 +35,10 @@
int fn_complete(EditLine *,
char *(*)(const char *, int),
char **(*)(const char *, int, int),
- const Char *, const Char *, const char *(*)(const char *), size_t,
+ const char *, const char *, const char *(*)(const char *), size_t,
int *, int *, int *, int *,
- const Char *(*)(const Char *, const Char *),
- Char *(*)(const Char *),
+ const char *(*)(const char *, const char *),
+ char *(*)(const char *),
char *(*)(const char *));
void fn_display_match_list(EditLine *, char **, size_t, size_t);
diff --git a/lib/libedit/hist.c b/lib/libedit/hist.c
index 66cfd312..601e102 100644
--- a/lib/libedit/hist.c
+++ b/lib/libedit/hist.c
@@ -1,5 +1,3 @@
-/* $NetBSD: hist.c,v 1.20 2011/07/29 15:16:33 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: hist.c,v 1.15 2003/11/01 23:36:39 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: hist.c,v 1.20 2011/07/29 15:16:33 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -46,6 +41,7 @@ __FBSDID("$FreeBSD$");
/*
* hist.c: History access functions
*/
+#include "sys.h"
#include <stdlib.h>
#include "el.h"
@@ -58,12 +54,12 @@ hist_init(EditLine *el)
el->el_history.fun = NULL;
el->el_history.ref = NULL;
- el->el_history.buf = el_malloc(EL_BUFSIZ * sizeof(*el->el_history.buf));
+ el->el_history.buf = (char *) el_malloc(EL_BUFSIZ);
el->el_history.sz = EL_BUFSIZ;
if (el->el_history.buf == NULL)
- return -1;
+ return (-1);
el->el_history.last = el->el_history.buf;
- return 0;
+ return (0);
}
@@ -74,7 +70,7 @@ protected void
hist_end(EditLine *el)
{
- el_free(el->el_history.buf);
+ el_free((ptr_t) el->el_history.buf);
el->el_history.buf = NULL;
}
@@ -83,12 +79,12 @@ hist_end(EditLine *el)
* Set new history interface
*/
protected int
-hist_set(EditLine *el, hist_fun_t fun, void *ptr)
+hist_set(EditLine *el, hist_fun_t fun, ptr_t ptr)
{
el->el_history.ref = ptr;
el->el_history.fun = fun;
- return 0;
+ return (0);
}
@@ -99,11 +95,11 @@ hist_set(EditLine *el, hist_fun_t fun, void *ptr)
protected el_action_t
hist_get(EditLine *el)
{
- const Char *hp;
+ const char *hp;
int h;
if (el->el_history.eventno == 0) { /* if really the current line */
- (void) Strncpy(el->el_line.buffer, el->el_history.buf,
+ (void) strncpy(el->el_line.buffer, el->el_history.buf,
el->el_history.sz);
el->el_line.lastchar = el->el_line.buffer +
(el->el_history.last - el->el_history.buf);
@@ -115,25 +111,24 @@ hist_get(EditLine *el)
#endif /* KSHVI */
el->el_line.cursor = el->el_line.lastchar;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
if (el->el_history.ref == NULL)
- return CC_ERROR;
+ return (CC_ERROR);
hp = HIST_FIRST(el);
if (hp == NULL)
- return CC_ERROR;
+ return (CC_ERROR);
for (h = 1; h < el->el_history.eventno; h++)
if ((hp = HIST_NEXT(el)) == NULL) {
el->el_history.eventno = h;
- return CC_ERROR;
+ return (CC_ERROR);
}
- (void) Strncpy(el->el_line.buffer, hp,
+ (void) strlcpy(el->el_line.buffer, hp,
(size_t)(el->el_line.limit - el->el_line.buffer));
- el->el_line.buffer[el->el_line.limit - el->el_line.buffer - 1] = '\0';
- el->el_line.lastchar = el->el_line.buffer + Strlen(el->el_line.buffer);
+ el->el_line.lastchar = el->el_line.buffer + strlen(el->el_line.buffer);
if (el->el_line.lastchar > el->el_line.buffer
&& el->el_line.lastchar[-1] == '\n')
@@ -148,7 +143,7 @@ hist_get(EditLine *el)
#endif /* KSHVI */
el->el_line.cursor = el->el_line.lastchar;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -156,34 +151,34 @@ hist_get(EditLine *el)
* process a history command
*/
protected int
-hist_command(EditLine *el, int argc, const Char **argv)
+hist_command(EditLine *el, int argc, const char **argv)
{
- const Char *str;
+ const char *str;
int num;
- TYPE(HistEvent) ev;
+ HistEvent ev;
if (el->el_history.ref == NULL)
- return -1;
+ return (-1);
- if (argc == 1 || Strcmp(argv[1], STR("list")) == 0) {
+ if (argc == 1 || strcmp(argv[1], "list") == 0) {
/* List history entries */
for (str = HIST_LAST(el); str != NULL; str = HIST_PREV(el))
(void) fprintf(el->el_outfile, "%d %s",
- el->el_history.ev.num, ct_encode_string(str, &el->el_scratch));
- return 0;
+ el->el_history.ev.num, str);
+ return (0);
}
if (argc != 3)
- return -1;
+ return (-1);
- num = (int)Strtol(argv[2], NULL, 0);
+ num = (int)strtol(argv[2], NULL, 0);
- if (Strcmp(argv[1], STR("size")) == 0)
- return FUNW(history)(el->el_history.ref, &ev, H_SETSIZE, num);
+ if (strcmp(argv[1], "size") == 0)
+ return history(el->el_history.ref, &ev, H_SETSIZE, num);
- if (Strcmp(argv[1], STR("unique")) == 0)
- return FUNW(history)(el->el_history.ref, &ev, H_SETUNIQUE, num);
+ if (strcmp(argv[1], "unique") == 0)
+ return history(el->el_history.ref, &ev, H_SETUNIQUE, num);
return -1;
}
@@ -196,13 +191,13 @@ protected int
/*ARGSUSED*/
hist_enlargebuf(EditLine *el, size_t oldsz, size_t newsz)
{
- Char *newbuf;
+ char *newbuf;
- newbuf = el_realloc(el->el_history.buf, newsz * sizeof(*newbuf));
+ newbuf = realloc(el->el_history.buf, newsz);
if (!newbuf)
return 0;
- (void) memset(&newbuf[oldsz], '\0', (newsz - oldsz) * sizeof(*newbuf));
+ (void) memset(&newbuf[oldsz], '\0', newsz - oldsz);
el->el_history.last = newbuf +
(el->el_history.last - el->el_history.buf);
@@ -211,15 +206,3 @@ hist_enlargebuf(EditLine *el, size_t oldsz, size_t newsz)
return 1;
}
-
-#ifdef WIDECHAR
-protected wchar_t *
-hist_convert(EditLine *el, int fn, void *arg)
-{
- HistEventW ev;
- if ((*(el)->el_history.fun)((el)->el_history.ref, &ev, fn, arg) == -1)
- return NULL;
- return ct_decode_string((const char *)(const void *)ev.str,
- &el->el_scratch);
-}
-#endif
diff --git a/lib/libedit/hist.h b/lib/libedit/hist.h
index 1cd7d9d..4ddedcc 100644
--- a/lib/libedit/hist.h
+++ b/lib/libedit/hist.h
@@ -1,5 +1,3 @@
-/* $NetBSD: hist.h,v 1.14 2014/05/11 01:05:17 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +30,7 @@
* SUCH DAMAGE.
*
* @(#)hist.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: hist.h,v 1.10 2003/08/07 16:44:31 agc Exp $
* $FreeBSD$
*/
@@ -43,29 +42,21 @@
#include "histedit.h"
-typedef int (*hist_fun_t)(void *, TYPE(HistEvent) *, int, ...);
+typedef int (*hist_fun_t)(ptr_t, HistEvent *, int, ...);
typedef struct el_history_t {
- Char *buf; /* The history buffer */
+ char *buf; /* The history buffer */
size_t sz; /* Size of history buffer */
- Char *last; /* The last character */
+ char *last; /* The last character */
int eventno; /* Event we are looking for */
- void * ref; /* Argument for history fcns */
+ ptr_t ref; /* Argument for history fcns */
hist_fun_t fun; /* Event access */
- TYPE(HistEvent) ev; /* Event cookie */
+ HistEvent ev; /* Event cookie */
} el_history_t;
-#define HIST_FUN_INTERNAL(el, fn, arg) \
+#define HIST_FUN(el, fn, arg) \
((((*(el)->el_history.fun) ((el)->el_history.ref, &(el)->el_history.ev, \
fn, arg)) == -1) ? NULL : (el)->el_history.ev.str)
-#ifdef WIDECHAR
-#define HIST_FUN(el, fn, arg) \
- (((el)->el_flags & NARROW_HISTORY) ? hist_convert(el, fn, arg) : \
- HIST_FUN_INTERNAL(el, fn, arg))
-#else
-#define HIST_FUN(el, fn, arg) HIST_FUN_INTERNAL(el, fn, arg)
-#endif
-
#define HIST_NEXT(el) HIST_FUN(el, H_NEXT, NULL)
#define HIST_FIRST(el) HIST_FUN(el, H_FIRST, NULL)
@@ -79,11 +70,8 @@ typedef struct el_history_t {
protected int hist_init(EditLine *);
protected void hist_end(EditLine *);
protected el_action_t hist_get(EditLine *);
-protected int hist_set(EditLine *, hist_fun_t, void *);
-protected int hist_command(EditLine *, int, const Char **);
+protected int hist_set(EditLine *, hist_fun_t, ptr_t);
+protected int hist_command(EditLine *, int, const char **);
protected int hist_enlargebuf(EditLine *, size_t, size_t);
-#ifdef WIDECHAR
-protected wchar_t *hist_convert(EditLine *, int, void *);
-#endif
#endif /* _h_el_hist */
diff --git a/lib/libedit/histedit.h b/lib/libedit/histedit.h
index bed186e..7cc5246 100644
--- a/lib/libedit/histedit.h
+++ b/lib/libedit/histedit.h
@@ -1,5 +1,3 @@
-/* $NetBSD: histedit.h,v 1.53 2014/06/18 18:12:28 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +30,7 @@
* SUCH DAMAGE.
*
* @(#)histedit.h 8.2 (Berkeley) 1/3/94
+ * $NetBSD: histedit.h,v 1.41 2009/09/07 21:24:33 christos Exp $
* $FreeBSD$
*/
@@ -41,12 +40,10 @@
#ifndef _HISTEDIT_H_
#define _HISTEDIT_H_
-#define LIBEDIT_MAJOR 2
-#define LIBEDIT_MINOR 11
-
#include <sys/types.h>
#include <stdio.h>
+__BEGIN_DECLS
#ifdef __cplusplus
extern "C" {
#endif
@@ -85,8 +82,6 @@ typedef struct lineinfo {
* Initialization, cleanup, and resetting
*/
EditLine *el_init(const char *, FILE *, FILE *, FILE *);
-EditLine *el_init_fd(const char *, FILE *, FILE *, FILE *,
- int, int, int);
void el_end(EditLine *);
void el_reset(EditLine *);
@@ -118,47 +113,32 @@ unsigned char _el_fn_sh_complete(EditLine *, int);
/*
* el_set/el_get parameters
- *
- * When using el_wset/el_wget (as opposed to el_set/el_get):
- * Char is wchar_t, otherwise it is char.
- * prompt_func is el_wpfunc_t, otherwise it is el_pfunc_t .
-
- * Prompt function prototypes are:
- * typedef char *(*el_pfunct_t) (EditLine *);
- * typedef wchar_t *(*el_wpfunct_t) (EditLine *);
- *
- * For operations that support set or set/get, the argument types listed are for
- * the "set" operation. For "get", each listed type must be a pointer.
- * E.g. EL_EDITMODE takes an int when set, but an int* when get.
- *
- * Operations that only support "get" have the correct argument types listed.
*/
-#define EL_PROMPT 0 /* , prompt_func); set/get */
-#define EL_TERMINAL 1 /* , const char *); set/get */
-#define EL_EDITOR 2 /* , const Char *); set/get */
-#define EL_SIGNAL 3 /* , int); set/get */
-#define EL_BIND 4 /* , const Char *, ..., NULL); set */
-#define EL_TELLTC 5 /* , const Char *, ..., NULL); set */
-#define EL_SETTC 6 /* , const Char *, ..., NULL); set */
-#define EL_ECHOTC 7 /* , const Char *, ..., NULL); set */
-#define EL_SETTY 8 /* , const Char *, ..., NULL); set */
-#define EL_ADDFN 9 /* , const Char *, const Char, set */
- /* el_func_t); */
-#define EL_HIST 10 /* , hist_fun_t, const void *); set */
-#define EL_EDITMODE 11 /* , int); set/get */
-#define EL_RPROMPT 12 /* , prompt_func); set/get */
-#define EL_GETCFN 13 /* , el_rfunc_t); set/get */
-#define EL_CLIENTDATA 14 /* , void *); set/get */
-#define EL_UNBUFFERED 15 /* , int); set/get */
-#define EL_PREP_TERM 16 /* , int); set */
-#define EL_GETTC 17 /* , const Char *, ..., NULL); get */
-#define EL_GETFP 18 /* , int, FILE **); get */
-#define EL_SETFP 19 /* , int, FILE *); set */
+#define EL_PROMPT 0 /* , el_pfunc_t); */
+#define EL_TERMINAL 1 /* , const char *); */
+#define EL_EDITOR 2 /* , const char *); */
+#define EL_SIGNAL 3 /* , int); */
+#define EL_BIND 4 /* , const char *, ..., NULL); */
+#define EL_TELLTC 5 /* , const char *, ..., NULL); */
+#define EL_SETTC 6 /* , const char *, ..., NULL); */
+#define EL_ECHOTC 7 /* , const char *, ..., NULL); */
+#define EL_SETTY 8 /* , const char *, ..., NULL); */
+#define EL_ADDFN 9 /* , const char *, const char * */
+ /* , el_func_t); */
+#define EL_HIST 10 /* , hist_fun_t, const char *); */
+#define EL_EDITMODE 11 /* , int); */
+#define EL_RPROMPT 12 /* , el_pfunc_t); */
+#define EL_GETCFN 13 /* , el_rfunc_t); */
+#define EL_CLIENTDATA 14 /* , void *); */
+#define EL_UNBUFFERED 15 /* , int); */
+#define EL_PREP_TERM 16 /* , int); */
+#define EL_GETTC 17 /* , const char *, ..., NULL); */
+#define EL_GETFP 18 /* , int, FILE **); */
+#define EL_SETFP 19 /* , int, FILE *); */
#define EL_REFRESH 20 /* , void); set */
#define EL_PROMPT_ESC 21 /* , prompt_func, Char); set/get */
#define EL_RPROMPT_ESC 22 /* , prompt_func, Char); set/get */
#define EL_RESIZE 23 /* , el_zfunc_t, void *); set */
-#define EL_ALIAS_TEXT 24 /* , el_afunc_t, void *); set */
#define EL_BUILTIN_GETCFN (NULL)
@@ -203,6 +183,7 @@ int history(History *, HistEvent *, int, ...);
#define H_FUNC 0 /* , UTSL */
#define H_SETSIZE 1 /* , const int); */
+#define H_EVENT 1 /* , const int); */
#define H_GETSIZE 2 /* , void); */
#define H_FIRST 3 /* , void); */
#define H_LAST 4 /* , void); */
@@ -210,12 +191,12 @@ int history(History *, HistEvent *, int, ...);
#define H_NEXT 6 /* , void); */
#define H_CURR 8 /* , const int); */
#define H_SET 7 /* , int); */
-#define H_ADD 9 /* , const wchar_t *); */
-#define H_ENTER 10 /* , const wchar_t *); */
-#define H_APPEND 11 /* , const wchar_t *); */
+#define H_ADD 9 /* , const char *); */
+#define H_ENTER 10 /* , const char *); */
+#define H_APPEND 11 /* , const char *); */
#define H_END 12 /* , void); */
-#define H_NEXT_STR 13 /* , const wchar_t *); */
-#define H_PREV_STR 14 /* , const wchar_t *); */
+#define H_NEXT_STR 13 /* , const char *); */
+#define H_PREV_STR 14 /* , const char *); */
#define H_NEXT_EVENT 15 /* , const int); */
#define H_PREV_EVENT 16 /* , const int); */
#define H_LOAD 17 /* , const char *); */
@@ -227,8 +208,7 @@ int history(History *, HistEvent *, int, ...);
#define H_NEXT_EVDATA 23 /* , const int, histdata_t *); */
#define H_DELDATA 24 /* , int, histdata_t *);*/
#define H_REPLACE 25 /* , const char *, histdata_t); */
-#define H_SAVE_FP 26 /* , FILE *); */
-
+#define H_SAVE_FP 26 /* , FILE*); */
/*
@@ -248,75 +228,7 @@ int tok_line(Tokenizer *, const LineInfo *,
int tok_str(Tokenizer *, const char *,
int *, const char ***);
-/*
- * Begin Wide Character Support
- */
-#ifdef __linux__
-/* Apparently we need _GNU_SOURCE defined to get access to wcsdup on Linux */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-#endif
-
-#include <wchar.h>
-#include <wctype.h>
-
-/*
- * Wide character versions
- */
-
-/*
- * ==== Editing ====
- */
-typedef struct lineinfow {
- const wchar_t *buffer;
- const wchar_t *cursor;
- const wchar_t *lastchar;
-} LineInfoW;
-
-const wchar_t *el_wgets(EditLine *, int *);
-int el_wgetc(EditLine *, wchar_t *);
-void el_wpush(EditLine *, const wchar_t *);
-
-int el_wparse(EditLine *, int, const wchar_t **);
-
-int el_wset(EditLine *, int, ...);
-int el_wget(EditLine *, int, ...);
-
-int el_cursor(EditLine *, int);
-const LineInfoW *el_wline(EditLine *);
-int el_winsertstr(EditLine *, const wchar_t *);
-#define el_wdeletestr el_deletestr
-
-/*
- * ==== History ====
- */
-typedef struct histeventW {
- int num;
- const wchar_t *str;
-} HistEventW;
-
-typedef struct historyW HistoryW;
-
-HistoryW * history_winit(void);
-void history_wend(HistoryW *);
-
-int history_w(HistoryW *, HistEventW *, int, ...);
-
-/*
- * ==== Tokenization ====
- */
-typedef struct tokenizerW TokenizerW;
-
-/* Wide character tokenizer support */
-TokenizerW *tok_winit(const wchar_t *);
-void tok_wend(TokenizerW *);
-void tok_wreset(TokenizerW *);
-int tok_wline(TokenizerW *, const LineInfoW *,
- int *, const wchar_t ***, int *, int *);
-int tok_wstr(TokenizerW *, const wchar_t *,
- int *, const wchar_t ***);
-
+__END_DECLS
#ifdef __cplusplus
}
#endif
diff --git a/lib/libedit/history.c b/lib/libedit/history.c
index 6e225e9..cd86977 100644
--- a/lib/libedit/history.c
+++ b/lib/libedit/history.c
@@ -1,5 +1,3 @@
-/* $NetBSD: history.c,v 1.47 2014/05/11 01:05:17 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,22 +28,21 @@
* LIABILITY, OR TORT (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: history.c,v 1.34 2009/09/07 21:24:33 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)history.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: history.c,v 1.47 2014/05/11 01:05:17 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
- * hist.c: TYPE(History) access functions
+ * hist.c: History access functions
*/
+#include "sys.h"
+
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -55,15 +52,14 @@ __FBSDID("$FreeBSD$");
static const char hist_cookie[] = "_HiStOrY_V2_\n";
#include "histedit.h"
-#include "chartype.h"
-typedef int (*history_gfun_t)(void *, TYPE(HistEvent) *);
-typedef int (*history_efun_t)(void *, TYPE(HistEvent) *, const Char *);
-typedef void (*history_vfun_t)(void *, TYPE(HistEvent) *);
-typedef int (*history_sfun_t)(void *, TYPE(HistEvent) *, const int);
+typedef int (*history_gfun_t)(ptr_t, HistEvent *);
+typedef int (*history_efun_t)(ptr_t, HistEvent *, const char *);
+typedef void (*history_vfun_t)(ptr_t, HistEvent *);
+typedef int (*history_sfun_t)(ptr_t, HistEvent *, const int);
-struct TYPE(history) {
- void *h_ref; /* Argument for history fcns */
+struct history {
+ ptr_t h_ref; /* Argument for history fcns */
int h_ent; /* Last entry point for history */
history_gfun_t h_first; /* Get the first element */
history_gfun_t h_next; /* Get the next element */
@@ -88,30 +84,30 @@ struct TYPE(history) {
#define HADD(h, ev, str) (*(h)->h_add)((h)->h_ref, ev, str)
#define HDEL(h, ev, n) (*(h)->h_del)((h)->h_ref, ev, n)
-#define h_strdup(a) Strdup(a)
+#define h_strdup(a) strdup(a)
#define h_malloc(a) malloc(a)
#define h_realloc(a, b) realloc((a), (b))
#define h_free(a) free(a)
typedef struct {
int num;
- Char *str;
+ char *str;
} HistEventPrivate;
-private int history_setsize(TYPE(History) *, TYPE(HistEvent) *, int);
-private int history_getsize(TYPE(History) *, TYPE(HistEvent) *);
-private int history_setunique(TYPE(History) *, TYPE(HistEvent) *, int);
-private int history_getunique(TYPE(History) *, TYPE(HistEvent) *);
-private int history_set_fun(TYPE(History) *, TYPE(History) *);
-private int history_load(TYPE(History) *, const char *);
-private int history_save(TYPE(History) *, const char *);
-private int history_save_fp(TYPE(History) *, FILE *);
-private int history_prev_event(TYPE(History) *, TYPE(HistEvent) *, int);
-private int history_next_event(TYPE(History) *, TYPE(HistEvent) *, int);
-private int history_next_string(TYPE(History) *, TYPE(HistEvent) *, const Char *);
-private int history_prev_string(TYPE(History) *, TYPE(HistEvent) *, const Char *);
+private int history_setsize(History *, HistEvent *, int);
+private int history_getsize(History *, HistEvent *);
+private int history_setunique(History *, HistEvent *, int);
+private int history_getunique(History *, HistEvent *);
+private int history_set_fun(History *, History *);
+private int history_load(History *, const char *);
+private int history_save(History *, const char *);
+private int history_save_fp(History *, FILE*);
+private int history_prev_event(History *, HistEvent *, int);
+private int history_next_event(History *, HistEvent *, int);
+private int history_next_string(History *, HistEvent *, const char *);
+private int history_prev_string(History *, HistEvent *, const char *);
/***********************************************************************/
@@ -120,7 +116,7 @@ private int history_prev_string(TYPE(History) *, TYPE(HistEvent) *, const Char *
* Builtin- history implementation
*/
typedef struct hentry_t {
- TYPE(HistEvent) ev; /* What we return */
+ HistEvent ev; /* What we return */
void *data; /* data */
struct hentry_t *next; /* Next entry */
struct hentry_t *prev; /* Previous entry */
@@ -132,27 +128,27 @@ typedef struct history_t {
int max; /* Maximum number of events */
int cur; /* Current number of events */
int eventid; /* For generation of unique event id */
- int flags; /* TYPE(History) flags */
+ int flags; /* History flags */
#define H_UNIQUE 1 /* Store only unique elements */
} history_t;
-private int history_def_next(void *, TYPE(HistEvent) *);
-private int history_def_first(void *, TYPE(HistEvent) *);
-private int history_def_prev(void *, TYPE(HistEvent) *);
-private int history_def_last(void *, TYPE(HistEvent) *);
-private int history_def_curr(void *, TYPE(HistEvent) *);
-private int history_def_set(void *, TYPE(HistEvent) *, const int);
-private void history_def_clear(void *, TYPE(HistEvent) *);
-private int history_def_enter(void *, TYPE(HistEvent) *, const Char *);
-private int history_def_add(void *, TYPE(HistEvent) *, const Char *);
-private int history_def_del(void *, TYPE(HistEvent) *, const int);
+private int history_def_next(ptr_t, HistEvent *);
+private int history_def_first(ptr_t, HistEvent *);
+private int history_def_prev(ptr_t, HistEvent *);
+private int history_def_last(ptr_t, HistEvent *);
+private int history_def_curr(ptr_t, HistEvent *);
+private int history_def_set(ptr_t, HistEvent *, const int);
+private void history_def_clear(ptr_t, HistEvent *);
+private int history_def_enter(ptr_t, HistEvent *, const char *);
+private int history_def_add(ptr_t, HistEvent *, const char *);
+private int history_def_del(ptr_t, HistEvent *, const int);
-private int history_def_init(void **, TYPE(HistEvent) *, int);
-private int history_def_insert(history_t *, TYPE(HistEvent) *, const Char *);
-private void history_def_delete(history_t *, TYPE(HistEvent) *, hentry_t *);
+private int history_def_init(ptr_t *, HistEvent *, int);
+private int history_def_insert(history_t *, HistEvent *, const char *);
+private void history_def_delete(history_t *, HistEvent *, hentry_t *);
-private int history_deldata_nth(history_t *, TYPE(HistEvent) *, int, void **);
-private int history_set_nth(void *, TYPE(HistEvent) *, int);
+private int history_deldata_nth(history_t *, HistEvent *, int, void **);
+private int history_set_nth(ptr_t, HistEvent *, int);
#define history_def_setsize(p, num)(void) (((history_t *)p)->max = (num))
#define history_def_getsize(p) (((history_t *)p)->cur)
@@ -170,23 +166,23 @@ private int history_set_nth(void *, TYPE(HistEvent) *, int);
}
/* error messages */
-static const Char *const he_errlist[] = {
- STR("OK"),
- STR("unknown error"),
- STR("malloc() failed"),
- STR("first event not found"),
- STR("last event not found"),
- STR("empty list"),
- STR("no next event"),
- STR("no previous event"),
- STR("current event is invalid"),
- STR("event not found"),
- STR("can't read history from file"),
- STR("can't write history"),
- STR("required parameter(s) not supplied"),
- STR("history size negative"),
- STR("function not allowed with other history-functions-set the default"),
- STR("bad parameters")
+static const char *const he_errlist[] = {
+ "OK",
+ "unknown error",
+ "malloc() failed",
+ "first event not found",
+ "last event not found",
+ "empty list",
+ "no next event",
+ "no previous event",
+ "current event is invalid",
+ "event not found",
+ "can't read history from file",
+ "can't write history",
+ "required parameter(s) not supplied",
+ "history size negative",
+ "function not allowed with other history-functions-set the default",
+ "bad parameters"
};
/* error codes */
#define _HE_OK 0
@@ -210,7 +206,7 @@ static const Char *const he_errlist[] = {
* Default function to return the first event in the history.
*/
private int
-history_def_first(void *p, TYPE(HistEvent) *ev)
+history_def_first(ptr_t p, HistEvent *ev)
{
history_t *h = (history_t *) p;
@@ -219,10 +215,10 @@ history_def_first(void *p, TYPE(HistEvent) *ev)
*ev = h->cursor->ev;
else {
he_seterrev(ev, _HE_FIRST_NOTFOUND);
- return -1;
+ return (-1);
}
- return 0;
+ return (0);
}
@@ -230,7 +226,7 @@ history_def_first(void *p, TYPE(HistEvent) *ev)
* Default function to return the last event in the history.
*/
private int
-history_def_last(void *p, TYPE(HistEvent) *ev)
+history_def_last(ptr_t p, HistEvent *ev)
{
history_t *h = (history_t *) p;
@@ -239,10 +235,10 @@ history_def_last(void *p, TYPE(HistEvent) *ev)
*ev = h->cursor->ev;
else {
he_seterrev(ev, _HE_LAST_NOTFOUND);
- return -1;
+ return (-1);
}
- return 0;
+ return (0);
}
@@ -250,24 +246,24 @@ history_def_last(void *p, TYPE(HistEvent) *ev)
* Default function to return the next event in the history.
*/
private int
-history_def_next(void *p, TYPE(HistEvent) *ev)
+history_def_next(ptr_t p, HistEvent *ev)
{
history_t *h = (history_t *) p;
if (h->cursor == &h->list) {
he_seterrev(ev, _HE_EMPTY_LIST);
- return -1;
+ return (-1);
}
if (h->cursor->next == &h->list) {
he_seterrev(ev, _HE_END_REACHED);
- return -1;
+ return (-1);
}
h->cursor = h->cursor->next;
*ev = h->cursor->ev;
- return 0;
+ return (0);
}
@@ -275,25 +271,25 @@ history_def_next(void *p, TYPE(HistEvent) *ev)
* Default function to return the previous event in the history.
*/
private int
-history_def_prev(void *p, TYPE(HistEvent) *ev)
+history_def_prev(ptr_t p, HistEvent *ev)
{
history_t *h = (history_t *) p;
if (h->cursor == &h->list) {
he_seterrev(ev,
(h->cur > 0) ? _HE_END_REACHED : _HE_EMPTY_LIST);
- return -1;
+ return (-1);
}
if (h->cursor->prev == &h->list) {
he_seterrev(ev, _HE_START_REACHED);
- return -1;
+ return (-1);
}
h->cursor = h->cursor->prev;
*ev = h->cursor->ev;
- return 0;
+ return (0);
}
@@ -301,7 +297,7 @@ history_def_prev(void *p, TYPE(HistEvent) *ev)
* Default function to return the current event in the history.
*/
private int
-history_def_curr(void *p, TYPE(HistEvent) *ev)
+history_def_curr(ptr_t p, HistEvent *ev)
{
history_t *h = (history_t *) p;
@@ -310,10 +306,10 @@ history_def_curr(void *p, TYPE(HistEvent) *ev)
else {
he_seterrev(ev,
(h->cur > 0) ? _HE_CURR_INVALID : _HE_EMPTY_LIST);
- return -1;
+ return (-1);
}
- return 0;
+ return (0);
}
@@ -322,13 +318,13 @@ history_def_curr(void *p, TYPE(HistEvent) *ev)
* given one.
*/
private int
-history_def_set(void *p, TYPE(HistEvent) *ev, const int n)
+history_def_set(ptr_t p, HistEvent *ev, const int n)
{
history_t *h = (history_t *) p;
if (h->cur == 0) {
he_seterrev(ev, _HE_EMPTY_LIST);
- return -1;
+ return (-1);
}
if (h->cursor == &h->list || h->cursor->ev.num != n) {
for (h->cursor = h->list.next; h->cursor != &h->list;
@@ -338,9 +334,9 @@ history_def_set(void *p, TYPE(HistEvent) *ev, const int n)
}
if (h->cursor == &h->list) {
he_seterrev(ev, _HE_NOT_FOUND);
- return -1;
+ return (-1);
}
- return 0;
+ return (0);
}
@@ -349,13 +345,13 @@ history_def_set(void *p, TYPE(HistEvent) *ev, const int n)
* n-th one.
*/
private int
-history_set_nth(void *p, TYPE(HistEvent) *ev, int n)
+history_set_nth(ptr_t p, HistEvent *ev, int n)
{
history_t *h = (history_t *) p;
if (h->cur == 0) {
he_seterrev(ev, _HE_EMPTY_LIST);
- return -1;
+ return (-1);
}
for (h->cursor = h->list.prev; h->cursor != &h->list;
h->cursor = h->cursor->prev)
@@ -363,9 +359,9 @@ history_set_nth(void *p, TYPE(HistEvent) *ev, int n)
break;
if (h->cursor == &h->list) {
he_seterrev(ev, _HE_NOT_FOUND);
- return -1;
+ return (-1);
}
- return 0;
+ return (0);
}
@@ -373,46 +369,45 @@ history_set_nth(void *p, TYPE(HistEvent) *ev, int n)
* Append string to element
*/
private int
-history_def_add(void *p, TYPE(HistEvent) *ev, const Char *str)
+history_def_add(ptr_t p, HistEvent *ev, const char *str)
{
history_t *h = (history_t *) p;
size_t len;
- Char *s;
+ char *s;
HistEventPrivate *evp = (void *)&h->cursor->ev;
if (h->cursor == &h->list)
- return history_def_enter(p, ev, str);
- len = Strlen(evp->str) + Strlen(str) + 1;
- s = h_malloc(len * sizeof(*s));
+ return (history_def_enter(p, ev, str));
+ len = strlen(evp->str) + strlen(str) + 1;
+ s = (char *) h_malloc(len);
if (s == NULL) {
he_seterrev(ev, _HE_MALLOC_FAILED);
- return -1;
+ return (-1);
}
- (void) Strncpy(s, h->cursor->ev.str, len);
- s[len - 1] = '\0';
- (void) Strncat(s, str, len - Strlen(s) - 1);
- h_free(evp->str);
+ (void) strlcpy(s, h->cursor->ev.str, len);
+ (void) strlcat(s, str, len);
+ h_free((ptr_t)evp->str);
evp->str = s;
*ev = h->cursor->ev;
- return 0;
+ return (0);
}
private int
-history_deldata_nth(history_t *h, TYPE(HistEvent) *ev,
+history_deldata_nth(history_t *h, HistEvent *ev,
int num, void **data)
{
if (history_set_nth(h, ev, num) != 0)
- return -1;
+ return (-1);
/* magic value to skip delete (just set to n-th history) */
if (data == (void **)-1)
- return 0;
- ev->str = Strdup(h->cursor->ev.str);
+ return (0);
+ ev->str = strdup(h->cursor->ev.str);
ev->num = h->cursor->ev.num;
if (data)
*data = h->cursor->data;
history_def_delete(h, ev, h->cursor);
- return 0;
+ return (0);
}
@@ -421,16 +416,16 @@ history_deldata_nth(history_t *h, TYPE(HistEvent) *ev,
*/
/* ARGSUSED */
private int
-history_def_del(void *p, TYPE(HistEvent) *ev __attribute__((__unused__)),
+history_def_del(ptr_t p, HistEvent *ev __unused,
const int num)
{
history_t *h = (history_t *) p;
if (history_def_set(h, ev, num) != 0)
- return -1;
- ev->str = Strdup(h->cursor->ev.str);
+ return (-1);
+ ev->str = strdup(h->cursor->ev.str);
ev->num = h->cursor->ev.num;
history_def_delete(h, ev, h->cursor);
- return 0;
+ return (0);
}
@@ -440,7 +435,7 @@ history_def_del(void *p, TYPE(HistEvent) *ev __attribute__((__unused__)),
/* ARGSUSED */
private void
history_def_delete(history_t *h,
- TYPE(HistEvent) *ev __attribute__((__unused__)), hentry_t *hp)
+ HistEvent *ev __unused, hentry_t *hp)
{
HistEventPrivate *evp = (void *)&hp->ev;
if (hp == &h->list)
@@ -452,7 +447,7 @@ history_def_delete(history_t *h,
}
hp->prev->next = hp->next;
hp->next->prev = hp->prev;
- h_free(evp->str);
+ h_free((ptr_t) evp->str);
h_free(hp);
h->cur--;
}
@@ -462,31 +457,29 @@ history_def_delete(history_t *h,
* Insert element with string str in the h list
*/
private int
-history_def_insert(history_t *h, TYPE(HistEvent) *ev, const Char *str)
+history_def_insert(history_t *h, HistEvent *ev, const char *str)
{
- hentry_t *c;
- c = h_malloc(sizeof(*c));
- if (c == NULL)
+ h->cursor = (hentry_t *) h_malloc(sizeof(hentry_t));
+ if (h->cursor == NULL)
goto oomem;
- if ((c->ev.str = h_strdup(str)) == NULL) {
- h_free(c);
+ if ((h->cursor->ev.str = h_strdup(str)) == NULL) {
+ h_free((ptr_t)h->cursor);
goto oomem;
}
- c->data = NULL;
- c->ev.num = ++h->eventid;
- c->next = h->list.next;
- c->prev = &h->list;
- h->list.next->prev = c;
- h->list.next = c;
+ h->cursor->data = NULL;
+ h->cursor->ev.num = ++h->eventid;
+ h->cursor->next = h->list.next;
+ h->cursor->prev = &h->list;
+ h->list.next->prev = h->cursor;
+ h->list.next = h->cursor;
h->cur++;
- h->cursor = c;
- *ev = c->ev;
- return 0;
+ *ev = h->cursor->ev;
+ return (0);
oomem:
he_seterrev(ev, _HE_MALLOC_FAILED);
- return -1;
+ return (-1);
}
@@ -494,16 +487,16 @@ oomem:
* Default function to enter an item in the history
*/
private int
-history_def_enter(void *p, TYPE(HistEvent) *ev, const Char *str)
+history_def_enter(ptr_t p, HistEvent *ev, const char *str)
{
history_t *h = (history_t *) p;
if ((h->flags & H_UNIQUE) != 0 && h->list.next != &h->list &&
- Strcmp(h->list.next->ev.str, str) == 0)
- return 0;
+ strcmp(h->list.next->ev.str, str) == 0)
+ return (0);
if (history_def_insert(h, ev, str) == -1)
- return -1; /* error, keep error message */
+ return (-1); /* error, keep error message */
/*
* Always keep at least one entry.
@@ -512,7 +505,7 @@ history_def_enter(void *p, TYPE(HistEvent) *ev, const Char *str)
while (h->cur > h->max && h->cur > 0)
history_def_delete(h, ev, h->list.prev);
- return 1;
+ return (1);
}
@@ -521,9 +514,9 @@ history_def_enter(void *p, TYPE(HistEvent) *ev, const Char *str)
*/
/* ARGSUSED */
private int
-history_def_init(void **p, TYPE(HistEvent) *ev __attribute__((__unused__)), int n)
+history_def_init(ptr_t *p, HistEvent *ev __unused, int n)
{
- history_t *h = (history_t *) h_malloc(sizeof(*h));
+ history_t *h = (history_t *) h_malloc(sizeof(history_t));
if (h == NULL)
return -1;
@@ -537,7 +530,7 @@ history_def_init(void **p, TYPE(HistEvent) *ev __attribute__((__unused__)), int
h->list.ev.num = 0;
h->cursor = &h->list;
h->flags = 0;
- *p = h;
+ *p = (ptr_t) h;
return 0;
}
@@ -546,13 +539,12 @@ history_def_init(void **p, TYPE(HistEvent) *ev __attribute__((__unused__)), int
* Default history cleanup function
*/
private void
-history_def_clear(void *p, TYPE(HistEvent) *ev)
+history_def_clear(ptr_t p, HistEvent *ev)
{
history_t *h = (history_t *) p;
while (h->list.prev != &h->list)
history_def_delete(h, ev, h->list.prev);
- h->cursor = &h->list;
h->eventid = 0;
h->cur = 0;
}
@@ -565,16 +557,16 @@ history_def_clear(void *p, TYPE(HistEvent) *ev)
/* history_init():
* Initialization function.
*/
-public TYPE(History) *
-FUN(history,init)(void)
+public History *
+history_init(void)
{
- TYPE(HistEvent) ev;
- TYPE(History) *h = (TYPE(History) *) h_malloc(sizeof(*h));
+ HistEvent ev;
+ History *h = (History *) h_malloc(sizeof(History));
if (h == NULL)
return NULL;
if (history_def_init(&h->h_ref, &ev, 0) == -1) {
- h_free(h);
+ h_free((ptr_t)h);
return NULL;
}
h->h_ent = -1;
@@ -589,7 +581,7 @@ FUN(history,init)(void)
h->h_add = history_def_add;
h->h_del = history_def_del;
- return h;
+ return (h);
}
@@ -597,9 +589,9 @@ FUN(history,init)(void)
* clean up history;
*/
public void
-FUN(history,end)(TYPE(History) *h)
+history_end(History *h)
{
- TYPE(HistEvent) ev;
+ HistEvent ev;
if (h->h_next == history_def_next)
history_def_clear(h->h_ref, &ev);
@@ -613,19 +605,19 @@ FUN(history,end)(TYPE(History) *h)
* Set history number of events
*/
private int
-history_setsize(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
+history_setsize(History *h, HistEvent *ev, int num)
{
if (h->h_next != history_def_next) {
he_seterrev(ev, _HE_NOT_ALLOWED);
- return -1;
+ return (-1);
}
if (num < 0) {
he_seterrev(ev, _HE_BAD_PARAM);
- return -1;
+ return (-1);
}
history_def_setsize(h->h_ref, num);
- return 0;
+ return (0);
}
@@ -633,18 +625,18 @@ history_setsize(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
* Get number of events currently in history
*/
private int
-history_getsize(TYPE(History) *h, TYPE(HistEvent) *ev)
+history_getsize(History *h, HistEvent *ev)
{
if (h->h_next != history_def_next) {
he_seterrev(ev, _HE_NOT_ALLOWED);
- return -1;
+ return (-1);
}
ev->num = history_def_getsize(h->h_ref);
if (ev->num < -1) {
he_seterrev(ev, _HE_SIZE_NEGATIVE);
- return -1;
+ return (-1);
}
- return 0;
+ return (0);
}
@@ -652,15 +644,15 @@ history_getsize(TYPE(History) *h, TYPE(HistEvent) *ev)
* Set if adjacent equal events should not be entered in history.
*/
private int
-history_setunique(TYPE(History) *h, TYPE(HistEvent) *ev, int uni)
+history_setunique(History *h, HistEvent *ev, int uni)
{
if (h->h_next != history_def_next) {
he_seterrev(ev, _HE_NOT_ALLOWED);
- return -1;
+ return (-1);
}
history_def_setunique(h->h_ref, uni);
- return 0;
+ return (0);
}
@@ -668,14 +660,14 @@ history_setunique(TYPE(History) *h, TYPE(HistEvent) *ev, int uni)
* Get if adjacent equal events should not be entered in history.
*/
private int
-history_getunique(TYPE(History) *h, TYPE(HistEvent) *ev)
+history_getunique(History *h, HistEvent *ev)
{
if (h->h_next != history_def_next) {
he_seterrev(ev, _HE_NOT_ALLOWED);
- return -1;
+ return (-1);
}
ev->num = history_def_getunique(h->h_ref);
- return 0;
+ return (0);
}
@@ -683,17 +675,16 @@ history_getunique(TYPE(History) *h, TYPE(HistEvent) *ev)
* Set history functions
*/
private int
-history_set_fun(TYPE(History) *h, TYPE(History) *nh)
+history_set_fun(History *h, History *nh)
{
- TYPE(HistEvent) ev;
+ HistEvent ev;
if (nh->h_first == NULL || nh->h_next == NULL || nh->h_last == NULL ||
nh->h_prev == NULL || nh->h_curr == NULL || nh->h_set == NULL ||
nh->h_enter == NULL || nh->h_add == NULL || nh->h_clear == NULL ||
nh->h_del == NULL || nh->h_ref == NULL) {
if (h->h_next != history_def_next) {
- if (history_def_init(&h->h_ref, &ev, 0) == -1)
- return -1;
+ history_def_init(&h->h_ref, &ev, 0);
h->h_first = history_def_first;
h->h_next = history_def_next;
h->h_last = history_def_last;
@@ -705,7 +696,7 @@ history_set_fun(TYPE(History) *h, TYPE(History) *nh)
h->h_add = history_def_add;
h->h_del = history_def_del;
}
- return -1;
+ return (-1);
}
if (h->h_next == history_def_next)
history_def_clear(h->h_ref, &ev);
@@ -722,28 +713,25 @@ history_set_fun(TYPE(History) *h, TYPE(History) *nh)
h->h_add = nh->h_add;
h->h_del = nh->h_del;
- return 0;
+ return (0);
}
/* history_load():
- * TYPE(History) load function
+ * History load function
*/
private int
-history_load(TYPE(History) *h, const char *fname)
+history_load(History *h, const char *fname)
{
FILE *fp;
char *line;
size_t sz, max_size;
char *ptr;
int i = -1;
- TYPE(HistEvent) ev;
-#ifdef WIDECHAR
- static ct_buffer_t conv;
-#endif
+ HistEvent ev;
if ((fp = fopen(fname, "r")) == NULL)
- return i;
+ return (i);
if ((line = fgetln(fp, &sz)) == NULL)
goto done;
@@ -751,7 +739,7 @@ history_load(TYPE(History) *h, const char *fname)
if (strncmp(line, hist_cookie, sz) != 0)
goto done;
- ptr = h_malloc((max_size = 1024) * sizeof(*ptr));
+ ptr = h_malloc(max_size = 1024);
if (ptr == NULL)
goto done;
for (i = 0; (line = fgetln(fp, &sz)) != NULL; i++) {
@@ -764,8 +752,8 @@ history_load(TYPE(History) *h, const char *fname)
if (max_size < sz) {
char *nptr;
- max_size = (sz + 1024) & (size_t)~1023;
- nptr = h_realloc(ptr, max_size * sizeof(*ptr));
+ max_size = (sz + 1024) & ~1023;
+ nptr = h_realloc(ptr, max_size);
if (nptr == NULL) {
i = -1;
goto oomem;
@@ -774,82 +762,77 @@ history_load(TYPE(History) *h, const char *fname)
}
(void) strunvis(ptr, line);
line[sz] = c;
- if (HENTER(h, &ev, ct_decode_string(ptr, &conv)) == -1) {
+ if (HENTER(h, &ev, ptr) == -1) {
i = -1;
goto oomem;
}
}
oomem:
- h_free(ptr);
+ h_free((ptr_t)ptr);
done:
(void) fclose(fp);
- return i;
+ return (i);
}
-
/* history_save_fp():
- * TYPE(History) save function
+ * History save with open FILE*
*/
-private int
-history_save_fp(TYPE(History) *h, FILE *fp)
+private int history_save_fp(History *h, FILE* fp)
{
- TYPE(HistEvent) ev;
+ HistEvent ev;
int i = -1, retval;
size_t len, max_size;
char *ptr;
- const char *str;
-#ifdef WIDECHAR
- static ct_buffer_t conv;
-#endif
if (fchmod(fileno(fp), S_IRUSR|S_IWUSR) == -1)
goto done;
if (fputs(hist_cookie, fp) == EOF)
goto done;
- ptr = h_malloc((max_size = 1024) * sizeof(*ptr));
+ ptr = h_malloc(max_size = 1024);
if (ptr == NULL)
goto done;
for (i = 0, retval = HLAST(h, &ev);
retval != -1;
retval = HPREV(h, &ev), i++) {
- str = ct_encode_string(ev.str, &conv);
- len = strlen(str) * 4;
+ len = strlen(ev.str) * 4;
if (len >= max_size) {
char *nptr;
- max_size = (len + 1024) & (size_t)~1023;
- nptr = h_realloc(ptr, max_size * sizeof(*ptr));
+ max_size = (len + 1024) & ~1023;
+ nptr = h_realloc(ptr, max_size);
if (nptr == NULL) {
i = -1;
goto oomem;
}
ptr = nptr;
}
- (void) strvis(ptr, str, VIS_WHITE);
+ (void) strvis(ptr, ev.str, VIS_WHITE);
(void) fprintf(fp, "%s\n", ptr);
}
oomem:
- h_free(ptr);
+ h_free((ptr_t)ptr);
done:
- return i;
+ return (i);
+
}
/* history_save():
- * History save function
+ * History save function
*/
private int
-history_save(TYPE(History) *h, const char *fname)
+history_save(History *h, const char *fname)
{
- FILE *fp;
- int i;
+ FILE *fp;
+ int i;
- if ((fp = fopen(fname, "w")) == NULL)
- return -1;
+ if ((fp = fopen(fname, "w")) == NULL)
+ return (-1);
- i = history_save_fp(h, fp);
+ i = history_save_fp(h, fp);
- (void) fclose(fp);
- return i;
+done:
+ (void) fclose(fp);
+ return (i);
}
@@ -857,33 +840,33 @@ history_save(TYPE(History) *h, const char *fname)
* Find the previous event, with number given
*/
private int
-history_prev_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
+history_prev_event(History *h, HistEvent *ev, int num)
{
int retval;
for (retval = HCURR(h, ev); retval != -1; retval = HPREV(h, ev))
if (ev->num == num)
- return 0;
+ return (0);
he_seterrev(ev, _HE_NOT_FOUND);
- return -1;
+ return (-1);
}
private int
-history_next_evdata(TYPE(History) *h, TYPE(HistEvent) *ev, int num, void **d)
+history_next_evdata(History *h, HistEvent *ev, int num, void **d)
{
int retval;
for (retval = HCURR(h, ev); retval != -1; retval = HPREV(h, ev))
- if (ev->num == num) {
+ if (num-- <= 0) {
if (d)
*d = ((history_t *)h->h_ref)->cursor->data;
- return 0;
+ return (0);
}
he_seterrev(ev, _HE_NOT_FOUND);
- return -1;
+ return (-1);
}
@@ -891,16 +874,16 @@ history_next_evdata(TYPE(History) *h, TYPE(HistEvent) *ev, int num, void **d)
* Find the next event, with number given
*/
private int
-history_next_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
+history_next_event(History *h, HistEvent *ev, int num)
{
int retval;
for (retval = HCURR(h, ev); retval != -1; retval = HNEXT(h, ev))
if (ev->num == num)
- return 0;
+ return (0);
he_seterrev(ev, _HE_NOT_FOUND);
- return -1;
+ return (-1);
}
@@ -908,17 +891,17 @@ history_next_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
* Find the previous event beginning with string
*/
private int
-history_prev_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *str)
+history_prev_string(History *h, HistEvent *ev, const char *str)
{
- size_t len = Strlen(str);
+ size_t len = strlen(str);
int retval;
for (retval = HCURR(h, ev); retval != -1; retval = HNEXT(h, ev))
- if (Strncmp(str, ev->str, len) == 0)
- return 0;
+ if (strncmp(str, ev->str, len) == 0)
+ return (0);
he_seterrev(ev, _HE_NOT_FOUND);
- return -1;
+ return (-1);
}
@@ -926,17 +909,17 @@ history_prev_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *str)
* Find the next event beginning with string
*/
private int
-history_next_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *str)
+history_next_string(History *h, HistEvent *ev, const char *str)
{
- size_t len = Strlen(str);
+ size_t len = strlen(str);
int retval;
for (retval = HCURR(h, ev); retval != -1; retval = HPREV(h, ev))
- if (Strncmp(str, ev->str, len) == 0)
- return 0;
+ if (strncmp(str, ev->str, len) == 0)
+ return (0);
he_seterrev(ev, _HE_NOT_FOUND);
- return -1;
+ return (-1);
}
@@ -944,10 +927,10 @@ history_next_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *str)
* User interface to history functions.
*/
int
-FUNW(history)(TYPE(History) *h, TYPE(HistEvent) *ev, int fun, ...)
+history(History *h, HistEvent *ev, int fun, ...)
{
va_list va;
- const Char *str;
+ const char *str;
int retval;
va_start(va, fun);
@@ -972,7 +955,7 @@ FUNW(history)(TYPE(History) *h, TYPE(HistEvent) *ev, int fun, ...)
break;
case H_ADD:
- str = va_arg(va, const Char *);
+ str = va_arg(va, const char *);
retval = HADD(h, ev, str);
break;
@@ -981,13 +964,13 @@ FUNW(history)(TYPE(History) *h, TYPE(HistEvent) *ev, int fun, ...)
break;
case H_ENTER:
- str = va_arg(va, const Char *);
+ str = va_arg(va, const char *);
if ((retval = HENTER(h, ev, str)) != -1)
h->h_ent = ev->num;
break;
case H_APPEND:
- str = va_arg(va, const Char *);
+ str = va_arg(va, const char *);
if ((retval = HSET(h, ev, h->h_ent)) != -1)
retval = HADD(h, ev, str);
break;
@@ -1034,9 +1017,9 @@ FUNW(history)(TYPE(History) *h, TYPE(HistEvent) *ev, int fun, ...)
break;
case H_SAVE_FP:
- retval = history_save_fp(h, va_arg(va, FILE *));
+ retval = history_save_fp(h, va_arg(va, FILE*));
if (retval == -1)
- he_seterrev(ev, _HE_HIST_WRITE);
+ he_seterrev(ev, _HE_HIST_WRITE);
break;
case H_PREV_EVENT:
@@ -1048,18 +1031,18 @@ FUNW(history)(TYPE(History) *h, TYPE(HistEvent) *ev, int fun, ...)
break;
case H_PREV_STR:
- retval = history_prev_string(h, ev, va_arg(va, const Char *));
+ retval = history_prev_string(h, ev, va_arg(va, const char *));
break;
case H_NEXT_STR:
- retval = history_next_string(h, ev, va_arg(va, const Char *));
+ retval = history_next_string(h, ev, va_arg(va, const char *));
break;
case H_FUNC:
{
- TYPE(History) hf;
+ History hf;
- hf.h_ref = va_arg(va, void *);
+ hf.h_ref = va_arg(va, ptr_t);
h->h_ent = -1;
hf.h_first = va_arg(va, history_gfun_t);
hf.h_next = va_arg(va, history_gfun_t);
@@ -1078,7 +1061,7 @@ FUNW(history)(TYPE(History) *h, TYPE(HistEvent) *ev, int fun, ...)
}
case H_END:
- FUN(history,end)(h);
+ history_end(h);
retval = 0;
break;
@@ -1100,10 +1083,10 @@ FUNW(history)(TYPE(History) *h, TYPE(HistEvent) *ev, int fun, ...)
case H_REPLACE: /* only use after H_NEXT_EVDATA */
{
- const Char *line = va_arg(va, const Char *);
+ const char *line = va_arg(va, const char *);
void *d = va_arg(va, void *);
- const Char *s;
- if(!line || !(s = Strdup(line))) {
+ const char *s;
+ if(!line || !(s = strdup(line))) {
retval = -1;
break;
}
diff --git a/lib/libedit/keymacro.c b/lib/libedit/key.c
index 1a1bdd5..5a0b779 100644
--- a/lib/libedit/keymacro.c
+++ b/lib/libedit/key.c
@@ -1,5 +1,3 @@
-/* $NetBSD: keymacro.c,v 1.7 2011/08/16 16:25:15 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,35 +28,31 @@
* LIABILITY, OR TORT (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: key.c,v 1.20 2009/02/15 21:55:23 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: keymacro.c,v 1.7 2011/08/16 16:25:15 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
- * keymacro.c: This module contains the procedures for maintaining
- * the extended-key map.
+ * key.c: This module contains the procedures for maintaining
+ * the extended-key map.
*
* An extended-key (key) is a sequence of keystrokes introduced
* with a sequence introducer and consisting of an arbitrary
- * number of characters. This module maintains a map (the
- * el->el_keymacro.map)
+ * number of characters. This module maintains a map (the el->el_key.map)
* to convert these extended-key sequences into input strs
* (XK_STR), editor functions (XK_CMD), or unix commands (XK_EXE).
*
* Warning:
* If key is a substr of some other keys, then the longer
* keys are lost!! That is, if the keys "abcd" and "abcef"
- * are in el->el_keymacro.map, adding the key "abc" will cause
- * the first two definitions to be lost.
+ * are in el->el_key.map, adding the key "abc" will cause the first two
+ * definitions to be lost.
*
* Restrictions:
* -------------
@@ -71,104 +65,102 @@ __FBSDID("$FreeBSD$");
#include "el.h"
/*
- * The Nodes of the el->el_keymacro.map. The el->el_keymacro.map is a
- * linked list of these node elements
+ * The Nodes of the el->el_key.map. The el->el_key.map is a linked list
+ * of these node elements
*/
-struct keymacro_node_t {
- Char ch; /* single character of key */
- int type; /* node type */
- keymacro_value_t val; /* command code or pointer to str, */
+struct key_node_t {
+ char ch; /* single character of key */
+ int type; /* node type */
+ key_value_t val; /* command code or pointer to str, */
/* if this is a leaf */
- struct keymacro_node_t *next; /* ptr to next char of this key */
- struct keymacro_node_t *sibling;/* ptr to another key with same prefix*/
+ struct key_node_t *next; /* ptr to next char of this key */
+ struct key_node_t *sibling; /* ptr to another key with same prefix*/
};
-private int node_trav(EditLine *, keymacro_node_t *, Char *,
- keymacro_value_t *);
-private int node__try(EditLine *, keymacro_node_t *, const Char *,
- keymacro_value_t *, int);
-private keymacro_node_t *node__get(Int);
-private void node__free(keymacro_node_t *);
-private void node__put(EditLine *, keymacro_node_t *);
-private int node__delete(EditLine *, keymacro_node_t **,
- const Char *);
-private int node_lookup(EditLine *, const Char *,
- keymacro_node_t *, size_t);
-private int node_enum(EditLine *, keymacro_node_t *, size_t);
+private int node_trav(EditLine *, key_node_t *, char *,
+ key_value_t *);
+private int node__try(EditLine *, key_node_t *, const char *,
+ key_value_t *, int);
+private key_node_t *node__get(int);
+private void node__free(key_node_t *);
+private void node__put(EditLine *, key_node_t *);
+private int node__delete(EditLine *, key_node_t **, const char *);
+private int node_lookup(EditLine *, const char *, key_node_t *,
+ size_t);
+private int node_enum(EditLine *, key_node_t *, size_t);
#define KEY_BUFSIZ EL_BUFSIZ
-/* keymacro_init():
+/* key_init():
* Initialize the key maps
*/
protected int
-keymacro_init(EditLine *el)
+key_init(EditLine *el)
{
- el->el_keymacro.buf = el_malloc(KEY_BUFSIZ *
- sizeof(*el->el_keymacro.buf));
- if (el->el_keymacro.buf == NULL)
- return -1;
- el->el_keymacro.map = NULL;
- keymacro_reset(el);
- return 0;
+ el->el_key.buf = (char *) el_malloc(KEY_BUFSIZ);
+ if (el->el_key.buf == NULL)
+ return (-1);
+ el->el_key.map = NULL;
+ key_reset(el);
+ return (0);
}
-/* keymacro_end():
+/* key_end():
* Free the key maps
*/
protected void
-keymacro_end(EditLine *el)
+key_end(EditLine *el)
{
- el_free(el->el_keymacro.buf);
- el->el_keymacro.buf = NULL;
- node__free(el->el_keymacro.map);
+ el_free((ptr_t) el->el_key.buf);
+ el->el_key.buf = NULL;
+ node__free(el->el_key.map);
}
-/* keymacro_map_cmd():
+/* key_map_cmd():
* Associate cmd with a key value
*/
-protected keymacro_value_t *
-keymacro_map_cmd(EditLine *el, int cmd)
+protected key_value_t *
+key_map_cmd(EditLine *el, int cmd)
{
- el->el_keymacro.val.cmd = (el_action_t) cmd;
- return &el->el_keymacro.val;
+ el->el_key.val.cmd = (el_action_t) cmd;
+ return (&el->el_key.val);
}
-/* keymacro_map_str():
+/* key_map_str():
* Associate str with a key value
*/
-protected keymacro_value_t *
-keymacro_map_str(EditLine *el, Char *str)
+protected key_value_t *
+key_map_str(EditLine *el, char *str)
{
- el->el_keymacro.val.str = str;
- return &el->el_keymacro.val;
+ el->el_key.val.str = str;
+ return (&el->el_key.val);
}
-/* keymacro_reset():
- * Takes all nodes on el->el_keymacro.map and puts them on free list.
- * Then initializes el->el_keymacro.map with arrow keys
+/* key_reset():
+ * Takes all nodes on el->el_key.map and puts them on free list. Then
+ * initializes el->el_key.map with arrow keys
* [Always bind the ansi arrow keys?]
*/
protected void
-keymacro_reset(EditLine *el)
+key_reset(EditLine *el)
{
- node__put(el, el->el_keymacro.map);
- el->el_keymacro.map = NULL;
+ node__put(el, el->el_key.map);
+ el->el_key.map = NULL;
return;
}
-/* keymacro_get():
- * Calls the recursive function with entry point el->el_keymacro.map
+/* key_get():
+ * Calls the recursive function with entry point el->el_key.map
* Looks up *ch in map and then reads characters until a
* complete match is found or a mismatch occurs. Returns the
* type of the match found (XK_STR, XK_CMD, or XK_EXE).
@@ -176,101 +168,98 @@ keymacro_reset(EditLine *el)
* The last character read is returned in *ch.
*/
protected int
-keymacro_get(EditLine *el, Char *ch, keymacro_value_t *val)
+key_get(EditLine *el, char *ch, key_value_t *val)
{
- return node_trav(el, el->el_keymacro.map, ch, val);
+ return (node_trav(el, el->el_key.map, ch, val));
}
-/* keymacro_add():
- * Adds key to the el->el_keymacro.map and associates the value in
- * val with it. If key is already is in el->el_keymacro.map, the new
- * code is applied to the existing key. Ntype specifies if code is a
- * command, an out str or a unix command.
+/* key_add():
+ * Adds key to the el->el_key.map and associates the value in val with it.
+ * If key is already is in el->el_key.map, the new code is applied to the
+ * existing key. Ntype specifies if code is a command, an
+ * out str or a unix command.
*/
protected void
-keymacro_add(EditLine *el, const Char *key, keymacro_value_t *val, int ntype)
+key_add(EditLine *el, const char *key, key_value_t *val, int ntype)
{
if (key[0] == '\0') {
(void) fprintf(el->el_errfile,
- "keymacro_add: Null extended-key not allowed.\n");
+ "key_add: Null extended-key not allowed.\n");
return;
}
if (ntype == XK_CMD && val->cmd == ED_SEQUENCE_LEAD_IN) {
(void) fprintf(el->el_errfile,
- "keymacro_add: sequence-lead-in command not allowed\n");
+ "key_add: sequence-lead-in command not allowed\n");
return;
}
- if (el->el_keymacro.map == NULL)
+ if (el->el_key.map == NULL)
/* tree is initially empty. Set up new node to match key[0] */
- el->el_keymacro.map = node__get(key[0]);
+ el->el_key.map = node__get(key[0]);
/* it is properly initialized */
- /* Now recurse through el->el_keymacro.map */
- (void) node__try(el, el->el_keymacro.map, key, val, ntype);
+ /* Now recurse through el->el_key.map */
+ (void) node__try(el, el->el_key.map, key, val, ntype);
return;
}
-/* keymacro_clear():
+/* key_clear():
*
*/
protected void
-keymacro_clear(EditLine *el, el_action_t *map, const Char *in)
+key_clear(EditLine *el, el_action_t *map, const char *in)
{
-#ifdef WIDECHAR
- if (*in > N_KEYS) /* can't be in the map */
- return;
-#endif
+
if ((map[(unsigned char)*in] == ED_SEQUENCE_LEAD_IN) &&
((map == el->el_map.key &&
el->el_map.alt[(unsigned char)*in] != ED_SEQUENCE_LEAD_IN) ||
(map == el->el_map.alt &&
el->el_map.key[(unsigned char)*in] != ED_SEQUENCE_LEAD_IN)))
- (void) keymacro_delete(el, in);
+ (void) key_delete(el, in);
}
-/* keymacro_delete():
+/* key_delete():
* Delete the key and all longer keys staring with key, if
* they exists.
*/
protected int
-keymacro_delete(EditLine *el, const Char *key)
+key_delete(EditLine *el, const char *key)
{
if (key[0] == '\0') {
(void) fprintf(el->el_errfile,
- "keymacro_delete: Null extended-key not allowed.\n");
- return -1;
+ "key_delete: Null extended-key not allowed.\n");
+ return (-1);
}
- if (el->el_keymacro.map == NULL)
- return 0;
+ if (el->el_key.map == NULL)
+ return (0);
- (void) node__delete(el, &el->el_keymacro.map, key);
- return 0;
+ (void) node__delete(el, &el->el_key.map, key);
+ return (0);
}
-/* keymacro_print():
+/* key_print():
* Print the binding associated with key key.
- * Print entire el->el_keymacro.map if null
+ * Print entire el->el_key.map if null
*/
protected void
-keymacro_print(EditLine *el, const Char *key)
+key_print(EditLine *el, const char *key)
{
- /* do nothing if el->el_keymacro.map is empty and null key specified */
- if (el->el_keymacro.map == NULL && *key == 0)
+ /* do nothing if el->el_key.map is empty and null key specified */
+ if (el->el_key.map == NULL && *key == 0)
return;
- el->el_keymacro.buf[0] = '"';
- if (node_lookup(el, key, el->el_keymacro.map, (size_t)1) <= -1)
+ el->el_key.buf[0] = '"';
+ if (node_lookup(el, key, el->el_key.map, 1) <= -1)
/* key is not bound */
- (void) fprintf(el->el_errfile, "Unbound extended key \"" FSTR
- "\"\n", key);
+ (void) fprintf(el->el_errfile, "Unbound extended key \"%s\"\n",
+ key);
return;
}
@@ -280,34 +269,34 @@ keymacro_print(EditLine *el, const Char *key)
* found. May read in more characters.
*/
private int
-node_trav(EditLine *el, keymacro_node_t *ptr, Char *ch, keymacro_value_t *val)
+node_trav(EditLine *el, key_node_t *ptr, char *ch, key_value_t *val)
{
if (ptr->ch == *ch) {
/* match found */
if (ptr->next) {
/* key not complete so get next char */
- if (FUN(el,getc)(el, ch) != 1) {/* if EOF or error */
+ if (el_getc(el, ch) != 1) { /* if EOF or error */
val->cmd = ED_END_OF_FILE;
- return XK_CMD;
+ return (XK_CMD);
/* PWP: Pretend we just read an end-of-file */
}
- return node_trav(el, ptr->next, ch, val);
+ return (node_trav(el, ptr->next, ch, val));
} else {
*val = ptr->val;
if (ptr->type != XK_CMD)
*ch = '\0';
- return ptr->type;
+ return (ptr->type);
}
} else {
/* no match found here */
if (ptr->sibling) {
/* try next sibling */
- return node_trav(el, ptr->sibling, ch, val);
+ return (node_trav(el, ptr->sibling, ch, val));
} else {
/* no next sibling -- mismatch */
val->str = NULL;
- return XK_STR;
+ return (XK_STR);
}
}
}
@@ -317,12 +306,11 @@ node_trav(EditLine *el, keymacro_node_t *ptr, Char *ch, keymacro_value_t *val)
* Find a node that matches *str or allocate a new one
*/
private int
-node__try(EditLine *el, keymacro_node_t *ptr, const Char *str,
- keymacro_value_t *val, int ntype)
+node__try(EditLine *el, key_node_t *ptr, const char *str, key_value_t *val, int ntype)
{
if (ptr->ch != *str) {
- keymacro_node_t *xm;
+ key_node_t *xm;
for (xm = ptr; xm->sibling != NULL; xm = xm->sibling)
if (xm->sibling->ch == *str)
@@ -345,7 +333,7 @@ node__try(EditLine *el, keymacro_node_t *ptr, const Char *str,
case XK_STR:
case XK_EXE:
if (ptr->val.str)
- el_free(ptr->val.str);
+ el_free((ptr_t) ptr->val.str);
break;
default:
EL_ABORT((el->el_errfile, "Bad XK_ type %d\n",
@@ -359,7 +347,7 @@ node__try(EditLine *el, keymacro_node_t *ptr, const Char *str,
break;
case XK_STR:
case XK_EXE:
- if ((ptr->val.str = Strdup(val->str)) == NULL)
+ if ((ptr->val.str = el_strdup(val->str)) == NULL)
return -1;
break;
default:
@@ -372,7 +360,7 @@ node__try(EditLine *el, keymacro_node_t *ptr, const Char *str,
ptr->next = node__get(*str); /* setup new node */
(void) node__try(el, ptr->next, str, val, ntype);
}
- return 0;
+ return (0);
}
@@ -380,21 +368,21 @@ node__try(EditLine *el, keymacro_node_t *ptr, const Char *str,
* Delete node that matches str
*/
private int
-node__delete(EditLine *el, keymacro_node_t **inptr, const Char *str)
+node__delete(EditLine *el, key_node_t **inptr, const char *str)
{
- keymacro_node_t *ptr;
- keymacro_node_t *prev_ptr = NULL;
+ key_node_t *ptr;
+ key_node_t *prev_ptr = NULL;
ptr = *inptr;
if (ptr->ch != *str) {
- keymacro_node_t *xm;
+ key_node_t *xm;
for (xm = ptr; xm->sibling != NULL; xm = xm->sibling)
if (xm->sibling->ch == *str)
break;
if (xm->sibling == NULL)
- return 0;
+ return (0);
prev_ptr = xm;
ptr = xm->sibling;
}
@@ -406,20 +394,20 @@ node__delete(EditLine *el, keymacro_node_t **inptr, const Char *str)
prev_ptr->sibling = ptr->sibling;
ptr->sibling = NULL;
node__put(el, ptr);
- return 1;
+ return (1);
} else if (ptr->next != NULL &&
node__delete(el, &ptr->next, str) == 1) {
if (ptr->next != NULL)
- return 0;
+ return (0);
if (prev_ptr == NULL)
*inptr = ptr->sibling;
else
prev_ptr->sibling = ptr->sibling;
ptr->sibling = NULL;
node__put(el, ptr);
- return 1;
+ return (1);
} else {
- return 0;
+ return (0);
}
}
@@ -428,7 +416,7 @@ node__delete(EditLine *el, keymacro_node_t **inptr, const Char *str)
* Puts a tree of nodes onto free list using free(3).
*/
private void
-node__put(EditLine *el, keymacro_node_t *ptr)
+node__put(EditLine *el, key_node_t *ptr)
{
if (ptr == NULL)
return;
@@ -446,25 +434,25 @@ node__put(EditLine *el, keymacro_node_t *ptr)
case XK_EXE:
case XK_STR:
if (ptr->val.str != NULL)
- el_free(ptr->val.str);
+ el_free((ptr_t) ptr->val.str);
break;
default:
EL_ABORT((el->el_errfile, "Bad XK_ type %d\n", ptr->type));
break;
}
- el_free(ptr);
+ el_free((ptr_t) ptr);
}
/* node__get():
- * Returns pointer to a keymacro_node_t for ch.
+ * Returns pointer to a key_node_t for ch.
*/
-private keymacro_node_t *
-node__get(Int ch)
+private key_node_t *
+node__get(int ch)
{
- keymacro_node_t *ptr;
+ key_node_t *ptr;
- ptr = el_malloc(sizeof(*ptr));
+ ptr = (key_node_t *) el_malloc((size_t) sizeof(key_node_t));
if (ptr == NULL)
return NULL;
ptr->ch = ch;
@@ -472,17 +460,17 @@ node__get(Int ch)
ptr->val.str = NULL;
ptr->next = NULL;
ptr->sibling = NULL;
- return ptr;
+ return (ptr);
}
private void
-node__free(keymacro_node_t *k)
+node__free(key_node_t *k)
{
if (k == NULL)
return;
node__free(k->sibling);
node__free(k->next);
- el_free(k);
+ el_free((ptr_t) k);
}
/* node_lookup():
@@ -490,40 +478,38 @@ node__free(keymacro_node_t *k)
* Print if last node
*/
private int
-node_lookup(EditLine *el, const Char *str, keymacro_node_t *ptr, size_t cnt)
+node_lookup(EditLine *el, const char *str, key_node_t *ptr, size_t cnt)
{
- ssize_t used;
+ size_t ncnt;
if (ptr == NULL)
- return -1; /* cannot have null ptr */
+ return (-1); /* cannot have null ptr */
- if (!str || *str == 0) {
+ if (*str == 0) {
/* no more chars in str. node_enum from here. */
(void) node_enum(el, ptr, cnt);
- return 0;
+ return (0);
} else {
- /* If match put this char into el->el_keymacro.buf. Recurse */
+ /* If match put this char into el->el_key.buf. Recurse */
if (ptr->ch == *str) {
/* match found */
- used = ct_visual_char(el->el_keymacro.buf + cnt,
- KEY_BUFSIZ - cnt, ptr->ch);
- if (used == -1)
- return -1; /* ran out of buffer space */
+ ncnt = key__decode_char(el->el_key.buf,
+ (size_t)KEY_BUFSIZ, cnt,
+ (unsigned char) ptr->ch);
if (ptr->next != NULL)
/* not yet at leaf */
return (node_lookup(el, str + 1, ptr->next,
- (size_t)used + cnt));
+ ncnt + 1));
else {
/* next node is null so key should be complete */
if (str[1] == 0) {
- size_t px = cnt + (size_t)used;
- el->el_keymacro.buf[px] = '"';
- el->el_keymacro.buf[px + 1] = '\0';
- keymacro_kprint(el, el->el_keymacro.buf,
+ el->el_key.buf[ncnt + 1] = '"';
+ el->el_key.buf[ncnt + 2] = '\0';
+ key_kprint(el, el->el_key.buf,
&ptr->val, ptr->type);
- return 0;
+ return (0);
} else
- return -1;
+ return (-1);
/* mismatch -- str still has chars */
}
} else {
@@ -532,7 +518,7 @@ node_lookup(EditLine *el, const Char *str, keymacro_node_t *ptr, size_t cnt)
return (node_lookup(el, str, ptr->sibling,
cnt));
else
- return -1;
+ return (-1);
}
}
}
@@ -542,50 +528,49 @@ node_lookup(EditLine *el, const Char *str, keymacro_node_t *ptr, size_t cnt)
* Traverse the node printing the characters it is bound in buffer
*/
private int
-node_enum(EditLine *el, keymacro_node_t *ptr, size_t cnt)
+node_enum(EditLine *el, key_node_t *ptr, size_t cnt)
{
- ssize_t used;
+ size_t ncnt;
if (cnt >= KEY_BUFSIZ - 5) { /* buffer too small */
- el->el_keymacro.buf[++cnt] = '"';
- el->el_keymacro.buf[++cnt] = '\0';
+ el->el_key.buf[++cnt] = '"';
+ el->el_key.buf[++cnt] = '\0';
(void) fprintf(el->el_errfile,
"Some extended keys too long for internal print buffer");
- (void) fprintf(el->el_errfile, " \"" FSTR "...\"\n",
- el->el_keymacro.buf);
- return 0;
+ (void) fprintf(el->el_errfile, " \"%s...\"\n", el->el_key.buf);
+ return (0);
}
if (ptr == NULL) {
#ifdef DEBUG_EDIT
(void) fprintf(el->el_errfile,
"node_enum: BUG!! Null ptr passed\n!");
#endif
- return -1;
+ return (-1);
}
/* put this char at end of str */
- used = ct_visual_char(el->el_keymacro.buf + cnt, KEY_BUFSIZ - cnt,
- ptr->ch);
+ ncnt = key__decode_char(el->el_key.buf, (size_t)KEY_BUFSIZ, cnt,
+ (unsigned char)ptr->ch);
if (ptr->next == NULL) {
/* print this key and function */
- el->el_keymacro.buf[cnt + (size_t)used ] = '"';
- el->el_keymacro.buf[cnt + (size_t)used + 1] = '\0';
- keymacro_kprint(el, el->el_keymacro.buf, &ptr->val, ptr->type);
+ el->el_key.buf[ncnt + 1] = '"';
+ el->el_key.buf[ncnt + 2] = '\0';
+ key_kprint(el, el->el_key.buf, &ptr->val, ptr->type);
} else
- (void) node_enum(el, ptr->next, cnt + (size_t)used);
+ (void) node_enum(el, ptr->next, ncnt + 1);
/* go to sibling if there is one */
if (ptr->sibling)
(void) node_enum(el, ptr->sibling, cnt);
- return 0;
+ return (0);
}
-/* keymacro_kprint():
+/* key_kprint():
* Print the specified key and its associated
* function specified by val
*/
protected void
-keymacro_kprint(EditLine *el, const Char *key, keymacro_value_t *val, int ntype)
+key_kprint(EditLine *el, const char *key, key_value_t *val, int ntype)
{
el_bindings_t *fp;
char unparsbuf[EL_BUFSIZ];
@@ -595,19 +580,16 @@ keymacro_kprint(EditLine *el, const Char *key, keymacro_value_t *val, int ntype)
switch (ntype) {
case XK_STR:
case XK_EXE:
- (void) keymacro__decode_str(val->str, unparsbuf,
+ (void) key__decode_str(val->str, unparsbuf,
sizeof(unparsbuf),
ntype == XK_STR ? "\"\"" : "[]");
- (void) fprintf(el->el_outfile, fmt,
- ct_encode_string(key, &el->el_scratch), unparsbuf);
+ (void) fprintf(el->el_outfile, fmt, key, unparsbuf);
break;
case XK_CMD:
for (fp = el->el_map.help; fp->name; fp++)
if (val->cmd == fp->func) {
- ct_wcstombs(unparsbuf, fp->name, sizeof(unparsbuf));
- unparsbuf[sizeof(unparsbuf) -1] = '\0';
(void) fprintf(el->el_outfile, fmt,
- ct_encode_string(key, &el->el_scratch), unparsbuf);
+ key, fp->name);
break;
}
#ifdef DEBUG_KEY
@@ -622,8 +604,7 @@ keymacro_kprint(EditLine *el, const Char *key, keymacro_value_t *val, int ntype)
break;
}
else
- (void) fprintf(el->el_outfile, fmt, ct_encode_string(key,
- &el->el_scratch), "no input");
+ (void) fprintf(el->el_outfile, fmt, key, "no input");
}
@@ -632,14 +613,54 @@ keymacro_kprint(EditLine *el, const Char *key, keymacro_value_t *val, int ntype)
*b++ = c; \
else \
b++
-/* keymacro__decode_str():
+/* key__decode_char():
+ * Put a printable form of char in buf.
+ */
+protected size_t
+key__decode_char(char *buf, size_t cnt, size_t off, int ch)
+{
+ char *sb = buf + off;
+ char *eb = buf + cnt;
+ char *b = sb;
+
+ ch = (unsigned char)ch;
+ if (ch == 0) {
+ ADDC('^');
+ ADDC('@');
+ return (int)(b - sb);
+ }
+ if (iscntrl(ch)) {
+ ADDC('^');
+ if (ch == '\177')
+ ADDC('?');
+ else
+ ADDC(toascii(ch) | 0100);
+ } else if (ch == '^') {
+ ADDC('\\');
+ ADDC('^');
+ } else if (ch == '\\') {
+ ADDC('\\');
+ ADDC('\\');
+ } else if (ch == ' ' || (isprint(ch) && !isspace(ch))) {
+ ADDC(ch);
+ } else {
+ ADDC('\\');
+ ADDC((((unsigned int) ch >> 6) & 7) + '0');
+ ADDC((((unsigned int) ch >> 3) & 7) + '0');
+ ADDC((ch & 7) + '0');
+ }
+ return (size_t)(b - sb);
+}
+
+
+/* key__decode_str():
* Make a printable version of the ey
*/
protected size_t
-keymacro__decode_str(const Char *str, char *buf, size_t len, const char *sep)
+key__decode_str(const char *str, char *buf, size_t len, const char *sep)
{
char *b = buf, *eb = b + len;
- const Char *p;
+ const char *p;
b = buf;
if (sep[0] != '\0') {
@@ -648,24 +669,36 @@ keymacro__decode_str(const Char *str, char *buf, size_t len, const char *sep)
if (*str == '\0') {
ADDC('^');
ADDC('@');
- goto add_endsep;
+ if (sep[0] != '\0' && sep[1] != '\0') {
+ ADDC(sep[1]);
+ }
+ goto done;
}
for (p = str; *p != 0; p++) {
- Char dbuf[VISUAL_WIDTH_MAX];
- Char *p2 = dbuf;
- ssize_t l = ct_visual_char(dbuf, VISUAL_WIDTH_MAX, *p);
- while (l-- > 0) {
- ssize_t n = ct_encode_char(b, (size_t)(eb - b), *p2++);
- if (n == -1) /* ran out of space */
- goto add_endsep;
- else
- b += n;
+ if (iscntrl((unsigned char) *p)) {
+ ADDC('^');
+ if (*p == '\177') {
+ ADDC('?');
+ } else {
+ ADDC(toascii(*p) | 0100);
+ }
+ } else if (*p == '^' || *p == '\\') {
+ ADDC('\\');
+ ADDC(*p);
+ } else if (*p == ' ' || (isprint((unsigned char) *p) &&
+ !isspace((unsigned char) *p))) {
+ ADDC(*p);
+ } else {
+ ADDC('\\');
+ ADDC((((unsigned int) *p >> 6) & 7) + '0');
+ ADDC((((unsigned int) *p >> 3) & 7) + '0');
+ ADDC((*p & 7) + '0');
}
}
-add_endsep:
if (sep[0] != '\0' && sep[1] != '\0') {
ADDC(sep[1]);
}
+done:
ADDC('\0');
if ((size_t)(b - buf) >= len)
buf[len - 1] = '\0';
diff --git a/lib/libedit/keymacro.h b/lib/libedit/key.h
index 57a7a5d..1997adc 100644
--- a/lib/libedit/keymacro.h
+++ b/lib/libedit/key.h
@@ -1,5 +1,3 @@
-/* $NetBSD: keymacro.h,v 1.2 2011/07/28 03:44:36 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,46 +30,54 @@
* SUCH DAMAGE.
*
* @(#)key.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: key.h,v 1.10 2006/03/23 20:22:51 christos Exp $
* $FreeBSD$
*/
/*
- * el.keymacro.h: Key macro header
+ * el.key.h: Key macro header
*/
-#ifndef _h_el_keymacro
-#define _h_el_keymacro
+#ifndef _h_el_key
+#define _h_el_key
-typedef union keymacro_value_t {
+typedef union key_value_t {
el_action_t cmd; /* If it is a command the # */
- Char *str; /* If it is a string... */
-} keymacro_value_t;
+ char *str; /* If it is a string... */
+} key_value_t;
-typedef struct keymacro_node_t keymacro_node_t;
+typedef struct key_node_t key_node_t;
-typedef struct el_keymacromacro_t {
- Char *buf; /* Key print buffer */
- keymacro_node_t *map; /* Key map */
- keymacro_value_t val; /* Local conversion buffer */
-} el_keymacro_t;
+typedef struct el_key_t {
+ char *buf; /* Key print buffer */
+ key_node_t *map; /* Key map */
+ key_value_t val; /* Local conversion buffer */
+} el_key_t;
#define XK_CMD 0
#define XK_STR 1
#define XK_NOD 2
#define XK_EXE 3
-protected int keymacro_init(EditLine *);
-protected void keymacro_end(EditLine *);
-protected keymacro_value_t *keymacro_map_cmd(EditLine *, int);
-protected keymacro_value_t *keymacro_map_str(EditLine *, Char *);
-protected void keymacro_reset(EditLine *);
-protected int keymacro_get(EditLine *, Char *, keymacro_value_t *);
-protected void keymacro_add(EditLine *, const Char *, keymacro_value_t *, int);
-protected void keymacro_clear(EditLine *, el_action_t *, const Char *);
-protected int keymacro_delete(EditLine *, const Char *);
-protected void keymacro_print(EditLine *, const Char *);
-protected void keymacro_kprint(EditLine *, const Char *, keymacro_value_t *,
+#include <term.h>
+
+#undef key_end
+#undef key_clear
+#undef key_print
+
+protected int key_init(EditLine *);
+protected void key_end(EditLine *);
+protected key_value_t *key_map_cmd(EditLine *, int);
+protected key_value_t *key_map_str(EditLine *, char *);
+protected void key_reset(EditLine *);
+protected int key_get(EditLine *, char *, key_value_t *);
+protected void key_add(EditLine *, const char *, key_value_t *, int);
+protected void key_clear(EditLine *, el_action_t *, const char *);
+protected int key_delete(EditLine *, const char *);
+protected void key_print(EditLine *, const char *);
+protected void key_kprint(EditLine *, const char *, key_value_t *,
int);
-protected size_t keymacro__decode_str(const Char *, char *, size_t,
+protected size_t key__decode_str(const char *, char *, size_t,
const char *);
+protected size_t key__decode_char(char *, size_t, size_t, int);
-#endif /* _h_el_keymacro */
+#endif /* _h_el_key */
diff --git a/lib/libedit/makelist b/lib/libedit/makelist
index ec3292f..6bb2476 100644
--- a/lib/libedit/makelist
+++ b/lib/libedit/makelist
@@ -1,6 +1,6 @@
#!/bin/sh -
+# $NetBSD: makelist,v 1.11 2005/10/22 16:45:03 christos Exp $
# $FreeBSD$
-# $NetBSD: makelist,v 1.18 2012/03/21 05:34:54 matt Exp $
#
# Copyright (c) 1992, 1993
# The Regents of the University of California. All rights reserved.
@@ -37,7 +37,7 @@
# makelist.sh: Automatically generate header files...
AWK=awk
-USAGE="Usage: $0 -n|-h|-e|-fc|-fh|-bc|-bh|-m <filenames>"
+USAGE="usage: $0 -h|-e|-fc|-fh|-bc|-bh|-m <filenames>"
if [ "x$1" = "x" ]
then
@@ -54,15 +54,6 @@ case $FLAG in
# generate foo.h file from foo.c
#
--n)
- cat << _EOF
-#include "config.h"
-#undef WIDECHAR
-#define NARROWCHAR
-#include "${FILES}"
-_EOF
- ;;
-
-h)
set - `echo $FILES | sed -e 's/\\./_/g'`
hdr="_h_`basename $1`"
@@ -79,7 +70,7 @@ _EOF
# XXX: need a space between name and prototype so that -fc and -fh
# parsing is much easier
#
- printf("protected el_action_t\t%s (EditLine *, Int);\n", name);
+ printf("protected el_action_t\t%s (EditLine *, int);\n", name);
}
}
END {
@@ -93,8 +84,7 @@ _EOF
cat $FILES | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
- printf("#include \"config.h\"\n#include \"el.h\"\n");
- printf("#include \"chartype.h\"\n");
+ printf("#include \"sys.h\"\n#include \"el.h\"\n");
printf("private const struct el_bindings_t el_func_help[] = {\n");
low = "abcdefghijklmnopqrstuvwxyz_";
high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
@@ -115,22 +105,22 @@ _EOF
fname = fname s;
}
- printf(" { %-30.30s %-30.30s\n","STR(\"" fname "\"),", uname ",");
+ printf(" { %-30.30s %-30.30s\n","\"" fname "\",", uname ",");
ok = 1;
}
}
/^ \*/ {
if (ok) {
- printf(" STR(\"");
+ printf(" \"");
for (i = 2; i < NF; i++)
printf("%s ", $i);
- printf("%s\") },\n", $i);
+ printf("%s\" },\n", $i);
ok = 0;
}
}
END {
printf("};\n");
- printf("\nprotected const el_bindings_t* help__get(void)");
+ printf("\nprotected const el_bindings_t* help__get()");
printf("{ return el_func_help; }\n");
}'
;;
@@ -151,7 +141,7 @@ _EOF
#
-fh)
cat $FILES | $AWK '/el_action_t/ { print $3 }' | \
- sort | tr '[:lower:]' '[:upper:]' | $AWK '
+ sort | LC_ALL=C tr '[:lower:]' '[:upper:]' | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n");
@@ -163,7 +153,7 @@ _EOF
END {
printf("#define\t%-30.30s\t%3d\n", "EL_NUM_FCNS", count);
- printf("typedef el_action_t (*el_func_t)(EditLine *, Int);");
+ printf("typedef el_action_t (*el_func_t)(EditLine *, int);");
printf("\nprotected const el_func_t* func__get(void);\n");
printf("#endif /* _h_fcns_c */\n");
}'
@@ -175,7 +165,7 @@ _EOF
cat $FILES | $AWK '/el_action_t/ { print $3 }' | sort | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
- printf("#include \"config.h\"\n#include \"el.h\"\n");
+ printf("#include \"sys.h\"\n#include \"el.h\"\n");
printf("private const el_func_t el_func[] = {");
maxlen = 80;
needn = 1;
@@ -196,7 +186,7 @@ _EOF
}
END {
printf("\n};\n");
- printf("\nprotected const el_func_t* func__get(void) { return el_func; }\n");
+ printf("\nprotected const el_func_t* func__get() { return el_func; }\n");
}'
;;
diff --git a/lib/libedit/map.c b/lib/libedit/map.c
index 03bb3d8..c70904a 100644
--- a/lib/libedit/map.c
+++ b/lib/libedit/map.c
@@ -1,5 +1,3 @@
-/* $NetBSD: map.c,v 1.35 2015/05/14 10:44:15 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: map.c,v 1.24 2006/04/09 01:36:51 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: map.c,v 1.35 2015/05/14 10:44:15 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -46,11 +41,14 @@ __FBSDID("$FreeBSD$");
/*
* map.c: Editor function definitions
*/
+#include "sys.h"
#include <stdlib.h>
#include "el.h"
-private void map_print_key(EditLine *, el_action_t *, const Char *);
-private void map_print_some_keys(EditLine *, el_action_t *, Int, Int);
+#define N_KEYS 256
+
+private void map_print_key(EditLine *, el_action_t *, const char *);
+private void map_print_some_keys(EditLine *, el_action_t *, int, int);
private void map_print_all_keys(EditLine *);
private void map_init_nls(EditLine *);
private void map_init_meta(EditLine *);
@@ -905,25 +903,26 @@ map_init(EditLine *el)
EL_ABORT((el->errfile, "Vi insert map incorrect\n"));
#endif
- el->el_map.alt = el_malloc(sizeof(*el->el_map.alt) * N_KEYS);
+ el->el_map.alt = (el_action_t *)el_malloc(sizeof(el_action_t) * N_KEYS);
if (el->el_map.alt == NULL)
- return -1;
- el->el_map.key = el_malloc(sizeof(*el->el_map.key) * N_KEYS);
+ return (-1);
+ el->el_map.key = (el_action_t *)el_malloc(sizeof(el_action_t) * N_KEYS);
if (el->el_map.key == NULL)
- return -1;
+ return (-1);
el->el_map.emacs = el_map_emacs;
el->el_map.vic = el_map_vi_command;
el->el_map.vii = el_map_vi_insert;
- el->el_map.help = el_malloc(sizeof(*el->el_map.help) * EL_NUM_FCNS);
+ el->el_map.help = (el_bindings_t *) el_malloc(sizeof(el_bindings_t) *
+ EL_NUM_FCNS);
if (el->el_map.help == NULL)
- return -1;
+ return (-1);
(void) memcpy(el->el_map.help, help__get(),
- sizeof(*el->el_map.help) * EL_NUM_FCNS);
- el->el_map.func = el_malloc(sizeof(*el->el_map.func) * EL_NUM_FCNS);
+ sizeof(el_bindings_t) * EL_NUM_FCNS);
+ el->el_map.func = (el_func_t *)el_malloc(sizeof(el_func_t) *
+ EL_NUM_FCNS);
if (el->el_map.func == NULL)
- return -1;
- memcpy(el->el_map.func, func__get(), sizeof(*el->el_map.func)
- * EL_NUM_FCNS);
+ return (-1);
+ memcpy(el->el_map.func, func__get(), sizeof(el_func_t) * EL_NUM_FCNS);
el->el_map.nfunc = EL_NUM_FCNS;
#ifdef VIDEFAULT
@@ -931,7 +930,7 @@ map_init(EditLine *el)
#else
map_init_emacs(el);
#endif /* VIDEFAULT */
- return 0;
+ return (0);
}
@@ -942,16 +941,16 @@ protected void
map_end(EditLine *el)
{
- el_free(el->el_map.alt);
+ el_free((ptr_t) el->el_map.alt);
el->el_map.alt = NULL;
- el_free(el->el_map.key);
+ el_free((ptr_t) el->el_map.key);
el->el_map.key = NULL;
el->el_map.emacs = NULL;
el->el_map.vic = NULL;
el->el_map.vii = NULL;
- el_free(el->el_map.help);
+ el_free((ptr_t) el->el_map.help);
el->el_map.help = NULL;
- el_free(el->el_map.func);
+ el_free((ptr_t) el->el_map.func);
el->el_map.func = NULL;
}
@@ -967,7 +966,7 @@ map_init_nls(EditLine *el)
el_action_t *map = el->el_map.key;
for (i = 0200; i <= 0377; i++)
- if (Isprint(i))
+ if (isprint(i))
map[i] = ED_INSERT;
}
@@ -978,7 +977,7 @@ map_init_nls(EditLine *el)
private void
map_init_meta(EditLine *el)
{
- Char buf[3];
+ char buf[3];
int i;
el_action_t *map = el->el_map.key;
el_action_t *alt = el->el_map.alt;
@@ -996,7 +995,7 @@ map_init_meta(EditLine *el)
} else
map = alt;
}
- buf[0] = (Char) i;
+ buf[0] = (char) i;
buf[2] = 0;
for (i = 0200; i <= 0377; i++)
switch (map[i]) {
@@ -1006,7 +1005,7 @@ map_init_meta(EditLine *el)
break;
default:
buf[1] = i & 0177;
- keymacro_add(el, buf, keymacro_map_cmd(el, (int) map[i]), XK_CMD);
+ key_add(el, buf, key_map_cmd(el, (int) map[i]), XK_CMD);
break;
}
map[(int) buf[0]] = ED_SEQUENCE_LEAD_IN;
@@ -1028,7 +1027,7 @@ map_init_vi(EditLine *el)
el->el_map.type = MAP_VI;
el->el_map.current = el->el_map.key;
- keymacro_reset(el);
+ key_reset(el);
for (i = 0; i < N_KEYS; i++) {
key[i] = vii[i];
@@ -1039,7 +1038,7 @@ map_init_vi(EditLine *el)
map_init_nls(el);
tty_bind_char(el, 1);
- terminal_bind_arrow(el);
+ term_bind_arrow(el);
}
@@ -1050,14 +1049,14 @@ protected void
map_init_emacs(EditLine *el)
{
int i;
- Char buf[3];
+ char buf[3];
el_action_t *key = el->el_map.key;
el_action_t *alt = el->el_map.alt;
const el_action_t *emacs = el->el_map.emacs;
el->el_map.type = MAP_EMACS;
el->el_map.current = el->el_map.key;
- keymacro_reset(el);
+ key_reset(el);
for (i = 0; i < N_KEYS; i++) {
key[i] = emacs[i];
@@ -1070,10 +1069,10 @@ map_init_emacs(EditLine *el)
buf[0] = CONTROL('X');
buf[1] = CONTROL('X');
buf[2] = 0;
- keymacro_add(el, buf, keymacro_map_cmd(el, EM_EXCHANGE_MARK), XK_CMD);
+ key_add(el, buf, key_map_cmd(el, EM_EXCHANGE_MARK), XK_CMD);
tty_bind_char(el, 1);
- terminal_bind_arrow(el);
+ term_bind_arrow(el);
}
@@ -1081,18 +1080,18 @@ map_init_emacs(EditLine *el)
* Set the editor
*/
protected int
-map_set_editor(EditLine *el, Char *editor)
+map_set_editor(EditLine *el, char *editor)
{
- if (Strcmp(editor, STR("emacs")) == 0) {
+ if (strcmp(editor, "emacs") == 0) {
map_init_emacs(el);
- return 0;
+ return (0);
}
- if (Strcmp(editor, STR("vi")) == 0) {
+ if (strcmp(editor, "vi") == 0) {
map_init_vi(el);
- return 0;
+ return (0);
}
- return -1;
+ return (-1);
}
@@ -1100,20 +1099,20 @@ map_set_editor(EditLine *el, Char *editor)
* Retrieve the editor
*/
protected int
-map_get_editor(EditLine *el, const Char **editor)
+map_get_editor(EditLine *el, const char **editor)
{
if (editor == NULL)
- return -1;
+ return (-1);
switch (el->el_map.type) {
case MAP_EMACS:
- *editor = STR("emacs");
- return 0;
+ *editor = "emacs";
+ return (0);
case MAP_VI:
- *editor = STR("vi");
- return 0;
+ *editor = "vi";
+ return (0);
}
- return -1;
+ return (-1);
}
@@ -1121,22 +1120,22 @@ map_get_editor(EditLine *el, const Char **editor)
* Print the function description for 1 key
*/
private void
-map_print_key(EditLine *el, el_action_t *map, const Char *in)
+map_print_key(EditLine *el, el_action_t *map, const char *in)
{
char outbuf[EL_BUFSIZ];
el_bindings_t *bp, *ep;
if (in[0] == '\0' || in[1] == '\0') {
- (void) keymacro__decode_str(in, outbuf, sizeof(outbuf), "");
+ (void) key__decode_str(in, outbuf, sizeof(outbuf), "");
ep = &el->el_map.help[el->el_map.nfunc];
for (bp = el->el_map.help; bp < ep; bp++)
if (bp->func == map[(unsigned char) *in]) {
(void) fprintf(el->el_outfile,
- "%s\t->\t" FSTR "\n", outbuf, bp->name);
+ "%s\t->\t%s\n", outbuf, bp->name);
return;
}
} else
- keymacro_print(el, in);
+ key_print(el, in);
}
@@ -1144,10 +1143,10 @@ map_print_key(EditLine *el, el_action_t *map, const Char *in)
* Print keys from first to last
*/
private void
-map_print_some_keys(EditLine *el, el_action_t *map, Int first, Int last)
+map_print_some_keys(EditLine *el, el_action_t *map, int first, int last)
{
el_bindings_t *bp, *ep;
- Char firstbuf[2], lastbuf[2];
+ char firstbuf[2], lastbuf[2];
char unparsbuf[EL_BUFSIZ], extrabuf[EL_BUFSIZ];
firstbuf[0] = first;
@@ -1156,7 +1155,7 @@ map_print_some_keys(EditLine *el, el_action_t *map, Int first, Int last)
lastbuf[1] = 0;
if (map[first] == ED_UNASSIGNED) {
if (first == last) {
- (void) keymacro__decode_str(firstbuf, unparsbuf,
+ (void) key__decode_str(firstbuf, unparsbuf,
sizeof(unparsbuf), STRQQ);
(void) fprintf(el->el_outfile,
"%-15s-> is undefined\n", unparsbuf);
@@ -1167,17 +1166,17 @@ map_print_some_keys(EditLine *el, el_action_t *map, Int first, Int last)
for (bp = el->el_map.help; bp < ep; bp++) {
if (bp->func == map[first]) {
if (first == last) {
- (void) keymacro__decode_str(firstbuf, unparsbuf,
+ (void) key__decode_str(firstbuf, unparsbuf,
sizeof(unparsbuf), STRQQ);
- (void) fprintf(el->el_outfile, "%-15s-> " FSTR "\n",
+ (void) fprintf(el->el_outfile, "%-15s-> %s\n",
unparsbuf, bp->name);
} else {
- (void) keymacro__decode_str(firstbuf, unparsbuf,
+ (void) key__decode_str(firstbuf, unparsbuf,
sizeof(unparsbuf), STRQQ);
- (void) keymacro__decode_str(lastbuf, extrabuf,
+ (void) key__decode_str(lastbuf, extrabuf,
sizeof(extrabuf), STRQQ);
(void) fprintf(el->el_outfile,
- "%-4s to %-7s-> " FSTR "\n",
+ "%-4s to %-7s-> %s\n",
unparsbuf, extrabuf, bp->name);
}
return;
@@ -1185,14 +1184,14 @@ map_print_some_keys(EditLine *el, el_action_t *map, Int first, Int last)
}
#ifdef MAP_DEBUG
if (map == el->el_map.key) {
- (void) keymacro__decode_str(firstbuf, unparsbuf,
+ (void) key__decode_str(firstbuf, unparsbuf,
sizeof(unparsbuf), STRQQ);
(void) fprintf(el->el_outfile,
"BUG!!! %s isn't bound to anything.\n", unparsbuf);
(void) fprintf(el->el_outfile, "el->el_map.key[%d] == %d\n",
first, el->el_map.key[first]);
} else {
- (void) keymacro__decode_str(firstbuf, unparsbuf,
+ (void) key__decode_str(firstbuf, unparsbuf,
sizeof(unparsbuf), STRQQ);
(void) fprintf(el->el_outfile,
"BUG!!! %s isn't bound to anything.\n", unparsbuf);
@@ -1233,9 +1232,9 @@ map_print_all_keys(EditLine *el)
map_print_some_keys(el, el->el_map.alt, prev, i - 1);
(void) fprintf(el->el_outfile, "Multi-character bindings\n");
- keymacro_print(el, STR(""));
+ key_print(el, "");
(void) fprintf(el->el_outfile, "Arrow key bindings\n");
- terminal_print_arrow(el, STR(""));
+ term_print_arrow(el, "");
}
@@ -1243,21 +1242,21 @@ map_print_all_keys(EditLine *el)
* Add/remove/change bindings
*/
protected int
-map_bind(EditLine *el, int argc, const Char **argv)
+map_bind(EditLine *el, int argc, const char **argv)
{
el_action_t *map;
int ntype, rem;
- const Char *p;
- Char inbuf[EL_BUFSIZ];
- Char outbuf[EL_BUFSIZ];
- const Char *in = NULL;
- Char *out;
+ const char *p;
+ char inbuf[EL_BUFSIZ];
+ char outbuf[EL_BUFSIZ];
+ const char *in = NULL;
+ char *out;
el_bindings_t *bp, *ep;
int cmd;
int key;
if (argv == NULL)
- return -1;
+ return (-1);
map = el->el_map.key;
ntype = XK_CMD;
@@ -1287,63 +1286,63 @@ map_bind(EditLine *el, int argc, const Char **argv)
case 'v':
map_init_vi(el);
- return 0;
+ return (0);
case 'e':
map_init_emacs(el);
- return 0;
+ return (0);
case 'l':
ep = &el->el_map.help[el->el_map.nfunc];
for (bp = el->el_map.help; bp < ep; bp++)
(void) fprintf(el->el_outfile,
- "" FSTR "\n\t" FSTR "\n",
+ "%s\n\t%s\n",
bp->name, bp->description);
- return 0;
+ return (0);
default:
(void) fprintf(el->el_errfile,
- "" FSTR ": Invalid switch `" FCHAR "'.\n",
- argv[0], (Int)p[1]);
+ "%s: Invalid switch `%c'.\n",
+ argv[0], p[1]);
}
else
break;
if (argv[argc] == NULL) {
map_print_all_keys(el);
- return 0;
+ return (0);
}
if (key)
in = argv[argc++];
else if ((in = parse__string(inbuf, argv[argc++])) == NULL) {
(void) fprintf(el->el_errfile,
- "" FSTR ": Invalid \\ or ^ in instring.\n",
+ "%s: Invalid \\ or ^ in instring.\n",
argv[0]);
- return -1;
+ return (-1);
}
if (rem) {
if (key) {
- (void) terminal_clear_arrow(el, in);
- return -1;
+ (void) term_clear_arrow(el, in);
+ return (-1);
}
if (in[1])
- (void) keymacro_delete(el, in);
+ (void) key_delete(el, in);
else if (map[(unsigned char) *in] == ED_SEQUENCE_LEAD_IN)
- (void) keymacro_delete(el, in);
+ (void) key_delete(el, in);
else
map[(unsigned char) *in] = ED_UNASSIGNED;
- return 0;
+ return (0);
}
if (argv[argc] == NULL) {
if (key)
- terminal_print_arrow(el, in);
+ term_print_arrow(el, in);
else
map_print_key(el, map, in);
- return 0;
+ return (0);
}
#ifdef notyet
if (argv[argc + 1] != NULL) {
- bindkeymacro_usage();
- return -1;
+ bindkey_usage();
+ return (-1);
}
#endif
@@ -1352,42 +1351,40 @@ map_bind(EditLine *el, int argc, const Char **argv)
case XK_EXE:
if ((out = parse__string(outbuf, argv[argc])) == NULL) {
(void) fprintf(el->el_errfile,
- "" FSTR ": Invalid \\ or ^ in outstring.\n", argv[0]);
- return -1;
+ "%s: Invalid \\ or ^ in outstring.\n", argv[0]);
+ return (-1);
}
if (key)
- terminal_set_arrow(el, in, keymacro_map_str(el, out), ntype);
+ term_set_arrow(el, in, key_map_str(el, out), ntype);
else
- keymacro_add(el, in, keymacro_map_str(el, out), ntype);
+ key_add(el, in, key_map_str(el, out), ntype);
map[(unsigned char) *in] = ED_SEQUENCE_LEAD_IN;
break;
case XK_CMD:
if ((cmd = parse_cmd(el, argv[argc])) == -1) {
(void) fprintf(el->el_errfile,
- "" FSTR ": Invalid command `" FSTR "'.\n",
- argv[0], argv[argc]);
- return -1;
+ "%s: Invalid command `%s'.\n", argv[0], argv[argc]);
+ return (-1);
}
if (key)
- terminal_set_arrow(el, in, keymacro_map_cmd(el, cmd), ntype);
+ term_set_arrow(el, in, key_map_cmd(el, cmd), ntype);
else {
if (in[1]) {
- keymacro_add(el, in, keymacro_map_cmd(el, cmd), ntype);
+ key_add(el, in, key_map_cmd(el, cmd), ntype);
map[(unsigned char) *in] = ED_SEQUENCE_LEAD_IN;
} else {
- keymacro_clear(el, map, in);
- map[(unsigned char) *in] = (el_action_t)cmd;
+ key_clear(el, map, in);
+ map[(unsigned char) *in] = cmd;
}
}
break;
- /* coverity[dead_error_begin] */
default:
EL_ABORT((el->el_errfile, "Bad XK_ type %d\n", ntype));
break;
}
- return 0;
+ return (0);
}
@@ -1395,30 +1392,29 @@ map_bind(EditLine *el, int argc, const Char **argv)
* add a user defined function
*/
protected int
-map_addfunc(EditLine *el, const Char *name, const Char *help, el_func_t func)
+map_addfunc(EditLine *el, const char *name, const char *help, el_func_t func)
{
void *p;
- size_t nf = el->el_map.nfunc + 1;
+ int nf = el->el_map.nfunc + 1;
if (name == NULL || help == NULL || func == NULL)
- return -1;
+ return (-1);
- if ((p = el_realloc(el->el_map.func, nf *
- sizeof(*el->el_map.func))) == NULL)
- return -1;
- el->el_map.func = p;
- if ((p = el_realloc(el->el_map.help, nf * sizeof(*el->el_map.help)))
+ if ((p = el_realloc(el->el_map.func, nf * sizeof(el_func_t))) == NULL)
+ return (-1);
+ el->el_map.func = (el_func_t *) p;
+ if ((p = el_realloc(el->el_map.help, nf * sizeof(el_bindings_t)))
== NULL)
- return -1;
- el->el_map.help = p;
+ return (-1);
+ el->el_map.help = (el_bindings_t *) p;
- nf = (size_t)el->el_map.nfunc;
+ nf = el->el_map.nfunc;
el->el_map.func[nf] = func;
el->el_map.help[nf].name = name;
- el->el_map.help[nf].func = (int)nf;
+ el->el_map.help[nf].func = nf;
el->el_map.help[nf].description = help;
el->el_map.nfunc++;
- return 0;
+ return (0);
}
diff --git a/lib/libedit/map.h b/lib/libedit/map.h
index 0380297..a76d872 100644
--- a/lib/libedit/map.h
+++ b/lib/libedit/map.h
@@ -1,5 +1,3 @@
-/* $NetBSD: map.h,v 1.10 2014/07/06 18:15:34 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +30,7 @@
* SUCH DAMAGE.
*
* @(#)map.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: map.h,v 1.8 2003/08/07 16:44:32 agc Exp $
* $FreeBSD$
*/
@@ -42,9 +41,9 @@
#define _h_el_map
typedef struct el_bindings_t { /* for the "bind" shell command */
- const Char *name; /* function name for bind command */
+ const char *name; /* function name for bind command */
int func; /* function numeric value */
- const Char *description; /* description of function */
+ const char *description; /* description of function */
} el_bindings_t;
@@ -58,21 +57,19 @@ typedef struct el_map_t {
int type; /* Emacs or vi */
el_bindings_t *help; /* The help for the editor functions */
el_func_t *func; /* List of available functions */
- size_t nfunc; /* The number of functions/help items */
+ int nfunc; /* The number of functions/help items */
} el_map_t;
#define MAP_EMACS 0
#define MAP_VI 1
-#define N_KEYS 256
-
-protected int map_bind(EditLine *, int, const Char **);
+protected int map_bind(EditLine *, int, const char **);
protected int map_init(EditLine *);
protected void map_end(EditLine *);
protected void map_init_vi(EditLine *);
protected void map_init_emacs(EditLine *);
-protected int map_set_editor(EditLine *, Char *);
-protected int map_get_editor(EditLine *, const Char **);
-protected int map_addfunc(EditLine *, const Char *, const Char *, el_func_t);
+protected int map_set_editor(EditLine *, char *);
+protected int map_get_editor(EditLine *, const char **);
+protected int map_addfunc(EditLine *, const char *, const char *, el_func_t);
#endif /* _h_el_map */
diff --git a/lib/libedit/parse.c b/lib/libedit/parse.c
index 1c19cc7..0ffe51d 100644
--- a/lib/libedit/parse.c
+++ b/lib/libedit/parse.c
@@ -1,5 +1,3 @@
-/* $NetBSD: parse.c,v 1.27 2014/07/06 18:15:34 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: parse.c,v 1.22 2005/05/29 04:58:15 lukem Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: parse.c,v 1.27 2014/07/06 18:15:34 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -56,21 +51,22 @@ __FBSDID("$FreeBSD$");
* settc
* setty
*/
+#include "sys.h"
#include "el.h"
#include <stdlib.h>
private const struct {
- const Char *name;
- int (*func)(EditLine *, int, const Char **);
+ const char *name;
+ int (*func)(EditLine *, int, const char **);
} cmds[] = {
- { STR("bind"), map_bind },
- { STR("echotc"), terminal_echotc },
- { STR("edit"), el_editmode },
- { STR("history"), hist_command },
- { STR("telltc"), terminal_telltc },
- { STR("settc"), terminal_settc },
- { STR("setty"), tty_stty },
- { NULL, NULL }
+ { "bind", map_bind },
+ { "echotc", term_echotc },
+ { "edit", el_editmode },
+ { "history", hist_command },
+ { "telltc", term_telltc },
+ { "settc", term_settc },
+ { "setty", tty_stty },
+ { NULL, NULL }
};
@@ -78,17 +74,17 @@ private const struct {
* Parse a line and dispatch it
*/
protected int
-parse_line(EditLine *el, const Char *line)
+parse_line(EditLine *el, const char *line)
{
- const Char **argv;
+ const char **argv;
int argc;
- TYPE(Tokenizer) *tok;
+ Tokenizer *tok;
- tok = FUN(tok,init)(NULL);
- FUN(tok,str)(tok, line, &argc, &argv);
- argc = FUN(el,parse)(el, argc, argv);
- FUN(tok,end)(tok);
- return argc;
+ tok = tok_init(NULL);
+ tok_str(tok, line, &argc, &argv);
+ argc = el_parse(el, argc, argv);
+ tok_end(tok);
+ return (argc);
}
@@ -96,57 +92,57 @@ parse_line(EditLine *el, const Char *line)
* Command dispatcher
*/
public int
-FUN(el,parse)(EditLine *el, int argc, const Char *argv[])
+el_parse(EditLine *el, int argc, const char *argv[])
{
- const Char *ptr;
+ const char *ptr;
int i;
if (argc < 1)
- return -1;
- ptr = Strchr(argv[0], ':');
+ return (-1);
+ ptr = strchr(argv[0], ':');
if (ptr != NULL) {
- Char *tprog;
+ char *tprog;
size_t l;
if (ptr == argv[0])
- return 0;
- l = (size_t)(ptr - argv[0] - 1);
- tprog = el_malloc((l + 1) * sizeof(*tprog));
+ return (0);
+ l = ptr - argv[0] - 1;
+ tprog = (char *) el_malloc(l + 1);
if (tprog == NULL)
- return 0;
- (void) Strncpy(tprog, argv[0], l);
+ return (0);
+ (void) strncpy(tprog, argv[0], l);
tprog[l] = '\0';
ptr++;
- l = (size_t)el_match(el->el_prog, tprog);
+ l = el_match(el->el_prog, tprog);
el_free(tprog);
if (!l)
- return 0;
+ return (0);
} else
ptr = argv[0];
for (i = 0; cmds[i].name != NULL; i++)
- if (Strcmp(cmds[i].name, ptr) == 0) {
+ if (strcmp(cmds[i].name, ptr) == 0) {
i = (*cmds[i].func) (el, argc, argv);
- return -i;
+ return (-i);
}
- return -1;
+ return (-1);
}
/* parse__escape():
- * Parse a string of the form ^<char> \<odigit> \<char> \U+xxxx and return
+ * Parse a string of the form ^<char> \<odigit> \<char> and return
* the appropriate character or -1 if the escape is not valid
*/
protected int
-parse__escape(const Char **ptr)
+parse__escape(const char **ptr)
{
- const Char *p;
- Int c;
+ const char *p;
+ int c;
p = *ptr;
if (p[1] == 0)
- return -1;
+ return (-1);
if (*p == '\\') {
p++;
@@ -175,28 +171,6 @@ parse__escape(const Char **ptr)
case 'e':
c = '\033'; /* Escape */
break;
- case 'U': /* Unicode \U+xxxx or \U+xxxxx format */
- {
- int i;
- const Char hex[] = STR("0123456789ABCDEF");
- const Char *h;
- ++p;
- if (*p++ != '+')
- return -1;
- c = 0;
- for (i = 0; i < 5; ++i) {
- h = Strchr(hex, *p++);
- if (!h && i < 4)
- return -1;
- else if (h)
- c = (c << 4) | ((int)(h - hex));
- else
- --p;
- }
- if (c > 0x10FFFF) /* outside valid character range */
- return -1;
- break;
- }
case '0':
case '1':
case '2':
@@ -216,8 +190,8 @@ parse__escape(const Char **ptr)
}
c = (c << 3) | (ch - '0');
}
- if ((c & (wint_t)0xffffff00) != (wint_t)0)
- return -1;
+ if ((c & 0xffffff00) != 0)
+ return (-1);
--p;
break;
}
@@ -231,28 +205,28 @@ parse__escape(const Char **ptr)
} else
c = *p;
*ptr = ++p;
- return c;
+ return ((unsigned char)c);
}
/* parse__string():
* Parse the escapes from in and put the raw string out
*/
-protected Char *
-parse__string(Char *out, const Char *in)
+protected char *
+parse__string(char *out, const char *in)
{
- Char *rv = out;
+ char *rv = out;
int n;
for (;;)
switch (*in) {
case '\0':
*out = '\0';
- return rv;
+ return (rv);
case '\\':
case '^':
if ((n = parse__escape(&in)) == -1)
- return NULL;
+ return (NULL);
*out++ = n;
break;
@@ -276,13 +250,12 @@ parse__string(Char *out, const Char *in)
* or -1 if one is not found
*/
protected int
-parse_cmd(EditLine *el, const Char *cmd)
+parse_cmd(EditLine *el, const char *cmd)
{
- el_bindings_t *b = el->el_map.help;
- size_t i;
+ el_bindings_t *b;
- for (i = 0; i < el->el_map.nfunc; i++)
- if (Strcmp(b[i].name, cmd) == 0)
- return b[i].func;
- return -1;
+ for (b = el->el_map.help; b->name != NULL; b++)
+ if (strcmp(b->name, cmd) == 0)
+ return (b->func);
+ return (-1);
}
diff --git a/lib/libedit/parse.h b/lib/libedit/parse.h
index 9d8c934..cca4abf 100644
--- a/lib/libedit/parse.h
+++ b/lib/libedit/parse.h
@@ -1,5 +1,3 @@
-/* $NetBSD: parse.h,v 1.7 2009/12/30 22:37:40 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +30,7 @@
* SUCH DAMAGE.
*
* @(#)parse.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: parse.h,v 1.6 2005/05/29 04:58:15 lukem Exp $
* $FreeBSD$
*/
@@ -41,9 +40,9 @@
#ifndef _h_el_parse
#define _h_el_parse
-protected int parse_line(EditLine *, const Char *);
-protected int parse__escape(const Char **);
-protected Char *parse__string(Char *, const Char *);
-protected int parse_cmd(EditLine *, const Char *);
+protected int parse_line(EditLine *, const char *);
+protected int parse__escape(const char **);
+protected char *parse__string(char *, const char *);
+protected int parse_cmd(EditLine *, const char *);
#endif /* _h_el_parse */
diff --git a/lib/libedit/prompt.c b/lib/libedit/prompt.c
index 3696d0c..2d37b67 100644
--- a/lib/libedit/prompt.c
+++ b/lib/libedit/prompt.c
@@ -1,5 +1,3 @@
-/* $NetBSD: prompt.c,v 1.20 2011/07/29 15:16:33 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: prompt.c,v 1.14 2009/03/31 17:38:27 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)prompt.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: prompt.c,v 1.20 2011/07/29 15:16:33 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -46,46 +41,50 @@ __FBSDID("$FreeBSD$");
/*
* prompt.c: Prompt printing functions
*/
+#include "sys.h"
#include <stdio.h>
#include "el.h"
-private Char *prompt_default(EditLine *);
-private Char *prompt_default_r(EditLine *);
+private char *prompt_default(EditLine *);
+private char *prompt_default_r(EditLine *);
/* prompt_default():
* Just a default prompt, in case the user did not provide one
*/
-private Char *
+private char *
/*ARGSUSED*/
-prompt_default(EditLine *el __attribute__((__unused__)))
+prompt_default(EditLine *el __unused)
{
- static Char a[3] = {'?', ' ', '\0'};
+ static char a[3] = {'?', ' ', '\0'};
- return a;
+ return (a);
}
/* prompt_default_r():
* Just a default rprompt, in case the user did not provide one
*/
-private Char *
+private char *
/*ARGSUSED*/
-prompt_default_r(EditLine *el __attribute__((__unused__)))
+prompt_default_r(EditLine *el __unused)
{
- static Char a[1] = {'\0'};
+ static char a[1] = {'\0'};
- return a;
+ return (a);
}
/* prompt_print():
* Print the prompt and update the prompt position.
+ * We use an array of integers in case we want to pass
+ * literal escape sequences in the prompt and we want a
+ * bit to flag them
*/
protected void
prompt_print(EditLine *el, int op)
{
el_prompt_t *elp;
- Char *p;
+ char *p;
int ignore = 0;
if (op == EL_PROMPT)
@@ -93,19 +92,13 @@ prompt_print(EditLine *el, int op)
else
elp = &el->el_rprompt;
- if (elp->p_wide)
- p = (*elp->p_func)(el);
- else
- p = ct_decode_string((char *)(void *)(*elp->p_func)(el),
- &el->el_scratch);
-
- for (; *p; p++) {
+ for (p = (*elp->p_func)(el); *p; p++) {
if (elp->p_ignore == *p) {
ignore = !ignore;
continue;
}
if (ignore)
- terminal__putc(el, *p);
+ term__putc(el, *p);
else
re_putc(el, *p, 1);
}
@@ -139,7 +132,7 @@ prompt_init(EditLine *el)
*/
protected void
/*ARGSUSED*/
-prompt_end(EditLine *el __attribute__((__unused__)))
+prompt_end(EditLine *el __unused)
{
}
@@ -148,7 +141,7 @@ prompt_end(EditLine *el __attribute__((__unused__)))
* Install a prompt printing function
*/
protected int
-prompt_set(EditLine *el, el_pfunc_t prf, Char c, int op, int wide)
+prompt_set(EditLine *el, el_pfunc_t prf, char c, int op)
{
el_prompt_t *p;
@@ -162,15 +155,13 @@ prompt_set(EditLine *el, el_pfunc_t prf, Char c, int op, int wide)
p->p_func = prompt_default;
else
p->p_func = prompt_default_r;
- } else {
+ } else
p->p_func = prf;
- }
p->p_ignore = c;
p->p_pos.v = 0;
p->p_pos.h = 0;
- p->p_wide = wide;
return 0;
}
@@ -180,7 +171,7 @@ prompt_set(EditLine *el, el_pfunc_t prf, Char c, int op, int wide)
* Retrieve the prompt printing function
*/
protected int
-prompt_get(EditLine *el, el_pfunc_t *prf, Char *c, int op)
+prompt_get(EditLine *el, el_pfunc_t *prf, char *c, int op)
{
el_prompt_t *p;
@@ -192,8 +183,8 @@ prompt_get(EditLine *el, el_pfunc_t *prf, Char *c, int op)
else
p = &el->el_rprompt;
- if (prf)
- *prf = p->p_func;
+ *prf = el->el_rprompt.p_func;
+
if (c)
*c = p->p_ignore;
diff --git a/lib/libedit/prompt.h b/lib/libedit/prompt.h
index 260c818..c796d93 100644
--- a/lib/libedit/prompt.h
+++ b/lib/libedit/prompt.h
@@ -1,5 +1,3 @@
-/* $NetBSD: prompt.h,v 1.10 2009/12/30 22:37:40 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +30,7 @@
* SUCH DAMAGE.
*
* @(#)prompt.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: prompt.h,v 1.9 2009/03/31 17:38:27 christos Exp $
* $FreeBSD$
*/
@@ -43,18 +42,18 @@
#include "histedit.h"
-typedef Char *(*el_pfunc_t)(EditLine *);
+typedef char * (*el_pfunc_t)(EditLine*);
typedef struct el_prompt_t {
el_pfunc_t p_func; /* Function to return the prompt */
coord_t p_pos; /* position in the line after prompt */
- Char p_ignore; /* character to start/end literal */
- int p_wide;
+ char p_ignore; /* character to start/end literal
+*/
} el_prompt_t;
protected void prompt_print(EditLine *, int);
-protected int prompt_set(EditLine *, el_pfunc_t, Char, int, int);
-protected int prompt_get(EditLine *, el_pfunc_t *, Char *, int);
+protected int prompt_set(EditLine *, el_pfunc_t, char, int);
+protected int prompt_get(EditLine *, el_pfunc_t *, char *, int);
protected int prompt_init(EditLine *);
protected void prompt_end(EditLine *);
diff --git a/lib/libedit/read.c b/lib/libedit/read.c
index 9740599..f0b5ef3 100644
--- a/lib/libedit/read.c
+++ b/lib/libedit/read.c
@@ -1,5 +1,3 @@
-/* $NetBSD: read.c,v 1.71 2014/07/06 18:15:34 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: read.c,v 1.52 2009/07/22 15:57:00 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: read.c,v 1.71 2014/07/06 18:15:34 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -47,19 +42,19 @@ __FBSDID("$FreeBSD$");
* read.c: Clean this junk up! This is horrible code.
* Terminal read functions
*/
+#include "sys.h"
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
-#include <limits.h>
#include "el.h"
-#define OKCMD -1 /* must be -1! */
+#define OKCMD -1
private int read__fixio(int, int);
private int read_preread(EditLine *);
-private int read_char(EditLine *, Char *);
-private int read_getcmd(EditLine *, el_action_t *, Char *);
+private int read_char(EditLine *, char *);
+private int read_getcmd(EditLine *, el_action_t *, char *);
private void read_pop(c_macro_t *);
/* read_init():
@@ -93,7 +88,7 @@ el_read_setfn(EditLine *el, el_rfunc_t rc)
protected el_rfunc_t
el_read_getfn(EditLine *el)
{
- return el->el_read.read_char == read_char ?
+ return (el->el_read.read_char == read_char) ?
EL_BUILTIN_GETCFN : el->el_read.read_char;
}
@@ -126,7 +121,7 @@ read_debug(EditLine *el)
*/
/* ARGSUSED */
private int
-read__fixio(int fd __attribute__((__unused__)), int e)
+read__fixio(int fd __unused, int e)
{
switch (e) {
@@ -135,7 +130,7 @@ read__fixio(int fd __attribute__((__unused__)), int e)
#ifdef EWOULDBLOCK
case EWOULDBLOCK:
#ifndef TRY_AGAIN
-#define TRY_AGAIN
+#define TRY_AGAIN
#endif
#endif /* EWOULDBLOCK */
@@ -143,7 +138,7 @@ read__fixio(int fd __attribute__((__unused__)), int e)
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EAGAIN:
#ifndef TRY_AGAIN
-#define TRY_AGAIN
+#define TRY_AGAIN
#endif
#endif /* EWOULDBLOCK && EWOULDBLOCK != EAGAIN */
#endif /* POSIX && EAGAIN */
@@ -152,10 +147,10 @@ read__fixio(int fd __attribute__((__unused__)), int e)
#ifdef TRY_AGAIN
#if defined(F_SETFL) && defined(O_NDELAY)
if ((e = fcntl(fd, F_GETFL, 0)) == -1)
- return -1;
+ return (-1);
if (fcntl(fd, F_SETFL, e & ~O_NDELAY) == -1)
- return -1;
+ return (-1);
else
e = 1;
#endif /* F_SETFL && O_NDELAY */
@@ -164,21 +159,21 @@ read__fixio(int fd __attribute__((__unused__)), int e)
{
int zero = 0;
- if (ioctl(fd, FIONBIO, &zero) == -1)
- return -1;
+ if (ioctl(fd, FIONBIO, (ioctl_t) & zero) == -1)
+ return (-1);
else
e = 1;
}
#endif /* FIONBIO */
#endif /* TRY_AGAIN */
- return e ? 0 : -1;
+ return (e ? 0 : -1);
case EINTR:
- return 0;
+ return (0);
default:
- return -1;
+ return (-1);
}
}
@@ -192,13 +187,10 @@ read_preread(EditLine *el)
int chrs = 0;
if (el->el_tty.t_mode == ED_IO)
- return 0;
+ return (0);
-#ifndef WIDECHAR
-/* FIONREAD attempts to buffer up multiple bytes, and to make that work
- * properly with partial wide/UTF-8 characters would need some careful work. */
#ifdef FIONREAD
- (void) ioctl(el->el_infd, FIONREAD, &chrs);
+ (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs);
if (chrs > 0) {
char buf[EL_BUFSIZ];
@@ -210,8 +202,8 @@ read_preread(EditLine *el)
}
}
#endif /* FIONREAD */
-#endif
- return chrs > 0;
+
+ return (chrs > 0);
}
@@ -219,36 +211,35 @@ read_preread(EditLine *el)
* Push a macro
*/
public void
-FUN(el,push)(EditLine *el, const Char *str)
+el_push(EditLine *el, const char *str)
{
c_macro_t *ma = &el->el_chared.c_macro;
if (str != NULL && ma->level + 1 < EL_MAXMACRO) {
ma->level++;
- if ((ma->macro[ma->level] = Strdup(str)) != NULL)
+ if ((ma->macro[ma->level] = el_strdup(str)) != NULL)
return;
ma->level--;
}
- terminal_beep(el);
- terminal__flush(el);
+ term_beep(el);
+ term__flush(el);
}
/* read_getcmd():
- * Get next command from the input stream, return OKCMD on success.
- * Character values > 255 are not looked up in the map, but inserted.
+ * Return next command from the input stream.
*/
private int
-read_getcmd(EditLine *el, el_action_t *cmdnum, Char *ch)
+read_getcmd(EditLine *el, el_action_t *cmdnum, char *ch)
{
el_action_t cmd;
int num;
el->el_errno = 0;
do {
- if ((num = FUN(el,getc)(el, ch)) != 1) {/* if EOF or error */
+ if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */
el->el_errno = num == 0 ? 0 : errno;
- return 0; /* not OKCMD */
+ return (num);
}
#ifdef KANJI
@@ -263,20 +254,15 @@ read_getcmd(EditLine *el, el_action_t *cmdnum, Char *ch)
el->el_state.metanext = 0;
*ch |= 0200;
}
-#ifdef WIDECHAR
- if (*ch >= N_KEYS)
- cmd = ED_INSERT;
- else
-#endif
- cmd = el->el_map.current[(unsigned char) *ch];
+ cmd = el->el_map.current[(unsigned char) *ch];
if (cmd == ED_SEQUENCE_LEAD_IN) {
- keymacro_value_t val;
- switch (keymacro_get(el, ch, &val)) {
+ key_value_t val;
+ switch (key_get(el, ch, &val)) {
case XK_CMD:
cmd = val.cmd;
break;
case XK_STR:
- FUN(el,push)(el, val.str);
+ el_push(el, val.str);
break;
#ifdef notyet
case XK_EXE:
@@ -293,90 +279,34 @@ read_getcmd(EditLine *el, el_action_t *cmdnum, Char *ch)
el->el_map.current = el->el_map.key;
} while (cmd == ED_SEQUENCE_LEAD_IN);
*cmdnum = cmd;
- return OKCMD;
+ return (OKCMD);
}
-#ifdef WIDECHAR
-/* utf8_islead():
- * Test whether a byte is a leading byte of a UTF-8 sequence.
- */
-private int
-utf8_islead(int c)
-{
- return c < 0x80 || /* single byte char */
- (c >= 0xc2 && c <= 0xf4); /* start of multibyte sequence */
-}
-#endif
/* read_char():
* Read a character from the tty.
*/
private int
-read_char(EditLine *el, Char *cp)
+read_char(EditLine *el, char *cp)
{
ssize_t num_read;
int tried = 0;
- char cbuf[MB_LEN_MAX];
- size_t cbp = 0;
- int bytes = 0;
again:
el->el_signal->sig_no = 0;
- while ((num_read = read(el->el_infd, cbuf + cbp, (size_t)1)) == -1) {
- int e = errno;
- switch (el->el_signal->sig_no) {
- case SIGCONT:
- FUN(el,set)(el, EL_REFRESH);
- /*FALLTHROUGH*/
- case SIGWINCH:
+ while ((num_read = read(el->el_infd, cp, 1)) == -1) {
+ if (el->el_signal->sig_no == SIGCONT) {
sig_set(el);
+ el_set(el, EL_REFRESH);
goto again;
- default:
- break;
}
- if (!tried && read__fixio(el->el_infd, e) == 0)
+ if (!tried && read__fixio(el->el_infd, errno) == 0)
tried = 1;
else {
- errno = e;
*cp = '\0';
- return -1;
+ return (-1);
}
}
-
- /* Test for EOF */
- if (num_read == 0) {
- errno = 0;
- *cp = '\0';
- return 0;
- }
-
-#ifdef WIDECHAR
- if (el->el_flags & CHARSET_IS_UTF8) {
- if (!utf8_islead((unsigned char)cbuf[0]))
- goto again; /* discard the byte we read and try again */
- ++cbp;
- if ((bytes = ct_mbtowc(cp, cbuf, cbp)) == -1) {
- ct_mbtowc_reset;
- if (cbp >= MB_LEN_MAX) { /* "shouldn't happen" */
- errno = EILSEQ;
- *cp = '\0';
- return -1;
- }
- goto again;
- }
- } else if (isascii((unsigned char)cbuf[0]) ||
- /* we don't support other multibyte charsets */
- ++cbp != 1 ||
- /* Try non-ASCII characters in a 8-bit character set */
- (bytes = ct_mbtowc(cp, cbuf, cbp)) != 1)
-#endif
- *cp = (unsigned char)cbuf[0];
-
- if ((el->el_flags & IGNORE_EXTCHARS) && bytes > 1) {
- cbp = 0; /* skip this character */
- goto again;
- }
-
return (int)num_read;
}
@@ -399,12 +329,12 @@ read_pop(c_macro_t *ma)
* Read a character
*/
public int
-FUN(el,getc)(EditLine *el, Char *cp)
+el_getc(EditLine *el, char *cp)
{
int num_read;
c_macro_t *ma = &el->el_chared.c_macro;
- terminal__flush(el);
+ term__flush(el);
for (;;) {
if (ma->level < 0) {
if (!read_preread(el))
@@ -419,36 +349,30 @@ FUN(el,getc)(EditLine *el, Char *cp)
continue;
}
- *cp = ma->macro[0][ma->offset++];
+ *cp = ma->macro[0][ma->offset++] & 0377;
if (ma->macro[0][ma->offset] == '\0') {
/* Needed for QuoteMode On */
read_pop(ma);
}
- return 1;
+ return (1);
}
#ifdef DEBUG_READ
(void) fprintf(el->el_errfile, "Turning raw mode on\n");
#endif /* DEBUG_READ */
if (tty_rawmode(el) < 0)/* make sure the tty is set up correctly */
- return 0;
+ return (0);
#ifdef DEBUG_READ
(void) fprintf(el->el_errfile, "Reading a character\n");
#endif /* DEBUG_READ */
num_read = (*el->el_read.read_char)(el, cp);
- if (num_read < 0)
- el->el_errno = errno;
-#ifdef WIDECHAR
- if (el->el_flags & NARROW_READ)
- *cp = *(char *)(void *)cp;
-#endif
#ifdef DEBUG_READ
(void) fprintf(el->el_errfile, "Got it %c\n", *cp);
#endif /* DEBUG_READ */
- return num_read;
+ return (num_read);
}
protected void
@@ -469,7 +393,7 @@ read_prepare(EditLine *el)
re_refresh(el); /* print the prompt */
if (el->el_flags & UNBUFFERED)
- terminal__flush(el);
+ term__flush(el);
}
protected void
@@ -481,13 +405,13 @@ read_finish(EditLine *el)
sig_clr(el);
}
-public const Char *
-FUN(el,gets)(EditLine *el, int *nread)
+public const char *
+el_gets(EditLine *el, int *nread)
{
int retval;
el_action_t cmdnum = 0;
int num; /* how many chars we have read at NL */
- Char ch, *cp;
+ char ch;
int crlf = 0;
int nrb;
#ifdef FIONREAD
@@ -499,14 +423,14 @@ FUN(el,gets)(EditLine *el, int *nread)
*nread = 0;
if (el->el_flags & NO_TTY) {
+ char *cp = el->el_line.buffer;
size_t idx;
- cp = el->el_line.buffer;
while ((num = (*el->el_read.read_char)(el, cp)) == 1) {
/* make sure there is space for next character */
if (cp + 1 >= el->el_line.limit) {
- idx = (size_t)(cp - el->el_line.buffer);
- if (!ch_enlargebufs(el, (size_t)2))
+ idx = (cp - el->el_line.buffer);
+ if (!ch_enlargebufs(el, 2))
break;
cp = &el->el_line.buffer[idx];
}
@@ -516,13 +440,13 @@ FUN(el,gets)(EditLine *el, int *nread)
if (cp[-1] == '\r' || cp[-1] == '\n')
break;
}
- if (num == -1) {
- if (errno == EINTR)
- cp = el->el_line.buffer;
+ if (num == -1)
el->el_errno = errno;
- }
- goto noedit;
+ el->el_line.cursor = el->el_line.lastchar = cp;
+ *cp = '\0';
+ *nread = (int)(el->el_line.cursor - el->el_line.buffer);
+ goto done;
}
@@ -530,12 +454,12 @@ FUN(el,gets)(EditLine *el, int *nread)
if (el->el_tty.t_mode == EX_IO && ma->level < 0) {
long chrs = 0;
- (void) ioctl(el->el_infd, FIONREAD, &chrs);
+ (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs);
if (chrs == 0) {
if (tty_rawmode(el) < 0) {
errno = 0;
*nread = 0;
- return NULL;
+ return (NULL);
}
}
}
@@ -545,6 +469,7 @@ FUN(el,gets)(EditLine *el, int *nread)
read_prepare(el);
if (el->el_flags & EDIT_DISABLED) {
+ char *cp;
size_t idx;
if ((el->el_flags & UNBUFFERED) == 0)
@@ -552,13 +477,13 @@ FUN(el,gets)(EditLine *el, int *nread)
else
cp = el->el_line.lastchar;
- terminal__flush(el);
+ term__flush(el);
while ((num = (*el->el_read.read_char)(el, cp)) == 1) {
/* make sure there is space next character */
if (cp + 1 >= el->el_line.limit) {
- idx = (size_t)(cp - el->el_line.buffer);
- if (!ch_enlargebufs(el, (size_t)2))
+ idx = (cp - el->el_line.buffer);
+ if (!ch_enlargebufs(el, 2))
break;
cp = &el->el_line.buffer[idx];
}
@@ -571,12 +496,12 @@ FUN(el,gets)(EditLine *el, int *nread)
}
if (num == -1) {
- if (errno == EINTR)
- cp = el->el_line.buffer;
el->el_errno = errno;
}
- goto noedit;
+ el->el_line.cursor = el->el_line.lastchar = cp;
+ *cp = '\0';
+ goto done;
}
for (num = OKCMD; num == OKCMD;) { /* while still editing this
@@ -586,20 +511,13 @@ FUN(el,gets)(EditLine *el, int *nread)
#endif /* DEBUG_EDIT */
/* if EOF or error */
if ((num = read_getcmd(el, &cmdnum, &ch)) != OKCMD) {
- num = -1;
#ifdef DEBUG_READ
(void) fprintf(el->el_errfile,
"Returning from el_gets %d\n", num);
#endif /* DEBUG_READ */
break;
}
- if (el->el_errno == EINTR) {
- el->el_line.buffer[0] = '\0';
- el->el_line.lastchar =
- el->el_line.cursor = el->el_line.buffer;
- break;
- }
- if ((size_t)cmdnum >= el->el_map.nfunc) { /* BUG CHECK command */
+ if ((unsigned int)cmdnum >= (unsigned int)el->el_map.nfunc) { /* BUG CHECK command */
#ifdef DEBUG_EDIT
(void) fprintf(el->el_errfile,
"ERROR: illegal command from key 0%o\r\n", ch);
@@ -629,7 +547,7 @@ FUN(el,gets)(EditLine *el, int *nread)
el->el_chared.c_redo.pos < el->el_chared.c_redo.lim) {
if (cmdnum == VI_DELETE_PREV_CHAR &&
el->el_chared.c_redo.pos != el->el_chared.c_redo.buf
- && Isprint(el->el_chared.c_redo.pos[-1]))
+ && isprint((unsigned char)el->el_chared.c_redo.pos[-1]))
el->el_chared.c_redo.pos--;
else
*el->el_chared.c_redo.pos++ = ch;
@@ -660,7 +578,7 @@ FUN(el,gets)(EditLine *el, int *nread)
case CC_REFRESH_BEEP:
re_refresh(el);
- terminal_beep(el);
+ term_beep(el);
break;
case CC_NORM: /* normal char */
@@ -692,7 +610,7 @@ FUN(el,gets)(EditLine *el, int *nread)
/* put (real) cursor in a known place */
re_clear_display(el); /* reset the display stuff */
ch_reset(el, 1); /* reset the input pointers */
- re_refresh(el); /* print the prompt again */
+ re_refresh(el); /* print the prompt again */
break;
case CC_ERROR:
@@ -701,8 +619,8 @@ FUN(el,gets)(EditLine *el, int *nread)
(void) fprintf(el->el_errfile,
"*** editor ERROR ***\r\n\n");
#endif /* DEBUG_READ */
- terminal_beep(el);
- terminal__flush(el);
+ term_beep(el);
+ term__flush(el);
break;
}
el->el_state.argument = 1;
@@ -712,7 +630,7 @@ FUN(el,gets)(EditLine *el, int *nread)
break;
}
- terminal__flush(el); /* flush any buffered output */
+ term__flush(el); /* flush any buffered output */
/* make sure the tty is set up correctly */
if ((el->el_flags & UNBUFFERED) == 0) {
read_finish(el);
@@ -720,11 +638,6 @@ FUN(el,gets)(EditLine *el, int *nread)
} else {
*nread = (int)(el->el_line.lastchar - el->el_line.buffer);
}
- goto done;
-noedit:
- el->el_line.cursor = el->el_line.lastchar = cp;
- *cp = '\0';
- *nread = (int)(el->el_line.cursor - el->el_line.buffer);
done:
if (*nread == 0) {
if (num == -1) {
diff --git a/lib/libedit/read.h b/lib/libedit/read.h
index fa2a611..6018934 100644
--- a/lib/libedit/read.h
+++ b/lib/libedit/read.h
@@ -1,5 +1,3 @@
-/* $NetBSD: read.h,v 1.7 2009/12/30 22:37:40 christos Exp $ */
-
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -28,6 +26,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
+ * $NetBSD: read.h,v 1.6 2008/04/29 06:53:01 martin Exp $
* $FreeBSD$
*/
@@ -37,7 +36,7 @@
#ifndef _h_el_read
#define _h_el_read
-typedef int (*el_rfunc_t)(EditLine *, Char *);
+typedef int (*el_rfunc_t)(EditLine *, char *);
typedef struct el_read_t {
el_rfunc_t read_char; /* Function to read a character */
diff --git a/lib/libedit/readline.c b/lib/libedit/readline.c
index 2dd7f4f..20a0f056 100644
--- a/lib/libedit/readline.c
+++ b/lib/libedit/readline.c
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.c,v 1.115 2015/04/01 15:23:15 christos Exp $ */
+/* $NetBSD: readline.c,v 1.90 2010/08/04 20:29:18 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -29,11 +29,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.115 2015/04/01 15:23:15 christos Exp $");
-#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
+__RCSID("$NetBSD: readline.c,v 1.90 2010/08/04 20:29:18 christos Exp $");
__FBSDID("$FreeBSD$");
#include <sys/types.h>
@@ -50,8 +47,9 @@ __FBSDID("$FreeBSD$");
#include <fcntl.h>
#include <setjmp.h>
#include <vis.h>
-
+#include "sys.h"
#include "readline/readline.h"
+#include "chartype.h"
#include "el.h"
#include "fcns.h" /* for EL_NUM_FCNS */
#include "histedit.h"
@@ -86,14 +84,6 @@ VFunction *rl_event_hook = NULL;
KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
emacs_meta_keymap,
emacs_ctlx_keymap;
-/*
- * The following is not implemented; we always catch signals in the
- * libedit fashion: set handlers on entry to el_gets() and clear them
- * on the way out. This simplistic approach works for most cases; if
- * it does not work for your application, please let us know.
- */
-int rl_catch_signals = 1;
-int rl_catch_sigwinch = 1;
int history_base = 1; /* probably never subject to change */
int history_length = 0;
@@ -110,7 +100,6 @@ char *rl_basic_word_break_characters = break_chars;
char *rl_completer_word_break_characters = NULL;
char *rl_completer_quote_characters = NULL;
Function *rl_completion_entry_function = NULL;
-char *(*rl_completion_word_break_hook)(void) = NULL;
CPPFunction *rl_attempted_completion_function = NULL;
Function *rl_pre_input_hook = NULL;
Function *rl_startup1_hook = NULL;
@@ -119,6 +108,7 @@ char *rl_terminal_name = NULL;
int rl_already_prompted = 0;
int rl_filename_completion_desired = 0;
int rl_ignore_completion_duplicates = 0;
+int rl_catch_signals = 1;
int readline_echoing_p = 1;
int _rl_print_completions_horizontally = 0;
VFunction *rl_redisplay_function = NULL;
@@ -128,6 +118,10 @@ VFunction *rl_prep_term_function = (VFunction *)rl_prep_terminal;
VFunction *rl_deprep_term_function = (VFunction *)rl_deprep_terminal;
KEYMAP_ENTRY_ARRAY emacs_meta_keymap;
+#ifdef WIDECHAR
+static ct_buffer_t conv;
+#endif
+
/*
* The current prompt string.
*/
@@ -160,7 +154,7 @@ int rl_completion_append_character = ' ';
/* stuff below is used internally by libedit for readline emulation */
-static History *h = NULL;
+static TYPE(History) *h = NULL;
static EditLine *e = NULL;
static Function *map[256];
static jmp_buf topbuf;
@@ -184,7 +178,7 @@ static char *
_get_prompt(EditLine *el __attribute__((__unused__)))
{
rl_already_prompted = 1;
- return rl_prompt;
+ return (rl_prompt);
}
@@ -194,16 +188,16 @@ _get_prompt(EditLine *el __attribute__((__unused__)))
static HIST_ENTRY *
_move_history(int op)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
static HIST_ENTRY rl_he;
- if (history(h, &ev, op) != 0)
- return NULL;
+ if (FUNW(history)(h, &ev, op) != 0)
+ return (HIST_ENTRY *) NULL;
- rl_he.line = ev.str;
+ rl_he.line = ct_encode_string(ev.str, &conv);
rl_he.data = NULL;
- return &rl_he;
+ return (&rl_he);
}
@@ -212,46 +206,31 @@ _move_history(int op)
*/
static int
/*ARGSUSED*/
-_getc_function(EditLine *el __attribute__((__unused__)), char *c)
+_getc_function(EditLine *el, char *c)
{
int i;
i = (*rl_getc_function)(NULL);
if (i == -1)
return 0;
- *c = (char)i;
+ *c = i;
return 1;
}
-static void
-_resize_fun(EditLine *el, void *a)
-{
- const LineInfo *li;
- char **ap = a;
-
- li = el_line(el);
- /* a cheesy way to get rid of const cast. */
- *ap = memchr(li->buffer, *li->buffer, (size_t)1);
-}
+static const char _dothistory[] = "/.history";
static const char *
_default_history_file(void)
{
struct passwd *p;
- static char *path;
- size_t len;
+ static char path[PATH_MAX];
- if (path)
+ if (*path)
return path;
-
if ((p = getpwuid(getuid())) == NULL)
return NULL;
-
- len = strlen(p->pw_dir) + sizeof("/.history");
- if ((path = malloc(len)) == NULL)
- return NULL;
-
- (void)snprintf(path, len, "%s/.history", p->pw_dir);
+ strlcpy(path, p->pw_dir, PATH_MAX);
+ strlcat(path, _dothistory, PATH_MAX);
return path;
}
@@ -272,7 +251,7 @@ rl_set_prompt(const char *prompt)
if (rl_prompt != NULL && strcmp(rl_prompt, prompt) == 0)
return 0;
if (rl_prompt)
- el_free(rl_prompt);
+ free(rl_prompt);
rl_prompt = strdup(prompt);
if (rl_prompt == NULL)
return -1;
@@ -289,14 +268,15 @@ rl_set_prompt(const char *prompt)
int
rl_initialize(void)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
+ const LineInfo *li;
int editmode = 1;
struct termios t;
if (e != NULL)
el_end(e);
if (h != NULL)
- history_end(h);
+ FUN(history,end)(h);
if (!rl_instream)
rl_instream = stdin;
@@ -312,27 +292,24 @@ rl_initialize(void)
e = el_init(rl_readline_name, rl_instream, rl_outstream, stderr);
if (!editmode)
- el_set(e, EL_EDITMODE, 0);
+ FUN(el,set)(e, EL_EDITMODE, 0);
- h = history_init();
+ h = FUN(history,init)();
if (!e || !h)
- return -1;
+ return (-1);
- history(h, &ev, H_SETSIZE, INT_MAX); /* unlimited */
+ FUNW(history)(h, &ev, H_SETSIZE, INT_MAX); /* unlimited */
history_length = 0;
max_input_history = INT_MAX;
el_set(e, EL_HIST, history, h);
- /* Setup resize function */
- el_set(e, EL_RESIZE, _resize_fun, &rl_line_buffer);
-
/* setup getc function if valid */
if (rl_getc_function)
el_set(e, EL_GETCFN, _getc_function);
/* for proper prompt printing in readline() */
if (rl_set_prompt("") == -1) {
- history_end(h);
+ FUN(history,end)(h);
el_end(e);
return -1;
}
@@ -340,7 +317,7 @@ rl_initialize(void)
el_set(e, EL_SIGNAL, rl_catch_signals);
/* set default mode to "emacs"-style and read setting afterwards */
- /* so this can be overridden */
+ /* so this can be overriden */
el_set(e, EL_EDITOR, "emacs");
if (rl_terminal_name != NULL)
el_set(e, EL_TERMINAL, rl_terminal_name);
@@ -364,37 +341,6 @@ rl_initialize(void)
_el_rl_tstp);
el_set(e, EL_BIND, "^Z", "rl_tstp", NULL);
- /*
- * Set some readline compatible key-bindings.
- */
- el_set(e, EL_BIND, "^R", "em-inc-search-prev", NULL);
-
- /*
- * Allow the use of Home/End keys.
- */
- el_set(e, EL_BIND, "\\e[1~", "ed-move-to-beg", NULL);
- el_set(e, EL_BIND, "\\e[4~", "ed-move-to-end", NULL);
- el_set(e, EL_BIND, "\\e[7~", "ed-move-to-beg", NULL);
- el_set(e, EL_BIND, "\\e[8~", "ed-move-to-end", NULL);
- el_set(e, EL_BIND, "\\e[H", "ed-move-to-beg", NULL);
- el_set(e, EL_BIND, "\\e[F", "ed-move-to-end", NULL);
-
- /*
- * Allow the use of the Delete/Insert keys.
- */
- el_set(e, EL_BIND, "\\e[3~", "ed-delete-next-char", NULL);
- el_set(e, EL_BIND, "\\e[2~", "ed-quoted-insert", NULL);
-
- /*
- * Ctrl-left-arrow and Ctrl-right-arrow for word moving.
- */
- el_set(e, EL_BIND, "\\e[1;5C", "em-next-word", NULL);
- el_set(e, EL_BIND, "\\e[1;5D", "ed-prev-word", NULL);
- el_set(e, EL_BIND, "\\e[5C", "em-next-word", NULL);
- el_set(e, EL_BIND, "\\e[5D", "ed-prev-word", NULL);
- el_set(e, EL_BIND, "\\e\\e[C", "em-next-word", NULL);
- el_set(e, EL_BIND, "\\e\\e[D", "ed-prev-word", NULL);
-
/* read settings from configuration file */
el_source(e, NULL);
@@ -402,13 +348,15 @@ rl_initialize(void)
* Unfortunately, some applications really do use rl_point
* and rl_line_buffer directly.
*/
- _resize_fun(e, &rl_line_buffer);
+ li = el_line(e);
+ /* a cheesy way to get rid of const cast. */
+ rl_line_buffer = memchr(li->buffer, *li->buffer, 1);
_rl_update_pos();
if (rl_startup_hook)
(*rl_startup_hook)(NULL, 0);
- return 0;
+ return (0);
}
@@ -419,7 +367,7 @@ rl_initialize(void)
char *
readline(const char *p)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
const char * volatile prompt = p;
int count;
const char *ret;
@@ -467,7 +415,7 @@ readline(const char *p)
} else
buf = NULL;
- history(h, &ev, H_GETSIZE);
+ FUNW(history)(h, &ev, H_GETSIZE);
history_length = ev.num;
return buf;
@@ -517,7 +465,7 @@ _rl_compat_sub(const char *str, const char *what, const char *with,
} else
s++;
}
- r = result = el_malloc((len + 1) * sizeof(*r));
+ r = result = malloc(len + 1);
if (result == NULL)
return NULL;
s = str;
@@ -528,13 +476,13 @@ _rl_compat_sub(const char *str, const char *what, const char *with,
s += what_len;
if (!globally) {
(void)strcpy(r, s);
- return result;
+ return(result);
}
} else
*r++ = *s++;
}
*r = '\0';
- return result;
+ return(result);
}
static char *last_search_pat; /* last !?pat[?] search pattern */
@@ -547,18 +495,18 @@ get_history_event(const char *cmd, int *cindex, int qchar)
size_t len;
char *pat;
const char *rptr;
- HistEvent ev;
+ TYPE(HistEvent) ev;
idx = *cindex;
if (cmd[idx++] != history_expansion_char)
- return NULL;
+ return(NULL);
/* find out which event to take */
if (cmd[idx] == history_expansion_char || cmd[idx] == '\0') {
- if (history(h, &ev, H_FIRST) != 0)
- return NULL;
+ if (FUNW(history)(h, &ev, H_FIRST) != 0)
+ return(NULL);
*cindex = cmd[idx]? (idx + 1):idx;
- return ev.str;
+ return ct_encode_string(ev.str, &conv);
}
sign = 0;
if (cmd[idx] == '-') {
@@ -578,10 +526,10 @@ get_history_event(const char *cmd, int *cindex, int qchar)
num = history_length - num + 1;
if (!(rl_he = history_get(num)))
- return NULL;
+ return(NULL);
*cindex = idx;
- return rl_he->line;
+ return(rl_he->line);
}
sub = 0;
if (cmd[idx] == '?') {
@@ -599,31 +547,31 @@ get_history_event(const char *cmd, int *cindex, int qchar)
break;
idx++;
}
- len = (size_t)idx - (size_t)begin;
+ len = idx - begin;
if (sub && cmd[idx] == '?')
idx++;
if (sub && len == 0 && last_search_pat && *last_search_pat)
pat = last_search_pat;
else if (len == 0)
- return NULL;
+ return(NULL);
else {
- if ((pat = el_malloc((len + 1) * sizeof(*pat))) == NULL)
+ if ((pat = malloc(len + 1)) == NULL)
return NULL;
(void)strncpy(pat, cmd + begin, len);
pat[len] = '\0';
}
- if (history(h, &ev, H_CURR) != 0) {
+ if (FUNW(history)(h, &ev, H_CURR) != 0) {
if (pat != last_search_pat)
- el_free(pat);
- return NULL;
+ free(pat);
+ return (NULL);
}
num = ev.num;
if (sub) {
if (pat != last_search_pat) {
if (last_search_pat)
- el_free(last_search_pat);
+ free(last_search_pat);
last_search_pat = pat;
}
ret = history_search(pat, -1);
@@ -632,29 +580,29 @@ get_history_event(const char *cmd, int *cindex, int qchar)
if (ret == -1) {
/* restore to end of list on failed search */
- history(h, &ev, H_FIRST);
+ FUNW(history)(h, &ev, H_FIRST);
(void)fprintf(rl_outstream, "%s: Event not found\n", pat);
if (pat != last_search_pat)
- el_free(pat);
- return NULL;
+ free(pat);
+ return(NULL);
}
if (sub && len) {
if (last_search_match && last_search_match != pat)
- el_free(last_search_match);
+ free(last_search_match);
last_search_match = pat;
}
if (pat != last_search_pat)
- el_free(pat);
+ free(pat);
- if (history(h, &ev, H_CURR) != 0)
- return NULL;
+ if (FUNW(history)(h, &ev, H_CURR) != 0)
+ return(NULL);
*cindex = idx;
- rptr = ev.str;
+ rptr = ct_encode_string(ev.str, &conv);
/* roll back to original position */
- (void)history(h, &ev, H_SET, num);
+ (void)FUNW(history)(h, &ev, H_SET, num);
return rptr;
}
@@ -667,7 +615,7 @@ get_history_event(const char *cmd, int *cindex, int qchar)
* returns 0 if data was not modified, 1 if it was and 2 if the string
* should be only printed and not executed; in case of error,
* returns -1 and *result points to NULL
- * it's the caller's responsibility to free() the string returned in *result
+ * it's callers responsibility to free() string returned in *result
*/
static int
_history_expand_command(const char *command, size_t offs, size_t cmdlen,
@@ -701,8 +649,7 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
} else {
if (command[offs + 1] == '#') {
/* use command so far */
- if ((aptr = el_malloc((offs + 1) * sizeof(*aptr)))
- == NULL)
+ if ((aptr = malloc(offs + 1)) == NULL)
return -1;
(void)strncpy(aptr, command, offs);
aptr[offs] = '\0';
@@ -713,19 +660,19 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
qchar = (offs > 0 && command[offs - 1] == '"')? '"':0;
ptr = get_history_event(command + offs, &idx, qchar);
}
- has_mods = command[offs + (size_t)idx] == ':';
+ has_mods = command[offs + idx] == ':';
}
if (ptr == NULL && aptr == NULL)
- return -1;
+ return(-1);
if (!has_mods) {
*result = strdup(aptr ? aptr : ptr);
if (aptr)
- el_free(aptr);
+ free(aptr);
if (*result == NULL)
return -1;
- return 1;
+ return(1);
}
cmd = command + offs + idx + 1;
@@ -770,18 +717,18 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
(void)fprintf(rl_outstream, "%s: Bad word specifier",
command + offs + idx);
if (aptr)
- el_free(aptr);
- return -1;
+ free(aptr);
+ return(-1);
}
} else
tmp = strdup(aptr? aptr:ptr);
if (aptr)
- el_free(aptr);
+ free(aptr);
if (*cmd == '\0' || ((size_t)(cmd - (command + offs)) >= cmdlen)) {
*result = tmp;
- return 1;
+ return(1);
}
for (; *cmd; cmd++) {
@@ -793,7 +740,7 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
} else if (*cmd == 't') { /* remove leading path */
if ((aptr = strrchr(tmp, '/')) != NULL) {
aptr = strdup(aptr + 1);
- el_free(tmp);
+ free(tmp);
tmp = aptr;
}
} else if (*cmd == 'r') { /* remove trailing suffix */
@@ -802,7 +749,7 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
} else if (*cmd == 'e') { /* remove all but suffix */
if ((aptr = strrchr(tmp, '.')) != NULL) {
aptr = strdup(aptr);
- el_free(tmp);
+ free(tmp);
tmp = aptr;
}
} else if (*cmd == 'p') /* print only */
@@ -819,10 +766,10 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
else if (*cmd == 's') {
delim = *(++cmd), cmd++;
size = 16;
- what = el_realloc(from, size * sizeof(*what));
+ what = realloc(from, size);
if (what == NULL) {
- el_free(from);
- el_free(tmp);
+ free(from);
+ free(tmp);
return 0;
}
len = 0;
@@ -831,12 +778,11 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
cmd++;
if (len >= size) {
char *nwhat;
- nwhat = el_realloc(what,
- (size <<= 1) *
- sizeof(*nwhat));
+ nwhat = realloc(what,
+ (size <<= 1));
if (nwhat == NULL) {
- el_free(what);
- el_free(tmp);
+ free(what);
+ free(tmp);
return 0;
}
what = nwhat;
@@ -846,17 +792,17 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
what[len] = '\0';
from = what;
if (*what == '\0') {
- el_free(what);
+ free(what);
if (search) {
from = strdup(search);
if (from == NULL) {
- el_free(tmp);
+ free(tmp);
return 0;
}
} else {
from = NULL;
- el_free(tmp);
- return -1;
+ free(tmp);
+ return (-1);
}
}
cmd++; /* shift after delim */
@@ -864,10 +810,10 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
continue;
size = 16;
- with = el_realloc(to, size * sizeof(*with));
+ with = realloc(to, size);
if (with == NULL) {
- el_free(to);
- el_free(tmp);
+ free(to);
+ free(tmp);
return -1;
}
len = 0;
@@ -876,11 +822,10 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
if (len + from_len + 1 >= size) {
char *nwith;
size += from_len + 1;
- nwith = el_realloc(with,
- size * sizeof(*nwith));
+ nwith = realloc(with, size);
if (nwith == NULL) {
- el_free(with);
- el_free(tmp);
+ free(with);
+ free(tmp);
return -1;
}
with = nwith;
@@ -903,14 +848,14 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen,
aptr = _rl_compat_sub(tmp, from, to, g_on);
if (aptr) {
- el_free(tmp);
+ free(tmp);
tmp = aptr;
}
g_on = 0;
}
}
*result = tmp;
- return p_on? 2:1;
+ return (p_on? 2:1);
}
@@ -929,13 +874,13 @@ history_expand(char *str, char **output)
if (history_expansion_char == 0) {
*output = strdup(str);
- return 0;
+ return(0);
}
*output = NULL;
if (str[0] == history_subst_char) {
/* ^foo^foo2^ is equivalent to !!:s^foo^foo2^ */
- *output = el_malloc((strlen(str) + 4 + 1) * sizeof(**output));
+ *output = malloc(strlen(str) + 4 + 1);
if (*output == NULL)
return 0;
(*output)[0] = (*output)[1] = history_expansion_char;
@@ -952,12 +897,11 @@ history_expand(char *str, char **output)
#define ADD_STRING(what, len, fr) \
{ \
if (idx + len + 1 > size) { \
- char *nresult = el_realloc(result, \
- (size += len + 1) * sizeof(*nresult)); \
+ char *nresult = realloc(result, (size += len + 1));\
if (nresult == NULL) { \
- el_free(*output); \
+ free(*output); \
if (/*CONSTCOND*/fr) \
- el_free(tmp); \
+ free(tmp); \
return 0; \
} \
result = nresult; \
@@ -981,8 +925,7 @@ loop:
for (; str[j]; j++) {
if (str[j] == '\\' &&
str[j + 1] == history_expansion_char) {
- len = strlen(&str[j + 1]) + 1;
- memmove(&str[j], &str[j + 1], len);
+ (void)strcpy(&str[j], &str[j + 1]);
continue;
}
if (!loop_again) {
@@ -1025,7 +968,7 @@ loop:
ADD_STRING(tmp, len, 1);
}
if (tmp) {
- el_free(tmp);
+ free(tmp);
tmp = NULL;
}
i = j;
@@ -1042,10 +985,10 @@ loop:
ret = -1;
#endif
}
- el_free(*output);
+ free(*output);
*output = result;
- return ret;
+ return (ret);
}
/*
@@ -1080,14 +1023,14 @@ history_arg_extract(int start, int end, const char *str)
(size_t)end > max || start > end)
goto out;
- for (i = (size_t)start, len = 0; i <= (size_t)end; i++)
+ for (i = start, len = 0; i <= (size_t)end; i++)
len += strlen(arr[i]) + 1;
len++;
- result = el_malloc(len * sizeof(*result));
+ result = malloc(len);
if (result == NULL)
goto out;
- for (i = (size_t)start, len = 0; i <= (size_t)end; i++) {
+ for (i = start, len = 0; i <= (size_t)end; i++) {
(void)strcpy(result + len, arr[i]);
len += strlen(arr[i]);
if (i < (size_t)end)
@@ -1097,8 +1040,8 @@ history_arg_extract(int start, int end, const char *str)
out:
for (i = 0; arr[i]; i++)
- el_free(arr[i]);
- el_free(arr);
+ free(arr[i]);
+ free(arr);
return result;
}
@@ -1137,19 +1080,19 @@ history_tokenize(const char *str)
if (idx + 2 >= size) {
char **nresult;
size <<= 1;
- nresult = el_realloc(result, (size_t)size * sizeof(*nresult));
+ nresult = realloc(result, size * sizeof(char *));
if (nresult == NULL) {
- el_free(result);
+ free(result);
return NULL;
}
result = nresult;
}
- len = (size_t)i - (size_t)start;
- temp = el_malloc((size_t)(len + 1) * sizeof(*temp));
+ len = i - start;
+ temp = malloc(len + 1);
if (temp == NULL) {
for (i = 0; i < idx; i++)
- el_free(result[i]);
- el_free(result);
+ free(result[i]);
+ free(result);
return NULL;
}
(void)strncpy(temp, &str[start], len);
@@ -1159,7 +1102,7 @@ history_tokenize(const char *str)
if (str[i])
i++;
}
- return result;
+ return (result);
}
@@ -1169,12 +1112,12 @@ history_tokenize(const char *str)
void
stifle_history(int max)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
if (h == NULL || e == NULL)
rl_initialize();
- if (history(h, &ev, H_SETSIZE, max) == 0)
+ if (FUNW(history)(h, &ev, H_SETSIZE, max) == 0)
max_input_history = max;
}
@@ -1185,13 +1128,13 @@ stifle_history(int max)
int
unstifle_history(void)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
int omax;
- history(h, &ev, H_SETSIZE, INT_MAX);
+ FUNW(history)(h, &ev, H_SETSIZE, INT_MAX);
omax = max_input_history;
max_input_history = INT_MAX;
- return omax; /* some value _must_ be returned */
+ return (omax); /* some value _must_ be returned */
}
@@ -1200,7 +1143,7 @@ history_is_stifled(void)
{
/* cannot return true answer */
- return max_input_history != INT_MAX;
+ return (max_input_history != INT_MAX);
}
static const char _history_tmp_template[] = "/tmp/.historyXXXXXX";
@@ -1235,7 +1178,7 @@ history_truncate_file (const char *filename, int nlines)
}
for(;;) {
- if (fread(buf, sizeof(buf), (size_t)1, fp) != 1) {
+ if (fread(buf, sizeof(buf), 1, fp) != 1) {
if (ferror(fp)) {
ret = errno;
break;
@@ -1245,7 +1188,7 @@ history_truncate_file (const char *filename, int nlines)
ret = errno;
break;
}
- left = (ssize_t)fread(buf, (size_t)1, sizeof(buf), fp);
+ left = fread(buf, 1, sizeof(buf), fp);
if (ferror(fp)) {
ret = errno;
break;
@@ -1253,15 +1196,14 @@ history_truncate_file (const char *filename, int nlines)
if (left == 0) {
count--;
left = sizeof(buf);
- } else if (fwrite(buf, (size_t)left, (size_t)1, tp)
- != 1) {
+ } else if (fwrite(buf, (size_t)left, 1, tp) != 1) {
ret = errno;
break;
}
fflush(tp);
break;
}
- if (fwrite(buf, sizeof(buf), (size_t)1, tp) != 1) {
+ if (fwrite(buf, sizeof(buf), 1, tp) != 1) {
ret = errno;
break;
}
@@ -1291,7 +1233,7 @@ history_truncate_file (const char *filename, int nlines)
ret = errno;
break;
}
- if (fread(buf, sizeof(buf), (size_t)1, tp) != 1) {
+ if (fread(buf, sizeof(buf), 1, tp) != 1) {
if (ferror(tp)) {
ret = errno;
break;
@@ -1305,7 +1247,7 @@ history_truncate_file (const char *filename, int nlines)
if (ret || nlines > 0)
goto out3;
- if (fseeko(fp, (off_t)0, SEEK_SET) == (off_t)-1) {
+ if (fseeko(fp, 0, SEEK_SET) == (off_t)-1) {
ret = errno;
goto out3;
}
@@ -1317,12 +1259,12 @@ history_truncate_file (const char *filename, int nlines)
}
for(;;) {
- if ((left = (ssize_t)fread(buf, (size_t)1, sizeof(buf), tp)) == 0) {
+ if ((left = fread(buf, 1, sizeof(buf), tp)) == 0) {
if (ferror(fp))
ret = errno;
break;
}
- if (fwrite(buf, (size_t)left, (size_t)1, fp) != 1) {
+ if (fwrite(buf, (size_t)left, 1, fp) != 1) {
ret = errno;
break;
}
@@ -1347,14 +1289,14 @@ out1:
int
read_history(const char *filename)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
if (h == NULL || e == NULL)
rl_initialize();
if (filename == NULL && (filename = _default_history_file()) == NULL)
return errno;
- return history(h, &ev, H_LOAD, filename) == -1 ?
- (errno ? errno : EINVAL) : 0;
+ return (FUNW(history)(h, &ev, H_LOAD, filename) == -1 ?
+ (errno ? errno : EINVAL) : 0);
}
@@ -1364,14 +1306,14 @@ read_history(const char *filename)
int
write_history(const char *filename)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
if (h == NULL || e == NULL)
rl_initialize();
if (filename == NULL && (filename = _default_history_file()) == NULL)
return errno;
- return history(h, &ev, H_SAVE, filename) == -1 ?
- (errno ? errno : EINVAL) : 0;
+ return (FUNW(history)(h, &ev, H_SAVE, filename) == -1 ?
+ (errno ? errno : EINVAL) : 0);
}
@@ -1384,31 +1326,31 @@ HIST_ENTRY *
history_get(int num)
{
static HIST_ENTRY she;
- HistEvent ev;
+ TYPE(HistEvent) ev;
int curr_num;
if (h == NULL || e == NULL)
rl_initialize();
/* save current position */
- if (history(h, &ev, H_CURR) != 0)
- return NULL;
+ if (FUNW(history)(h, &ev, H_CURR) != 0)
+ return (NULL);
curr_num = ev.num;
/* start from the oldest */
- if (history(h, &ev, H_LAST) != 0)
- return NULL; /* error */
+ if (FUNW(history)(h, &ev, H_LAST) != 0)
+ return (NULL); /* error */
/* look forwards for event matching specified offset */
- if (history(h, &ev, H_NEXT_EVDATA, num, &she.data))
- return NULL;
+ if (FUNW(history)(h, &ev, H_NEXT_EVDATA, num, &she.data))
+ return (NULL);
- she.line = ev.str;
+ she.line = ct_encode_string(ev.str, &conv);
/* restore pointer to where it was */
- (void)history(h, &ev, H_SET, curr_num);
+ (void)FUNW(history)(h, &ev, H_SET, curr_num);
- return &she;
+ return (&she);
}
@@ -1418,7 +1360,8 @@ history_get(int num)
int
add_history(const char *line)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
+ const Char *wline;
if (line == NULL)
return 0;
@@ -1426,11 +1369,13 @@ add_history(const char *line)
if (h == NULL || e == NULL)
rl_initialize();
- (void)history(h, &ev, H_ENTER, line);
- if (history(h, &ev, H_GETSIZE) == 0)
+ wline = ct_decode_string(line, &conv);
+
+ (void)FUNW(history)(h, &ev, H_ENTER, wline);
+ if (FUNW(history)(h, &ev, H_GETSIZE) == 0)
history_length = ev.num;
- return !(history_length > 0); /* return 0 if all is okay */
+ return (!(history_length > 0)); /* return 0 if all is okay */
}
@@ -1441,21 +1386,21 @@ HIST_ENTRY *
remove_history(int num)
{
HIST_ENTRY *he;
- HistEvent ev;
+ TYPE(HistEvent) ev;
if (h == NULL || e == NULL)
rl_initialize();
- if ((he = el_malloc(sizeof(*he))) == NULL)
+ if ((he = malloc(sizeof(*he))) == NULL)
return NULL;
- if (history(h, &ev, H_DELDATA, num, &he->data) != 0) {
- el_free(he);
+ if (FUNW(history)(h, &ev, H_DELDATA, num, &he->data) != 0) {
+ free(he);
return NULL;
}
- he->line = ev.str;
- if (history(h, &ev, H_GETSIZE) == 0)
+ he->line = ct_encode_string(ev.str, &conv);
+ if (FUNW(history)(h, &ev, H_GETSIZE) == 0)
history_length = ev.num;
return he;
@@ -1469,42 +1414,42 @@ HIST_ENTRY *
replace_history_entry(int num, const char *line, histdata_t data)
{
HIST_ENTRY *he;
- HistEvent ev;
+ TYPE(HistEvent) ev;
int curr_num;
if (h == NULL || e == NULL)
rl_initialize();
/* save current position */
- if (history(h, &ev, H_CURR) != 0)
+ if (FUNW(history)(h, &ev, H_CURR) != 0)
return NULL;
curr_num = ev.num;
/* start from the oldest */
- if (history(h, &ev, H_LAST) != 0)
+ if (FUNW(history)(h, &ev, H_LAST) != 0)
return NULL; /* error */
- if ((he = el_malloc(sizeof(*he))) == NULL)
+ if ((he = malloc(sizeof(*he))) == NULL)
return NULL;
/* look forwards for event matching specified offset */
- if (history(h, &ev, H_NEXT_EVDATA, num, &he->data))
+ if (FUNW(history)(h, &ev, H_NEXT_EVDATA, num, &he->data))
goto out;
- he->line = strdup(ev.str);
+ he->line = strdup(ct_encode_string(ev.str, &e->el_scratch));
if (he->line == NULL)
goto out;
- if (history(h, &ev, H_REPLACE, line, data))
+ if (FUNW(history)(h, &ev, H_REPLACE, line, data))
goto out;
/* restore pointer to where it was */
- if (history(h, &ev, H_SET, curr_num))
+ if (FUNW(history)(h, &ev, H_SET, curr_num))
goto out;
return he;
out:
- el_free(he);
+ free(he);
return NULL;
}
@@ -1514,12 +1459,9 @@ out:
void
clear_history(void)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
- if (h == NULL || e == NULL)
- rl_initialize();
-
- (void)history(h, &ev, H_CLEAR);
+ (void)FUNW(history)(h, &ev, H_CLEAR);
history_length = 0;
}
@@ -1530,19 +1472,19 @@ clear_history(void)
int
where_history(void)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
int curr_num, off;
- if (history(h, &ev, H_CURR) != 0)
- return 0;
+ if (FUNW(history)(h, &ev, H_CURR) != 0)
+ return (0);
curr_num = ev.num;
- (void)history(h, &ev, H_FIRST);
+ (void)FUNW(history)(h, &ev, H_FIRST);
off = 1;
- while (ev.num != curr_num && history(h, &ev, H_NEXT) == 0)
+ while (ev.num != curr_num && FUNW(history)(h, &ev, H_NEXT) == 0)
off++;
- return off;
+ return (off);
}
@@ -1553,7 +1495,7 @@ HIST_ENTRY *
current_history(void)
{
- return _move_history(H_CURR);
+ return (_move_history(H_CURR));
}
@@ -1563,24 +1505,24 @@ current_history(void)
int
history_total_bytes(void)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
int curr_num;
size_t size;
- if (history(h, &ev, H_CURR) != 0)
- return -1;
+ if (FUNW(history)(h, &ev, H_CURR) != 0)
+ return (-1);
curr_num = ev.num;
- (void)history(h, &ev, H_FIRST);
+ (void)FUNW(history)(h, &ev, H_FIRST);
size = 0;
do
- size += strlen(ev.str) * sizeof(*ev.str);
- while (history(h, &ev, H_NEXT) == 0);
+ size += Strlen(ev.str) * sizeof(*ev.str);
+ while (FUNW(history)(h, &ev, H_NEXT) == 0);
/* get to the same position as before */
- history(h, &ev, H_PREV_EVENT, curr_num);
+ FUNW(history)(h, &ev, H_PREV_EVENT, curr_num);
- return (int)size;
+ return (int)(size);
}
@@ -1590,24 +1532,24 @@ history_total_bytes(void)
int
history_set_pos(int pos)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
int curr_num;
if (pos >= history_length || pos < 0)
- return -1;
+ return (-1);
- (void)history(h, &ev, H_CURR);
+ (void)FUNW(history)(h, &ev, H_CURR);
curr_num = ev.num;
/*
* use H_DELDATA to set to nth history (without delete) by passing
* (void **)-1
*/
- if (history(h, &ev, H_DELDATA, pos, (void **)-1)) {
- (void)history(h, &ev, H_SET, curr_num);
- return -1;
+ if (FUNW(history)(h, &ev, H_DELDATA, pos, (void **)-1)) {
+ (void)FUNW(history)(h, &ev, H_SET, curr_num);
+ return(-1);
}
- return 0;
+ return (0);
}
@@ -1618,7 +1560,7 @@ HIST_ENTRY *
previous_history(void)
{
- return _move_history(H_PREV);
+ return (_move_history(H_PREV));
}
@@ -1629,7 +1571,7 @@ HIST_ENTRY *
next_history(void)
{
- return _move_history(H_NEXT);
+ return (_move_history(H_NEXT));
}
@@ -1639,22 +1581,24 @@ next_history(void)
int
history_search(const char *str, int direction)
{
- HistEvent ev;
- const char *strp;
+ TYPE(HistEvent) ev;
+ const Char *strp;
+ const Char *wstr;
int curr_num;
- if (history(h, &ev, H_CURR) != 0)
- return -1;
+ if (FUNW(history)(h, &ev, H_CURR) != 0)
+ return (-1);
curr_num = ev.num;
+ wstr = ct_decode_string(str, &conv);
for (;;) {
- if ((strp = strstr(ev.str, str)) != NULL)
- return (int)(strp - ev.str);
- if (history(h, &ev, direction < 0 ? H_NEXT:H_PREV) != 0)
+ if ((strp = Strstr(ev.str, wstr)) != NULL)
+ return (int) (strp - ev.str);
+ if (FUNW(history)(h, &ev, direction < 0 ? H_NEXT:H_PREV) != 0)
break;
}
- (void)history(h, &ev, H_SET, curr_num);
- return -1;
+ (void)FUNW(history)(h, &ev, H_SET, curr_num);
+ return (-1);
}
@@ -1664,9 +1608,9 @@ history_search(const char *str, int direction)
int
history_search_prefix(const char *str, int direction)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
- return (history(h, &ev, direction < 0 ?
+ return (FUNW(history)(h, &ev, direction < 0 ?
H_PREV_STR : H_NEXT_STR, str));
}
@@ -1680,31 +1624,33 @@ int
history_search_pos(const char *str,
int direction __attribute__((__unused__)), int pos)
{
- HistEvent ev;
+ TYPE(HistEvent) ev;
int curr_num, off;
+ const Char *wstr;
off = (pos > 0) ? pos : -pos;
pos = (pos > 0) ? 1 : -1;
- if (history(h, &ev, H_CURR) != 0)
- return -1;
+ if (FUNW(history)(h, &ev, H_CURR) != 0)
+ return (-1);
curr_num = ev.num;
- if (history_set_pos(off) != 0 || history(h, &ev, H_CURR) != 0)
- return -1;
+ if (history_set_pos(off) != 0 || FUNW(history)(h, &ev, H_CURR) != 0)
+ return (-1);
+ wstr = ct_decode_string(str, &conv);
for (;;) {
- if (strstr(ev.str, str))
- return off;
- if (history(h, &ev, (pos < 0) ? H_PREV : H_NEXT) != 0)
+ if (Strstr(ev.str, wstr))
+ return (off);
+ if (FUNW(history)(h, &ev, (pos < 0) ? H_PREV : H_NEXT) != 0)
break;
}
/* set "current" pointer back to previous state */
- (void)history(h, &ev,
+ (void)FUNW(history)(h, &ev,
pos < 0 ? H_NEXT_EVENT : H_PREV_EVENT, curr_num);
- return -1;
+ return (-1);
}
@@ -1727,20 +1673,17 @@ filename_completion_function(const char *name, int state)
* a completion generator for usernames; returns _first_ username
* which starts with supplied text
* text contains a partial username preceded by random character
- * (usually '~'); state resets search from start (??? should we do that anyway)
- * it's the caller's responsibility to free the returned value
+ * (usually '~'); state is ignored
+ * it's callers responsibility to free returned value
*/
char *
username_completion_function(const char *text, int state)
{
-#if defined(HAVE_GETPW_R_POSIX) || defined(HAVE_GETPW_R_DRAFT)
- struct passwd pwres;
+ struct passwd *pwd, pwres;
char pwbuf[1024];
-#endif
- struct passwd *pass = NULL;
if (text[0] == '\0')
- return NULL;
+ return (NULL);
if (*text == '~')
text++;
@@ -1748,21 +1691,15 @@ username_completion_function(const char *text, int state)
if (state == 0)
setpwent();
- while (
-#if defined(HAVE_GETPW_R_POSIX) || defined(HAVE_GETPW_R_DRAFT)
- getpwent_r(&pwres, pwbuf, sizeof(pwbuf), &pass) == 0 && pass != NULL
-#else
- (pass = getpwent()) != NULL
-#endif
- && text[0] == pass->pw_name[0]
- && strcmp(text, pass->pw_name) == 0)
- continue;
+ while (getpwent_r(&pwres, pwbuf, sizeof(pwbuf), &pwd) == 0
+ && pwd != NULL && text[0] == pwd->pw_name[0]
+ && strcmp(text, pwd->pw_name) == 0);
- if (pass == NULL) {
+ if (pwd == NULL) {
endpwent();
return NULL;
}
- return strdup(pass->pw_name);
+ return strdup(pwd->pw_name);
}
@@ -1795,7 +1732,7 @@ _rl_completion_append_character_function(const char *dummy
__attribute__((__unused__)))
{
static char buf[2];
- buf[0] = (char)rl_completion_append_character;
+ buf[0] = rl_completion_append_character;
buf[1] = '\0';
return buf;
}
@@ -1811,7 +1748,6 @@ rl_complete(int ignore __attribute__((__unused__)), int invoking_key)
#ifdef WIDECHAR
static ct_buffer_t wbreak_conv, sprefix_conv;
#endif
- char *breakchars;
if (h == NULL || e == NULL)
rl_initialize();
@@ -1821,26 +1757,19 @@ rl_complete(int ignore __attribute__((__unused__)), int invoking_key)
arr[0] = (char)invoking_key;
arr[1] = '\0';
el_insertstr(e, arr);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- if (rl_completion_word_break_hook != NULL)
- breakchars = (*rl_completion_word_break_hook)();
- else
- breakchars = rl_basic_word_break_characters;
-
/* Just look at how many global variables modify this operation! */
return fn_complete(e,
(CPFunction *)rl_completion_entry_function,
rl_attempted_completion_function,
ct_decode_string(rl_basic_word_break_characters, &wbreak_conv),
- ct_decode_string(breakchars, &sprefix_conv),
+ ct_decode_string(rl_special_prefixes, &sprefix_conv),
_rl_completion_append_character_function,
(size_t)rl_completion_query_items,
&rl_completion_type, &rl_attempted_completion_over,
&rl_point, &rl_end, NULL, NULL, NULL);
-
-
}
@@ -1871,7 +1800,7 @@ rl_bind_key(int c, rl_command_func_t *func)
e->el_map.key[c] = ED_INSERT;
retval = 0;
}
- return retval;
+ return (retval);
}
@@ -1887,7 +1816,7 @@ rl_read_key(void)
if (e == NULL || h == NULL)
rl_initialize();
- return el_getc(e, fooarr);
+ return (el_getc(e, fooarr));
}
@@ -1917,33 +1846,32 @@ rl_insert(int count, int c)
rl_initialize();
/* XXX - int -> char conversion can lose on multichars */
- arr[0] = (char)c;
+ arr[0] = c;
arr[1] = '\0';
for (; count > 0; count--)
el_push(e, arr);
- return 0;
+ return (0);
}
int
rl_insert_text(const char *text)
{
if (!text || *text == 0)
- return 0;
+ return (0);
if (h == NULL || e == NULL)
rl_initialize();
if (el_insertstr(e, text) < 0)
- return 0;
+ return (0);
return (int)strlen(text);
}
/*ARGSUSED*/
int
-rl_newline(int count __attribute__((__unused__)),
- int c __attribute__((__unused__)))
+rl_newline(int count, int c)
{
/*
* Readline-4.0 appears to ignore the args.
@@ -1953,7 +1881,7 @@ rl_newline(int count __attribute__((__unused__)),
/*ARGSUSED*/
static unsigned char
-rl_bind_wrapper(EditLine *el __attribute__((__unused__)), unsigned char c)
+rl_bind_wrapper(EditLine *el, unsigned char c)
{
if (map[c] == NULL)
return CC_ERROR;
@@ -1978,12 +1906,12 @@ rl_add_defun(const char *name, Function *fun, int c)
map[(unsigned char)c] = fun;
el_set(e, EL_ADDFN, name, name, rl_bind_wrapper);
vis(dest, c, VIS_WHITE|VIS_NOSLASH, 0);
- el_set(e, EL_BIND, dest, name, NULL);
+ el_set(e, EL_BIND, dest, name);
return 0;
}
void
-rl_callback_read_char(void)
+rl_callback_read_char()
{
int count = 0, done = 0;
const char *buf = el_gets(e, &count);
@@ -2004,7 +1932,7 @@ rl_callback_read_char(void)
} else
wbuf = NULL;
(*(void (*)(const char *))rl_linefunc)(wbuf);
- el_set(e, EL_UNBUFFERED, 1);
+ //el_set(e, EL_UNBUFFERED, 1);
}
}
@@ -2030,7 +1958,7 @@ void
rl_redisplay(void)
{
char a[2];
- a[0] = (char)e->el_tty.t_c[TS_IO][C_REPRINT];
+ a[0] = e->el_tty.t_c[TS_IO][C_REPRINT];
a[1] = '\0';
el_push(e, a);
}
@@ -2039,7 +1967,7 @@ int
rl_get_previous_history(int count, int key)
{
char a[2];
- a[0] = (char)key;
+ a[0] = key;
a[1] = '\0';
while (count--)
el_push(e, a);
@@ -2048,7 +1976,7 @@ rl_get_previous_history(int count, int key)
void
/*ARGSUSED*/
-rl_prep_terminal(int meta_flag __attribute__((__unused__)))
+rl_prep_terminal(int meta_flag)
{
el_set(e, EL_PREP_TERM, 1);
}
@@ -2062,7 +1990,7 @@ rl_deprep_terminal(void)
int
rl_read_init_file(const char *s)
{
- return el_source(e, s);
+ return(el_source(e, s));
}
int
@@ -2076,7 +2004,7 @@ rl_parse_and_bind(const char *line)
tok_str(tok, line, &argc, &argv);
argc = el_parse(e, argc, argv);
tok_end(tok);
- return argc ? 1 : 0;
+ return (argc ? 1 : 0);
}
int
@@ -2086,7 +2014,7 @@ rl_variable_bind(const char *var, const char *value)
* The proper return value is undocument, but this is what the
* readline source seems to do.
*/
- return el_set(e, EL_BIND, "", var, value, NULL) == -1 ? 1 : 0;
+ return ((el_set(e, EL_BIND, "", var, value) == -1) ? 1 : 0);
}
void
@@ -2094,7 +2022,7 @@ rl_stuff_char(int c)
{
char buf[2];
- buf[0] = (char)c;
+ buf[0] = c;
buf[1] = '\0';
el_insertstr(e, buf);
}
@@ -2112,23 +2040,23 @@ _rl_event_read_char(EditLine *el, char *cp)
#if defined(FIONREAD)
if (ioctl(el->el_infd, FIONREAD, &n) < 0)
- return -1;
+ return(-1);
if (n)
- num_read = read(el->el_infd, cp, (size_t)1);
+ num_read = read(el->el_infd, cp, 1);
else
num_read = 0;
#elif defined(F_SETFL) && defined(O_NDELAY)
if ((n = fcntl(el->el_infd, F_GETFL, 0)) < 0)
- return -1;
+ return(-1);
if (fcntl(el->el_infd, F_SETFL, n|O_NDELAY) < 0)
- return -1;
+ return(-1);
num_read = read(el->el_infd, cp, 1);
if (fcntl(el->el_infd, F_SETFL, n))
- return -1;
+ return(-1);
#else
/* not non-blocking, but what you gonna do? */
num_read = read(el->el_infd, cp, 1);
- return -1;
+ return(-1);
#endif
if (num_read < 0 && errno == EAGAIN)
@@ -2155,9 +2083,9 @@ void
rl_get_screen_size(int *rows, int *cols)
{
if (rows)
- el_get(e, EL_GETTC, "li", rows, (void *)0);
+ el_get(e, EL_GETTC, "li", rows);
if (cols)
- el_get(e, EL_GETTC, "co", cols, (void *)0);
+ el_get(e, EL_GETTC, "co", cols);
}
void
@@ -2165,9 +2093,9 @@ rl_set_screen_size(int rows, int cols)
{
char buf[64];
(void)snprintf(buf, sizeof(buf), "%d", rows);
- el_set(e, EL_SETTC, "li", buf, NULL);
+ el_set(e, EL_SETTC, "li", buf);
(void)snprintf(buf, sizeof(buf), "%d", cols);
- el_set(e, EL_SETTC, "co", buf, NULL);
+ el_set(e, EL_SETTC, "co", buf);
}
char **
@@ -2178,7 +2106,7 @@ rl_completion_matches(const char *str, rl_compentry_func_t *fun)
len = 1;
max = 10;
- if ((list = el_malloc(max * sizeof(*list))) == NULL)
+ if ((list = malloc(max * sizeof(*list))) == NULL)
return NULL;
while ((match = (*fun)(str, (int)(len - 1))) != NULL) {
@@ -2186,7 +2114,7 @@ rl_completion_matches(const char *str, rl_compentry_func_t *fun)
if (len == max) {
char **nl;
max += 10;
- if ((nl = el_realloc(list, max * sizeof(*nl))) == NULL)
+ if ((nl = realloc(list, max * sizeof(*nl))) == NULL)
goto out;
list = nl;
}
@@ -2213,7 +2141,7 @@ rl_completion_matches(const char *str, rl_compentry_func_t *fun)
if ((list[0] = strdup(str)) == NULL)
goto out;
} else {
- if ((list[0] = el_malloc((min + 1) * sizeof(*list[0]))) == NULL)
+ if ((list[0] = malloc(min + 1)) == NULL)
goto out;
(void)memcpy(list[0], list[1], min);
list[0][min] = '\0';
@@ -2221,7 +2149,7 @@ rl_completion_matches(const char *str, rl_compentry_func_t *fun)
return list;
out:
- el_free(list);
+ free(list);
return NULL;
}
@@ -2256,16 +2184,15 @@ history_get_history_state(void)
{
HISTORY_STATE *hs;
- if ((hs = el_malloc(sizeof(*hs))) == NULL)
- return NULL;
+ if ((hs = malloc(sizeof(HISTORY_STATE))) == NULL)
+ return (NULL);
hs->length = history_length;
- return hs;
+ return (hs);
}
int
/*ARGSUSED*/
-rl_kill_text(int from __attribute__((__unused__)),
- int to __attribute__((__unused__)))
+rl_kill_text(int from, int to)
{
return 0;
}
@@ -2284,25 +2211,20 @@ rl_get_keymap(void)
void
/*ARGSUSED*/
-rl_set_keymap(Keymap k __attribute__((__unused__)))
+rl_set_keymap(Keymap k)
{
}
int
/*ARGSUSED*/
-rl_generic_bind(int type __attribute__((__unused__)),
- const char * keyseq __attribute__((__unused__)),
- const char * data __attribute__((__unused__)),
- Keymap k __attribute__((__unused__)))
+rl_generic_bind(int type, const char * keyseq, const char * data, Keymap k)
{
return 0;
}
int
/*ARGSUSED*/
-rl_bind_key_in_map(int key __attribute__((__unused__)),
- rl_command_func_t *fun __attribute__((__unused__)),
- Keymap k __attribute__((__unused__)))
+rl_bind_key_in_map(int key, rl_command_func_t *fun, Keymap k)
{
return 0;
}
@@ -2318,8 +2240,3 @@ rl_on_new_line(void)
{
return 0;
}
-
-void
-rl_free_line_state(void)
-{
-}
diff --git a/lib/libedit/refresh.c b/lib/libedit/refresh.c
index c85e845..8fe8229 100644
--- a/lib/libedit/refresh.c
+++ b/lib/libedit/refresh.c
@@ -1,5 +1,3 @@
-/* $NetBSD: refresh.c,v 1.37 2011/07/29 23:44:45 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: refresh.c,v 1.34 2009/12/28 22:15:36 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: refresh.c,v 1.37 2011/07/29 23:44:45 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -46,6 +41,7 @@ __FBSDID("$FreeBSD$");
/*
* refresh.c: Lower level screen refreshing functions
*/
+#include "sys.h"
#include <stdio.h>
#include <ctype.h>
#include <unistd.h>
@@ -54,14 +50,14 @@ __FBSDID("$FreeBSD$");
#include "el.h"
private void re_nextline(EditLine *);
-private void re_addc(EditLine *, Int);
-private void re_update_line(EditLine *, Char *, Char *, int);
-private void re_insert (EditLine *, Char *, int, int, Char *, int);
-private void re_delete(EditLine *, Char *, int, int, int);
-private void re_fastputc(EditLine *, Int);
+private void re_addc(EditLine *, int);
+private void re_update_line(EditLine *, char *, char *, int);
+private void re_insert (EditLine *, char *, int, int, char *, int);
+private void re_delete(EditLine *, char *, int, int, int);
+private void re_fastputc(EditLine *, int);
private void re_clear_eol(EditLine *, int, int, int);
-private void re__strncopy(Char *, Char *, size_t);
-private void re__copy_and_pad(Char *, const Char *, size_t);
+private void re__strncopy(char *, char *, size_t);
+private void re__copy_and_pad(char *, const char *, size_t);
#ifdef DEBUG_REFRESH
private void re_printstr(EditLine *, const char *, char *, char *);
@@ -105,9 +101,9 @@ re_nextline(EditLine *el)
* We do this via pointer shuffling - it's safe in this case
* and we avoid memcpy().
*/
- if (el->el_refresh.r_cursor.v + 1 >= el->el_terminal.t_size.v) {
- int i, lins = el->el_terminal.t_size.v;
- Char *firstline = el->el_vdisplay[0];
+ if (el->el_refresh.r_cursor.v + 1 >= el->el_term.t_size.v) {
+ int i, lins = el->el_term.t_size.v;
+ char *firstline = el->el_vdisplay[0];
for(i = 1; i < lins; i++)
el->el_vdisplay[i - 1] = el->el_vdisplay[i];
@@ -117,9 +113,9 @@ re_nextline(EditLine *el)
} else
el->el_refresh.r_cursor.v++;
- ELRE_ASSERT(el->el_refresh.r_cursor.v >= el->el_terminal.t_size.v,
+ ELRE_ASSERT(el->el_refresh.r_cursor.v >= el->el_term.t_size.v,
(__F, "\r\nre_putc: overflow! r_cursor.v == %d > %d\r\n",
- el->el_refresh.r_cursor.v, el->el_terminal.t_size.v),
+ el->el_refresh.r_cursor.v, el->el_term.t_size.v),
abort());
}
@@ -127,34 +123,38 @@ re_nextline(EditLine *el)
* Draw c, expanding tabs, control chars etc.
*/
private void
-re_addc(EditLine *el, Int c)
+re_addc(EditLine *el, int c)
{
- switch (ct_chr_class((Char)c)) {
- case CHTYPE_TAB: /* expand the tab */
- for (;;) {
- re_putc(el, ' ', 1);
- if ((el->el_refresh.r_cursor.h & 07) == 0)
- break; /* go until tab stop */
- }
- break;
- case CHTYPE_NL: {
+
+ if (isprint(c)) {
+ re_putc(el, c, 1);
+ return;
+ }
+ if (c == '\n') { /* expand the newline */
int oldv = el->el_refresh.r_cursor.v;
re_putc(el, '\0', 0); /* assure end of line */
if (oldv == el->el_refresh.r_cursor.v) /* XXX */
re_nextline(el);
- break;
- }
- case CHTYPE_PRINT:
- re_putc(el, c, 1);
- break;
- default: {
- Char visbuf[VISUAL_WIDTH_MAX];
- ssize_t i, n =
- ct_visual_char(visbuf, VISUAL_WIDTH_MAX, (Char)c);
- for (i = 0; n-- > 0; ++i)
- re_putc(el, visbuf[i], 1);
- break;
+ return;
}
+ if (c == '\t') { /* expand the tab */
+ for (;;) {
+ re_putc(el, ' ', 1);
+ if ((el->el_refresh.r_cursor.h & 07) == 0)
+ break; /* go until tab stop */
+ }
+ } else if (iscntrl(c)) {
+ re_putc(el, '^', 1);
+ if (c == 0177)
+ re_putc(el, '?', 1);
+ else
+ /* uncontrolify it; works only for iso8859-1 like sets */
+ re_putc(el, (toascii(c) | 0100), 1);
+ } else {
+ re_putc(el, '\\', 1);
+ re_putc(el, (int) ((((unsigned int) c >> 6) & 07) + '0'), 1);
+ re_putc(el, (int) ((((unsigned int) c >> 3) & 07) + '0'), 1);
+ re_putc(el, (c & 07) + '0', 1);
}
}
@@ -163,32 +163,23 @@ re_addc(EditLine *el, Int c)
* Draw the character given
*/
protected void
-re_putc(EditLine *el, Int c, int shift)
+re_putc(EditLine *el, int c, int shift)
{
- int i, w = Width(c);
- ELRE_DEBUG(1, (__F, "printing %5x '%c'\r\n", c, c));
- while (shift && (el->el_refresh.r_cursor.h + w > el->el_terminal.t_size.h))
- re_putc(el, ' ', 1);
-
- el->el_vdisplay[el->el_refresh.r_cursor.v]
- [el->el_refresh.r_cursor.h] = c;
- /* assumes !shift is only used for single-column chars */
- i = w;
- while (--i > 0)
- el->el_vdisplay[el->el_refresh.r_cursor.v]
- [el->el_refresh.r_cursor.h + i] = MB_FILL_CHAR;
+ ELRE_DEBUG(1, (__F, "printing %3.3o '%c'\r\n", c, c));
+ el->el_vdisplay[el->el_refresh.r_cursor.v][el->el_refresh.r_cursor.h] = c;
if (!shift)
return;
- el->el_refresh.r_cursor.h += w; /* advance to next place */
- if (el->el_refresh.r_cursor.h >= el->el_terminal.t_size.h) {
+ el->el_refresh.r_cursor.h++; /* advance to next place */
+ if (el->el_refresh.r_cursor.h >= el->el_term.t_size.h) {
/* assure end of line */
- el->el_vdisplay[el->el_refresh.r_cursor.v][el->el_terminal.t_size.h]
+ el->el_vdisplay[el->el_refresh.r_cursor.v][el->el_term.t_size.h]
= '\0';
re_nextline(el);
}
+
}
@@ -202,7 +193,7 @@ protected void
re_refresh(EditLine *el)
{
int i, rhdiff;
- Char *cp, *st;
+ char *cp, *st;
coord_t cur;
#ifdef notyet
size_t termsz;
@@ -237,7 +228,7 @@ re_refresh(EditLine *el)
/* draw the current input buffer */
#if notyet
- termsz = el->el_terminal.t_size.h * el->el_terminal.t_size.v;
+ termsz = el->el_term.t_size.h * el->el_term.t_size.v;
if (el->el_line.lastchar - el->el_line.buffer > termsz) {
/*
* If line is longer than terminal, process only part
@@ -246,33 +237,26 @@ re_refresh(EditLine *el)
size_t rem = (el->el_line.lastchar-el->el_line.buffer)%termsz;
st = el->el_line.lastchar - rem
- - (termsz - (((rem / el->el_terminal.t_size.v) - 1)
- * el->el_terminal.t_size.v));
+ - (termsz - (((rem / el->el_term.t_size.v) - 1)
+ * el->el_term.t_size.v));
} else
#endif
st = el->el_line.buffer;
for (cp = st; cp < el->el_line.lastchar; cp++) {
if (cp == el->el_line.cursor) {
- int w = Width(*cp);
/* save for later */
cur.h = el->el_refresh.r_cursor.h;
cur.v = el->el_refresh.r_cursor.v;
- /* handle being at a linebroken doublewidth char */
- if (w > 1 && el->el_refresh.r_cursor.h + w >
- el->el_terminal.t_size.h) {
- cur.h = 0;
- cur.v++;
- }
}
- re_addc(el, *cp);
+ re_addc(el, (unsigned char) *cp);
}
if (cur.h == -1) { /* if I haven't been set yet, I'm at the end */
cur.h = el->el_refresh.r_cursor.h;
cur.v = el->el_refresh.r_cursor.v;
}
- rhdiff = el->el_terminal.t_size.h - el->el_refresh.r_cursor.h -
+ rhdiff = el->el_term.t_size.h - el->el_refresh.r_cursor.h -
el->el_rprompt.p_pos.h;
if (el->el_rprompt.p_pos.h && !el->el_rprompt.p_pos.v &&
!el->el_refresh.r_cursor.v && rhdiff > 1) {
@@ -295,8 +279,8 @@ re_refresh(EditLine *el)
ELRE_DEBUG(1, (__F,
"term.h=%d vcur.h=%d vcur.v=%d vdisplay[0]=\r\n:%80.80s:\r\n",
- el->el_terminal.t_size.h, el->el_refresh.r_cursor.h,
- el->el_refresh.r_cursor.v, ct_encode_string(el->el_vdisplay[0])));
+ el->el_term.t_size.h, el->el_refresh.r_cursor.h,
+ el->el_refresh.r_cursor.v, el->el_vdisplay[0]));
ELRE_DEBUG(1, (__F, "updating %d lines.\r\n", el->el_refresh.r_newcv));
for (i = 0; i <= el->el_refresh.r_newcv; i++) {
@@ -311,7 +295,7 @@ re_refresh(EditLine *el)
* leftover stuff.
*/
re__copy_and_pad(el->el_display[i], el->el_vdisplay[i],
- (size_t) el->el_terminal.t_size.h);
+ (size_t) el->el_term.t_size.h);
}
ELRE_DEBUG(1, (__F,
"\r\nel->el_refresh.r_cursor.v=%d,el->el_refresh.r_oldcv=%d i=%d\r\n",
@@ -319,12 +303,11 @@ re_refresh(EditLine *el)
if (el->el_refresh.r_oldcv > el->el_refresh.r_newcv)
for (; i <= el->el_refresh.r_oldcv; i++) {
- terminal_move_to_line(el, i);
- terminal_move_to_char(el, 0);
- /* This Strlen should be safe even with MB_FILL_CHARs */
- terminal_clear_EOL(el, (int) Strlen(el->el_display[i]));
+ term_move_to_line(el, i);
+ term_move_to_char(el, 0);
+ term_clear_EOL(el, (int) strlen(el->el_display[i]));
#ifdef DEBUG_REFRESH
- terminal_overwrite(el, "C\b", (size_t)2);
+ term_overwrite(el, "C\b", (size_t)2);
#endif /* DEBUG_REFRESH */
el->el_display[i][0] = '\0';
}
@@ -334,8 +317,8 @@ re_refresh(EditLine *el)
"\r\ncursor.h = %d, cursor.v = %d, cur.h = %d, cur.v = %d\r\n",
el->el_refresh.r_cursor.h, el->el_refresh.r_cursor.v,
cur.h, cur.v));
- terminal_move_to_line(el, cur.v); /* go to where the cursor is */
- terminal_move_to_char(el, cur.h);
+ term_move_to_line(el, cur.v); /* go to where the cursor is */
+ term_move_to_char(el, cur.h);
}
@@ -346,10 +329,10 @@ protected void
re_goto_bottom(EditLine *el)
{
- terminal_move_to_line(el, el->el_refresh.r_oldcv);
- terminal__putc(el, '\n');
+ term_move_to_line(el, el->el_refresh.r_oldcv);
+ term__putc(el, '\n');
re_clear_display(el);
- terminal__flush(el);
+ term__flush(el);
}
@@ -359,10 +342,10 @@ re_goto_bottom(EditLine *el)
*/
private void
/*ARGSUSED*/
-re_insert(EditLine *el __attribute__((__unused__)),
- Char *d, int dat, int dlen, Char *s, int num)
+re_insert(EditLine *el __unused,
+ char *d, int dat, int dlen, char *s, int num)
{
- Char *a, *b;
+ char *a, *b;
if (num <= 0)
return;
@@ -371,8 +354,8 @@ re_insert(EditLine *el __attribute__((__unused__)),
ELRE_DEBUG(1,
(__F, "re_insert() starting: %d at %d max %d, d == \"%s\"\n",
- num, dat, dlen, ct_encode_string(d)));
- ELRE_DEBUG(1, (__F, "s == \"%s\"\n", ct_encode_string(s)));
+ num, dat, dlen, d));
+ ELRE_DEBUG(1, (__F, "s == \"%s\"\n", s));
/* open up the space for num chars */
if (num > 0) {
@@ -382,24 +365,19 @@ re_insert(EditLine *el __attribute__((__unused__)),
*b-- = *a--;
d[dlen] = '\0'; /* just in case */
}
-
ELRE_DEBUG(1, (__F,
"re_insert() after insert: %d at %d max %d, d == \"%s\"\n",
- num, dat, dlen, ct_encode_string(d)));
- ELRE_DEBUG(1, (__F, "s == \"%s\"\n", ct_encode_string(s)));
+ num, dat, dlen, d));
+ ELRE_DEBUG(1, (__F, "s == \"%s\"\n", s));
/* copy the characters */
for (a = d + dat; (a < d + dlen) && (num > 0); num--)
*a++ = *s++;
-#ifdef notyet
- /* ct_encode_string() uses a static buffer, so we can't conveniently
- * encode both d & s here */
ELRE_DEBUG(1,
(__F, "re_insert() after copy: %d at %d max %d, %s == \"%s\"\n",
num, dat, dlen, d, s));
ELRE_DEBUG(1, (__F, "s == \"%s\"\n", s));
-#endif
}
@@ -408,10 +386,10 @@ re_insert(EditLine *el __attribute__((__unused__)),
*/
private void
/*ARGSUSED*/
-re_delete(EditLine *el __attribute__((__unused__)),
- Char *d, int dat, int dlen, int num)
+re_delete(EditLine *el __unused,
+ char *d, int dat, int dlen, int num)
{
- Char *a, *b;
+ char *a, *b;
if (num <= 0)
return;
@@ -421,7 +399,7 @@ re_delete(EditLine *el __attribute__((__unused__)),
}
ELRE_DEBUG(1,
(__F, "re_delete() starting: %d at %d max %d, d == \"%s\"\n",
- num, dat, dlen, ct_encode_string(d)));
+ num, dat, dlen, d));
/* open up the space for num chars */
if (num > 0) {
@@ -433,7 +411,7 @@ re_delete(EditLine *el __attribute__((__unused__)),
}
ELRE_DEBUG(1,
(__F, "re_delete() after delete: %d at %d max %d, d == \"%s\"\n",
- num, dat, dlen, ct_encode_string(d)));
+ num, dat, dlen, d));
}
@@ -441,7 +419,7 @@ re_delete(EditLine *el __attribute__((__unused__)),
* Like strncpy without padding.
*/
private void
-re__strncopy(Char *a, Char *b, size_t n)
+re__strncopy(char *a, char *b, size_t n)
{
while (n-- && *b)
@@ -452,7 +430,7 @@ re__strncopy(Char *a, Char *b, size_t n)
* Find the number of characters we need to clear till the end of line
* in order to make sure that we have cleared the previous contents of
* the line. fx and sx is the number of characters inserted or deleted
- * in the first or second diff, diff is the difference between the
+ * int the first or second diff, diff is the difference between the
* number of characters between the new and old line.
*/
private void
@@ -472,7 +450,7 @@ re_clear_eol(EditLine *el, int fx, int sx, int diff)
diff = sx;
ELRE_DEBUG(1, (__F, "re_clear_eol %d\n", diff));
- terminal_clear_EOL(el, diff);
+ term_clear_EOL(el, diff);
}
/*****************************************************************
@@ -500,11 +478,11 @@ new: eddie> Oh, my little buggy says to me, as lurgid as
#define MIN_END_KEEP 4
private void
-re_update_line(EditLine *el, Char *old, Char *new, int i)
+re_update_line(EditLine *el, char *old, char *new, int i)
{
- Char *o, *n, *p, c;
- Char *ofd, *ols, *oe, *nfd, *nls, *ne;
- Char *osb, *ose, *nsb, *nse;
+ char *o, *n, *p, c;
+ char *ofd, *ols, *oe, *nfd, *nls, *ne;
+ char *osb, *ose, *nsb, *nse;
int fx, sx;
size_t len;
@@ -719,7 +697,7 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
* don't have to change the line, we don't move to it. el_cursor.h to
* first diff char
*/
- terminal_move_to_line(el, i);
+ term_move_to_line(el, i);
/*
* at this point we have something like this:
@@ -743,7 +721,7 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
* if we have a net insert on the first difference, AND inserting the
* net amount ((nsb-nfd) - (osb-ofd)) won't push the last useful
* character (which is ne if nls != ne, otherwise is nse) off the edge
- * of the screen (el->el_terminal.t_size.h) else we do the deletes first
+ * of the screen (el->el_term.t_size.h) else we do the deletes first
* so that we keep everything we need to.
*/
@@ -765,13 +743,13 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
* No insert or delete
*/
if ((nsb != nfd) && fx > 0 &&
- ((p - old) + fx <= el->el_terminal.t_size.h)) {
+ ((p - old) + fx <= el->el_term.t_size.h)) {
ELRE_DEBUG(1,
(__F, "first diff insert at %d...\r\n", nfd - new));
/*
* Move to the first char to insert, where the first diff is.
*/
- terminal_move_to_char(el, (int)(nfd - new));
+ term_move_to_char(el, (int)(nfd - new));
/*
* Check if we have stuff to keep at end
*/
@@ -783,21 +761,21 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
if (fx > 0) {
ELRE_DEBUG(!EL_CAN_INSERT, (__F,
"ERROR: cannot insert in early first diff\n"));
- terminal_insertwrite(el, nfd, fx);
+ term_insertwrite(el, nfd, fx);
re_insert(el, old, (int)(ofd - old),
- el->el_terminal.t_size.h, nfd, fx);
+ el->el_term.t_size.h, nfd, fx);
}
/*
* write (nsb-nfd) - fx chars of new starting at
* (nfd + fx)
*/
len = (size_t) ((nsb - nfd) - fx);
- terminal_overwrite(el, (nfd + fx), len);
+ term_overwrite(el, (nfd + fx), len);
re__strncopy(ofd + fx, nfd + fx, len);
} else {
ELRE_DEBUG(1, (__F, "without anything to save\r\n"));
len = (size_t)(nsb - nfd);
- terminal_overwrite(el, nfd, len);
+ term_overwrite(el, nfd, len);
re__strncopy(ofd, nfd, len);
/*
* Done
@@ -810,7 +788,7 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
/*
* move to the first char to delete where the first diff is
*/
- terminal_move_to_char(el, (int)(ofd - old));
+ term_move_to_char(el, (int)(ofd - old));
/*
* Check if we have stuff to save
*/
@@ -823,15 +801,15 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
if (fx < 0) {
ELRE_DEBUG(!EL_CAN_DELETE, (__F,
"ERROR: cannot delete in first diff\n"));
- terminal_deletechars(el, -fx);
+ term_deletechars(el, -fx);
re_delete(el, old, (int)(ofd - old),
- el->el_terminal.t_size.h, -fx);
+ el->el_term.t_size.h, -fx);
}
/*
* write (nsb-nfd) chars of new starting at nfd
*/
len = (size_t) (nsb - nfd);
- terminal_overwrite(el, nfd, len);
+ term_overwrite(el, nfd, len);
re__strncopy(ofd, nfd, len);
} else {
@@ -840,7 +818,7 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
/*
* write (nsb-nfd) chars of new starting at nfd
*/
- terminal_overwrite(el, nfd, (size_t)(nsb - nfd));
+ term_overwrite(el, nfd, (size_t)(nsb - nfd));
re_clear_eol(el, fx, sx,
(int)((oe - old) - (ne - new)));
/*
@@ -851,7 +829,7 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
} else
fx = 0;
- if (sx < 0 && (ose - old) + fx < el->el_terminal.t_size.h) {
+ if (sx < 0 && (ose - old) + fx < el->el_term.t_size.h) {
ELRE_DEBUG(1, (__F,
"second diff delete at %d...\r\n", (ose - old) + fx));
/*
@@ -861,7 +839,7 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
* fx is the number of characters inserted (+) or deleted (-)
*/
- terminal_move_to_char(el, (int)((ose - old) + fx));
+ term_move_to_char(el, (int)((ose - old) + fx));
/*
* Check if we have stuff to save
*/
@@ -873,16 +851,16 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
if (sx < 0) {
ELRE_DEBUG(!EL_CAN_DELETE, (__F,
"ERROR: cannot delete in second diff\n"));
- terminal_deletechars(el, -sx);
+ term_deletechars(el, -sx);
}
/*
* write (nls-nse) chars of new starting at nse
*/
- terminal_overwrite(el, nse, (size_t)(nls - nse));
+ term_overwrite(el, nse, (size_t)(nls - nse));
} else {
ELRE_DEBUG(1, (__F,
"but with nothing left to save\r\n"));
- terminal_overwrite(el, nse, (size_t)(nls - nse));
+ term_overwrite(el, nse, (size_t)(nls - nse));
re_clear_eol(el, fx, sx,
(int)((oe - old) - (ne - new)));
}
@@ -894,7 +872,7 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
ELRE_DEBUG(1, (__F, "late first diff insert at %d...\r\n",
nfd - new));
- terminal_move_to_char(el, (int)(nfd - new));
+ term_move_to_char(el, (int)(nfd - new));
/*
* Check if we have stuff to keep at the end
*/
@@ -912,21 +890,21 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
*/
ELRE_DEBUG(!EL_CAN_INSERT, (__F,
"ERROR: cannot insert in late first diff\n"));
- terminal_insertwrite(el, nfd, fx);
+ term_insertwrite(el, nfd, fx);
re_insert(el, old, (int)(ofd - old),
- el->el_terminal.t_size.h, nfd, fx);
+ el->el_term.t_size.h, nfd, fx);
}
/*
* write (nsb-nfd) - fx chars of new starting at
* (nfd + fx)
*/
len = (size_t) ((nsb - nfd) - fx);
- terminal_overwrite(el, (nfd + fx), len);
+ term_overwrite(el, (nfd + fx), len);
re__strncopy(ofd + fx, nfd + fx, len);
} else {
ELRE_DEBUG(1, (__F, "without anything to save\r\n"));
len = (size_t) (nsb - nfd);
- terminal_overwrite(el, nfd, len);
+ term_overwrite(el, nfd, len);
re__strncopy(ofd, nfd, len);
}
}
@@ -936,24 +914,24 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
if (sx >= 0) {
ELRE_DEBUG(1, (__F,
"second diff insert at %d...\r\n", (int)(nse - new)));
- terminal_move_to_char(el, (int)(nse - new));
+ term_move_to_char(el, (int)(nse - new));
if (ols != oe) {
ELRE_DEBUG(1, (__F, "with stuff to keep at end\r\n"));
if (sx > 0) {
/* insert sx chars of new starting at nse */
ELRE_DEBUG(!EL_CAN_INSERT, (__F,
"ERROR: cannot insert in second diff\n"));
- terminal_insertwrite(el, nse, sx);
+ term_insertwrite(el, nse, sx);
}
/*
* write (nls-nse) - sx chars of new starting at
* (nse + sx)
*/
- terminal_overwrite(el, (nse + sx),
+ term_overwrite(el, (nse + sx),
(size_t)((nls - nse) - sx));
} else {
ELRE_DEBUG(1, (__F, "without anything to save\r\n"));
- terminal_overwrite(el, nse, (size_t)(nls - nse));
+ term_overwrite(el, nse, (size_t)(nls - nse));
/*
* No need to do a clear-to-end here because we were
@@ -970,7 +948,7 @@ re_update_line(EditLine *el, Char *old, Char *new, int i)
* Copy string and pad with spaces
*/
private void
-re__copy_and_pad(Char *dst, const Char *src, size_t width)
+re__copy_and_pad(char *dst, const char *src, size_t width)
{
size_t i;
@@ -993,8 +971,8 @@ re__copy_and_pad(Char *dst, const Char *src, size_t width)
protected void
re_refresh_cursor(EditLine *el)
{
- Char *cp;
- int h, v, th, w;
+ char *cp, c;
+ int h, v, th;
if (el->el_line.cursor >= el->el_line.lastchar) {
if (el->el_map.current == el->el_map.alt
@@ -1007,46 +985,41 @@ re_refresh_cursor(EditLine *el)
/* first we must find where the cursor is... */
h = el->el_prompt.p_pos.h;
v = el->el_prompt.p_pos.v;
- th = el->el_terminal.t_size.h; /* optimize for speed */
+ th = el->el_term.t_size.h; /* optimize for speed */
/* do input buffer to el->el_line.cursor */
for (cp = el->el_line.buffer; cp < el->el_line.cursor; cp++) {
- switch (ct_chr_class(*cp)) {
- case CHTYPE_NL: /* handle newline in data part too */
+ c = *cp;
+
+ switch (c) {
+ case '\n': /* handle newline in data part too */
h = 0;
v++;
break;
- case CHTYPE_TAB: /* if a tab, to next tab stop */
+ case '\t': /* if a tab, to next tab stop */
while (++h & 07)
continue;
break;
default:
- w = Width(*cp);
- if (w > 1 && h + w > th) { /* won't fit on line */
- h = 0;
- v++;
- }
- h += ct_visual_width(*cp);
+ if (iscntrl((unsigned char) c))
+ h += 2; /* ^x */
+ else if (!isprint((unsigned char) c))
+ h += 4; /* octal \xxx */
+ else
+ h++;
break;
- }
+ }
if (h >= th) { /* check, extra long tabs picked up here also */
h -= th;
v++;
}
}
- /* if we have a next character, and it's a doublewidth one, we need to
- * check whether we need to linebreak for it to fit */
- if (cp < el->el_line.lastchar && (w = Width(*cp)) > 1)
- if (h + w > th) {
- h = 0;
- v++;
- }
/* now go there */
- terminal_move_to_line(el, v);
- terminal_move_to_char(el, h);
- terminal__flush(el);
+ term_move_to_line(el, v);
+ term_move_to_char(el, h);
+ term__flush(el);
}
@@ -1054,19 +1027,12 @@ re_refresh_cursor(EditLine *el)
* Add a character fast.
*/
private void
-re_fastputc(EditLine *el, Int c)
+re_fastputc(EditLine *el, int c)
{
- int w = Width((Char)c);
- while (w > 1 && el->el_cursor.h + w > el->el_terminal.t_size.h)
- re_fastputc(el, ' ');
- terminal__putc(el, c);
+ term__putc(el, c);
el->el_display[el->el_cursor.v][el->el_cursor.h++] = c;
- while (--w > 0)
- el->el_display[el->el_cursor.v][el->el_cursor.h++]
- = MB_FILL_CHAR;
-
- if (el->el_cursor.h >= el->el_terminal.t_size.h) {
+ if (el->el_cursor.h >= el->el_term.t_size.h) {
/* if we must overflow */
el->el_cursor.h = 0;
@@ -1076,14 +1042,14 @@ re_fastputc(EditLine *el, Int c)
* We do this via pointer shuffling - it's safe in this case
* and we avoid memcpy().
*/
- if (el->el_cursor.v + 1 >= el->el_terminal.t_size.v) {
- int i, lins = el->el_terminal.t_size.v;
- Char *firstline = el->el_display[0];
+ if (el->el_cursor.v + 1 >= el->el_term.t_size.v) {
+ int i, lins = el->el_term.t_size.v;
+ char *firstline = el->el_display[0];
for(i = 1; i < lins; i++)
el->el_display[i - 1] = el->el_display[i];
- re__copy_and_pad(firstline, STR(""), (size_t)0);
+ re__copy_and_pad(firstline, "", 0);
el->el_display[i - 1] = firstline;
} else {
el->el_cursor.v++;
@@ -1091,12 +1057,12 @@ re_fastputc(EditLine *el, Int c)
}
if (EL_HAS_AUTO_MARGINS) {
if (EL_HAS_MAGIC_MARGINS) {
- terminal__putc(el, ' ');
- terminal__putc(el, '\b');
+ term__putc(el, ' ');
+ term__putc(el, '\b');
}
} else {
- terminal__putc(el, '\r');
- terminal__putc(el, '\n');
+ term__putc(el, '\r');
+ term__putc(el, '\n');
}
}
}
@@ -1109,39 +1075,34 @@ re_fastputc(EditLine *el, Int c)
protected void
re_fastaddc(EditLine *el)
{
- Char c;
+ char c;
int rhdiff;
- c = el->el_line.cursor[-1];
+ c = (unsigned char)el->el_line.cursor[-1];
if (c == '\t' || el->el_line.cursor != el->el_line.lastchar) {
re_refresh(el); /* too hard to handle */
return;
}
- rhdiff = el->el_terminal.t_size.h - el->el_cursor.h -
+ rhdiff = el->el_term.t_size.h - el->el_cursor.h -
el->el_rprompt.p_pos.h;
if (el->el_rprompt.p_pos.h && rhdiff < 3) {
re_refresh(el); /* clear out rprompt if less than 1 char gap */
return;
} /* else (only do at end of line, no TAB) */
- switch (ct_chr_class(c)) {
- case CHTYPE_TAB: /* already handled, should never happen here */
- break;
- case CHTYPE_NL:
- case CHTYPE_PRINT:
+ if (iscntrl((unsigned char) c)) { /* if control char, do caret */
+ char mc = (c == 0177) ? '?' : (toascii(c) | 0100);
+ re_fastputc(el, '^');
+ re_fastputc(el, mc);
+ } else if (isprint((unsigned char) c)) { /* normal char */
re_fastputc(el, c);
- break;
- case CHTYPE_ASCIICTL:
- case CHTYPE_NONPRINT: {
- Char visbuf[VISUAL_WIDTH_MAX];
- ssize_t i, n =
- ct_visual_char(visbuf, VISUAL_WIDTH_MAX, (Char)c);
- for (i = 0; n-- > 0; ++i)
- re_fastputc(el, visbuf[i]);
- break;
- }
+ } else {
+ re_fastputc(el, '\\');
+ re_fastputc(el, (int)(((((unsigned int)c) >> 6) & 3) + '0'));
+ re_fastputc(el, (int)(((((unsigned int)c) >> 3) & 7) + '0'));
+ re_fastputc(el, (c & 7) + '0');
}
- terminal__flush(el);
+ term__flush(el);
}
@@ -1155,7 +1116,7 @@ re_clear_display(EditLine *el)
el->el_cursor.v = 0;
el->el_cursor.h = 0;
- for (i = 0; i < el->el_terminal.t_size.v; i++)
+ for (i = 0; i < el->el_term.t_size.v; i++)
el->el_display[i][0] = '\0';
el->el_refresh.r_oldcv = 0;
}
@@ -1172,14 +1133,14 @@ re_clear_lines(EditLine *el)
int i;
for (i = el->el_refresh.r_oldcv; i >= 0; i--) {
/* for each line on the screen */
- terminal_move_to_line(el, i);
- terminal_move_to_char(el, 0);
- terminal_clear_EOL(el, el->el_terminal.t_size.h);
+ term_move_to_line(el, i);
+ term_move_to_char(el, 0);
+ term_clear_EOL(el, el->el_term.t_size.h);
}
} else {
- terminal_move_to_line(el, el->el_refresh.r_oldcv);
+ term_move_to_line(el, el->el_refresh.r_oldcv);
/* go to last line */
- terminal__putc(el, '\r'); /* go to BOL */
- terminal__putc(el, '\n'); /* go to new line */
+ term__putc(el, '\r'); /* go to BOL */
+ term__putc(el, '\n'); /* go to new line */
}
}
diff --git a/lib/libedit/refresh.h b/lib/libedit/refresh.h
index 71a1587..e44ef9c 100644
--- a/lib/libedit/refresh.h
+++ b/lib/libedit/refresh.h
@@ -1,5 +1,3 @@
-/* $NetBSD: refresh.h,v 1.6 2009/12/30 22:37:40 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +30,7 @@
* SUCH DAMAGE.
*
* @(#)refresh.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: refresh.h,v 1.5 2003/08/07 16:44:33 agc Exp $
* $FreeBSD$
*/
@@ -49,7 +48,7 @@ typedef struct {
int r_newcv;
} el_refresh_t;
-protected void re_putc(EditLine *, Int, int);
+protected void re_putc(EditLine *, int, int);
protected void re_clear_lines(EditLine *);
protected void re_clear_display(EditLine *);
protected void re_refresh(EditLine *);
diff --git a/lib/libedit/search.c b/lib/libedit/search.c
index 3cd205a..af3da8c 100644
--- a/lib/libedit/search.c
+++ b/lib/libedit/search.c
@@ -1,5 +1,3 @@
-/* $NetBSD: search.c,v 1.30 2011/10/04 15:27:04 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: search.c,v 1.21 2009/02/15 21:55:23 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: search.c,v 1.30 2011/10/04 15:27:04 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -46,6 +41,7 @@ __FBSDID("$FreeBSD$");
/*
* search.c: History and character search functions
*/
+#include "sys.h"
#include <stdlib.h>
#if defined(REGEX)
#include <regex.h>
@@ -68,16 +64,15 @@ protected int
search_init(EditLine *el)
{
- el->el_search.patbuf = el_malloc(EL_BUFSIZ *
- sizeof(*el->el_search.patbuf));
+ el->el_search.patbuf = (char *) el_malloc(EL_BUFSIZ);
if (el->el_search.patbuf == NULL)
- return -1;
+ return (-1);
el->el_search.patlen = 0;
el->el_search.patdir = -1;
el->el_search.chacha = '\0';
el->el_search.chadir = CHAR_FWD;
el->el_search.chatflg = 0;
- return 0;
+ return (0);
}
@@ -88,7 +83,7 @@ protected void
search_end(EditLine *el)
{
- el_free(el->el_search.patbuf);
+ el_free((ptr_t) el->el_search.patbuf);
el->el_search.patbuf = NULL;
}
@@ -109,11 +104,8 @@ regerror(const char *msg)
* Return if string matches pattern
*/
protected int
-el_match(const Char *str, const Char *pat)
+el_match(const char *str, const char *pat)
{
-#ifdef WIDECHAR
- static ct_buffer_t conv;
-#endif
#if defined (REGEX)
regex_t re;
int rv;
@@ -125,31 +117,30 @@ el_match(const Char *str, const Char *pat)
extern int re_exec(const char *);
#endif
- if (Strstr(str, pat) != 0)
- return 1;
+ if (strstr(str, pat) != NULL)
+ return (1);
#if defined(REGEX)
- if (regcomp(&re, ct_encode_string(pat, &conv), 0) == 0) {
- rv = regexec(&re, ct_encode_string(str, &conv), (size_t)0, NULL,
- 0) == 0;
+ if (regcomp(&re, pat, 0) == 0) {
+ rv = regexec(&re, str, 0, NULL, 0) == 0;
regfree(&re);
} else {
rv = 0;
}
- return rv;
+ return (rv);
#elif defined(REGEXP)
- if ((re = regcomp(ct_encode_string(pat, &conv))) != NULL) {
- rv = regexec(re, ct_encode_string(str, &conv));
- el_free(re);
+ if ((re = regcomp(pat)) != NULL) {
+ rv = regexec(re, str);
+ free((ptr_t) re);
} else {
rv = 0;
}
- return rv;
+ return (rv);
#else
- if (re_comp(ct_encode_string(pat, &conv)) != NULL)
- return 0;
+ if (re_comp(pat) != NULL)
+ return (0);
else
- return re_exec(ct_encode_string(str, &conv) == 1);
+ return (re_exec(str) == 1);
#endif
}
@@ -158,14 +149,14 @@ el_match(const Char *str, const Char *pat)
* return True if the pattern matches the prefix
*/
protected int
-c_hmatch(EditLine *el, const Char *str)
+c_hmatch(EditLine *el, const char *str)
{
#ifdef SDEBUG
(void) fprintf(el->el_errfile, "match `%s' with `%s'\n",
el->el_search.patbuf, str);
#endif /* SDEBUG */
- return el_match(str, el->el_search.patbuf);
+ return (el_match(str, el->el_search.patbuf));
}
@@ -177,16 +168,15 @@ c_setpat(EditLine *el)
{
if (el->el_state.lastcmd != ED_SEARCH_PREV_HISTORY &&
el->el_state.lastcmd != ED_SEARCH_NEXT_HISTORY) {
- el->el_search.patlen =
- (size_t)(EL_CURSOR(el) - el->el_line.buffer);
+ el->el_search.patlen = EL_CURSOR(el) - el->el_line.buffer;
if (el->el_search.patlen >= EL_BUFSIZ)
el->el_search.patlen = EL_BUFSIZ - 1;
if (el->el_search.patlen != 0) {
- (void) Strncpy(el->el_search.patbuf, el->el_line.buffer,
+ (void) strncpy(el->el_search.patbuf, el->el_line.buffer,
el->el_search.patlen);
el->el_search.patbuf[el->el_search.patlen] = '\0';
} else
- el->el_search.patlen = Strlen(el->el_search.patbuf);
+ el->el_search.patlen = strlen(el->el_search.patbuf);
}
#ifdef SDEBUG
(void) fprintf(el->el_errfile, "\neventno = %d\n",
@@ -207,12 +197,12 @@ c_setpat(EditLine *el)
protected el_action_t
ce_inc_search(EditLine *el, int dir)
{
- static const Char STRfwd[] = {'f', 'w', 'd', '\0'},
+ static const char STRfwd[] = {'f', 'w', 'd', '\0'},
STRbck[] = {'b', 'c', 'k', '\0'};
- static Char pchar = ':';/* ':' = normal, '?' = failed */
- static Char endcmd[2] = {'\0', '\0'};
- Char ch, *ocursor = el->el_line.cursor, oldpchar = pchar;
- const Char *cp;
+ static char pchar = ':';/* ':' = normal, '?' = failed */
+ static char endcmd[2] = {'\0', '\0'};
+ char ch, *ocursor = el->el_line.cursor, oldpchar = pchar;
+ const char *cp;
el_action_t ret = CC_NORM;
@@ -221,10 +211,9 @@ ce_inc_search(EditLine *el, int dir)
int newdir = dir;
int done, redo;
- if (el->el_line.lastchar + sizeof(STRfwd) /
- sizeof(*el->el_line.lastchar) + 2 +
+ if (el->el_line.lastchar + sizeof(STRfwd) / sizeof(char) + 2 +
el->el_search.patlen >= el->el_line.limit)
- return CC_ERROR;
+ return (CC_ERROR);
for (;;) {
@@ -251,14 +240,14 @@ ce_inc_search(EditLine *el, int dir)
*el->el_line.lastchar = '\0';
re_refresh(el);
- if (FUN(el,getc)(el, &ch) != 1)
- return ed_end_of_file(el, 0);
+ if (el_getc(el, &ch) != 1)
+ return (ed_end_of_file(el, 0));
switch (el->el_map.current[(unsigned char) ch]) {
case ED_INSERT:
case ED_DIGIT:
if (el->el_search.patlen >= EL_BUFSIZ - LEN)
- terminal_beep(el);
+ term_beep(el);
else {
el->el_search.patbuf[el->el_search.patlen++] =
ch;
@@ -283,7 +272,7 @@ ce_inc_search(EditLine *el, int dir)
if (el->el_search.patlen > LEN)
done++;
else
- terminal_beep(el);
+ term_beep(el);
break;
default:
@@ -307,7 +296,7 @@ ce_inc_search(EditLine *el, int dir)
*el->el_line.cursor != '\n') {
if (el->el_search.patlen >=
EL_BUFSIZ - LEN) {
- terminal_beep(el);
+ term_beep(el);
break;
}
el->el_search.patbuf[el->el_search.patlen++] =
@@ -320,14 +309,14 @@ ce_inc_search(EditLine *el, int dir)
re_refresh(el);
break;
} else if (isglob(*cp)) {
- terminal_beep(el);
+ term_beep(el);
break;
}
break;
default: /* Terminate and execute cmd */
endcmd[0] = ch;
- FUN(el,push)(el, endcmd);
+ el_push(el, endcmd);
/* FALLTHROUGH */
case 0033: /* ESC: Terminate */
@@ -389,10 +378,9 @@ ce_inc_search(EditLine *el, int dir)
/* avoid c_setpat */
el->el_state.lastcmd =
(el_action_t) newdir;
- ret = (el_action_t)
- (newdir == ED_SEARCH_PREV_HISTORY ?
+ ret = newdir == ED_SEARCH_PREV_HISTORY ?
ed_search_prev_history(el, 0) :
- ed_search_next_history(el, 0));
+ ed_search_next_history(el, 0);
if (ret != CC_ERROR) {
el->el_line.cursor = newdir ==
ED_SEARCH_PREV_HISTORY ?
@@ -406,13 +394,13 @@ ce_inc_search(EditLine *el, int dir)
el->el_search.patbuf[el->el_search.patlen] =
'\0';
if (ret == CC_ERROR) {
- terminal_beep(el);
+ term_beep(el);
if (el->el_history.eventno !=
ohisteventno) {
el->el_history.eventno =
ohisteventno;
if (hist_get(el) == CC_ERROR)
- return CC_ERROR;
+ return (CC_ERROR);
}
el->el_line.cursor = ocursor;
pchar = '?';
@@ -437,14 +425,14 @@ ce_inc_search(EditLine *el, int dir)
if (el->el_history.eventno != ohisteventno) {
el->el_history.eventno = ohisteventno;
if (hist_get(el) == CC_ERROR)
- return CC_ERROR;
+ return (CC_ERROR);
}
el->el_line.cursor = ocursor;
if (ret == CC_ERROR)
re_refresh(el);
}
if (done || ret != CC_NORM)
- return ret;
+ return (ret);
}
}
@@ -455,9 +443,9 @@ ce_inc_search(EditLine *el, int dir)
protected el_action_t
cv_search(EditLine *el, int dir)
{
- Char ch;
- Char tmpbuf[EL_BUFSIZ];
- ssize_t tmplen;
+ char ch;
+ char tmpbuf[EL_BUFSIZ];
+ int tmplen;
#ifdef ANCHOR
tmpbuf[0] = '.';
@@ -468,7 +456,7 @@ cv_search(EditLine *el, int dir)
el->el_search.patdir = dir;
tmplen = c_gets(el, &tmpbuf[LEN],
- dir == ED_SEARCH_PREV_HISTORY ? STR("\n/") : STR("\n?") );
+ dir == ED_SEARCH_PREV_HISTORY ? "\n/" : "\n?" );
if (tmplen == -1)
return CC_REFRESH;
@@ -482,16 +470,16 @@ cv_search(EditLine *el, int dir)
*/
if (el->el_search.patlen == 0) {
re_refresh(el);
- return CC_ERROR;
+ return (CC_ERROR);
}
#ifdef ANCHOR
if (el->el_search.patbuf[0] != '.' &&
el->el_search.patbuf[0] != '*') {
- (void) Strncpy(tmpbuf, el->el_search.patbuf,
- sizeof(tmpbuf) / sizeof(*tmpbuf) - 1);
+ (void) strncpy(tmpbuf, el->el_search.patbuf,
+ sizeof(tmpbuf) - 1);
el->el_search.patbuf[0] = '.';
el->el_search.patbuf[1] = '*';
- (void) Strncpy(&el->el_search.patbuf[2], tmpbuf,
+ (void) strncpy(&el->el_search.patbuf[2], tmpbuf,
EL_BUFSIZ - 3);
el->el_search.patlen++;
el->el_search.patbuf[el->el_search.patlen++] = '.';
@@ -505,21 +493,21 @@ cv_search(EditLine *el, int dir)
tmpbuf[tmplen++] = '*';
#endif
tmpbuf[tmplen] = '\0';
- (void) Strncpy(el->el_search.patbuf, tmpbuf, EL_BUFSIZ - 1);
- el->el_search.patlen = (size_t)tmplen;
+ (void) strncpy(el->el_search.patbuf, tmpbuf, EL_BUFSIZ - 1);
+ el->el_search.patlen = tmplen;
}
el->el_state.lastcmd = (el_action_t) dir; /* avoid c_setpat */
el->el_line.cursor = el->el_line.lastchar = el->el_line.buffer;
if ((dir == ED_SEARCH_PREV_HISTORY ? ed_search_prev_history(el, 0) :
ed_search_next_history(el, 0)) == CC_ERROR) {
re_refresh(el);
- return CC_ERROR;
+ return (CC_ERROR);
}
if (ch == 0033) {
re_refresh(el);
return ed_newline(el, 0);
}
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -529,9 +517,9 @@ cv_search(EditLine *el, int dir)
protected el_action_t
ce_search_line(EditLine *el, int dir)
{
- Char *cp = el->el_line.cursor;
- Char *pattern = el->el_search.patbuf;
- Char oc, *ocp;
+ char *cp = el->el_line.cursor;
+ char *pattern = el->el_search.patbuf;
+ char oc, *ocp;
#ifdef ANCHOR
ocp = &pattern[1];
oc = *ocp;
@@ -546,21 +534,21 @@ ce_search_line(EditLine *el, int dir)
if (el_match(cp, ocp)) {
*ocp = oc;
el->el_line.cursor = cp;
- return CC_NORM;
+ return (CC_NORM);
}
}
*ocp = oc;
- return CC_ERROR;
+ return (CC_ERROR);
} else {
for (; *cp != '\0' && cp < el->el_line.limit; cp++) {
if (el_match(cp, ocp)) {
*ocp = oc;
el->el_line.cursor = cp;
- return CC_NORM;
+ return (CC_NORM);
}
}
*ocp = oc;
- return CC_ERROR;
+ return (CC_ERROR);
}
}
@@ -569,12 +557,12 @@ ce_search_line(EditLine *el, int dir)
* Vi repeat search
*/
protected el_action_t
-cv_repeat_srch(EditLine *el, Int c)
+cv_repeat_srch(EditLine *el, int c)
{
#ifdef SDEBUG
(void) fprintf(el->el_errfile, "dir %d patlen %d patbuf %s\n",
- c, el->el_search.patlen, ct_encode_string(el->el_search.patbuf));
+ c, el->el_search.patlen, el->el_search.patbuf);
#endif
el->el_state.lastcmd = (el_action_t) c; /* Hack to stop c_setpat */
@@ -582,11 +570,11 @@ cv_repeat_srch(EditLine *el, Int c)
switch (c) {
case ED_SEARCH_NEXT_HISTORY:
- return ed_search_next_history(el, 0);
+ return (ed_search_next_history(el, 0));
case ED_SEARCH_PREV_HISTORY:
- return ed_search_prev_history(el, 0);
+ return (ed_search_prev_history(el, 0));
default:
- return CC_ERROR;
+ return (CC_ERROR);
}
}
@@ -595,16 +583,16 @@ cv_repeat_srch(EditLine *el, Int c)
* Vi character search
*/
protected el_action_t
-cv_csearch(EditLine *el, int direction, Int ch, int count, int tflag)
+cv_csearch(EditLine *el, int direction, int ch, int count, int tflag)
{
- Char *cp;
+ char *cp;
if (ch == 0)
return CC_ERROR;
- if (ch == (Int)-1) {
- Char c;
- if (FUN(el,getc)(el, &c) != 1)
+ if (ch == -1) {
+ char c;
+ if (el_getc(el, &c) != 1)
return ed_end_of_file(el, 0);
ch = c;
}
@@ -612,18 +600,18 @@ cv_csearch(EditLine *el, int direction, Int ch, int count, int tflag)
/* Save for ';' and ',' commands */
el->el_search.chacha = ch;
el->el_search.chadir = direction;
- el->el_search.chatflg = (char)tflag;
+ el->el_search.chatflg = tflag;
cp = el->el_line.cursor;
while (count--) {
- if ((Int)*cp == ch)
+ if (*cp == ch)
cp += direction;
for (;;cp += direction) {
if (cp >= el->el_line.lastchar)
return CC_ERROR;
if (cp < el->el_line.buffer)
return CC_ERROR;
- if ((Int)*cp == ch)
+ if (*cp == ch)
break;
}
}
diff --git a/lib/libedit/search.h b/lib/libedit/search.h
index 02c8f5d..725af7c 100644
--- a/lib/libedit/search.h
+++ b/lib/libedit/search.h
@@ -1,5 +1,3 @@
-/* $NetBSD: search.h,v 1.9 2009/12/30 22:37:40 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +30,7 @@
* SUCH DAMAGE.
*
* @(#)search.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: search.h,v 1.8 2003/10/18 23:27:36 christos Exp $
* $FreeBSD$
*/
@@ -44,24 +43,24 @@
#include "histedit.h"
typedef struct el_search_t {
- Char *patbuf; /* The pattern buffer */
+ char *patbuf; /* The pattern buffer */
size_t patlen; /* Length of the pattern buffer */
int patdir; /* Direction of the last search */
int chadir; /* Character search direction */
- Char chacha; /* Character we are looking for */
+ char chacha; /* Character we are looking for */
char chatflg; /* 0 if f, 1 if t */
} el_search_t;
-protected int el_match(const Char *, const Char *);
+protected int el_match(const char *, const char *);
protected int search_init(EditLine *);
protected void search_end(EditLine *);
-protected int c_hmatch(EditLine *, const Char *);
+protected int c_hmatch(EditLine *, const char *);
protected void c_setpat(EditLine *);
protected el_action_t ce_inc_search(EditLine *, int);
protected el_action_t cv_search(EditLine *, int);
protected el_action_t ce_search_line(EditLine *, int);
-protected el_action_t cv_repeat_srch(EditLine *, Int);
-protected el_action_t cv_csearch(EditLine *, int, Int, int, int);
+protected el_action_t cv_repeat_srch(EditLine *, int);
+protected el_action_t cv_csearch(EditLine *, int, int, int, int);
#endif /* _h_el_search */
diff --git a/lib/libedit/sig.c b/lib/libedit/sig.c
index babec69..e48dbef 100644
--- a/lib/libedit/sig.c
+++ b/lib/libedit/sig.c
@@ -1,5 +1,3 @@
-/* $NetBSD: sig.c,v 1.17 2011/07/28 20:50:55 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: sig.c,v 1.15 2009/02/19 15:20:22 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: sig.c,v 1.17 2011/07/28 20:50:55 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -48,6 +43,7 @@ __FBSDID("$FreeBSD$");
* our policy is to trap all signals, set a good state
* and pass the ball to our caller.
*/
+#include "sys.h"
#include "el.h"
#include <stdlib.h>
@@ -84,7 +80,7 @@ sig_handler(int signo)
tty_rawmode(sel);
if (ed_redisplay(sel, 0) == CC_REFRESH)
re_refresh(sel);
- terminal__flush(sel);
+ term__flush(sel);
break;
case SIGWINCH:
@@ -148,7 +144,7 @@ protected void
sig_end(EditLine *el)
{
- el_free(el->el_signal);
+ el_free((ptr_t) el->el_signal);
el->el_signal = NULL;
}
diff --git a/lib/libedit/sig.h b/lib/libedit/sig.h
index a096681..7e38100 100644
--- a/lib/libedit/sig.h
+++ b/lib/libedit/sig.h
@@ -1,5 +1,3 @@
-/* $NetBSD: sig.h,v 1.8 2009/02/19 15:20:22 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +30,7 @@
* SUCH DAMAGE.
*
* @(#)sig.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: sig.h,v 1.8 2009/02/19 15:20:22 christos Exp $
* $FreeBSD$
*/
diff --git a/lib/libedit/sys.h b/lib/libedit/sys.h
index d005ffd..5c017d3 100644
--- a/lib/libedit/sys.h
+++ b/lib/libedit/sys.h
@@ -1,5 +1,3 @@
-/* $NetBSD: sys.h,v 1.17 2011/09/28 14:08:04 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +30,7 @@
* SUCH DAMAGE.
*
* @(#)sys.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: sys.h,v 1.12 2009/08/31 00:05:43 christos Exp $
* $FreeBSD$
*/
@@ -41,24 +40,8 @@
#ifndef _h_sys
#define _h_sys
-#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
-#endif
-
-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
-# define __attribute__(A)
-#endif
-#ifndef __BEGIN_DECLS
-# ifdef __cplusplus
-# define __BEGIN_DECLS extern "C" {
-# define __END_DECLS }
-# else
-# define __BEGIN_DECLS
-# define __END_DECLS
-# endif
-#endif
-
#ifndef public
# define public /* Externally visible functions/variables */
#endif
@@ -72,47 +55,17 @@
/* When we want to hide everything */
#endif
-#ifndef __arraycount
-# define __arraycount(a) (sizeof(a) / sizeof(*(a)))
-#endif
-
-#include <stdio.h>
-
-#ifndef HAVE_STRLCAT
-#define strlcat libedit_strlcat
-size_t strlcat(char *dst, const char *src, size_t size);
-#endif
-
-#ifndef HAVE_STRLCPY
-#define strlcpy libedit_strlcpy
-size_t strlcpy(char *dst, const char *src, size_t size);
-#endif
-
-#ifndef HAVE_FGETLN
-#define fgetln libedit_fgetln
-char *fgetln(FILE *fp, size_t *len);
+#ifndef _PTR_T
+# define _PTR_T
+typedef void *ptr_t;
#endif
-#ifndef HAVE_WCSDUP
-#include <wchar.h>
-wchar_t *wcsdup(const wchar_t *);
+#ifndef _IOCTL_T
+# define _IOCTL_T
+typedef void *ioctl_t;
#endif
-#ifndef _DIAGASSERT
-#define _DIAGASSERT(x)
-#endif
-
-#ifndef __RCSID
-#define __RCSID(x)
-#endif
-
-#ifndef HAVE_U_INT32_T
-typedef unsigned int u_int32_t;
-#endif
-
-#ifndef SIZE_T_MAX
-#define SIZE_T_MAX ((size_t)-1)
-#endif
+#include <stdio.h>
#define REGEX /* Use POSIX.2 regular expression functions */
#undef REGEXP /* Use UNIX V8 regular expression functions */
@@ -126,4 +79,40 @@ extern char* tgoto(const char*, int, int);
extern char* tgetstr(char*, char**);
#endif
+#ifdef notdef
+# undef REGEX
+# undef REGEXP
+# include <malloc.h>
+# ifdef __GNUC__
+/*
+ * Broken hdrs.
+ */
+extern int tgetent(const char *bp, char *name);
+extern int tgetflag(const char *id);
+extern int tgetnum(const char *id);
+extern char *tgetstr(const char *id, char **area);
+extern char *tgoto(const char *cap, int col, int row);
+extern int tputs(const char *str, int affcnt, int (*putc)(int));
+extern char *getenv(const char *);
+extern int fprintf(FILE *, const char *, ...);
+extern int sigsetmask(int);
+extern int sigblock(int);
+extern int fputc(int, FILE *);
+extern int fgetc(FILE *);
+extern int fflush(FILE *);
+extern int tolower(int);
+extern int toupper(int);
+extern int errno, sys_nerr;
+extern char *sys_errlist[];
+extern void perror(const char *);
+# include <string.h>
+# define strerror(e) sys_errlist[e]
+# endif
+# ifdef SABER
+extern ptr_t memcpy(ptr_t, const ptr_t, size_t);
+extern ptr_t memset(ptr_t, int, size_t);
+# endif
+extern char *fgetline(FILE *, int *);
+#endif
+
#endif /* _h_sys */
diff --git a/lib/libedit/terminal.c b/lib/libedit/term.c
index 0709d53..e526484 100644
--- a/lib/libedit/terminal.c
+++ b/lib/libedit/term.c
@@ -1,5 +1,3 @@
-/* $NetBSD: terminal.c,v 1.14 2012/05/30 18:21:14 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,66 +28,120 @@
* LIABILITY, OR TORT (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: term.c,v 1.56 2009/12/28 21:54:21 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
-#else
-__RCSID("$NetBSD: terminal.c,v 1.14 2012/05/30 18:21:14 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
- * terminal.c: Editor/termcap-curses interface
- * We have to declare a static variable here, since the
- * termcap putchar routine does not take an argument!
+ * term.c: Editor/termcap-curses interface
+ * We have to declare a static variable here, since the
+ * termcap putchar routine does not take an argument!
*/
#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
-#include <limits.h>
-#ifdef HAVE_TERMCAP_H
#include <termcap.h>
-#endif
-#ifdef HAVE_CURSES_H
#include <curses.h>
-#elif HAVE_NCURSES_H
#include <ncurses.h>
-#endif
-
-/* Solaris's term.h does horrid things. */
-#if defined(HAVE_TERM_H) && !defined(__sun) && !defined(HAVE_TERMCAP_H)
#include <term.h>
-#endif
-
#include <sys/types.h>
#include <sys/ioctl.h>
-#ifdef _REENTRANT
-#include <pthread.h>
-#endif
-
#include "el.h"
/*
* IMPORTANT NOTE: these routines are allowed to look at the current screen
- * and the current position assuming that it is correct. If this is not
+ * and the current possition assuming that it is correct. If this is not
* true, then the update will be WRONG! This is (should be) a valid
* assumption...
*/
-#define TC_BUFSIZE ((size_t)2048)
+#define TC_BUFSIZE 2048
-#define GoodStr(a) (el->el_terminal.t_str[a] != NULL && \
- el->el_terminal.t_str[a][0] != '\0')
-#define Str(a) el->el_terminal.t_str[a]
-#define Val(a) el->el_terminal.t_val[a]
+#define GoodStr(a) (el->el_term.t_str[a] != NULL && \
+ el->el_term.t_str[a][0] != '\0')
+#define Str(a) el->el_term.t_str[a]
+#define Val(a) el->el_term.t_val[a]
+
+#ifdef notdef
+private const struct {
+ const char *b_name;
+ int b_rate;
+} baud_rate[] = {
+#ifdef B0
+ { "0", B0 },
+#endif
+#ifdef B50
+ { "50", B50 },
+#endif
+#ifdef B75
+ { "75", B75 },
+#endif
+#ifdef B110
+ { "110", B110 },
+#endif
+#ifdef B134
+ { "134", B134 },
+#endif
+#ifdef B150
+ { "150", B150 },
+#endif
+#ifdef B200
+ { "200", B200 },
+#endif
+#ifdef B300
+ { "300", B300 },
+#endif
+#ifdef B600
+ { "600", B600 },
+#endif
+#ifdef B900
+ { "900", B900 },
+#endif
+#ifdef B1200
+ { "1200", B1200 },
+#endif
+#ifdef B1800
+ { "1800", B1800 },
+#endif
+#ifdef B2400
+ { "2400", B2400 },
+#endif
+#ifdef B3600
+ { "3600", B3600 },
+#endif
+#ifdef B4800
+ { "4800", B4800 },
+#endif
+#ifdef B7200
+ { "7200", B7200 },
+#endif
+#ifdef B9600
+ { "9600", B9600 },
+#endif
+#ifdef EXTA
+ { "19200", EXTA },
+#endif
+#ifdef B19200
+ { "19200", B19200 },
+#endif
+#ifdef EXTB
+ { "38400", EXTB },
+#endif
+#ifdef B38400
+ { "38400", B38400 },
+#endif
+ { NULL, 0 }
+};
+#endif
private const struct termcapstr {
const char *name;
@@ -202,28 +254,27 @@ private const struct termcapval {
};
/* do two or more of the attributes use me */
-private void terminal_setflags(EditLine *);
-private int terminal_rebuffer_display(EditLine *);
-private void terminal_free_display(EditLine *);
-private int terminal_alloc_display(EditLine *);
-private void terminal_alloc(EditLine *, const struct termcapstr *,
- const char *);
-private void terminal_init_arrow(EditLine *);
-private void terminal_reset_arrow(EditLine *);
-private int terminal_putc(int);
-private void terminal_tputs(EditLine *, const char *, int);
+private void term_setflags(EditLine *);
+private int term_rebuffer_display(EditLine *);
+private void term_free_display(EditLine *);
+private int term_alloc_display(EditLine *);
+private void term_alloc(EditLine *, const struct termcapstr *, const char *);
+private void term_init_arrow(EditLine *);
+private void term_reset_arrow(EditLine *);
+private int term_putc(int);
+private void term_tputs(EditLine *, const char *, int);
#ifdef _REENTRANT
-private pthread_mutex_t terminal_mutex = PTHREAD_MUTEX_INITIALIZER;
+private pthread_mutex_t term_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
-private FILE *terminal_outfile = NULL;
+private FILE *term_outfile = NULL;
-/* terminal_setflags():
+/* term_setflags():
* Set the terminal capability flags
*/
private void
-terminal_setflags(EditLine *el)
+term_setflags(EditLine *el)
{
EL_FLAGS = 0;
if (el->el_tty.t_tabs)
@@ -264,77 +315,69 @@ terminal_setflags(EditLine *el)
#endif /* DEBUG_SCREEN */
}
-/* terminal_init():
+/* term_init():
* Initialize the terminal stuff
*/
protected int
-terminal_init(EditLine *el)
+term_init(EditLine *el)
{
- el->el_terminal.t_buf = el_malloc(TC_BUFSIZE *
- sizeof(*el->el_terminal.t_buf));
- if (el->el_terminal.t_buf == NULL)
- return -1;
- el->el_terminal.t_cap = el_malloc(TC_BUFSIZE *
- sizeof(*el->el_terminal.t_cap));
- if (el->el_terminal.t_cap == NULL)
- return -1;
- el->el_terminal.t_fkey = el_malloc(A_K_NKEYS *
- sizeof(*el->el_terminal.t_fkey));
- if (el->el_terminal.t_fkey == NULL)
- return -1;
- el->el_terminal.t_loc = 0;
- el->el_terminal.t_str = el_malloc(T_str *
- sizeof(*el->el_terminal.t_str));
- if (el->el_terminal.t_str == NULL)
- return -1;
- (void) memset(el->el_terminal.t_str, 0, T_str *
- sizeof(*el->el_terminal.t_str));
- el->el_terminal.t_val = el_malloc(T_val *
- sizeof(*el->el_terminal.t_val));
- if (el->el_terminal.t_val == NULL)
- return -1;
- (void) memset(el->el_terminal.t_val, 0, T_val *
- sizeof(*el->el_terminal.t_val));
- (void) terminal_set(el, NULL);
- terminal_init_arrow(el);
- return 0;
+ el->el_term.t_buf = (char *) el_malloc(TC_BUFSIZE);
+ if (el->el_term.t_buf == NULL)
+ return (-1);
+ el->el_term.t_cap = (char *) el_malloc(TC_BUFSIZE);
+ if (el->el_term.t_cap == NULL)
+ return (-1);
+ el->el_term.t_fkey = (fkey_t *) el_malloc(A_K_NKEYS * sizeof(fkey_t));
+ if (el->el_term.t_fkey == NULL)
+ return (-1);
+ el->el_term.t_loc = 0;
+ el->el_term.t_str = (char **) el_malloc(T_str * sizeof(char *));
+ if (el->el_term.t_str == NULL)
+ return (-1);
+ (void) memset(el->el_term.t_str, 0, T_str * sizeof(char *));
+ el->el_term.t_val = (int *) el_malloc(T_val * sizeof(int));
+ if (el->el_term.t_val == NULL)
+ return (-1);
+ (void) memset(el->el_term.t_val, 0, T_val * sizeof(int));
+ (void) term_set(el, NULL);
+ term_init_arrow(el);
+ return (0);
}
-/* terminal_end():
+/* term_end():
* Clean up the terminal stuff
*/
protected void
-terminal_end(EditLine *el)
+term_end(EditLine *el)
{
- el_free(el->el_terminal.t_buf);
- el->el_terminal.t_buf = NULL;
- el_free(el->el_terminal.t_cap);
- el->el_terminal.t_cap = NULL;
- el->el_terminal.t_loc = 0;
- el_free(el->el_terminal.t_str);
- el->el_terminal.t_str = NULL;
- el_free(el->el_terminal.t_val);
- el->el_terminal.t_val = NULL;
- el_free(el->el_terminal.t_fkey);
- el->el_terminal.t_fkey = NULL;
- terminal_free_display(el);
+ el_free((ptr_t) el->el_term.t_buf);
+ el->el_term.t_buf = NULL;
+ el_free((ptr_t) el->el_term.t_cap);
+ el->el_term.t_cap = NULL;
+ el->el_term.t_loc = 0;
+ el_free((ptr_t) el->el_term.t_str);
+ el->el_term.t_str = NULL;
+ el_free((ptr_t) el->el_term.t_val);
+ el->el_term.t_val = NULL;
+ el_free((ptr_t) el->el_term.t_fkey);
+ el->el_term.t_fkey = NULL;
+ term_free_display(el);
}
-/* terminal_alloc():
+/* term_alloc():
* Maintain a string pool for termcap strings
*/
private void
-terminal_alloc(EditLine *el, const struct termcapstr *t, const char *cap)
+term_alloc(EditLine *el, const struct termcapstr *t, const char *cap)
{
char termbuf[TC_BUFSIZE];
size_t tlen, clen;
- char **tlist = el->el_terminal.t_str;
+ char **tlist = el->el_term.t_str;
char **tmp, **str = &tlist[t - tstr];
- (void) memset(termbuf, 0, sizeof(termbuf));
if (cap == NULL || *cap == '\0') {
*str = NULL;
return;
@@ -354,11 +397,11 @@ terminal_alloc(EditLine *el, const struct termcapstr *t, const char *cap)
/*
* New string is longer; see if we have enough space to append
*/
- if (el->el_terminal.t_loc + 3 < TC_BUFSIZE) {
+ if (el->el_term.t_loc + 3 < TC_BUFSIZE) {
/* XXX strcpy is safe */
- (void) strcpy(*str = &el->el_terminal.t_buf[
- el->el_terminal.t_loc], cap);
- el->el_terminal.t_loc += clen + 1; /* one for \0 */
+ (void) strcpy(*str = &el->el_term.t_buf[el->el_term.t_loc],
+ cap);
+ el->el_term.t_loc += (int)clen + 1; /* one for \0 */
return;
}
/*
@@ -374,126 +417,124 @@ terminal_alloc(EditLine *el, const struct termcapstr *t, const char *cap)
continue;
termbuf[tlen++] = '\0';
}
- memcpy(el->el_terminal.t_buf, termbuf, TC_BUFSIZE);
- el->el_terminal.t_loc = tlen;
- if (el->el_terminal.t_loc + 3 >= TC_BUFSIZE) {
+ memcpy(el->el_term.t_buf, termbuf, TC_BUFSIZE);
+ el->el_term.t_loc = (int)tlen;
+ if (el->el_term.t_loc + 3 >= TC_BUFSIZE) {
(void) fprintf(el->el_errfile,
"Out of termcap string space.\n");
return;
}
/* XXX strcpy is safe */
- (void) strcpy(*str = &el->el_terminal.t_buf[el->el_terminal.t_loc],
- cap);
- el->el_terminal.t_loc += (size_t)clen + 1; /* one for \0 */
+ (void) strcpy(*str = &el->el_term.t_buf[el->el_term.t_loc], cap);
+ el->el_term.t_loc += (int)clen + 1; /* one for \0 */
return;
}
-/* terminal_rebuffer_display():
+/* term_rebuffer_display():
* Rebuffer the display after the screen changed size
*/
private int
-terminal_rebuffer_display(EditLine *el)
+term_rebuffer_display(EditLine *el)
{
- coord_t *c = &el->el_terminal.t_size;
+ coord_t *c = &el->el_term.t_size;
- terminal_free_display(el);
+ term_free_display(el);
c->h = Val(T_co);
c->v = Val(T_li);
- if (terminal_alloc_display(el) == -1)
- return -1;
- return 0;
+ if (term_alloc_display(el) == -1)
+ return (-1);
+ return (0);
}
-/* terminal_alloc_display():
+/* term_alloc_display():
* Allocate a new display.
*/
private int
-terminal_alloc_display(EditLine *el)
+term_alloc_display(EditLine *el)
{
int i;
- Char **b;
- coord_t *c = &el->el_terminal.t_size;
+ char **b;
+ coord_t *c = &el->el_term.t_size;
- b = el_malloc(sizeof(*b) * (size_t)(c->v + 1));
+ b = (char **) el_malloc((size_t) (sizeof(char *) * (c->v + 1)));
if (b == NULL)
- return -1;
+ return (-1);
for (i = 0; i < c->v; i++) {
- b[i] = el_malloc(sizeof(**b) * (size_t)(c->h + 1));
+ b[i] = (char *) el_malloc((size_t) (sizeof(char) * (c->h + 1)));
if (b[i] == NULL) {
while (--i >= 0)
- el_free(b[i]);
- el_free(b);
- return -1;
+ el_free((ptr_t) b[i]);
+ el_free((ptr_t) b);
+ return (-1);
}
}
b[c->v] = NULL;
el->el_display = b;
- b = el_malloc(sizeof(*b) * (size_t)(c->v + 1));
+ b = (char **) el_malloc((size_t) (sizeof(char *) * (c->v + 1)));
if (b == NULL)
- return -1;
+ return (-1);
for (i = 0; i < c->v; i++) {
- b[i] = el_malloc(sizeof(**b) * (size_t)(c->h + 1));
+ b[i] = (char *) el_malloc((size_t) (sizeof(char) * (c->h + 1)));
if (b[i] == NULL) {
while (--i >= 0)
- el_free(b[i]);
- el_free(b);
- return -1;
+ el_free((ptr_t) b[i]);
+ el_free((ptr_t) b);
+ return (-1);
}
}
b[c->v] = NULL;
el->el_vdisplay = b;
- return 0;
+ return (0);
}
-/* terminal_free_display():
+/* term_free_display():
* Free the display buffers
*/
private void
-terminal_free_display(EditLine *el)
+term_free_display(EditLine *el)
{
- Char **b;
- Char **bufp;
+ char **b;
+ char **bufp;
b = el->el_display;
el->el_display = NULL;
if (b != NULL) {
for (bufp = b; *bufp != NULL; bufp++)
- el_free(*bufp);
- el_free(b);
+ el_free((ptr_t) * bufp);
+ el_free((ptr_t) b);
}
b = el->el_vdisplay;
el->el_vdisplay = NULL;
if (b != NULL) {
for (bufp = b; *bufp != NULL; bufp++)
- el_free(*bufp);
- el_free(b);
+ el_free((ptr_t) * bufp);
+ el_free((ptr_t) b);
}
}
-/* terminal_move_to_line():
+/* term_move_to_line():
* move to line <where> (first line == 0)
* as efficiently as possible
*/
protected void
-terminal_move_to_line(EditLine *el, int where)
+term_move_to_line(EditLine *el, int where)
{
int del;
if (where == el->el_cursor.v)
return;
- if (where > el->el_terminal.t_size.v) {
+ if (where > el->el_term.t_size.v) {
#ifdef DEBUG_SCREEN
(void) fprintf(el->el_errfile,
- "terminal_move_to_line: where is ridiculous: %d\r\n",
- where);
+ "term_move_to_line: where is ridiculous: %d\r\n", where);
#endif /* DEBUG_SCREEN */
return;
}
@@ -501,31 +542,22 @@ terminal_move_to_line(EditLine *el, int where)
while (del > 0) {
if (EL_HAS_AUTO_MARGINS &&
el->el_display[el->el_cursor.v][0] != '\0') {
- size_t h = (size_t)
- (el->el_terminal.t_size.h - 1);
-#ifdef WIDECHAR
- for (; h > 0 &&
- el->el_display[el->el_cursor.v][h] ==
- MB_FILL_CHAR;
- h--)
- continue;
-#endif
/* move without newline */
- terminal_move_to_char(el, (int)h);
- terminal_overwrite(el, &el->el_display
+ term_move_to_char(el, el->el_term.t_size.h - 1);
+ term_overwrite(el, &el->el_display
[el->el_cursor.v][el->el_cursor.h],
- (size_t)(el->el_terminal.t_size.h -
+ (size_t)(el->el_term.t_size.h -
el->el_cursor.h));
/* updates Cursor */
del--;
} else {
if ((del > 1) && GoodStr(T_DO)) {
- terminal_tputs(el, tgoto(Str(T_DO), del,
+ term_tputs(el, tgoto(Str(T_DO), del,
del), del);
del = 0;
} else {
for (; del > 0; del--)
- terminal__putc(el, '\n');
+ term__putc(el, '\n');
/* because the \n will become \r\n */
el->el_cursor.h = 0;
}
@@ -533,22 +565,22 @@ terminal_move_to_line(EditLine *el, int where)
}
} else { /* del < 0 */
if (GoodStr(T_UP) && (-del > 1 || !GoodStr(T_up)))
- terminal_tputs(el, tgoto(Str(T_UP), -del, -del), -del);
+ term_tputs(el, tgoto(Str(T_UP), -del, -del), -del);
else {
if (GoodStr(T_up))
for (; del < 0; del++)
- terminal_tputs(el, Str(T_up), 1);
+ term_tputs(el, Str(T_up), 1);
}
}
el->el_cursor.v = where;/* now where is here */
}
-/* terminal_move_to_char():
+/* term_move_to_char():
* Move to the character position specified
*/
protected void
-terminal_move_to_char(EditLine *el, int where)
+term_move_to_char(EditLine *el, int where)
{
int del, i;
@@ -556,16 +588,15 @@ mc_again:
if (where == el->el_cursor.h)
return;
- if (where > el->el_terminal.t_size.h) {
+ if (where > el->el_term.t_size.h) {
#ifdef DEBUG_SCREEN
(void) fprintf(el->el_errfile,
- "terminal_move_to_char: where is riduculous: %d\r\n",
- where);
+ "term_move_to_char: where is riduculous: %d\r\n", where);
#endif /* DEBUG_SCREEN */
return;
}
if (!where) { /* if where is first column */
- terminal__putc(el, '\r'); /* do a CR */
+ term__putc(el, '\r'); /* do a CR */
el->el_cursor.h = 0;
return;
}
@@ -573,30 +604,22 @@ mc_again:
if ((del < -4 || del > 4) && GoodStr(T_ch))
/* go there directly */
- terminal_tputs(el, tgoto(Str(T_ch), where, where), where);
+ term_tputs(el, tgoto(Str(T_ch), where, where), where);
else {
if (del > 0) { /* moving forward */
if ((del > 4) && GoodStr(T_RI))
- terminal_tputs(el, tgoto(Str(T_RI), del, del),
- del);
+ term_tputs(el, tgoto(Str(T_RI), del, del), del);
else {
/* if I can do tabs, use them */
if (EL_CAN_TAB) {
if ((el->el_cursor.h & 0370) !=
- (where & ~0x7)
-#ifdef WIDECHAR
- && (el->el_display[
- el->el_cursor.v][where & 0370] !=
- MB_FILL_CHAR)
-#endif
- ) {
+ (where & ~0x7)) {
/* if not within tab stop */
for (i =
(el->el_cursor.h & 0370);
i < (where & ~0x7);
i += 8)
- terminal__putc(el,
- '\t');
+ term__putc(el, '\t');
/* then tab over */
el->el_cursor.h = where & ~0x7;
}
@@ -606,17 +629,17 @@ mc_again:
* chars, so we do.
*/
/*
- * NOTE THAT terminal_overwrite() WILL CHANGE
+ * NOTE THAT term_overwrite() WILL CHANGE
* el->el_cursor.h!!!
*/
- terminal_overwrite(el, &el->el_display[
+ term_overwrite(el, &el->el_display[
el->el_cursor.v][el->el_cursor.h],
(size_t)(where - el->el_cursor.h));
}
} else { /* del < 0 := moving backward */
if ((-del > 4) && GoodStr(T_LE))
- terminal_tputs(el, tgoto(Str(T_LE), -del, -del),
+ term_tputs(el, tgoto(Str(T_LE), -del, -del),
-del);
else { /* can't go directly there */
/*
@@ -628,12 +651,12 @@ mc_again:
(((unsigned int) where >> 3) +
(where & 07)))
: (-del > where)) {
- terminal__putc(el, '\r');/* do a CR */
+ term__putc(el, '\r'); /* do a CR */
el->el_cursor.h = 0;
goto mc_again; /* and try again */
}
for (i = 0; i < -del; i++)
- terminal__putc(el, '\b');
+ term__putc(el, '\b');
}
}
}
@@ -641,62 +664,55 @@ mc_again:
}
-/* terminal_overwrite():
+/* term_overwrite():
* Overstrike num characters
- * Assumes MB_FILL_CHARs are present to keep the column count correct
*/
protected void
-terminal_overwrite(EditLine *el, const Char *cp, size_t n)
+term_overwrite(EditLine *el, const char *cp, size_t n)
{
if (n == 0)
return;
- if (n > (size_t)el->el_terminal.t_size.h) {
+ if (n > (size_t)el->el_term.t_size.h) {
#ifdef DEBUG_SCREEN
(void) fprintf(el->el_errfile,
- "terminal_overwrite: n is riduculous: %d\r\n", n);
+ "term_overwrite: n is riduculous: %d\r\n", n);
#endif /* DEBUG_SCREEN */
return;
}
- do {
- /* terminal__putc() ignores any MB_FILL_CHARs */
- terminal__putc(el, *cp++);
- el->el_cursor.h++;
- } while (--n);
+ do {
+ term__putc(el, *cp++);
+ el->el_cursor.h++;
+ } while (--n);
- if (el->el_cursor.h >= el->el_terminal.t_size.h) { /* wrap? */
+ if (el->el_cursor.h >= el->el_term.t_size.h) { /* wrap? */
if (EL_HAS_AUTO_MARGINS) { /* yes */
el->el_cursor.h = 0;
el->el_cursor.v++;
if (EL_HAS_MAGIC_MARGINS) {
/* force the wrap to avoid the "magic"
* situation */
- Char c;
- if ((c = el->el_display[el->el_cursor.v]
- [el->el_cursor.h]) != '\0') {
- terminal_overwrite(el, &c, (size_t)1);
-#ifdef WIDECHAR
- while (el->el_display[el->el_cursor.v]
- [el->el_cursor.h] == MB_FILL_CHAR)
- el->el_cursor.h++;
-#endif
- } else {
- terminal__putc(el, ' ');
+ char c;
+ if ((c = el->el_display[el->el_cursor.v][el->el_cursor.h])
+ != '\0')
+ term_overwrite(el, &c, 1);
+ else {
+ term__putc(el, ' ');
el->el_cursor.h = 1;
}
}
} else /* no wrap, but cursor stays on screen */
- el->el_cursor.h = el->el_terminal.t_size.h - 1;
+ el->el_cursor.h = el->el_term.t_size.h - 1;
}
}
-/* terminal_deletechars():
+/* term_deletechars():
* Delete num characters
*/
protected void
-terminal_deletechars(EditLine *el, int num)
+term_deletechars(EditLine *el, int num)
{
if (num <= 0)
return;
@@ -707,38 +723,37 @@ terminal_deletechars(EditLine *el, int num)
#endif /* DEBUG_EDIT */
return;
}
- if (num > el->el_terminal.t_size.h) {
+ if (num > el->el_term.t_size.h) {
#ifdef DEBUG_SCREEN
(void) fprintf(el->el_errfile,
- "terminal_deletechars: num is riduculous: %d\r\n", num);
+ "term_deletechars: num is riduculous: %d\r\n", num);
#endif /* DEBUG_SCREEN */
return;
}
if (GoodStr(T_DC)) /* if I have multiple delete */
if ((num > 1) || !GoodStr(T_dc)) { /* if dc would be more
* expen. */
- terminal_tputs(el, tgoto(Str(T_DC), num, num), num);
+ term_tputs(el, tgoto(Str(T_DC), num, num), num);
return;
}
if (GoodStr(T_dm)) /* if I have delete mode */
- terminal_tputs(el, Str(T_dm), 1);
+ term_tputs(el, Str(T_dm), 1);
if (GoodStr(T_dc)) /* else do one at a time */
while (num--)
- terminal_tputs(el, Str(T_dc), 1);
+ term_tputs(el, Str(T_dc), 1);
if (GoodStr(T_ed)) /* if I have delete mode */
- terminal_tputs(el, Str(T_ed), 1);
+ term_tputs(el, Str(T_ed), 1);
}
-/* terminal_insertwrite():
+/* term_insertwrite():
* Puts terminal in insert character mode or inserts num
* characters in the line
- * Assumes MB_FILL_CHARs are present to keep column count correct
*/
protected void
-terminal_insertwrite(EditLine *el, Char *cp, int num)
+term_insertwrite(EditLine *el, char *cp, int num)
{
if (num <= 0)
return;
@@ -748,7 +763,7 @@ terminal_insertwrite(EditLine *el, Char *cp, int num)
#endif /* DEBUG_EDIT */
return;
}
- if (num > el->el_terminal.t_size.h) {
+ if (num > el->el_term.t_size.h) {
#ifdef DEBUG_SCREEN
(void) fprintf(el->el_errfile,
"StartInsert: num is riduculous: %d\r\n", num);
@@ -758,106 +773,120 @@ terminal_insertwrite(EditLine *el, Char *cp, int num)
if (GoodStr(T_IC)) /* if I have multiple insert */
if ((num > 1) || !GoodStr(T_ic)) {
/* if ic would be more expensive */
- terminal_tputs(el, tgoto(Str(T_IC), num, num), num);
- terminal_overwrite(el, cp, (size_t)num);
+ term_tputs(el, tgoto(Str(T_IC), num, num), num);
+ term_overwrite(el, cp, (size_t)num);
/* this updates el_cursor.h */
return;
}
if (GoodStr(T_im) && GoodStr(T_ei)) { /* if I have insert mode */
- terminal_tputs(el, Str(T_im), 1);
+ term_tputs(el, Str(T_im), 1);
el->el_cursor.h += num;
do
- terminal__putc(el, *cp++);
+ term__putc(el, *cp++);
while (--num);
if (GoodStr(T_ip)) /* have to make num chars insert */
- terminal_tputs(el, Str(T_ip), 1);
+ term_tputs(el, Str(T_ip), 1);
- terminal_tputs(el, Str(T_ei), 1);
+ term_tputs(el, Str(T_ei), 1);
return;
}
do {
if (GoodStr(T_ic)) /* have to make num chars insert */
- terminal_tputs(el, Str(T_ic), 1);
+ term_tputs(el, Str(T_ic), 1);
- terminal__putc(el, *cp++);
+ term__putc(el, *cp++);
el->el_cursor.h++;
if (GoodStr(T_ip)) /* have to make num chars insert */
- terminal_tputs(el, Str(T_ip), 1);
+ term_tputs(el, Str(T_ip), 1);
/* pad the inserted char */
} while (--num);
}
-/* terminal_clear_EOL():
+/* term_clear_EOL():
* clear to end of line. There are num characters to clear
*/
protected void
-terminal_clear_EOL(EditLine *el, int num)
+term_clear_EOL(EditLine *el, int num)
{
int i;
if (EL_CAN_CEOL && GoodStr(T_ce))
- terminal_tputs(el, Str(T_ce), 1);
+ term_tputs(el, Str(T_ce), 1);
else {
for (i = 0; i < num; i++)
- terminal__putc(el, ' ');
+ term__putc(el, ' ');
el->el_cursor.h += num; /* have written num spaces */
}
}
-/* terminal_clear_screen():
+/* term_clear_screen():
* Clear the screen
*/
protected void
-terminal_clear_screen(EditLine *el)
+term_clear_screen(EditLine *el)
{ /* clear the whole screen and home */
if (GoodStr(T_cl))
/* send the clear screen code */
- terminal_tputs(el, Str(T_cl), Val(T_li));
+ term_tputs(el, Str(T_cl), Val(T_li));
else if (GoodStr(T_ho) && GoodStr(T_cd)) {
- terminal_tputs(el, Str(T_ho), Val(T_li)); /* home */
+ term_tputs(el, Str(T_ho), Val(T_li)); /* home */
/* clear to bottom of screen */
- terminal_tputs(el, Str(T_cd), Val(T_li));
+ term_tputs(el, Str(T_cd), Val(T_li));
} else {
- terminal__putc(el, '\r');
- terminal__putc(el, '\n');
+ term__putc(el, '\r');
+ term__putc(el, '\n');
}
}
-/* terminal_beep():
+/* term_beep():
* Beep the way the terminal wants us
*/
protected void
-terminal_beep(EditLine *el)
+term_beep(EditLine *el)
{
if (GoodStr(T_bl))
/* what termcap says we should use */
- terminal_tputs(el, Str(T_bl), 1);
+ term_tputs(el, Str(T_bl), 1);
else
- terminal__putc(el, '\007'); /* an ASCII bell; ^G */
+ term__putc(el, '\007'); /* an ASCII bell; ^G */
}
+#ifdef notdef
+/* term_clear_to_bottom():
+ * Clear to the bottom of the screen
+ */
+protected void
+term_clear_to_bottom(EditLine *el)
+{
+ if (GoodStr(T_cd))
+ term_tputs(el, Str(T_cd), Val(T_li));
+ else if (GoodStr(T_ce))
+ term_tputs(el, Str(T_ce), Val(T_li));
+}
+#endif
+
protected void
-terminal_get(EditLine *el, const char **term)
+term_get(EditLine *el, const char **term)
{
- *term = el->el_terminal.t_name;
+ *term = el->el_term.t_name;
}
-/* terminal_set():
+/* term_set():
* Read in the terminal capabilities from the requested terminal
*/
protected int
-terminal_set(EditLine *el, const char *term)
+term_set(EditLine *el, const char *term)
{
int i;
char buf[TC_BUFSIZE];
@@ -882,9 +911,9 @@ terminal_set(EditLine *el, const char *term)
if (strcmp(term, "emacs") == 0)
el->el_flags |= EDIT_DISABLED;
- (void) memset(el->el_terminal.t_cap, 0, TC_BUFSIZE);
+ memset(el->el_term.t_cap, 0, TC_BUFSIZE);
- i = tgetent(el->el_terminal.t_cap, term);
+ i = tgetent(el->el_term.t_cap, term);
if (i <= 0) {
if (i == -1)
@@ -899,7 +928,7 @@ terminal_set(EditLine *el, const char *term)
Val(T_pt) = Val(T_km) = Val(T_li) = 0;
Val(T_xt) = Val(T_MT);
for (t = tstr; t->name != NULL; t++)
- terminal_alloc(el, t, NULL);
+ term_alloc(el, t, NULL);
} else {
/* auto/magic margins */
Val(T_am) = tgetflag("am");
@@ -915,7 +944,7 @@ terminal_set(EditLine *el, const char *term)
Val(T_li) = tgetnum("li");
for (t = tstr; t->name != NULL; t++) {
/* XXX: some systems' tgetstr needs non const */
- terminal_alloc(el, t, tgetstr(strchr(t->name, *t->name),
+ term_alloc(el, t, tgetstr(strchr(t->name, *t->name),
&area));
}
}
@@ -925,28 +954,28 @@ terminal_set(EditLine *el, const char *term)
if (Val(T_li) < 1)
Val(T_li) = 24;
- el->el_terminal.t_size.v = Val(T_co);
- el->el_terminal.t_size.h = Val(T_li);
+ el->el_term.t_size.v = Val(T_co);
+ el->el_term.t_size.h = Val(T_li);
- terminal_setflags(el);
+ term_setflags(el);
/* get the correct window size */
- (void) terminal_get_size(el, &lins, &cols);
- if (terminal_change_size(el, lins, cols) == -1)
- return -1;
+ (void) term_get_size(el, &lins, &cols);
+ if (term_change_size(el, lins, cols) == -1)
+ return (-1);
(void) sigprocmask(SIG_SETMASK, &oset, NULL);
- terminal_bind_arrow(el);
- el->el_terminal.t_name = term;
- return i <= 0 ? -1 : 0;
+ term_bind_arrow(el);
+ el->el_term.t_name = term;
+ return (i <= 0 ? -1 : 0);
}
-/* terminal_get_size():
+/* term_get_size():
* Return the new window size in lines and cols, and
* true if the size was changed.
*/
protected int
-terminal_get_size(EditLine *el, int *lins, int *cols)
+term_get_size(EditLine *el, int *lins, int *cols)
{
*cols = Val(T_co);
@@ -955,7 +984,7 @@ terminal_get_size(EditLine *el, int *lins, int *cols)
#ifdef TIOCGWINSZ
{
struct winsize ws;
- if (ioctl(el->el_infd, TIOCGWINSZ, &ws) != -1) {
+ if (ioctl(el->el_infd, TIOCGWINSZ, (ioctl_t) & ws) != -1) {
if (ws.ws_col)
*cols = ws.ws_col;
if (ws.ws_row)
@@ -966,7 +995,7 @@ terminal_get_size(EditLine *el, int *lins, int *cols)
#ifdef TIOCGSIZE
{
struct ttysize ts;
- if (ioctl(el->el_infd, TIOCGSIZE, &ts) != -1) {
+ if (ioctl(el->el_infd, TIOCGSIZE, (ioctl_t) & ts) != -1) {
if (ts.ts_cols)
*cols = ts.ts_cols;
if (ts.ts_lines)
@@ -974,15 +1003,15 @@ terminal_get_size(EditLine *el, int *lins, int *cols)
}
}
#endif
- return Val(T_co) != *cols || Val(T_li) != *lins;
+ return (Val(T_co) != *cols || Val(T_li) != *lins);
}
-/* terminal_change_size():
+/* term_change_size():
* Change the size of the terminal
*/
protected int
-terminal_change_size(EditLine *el, int lins, int cols)
+term_change_size(EditLine *el, int lins, int cols)
{
/*
* Just in case
@@ -991,305 +1020,294 @@ terminal_change_size(EditLine *el, int lins, int cols)
Val(T_li) = (lins < 1) ? 24 : lins;
/* re-make display buffers */
- if (terminal_rebuffer_display(el) == -1)
- return -1;
+ if (term_rebuffer_display(el) == -1)
+ return (-1);
re_clear_display(el);
- return 0;
+ return (0);
}
-/* terminal_init_arrow():
+/* term_init_arrow():
* Initialize the arrow key bindings from termcap
*/
private void
-terminal_init_arrow(EditLine *el)
+term_init_arrow(EditLine *el)
{
- funckey_t *arrow = el->el_terminal.t_fkey;
+ fkey_t *arrow = el->el_term.t_fkey;
- arrow[A_K_DN].name = STR("down");
+ arrow[A_K_DN].name = "down";
arrow[A_K_DN].key = T_kd;
arrow[A_K_DN].fun.cmd = ED_NEXT_HISTORY;
arrow[A_K_DN].type = XK_CMD;
- arrow[A_K_UP].name = STR("up");
+ arrow[A_K_UP].name = "up";
arrow[A_K_UP].key = T_ku;
arrow[A_K_UP].fun.cmd = ED_PREV_HISTORY;
arrow[A_K_UP].type = XK_CMD;
- arrow[A_K_LT].name = STR("left");
+ arrow[A_K_LT].name = "left";
arrow[A_K_LT].key = T_kl;
arrow[A_K_LT].fun.cmd = ED_PREV_CHAR;
arrow[A_K_LT].type = XK_CMD;
- arrow[A_K_RT].name = STR("right");
+ arrow[A_K_RT].name = "right";
arrow[A_K_RT].key = T_kr;
arrow[A_K_RT].fun.cmd = ED_NEXT_CHAR;
arrow[A_K_RT].type = XK_CMD;
- arrow[A_K_HO].name = STR("home");
+ arrow[A_K_HO].name = "home";
arrow[A_K_HO].key = T_kh;
arrow[A_K_HO].fun.cmd = ED_MOVE_TO_BEG;
arrow[A_K_HO].type = XK_CMD;
- arrow[A_K_EN].name = STR("end");
+ arrow[A_K_EN].name = "end";
arrow[A_K_EN].key = T_at7;
arrow[A_K_EN].fun.cmd = ED_MOVE_TO_END;
arrow[A_K_EN].type = XK_CMD;
- arrow[A_K_DE].name = STR("delete");
+ arrow[A_K_DE].name = "delete";
arrow[A_K_DE].key = T_kD;
arrow[A_K_DE].fun.cmd = ED_DELETE_NEXT_CHAR;
arrow[A_K_DE].type = XK_CMD;
}
-/* terminal_reset_arrow():
+/* term_reset_arrow():
* Reset arrow key bindings
*/
private void
-terminal_reset_arrow(EditLine *el)
+term_reset_arrow(EditLine *el)
{
- funckey_t *arrow = el->el_terminal.t_fkey;
- static const Char strA[] = {033, '[', 'A', '\0'};
- static const Char strB[] = {033, '[', 'B', '\0'};
- static const Char strC[] = {033, '[', 'C', '\0'};
- static const Char strD[] = {033, '[', 'D', '\0'};
- static const Char strH[] = {033, '[', 'H', '\0'};
- static const Char strF[] = {033, '[', 'F', '\0'};
- static const Char stOA[] = {033, 'O', 'A', '\0'};
- static const Char stOB[] = {033, 'O', 'B', '\0'};
- static const Char stOC[] = {033, 'O', 'C', '\0'};
- static const Char stOD[] = {033, 'O', 'D', '\0'};
- static const Char stOH[] = {033, 'O', 'H', '\0'};
- static const Char stOF[] = {033, 'O', 'F', '\0'};
-
- keymacro_add(el, strA, &arrow[A_K_UP].fun, arrow[A_K_UP].type);
- keymacro_add(el, strB, &arrow[A_K_DN].fun, arrow[A_K_DN].type);
- keymacro_add(el, strC, &arrow[A_K_RT].fun, arrow[A_K_RT].type);
- keymacro_add(el, strD, &arrow[A_K_LT].fun, arrow[A_K_LT].type);
- keymacro_add(el, strH, &arrow[A_K_HO].fun, arrow[A_K_HO].type);
- keymacro_add(el, strF, &arrow[A_K_EN].fun, arrow[A_K_EN].type);
- keymacro_add(el, stOA, &arrow[A_K_UP].fun, arrow[A_K_UP].type);
- keymacro_add(el, stOB, &arrow[A_K_DN].fun, arrow[A_K_DN].type);
- keymacro_add(el, stOC, &arrow[A_K_RT].fun, arrow[A_K_RT].type);
- keymacro_add(el, stOD, &arrow[A_K_LT].fun, arrow[A_K_LT].type);
- keymacro_add(el, stOH, &arrow[A_K_HO].fun, arrow[A_K_HO].type);
- keymacro_add(el, stOF, &arrow[A_K_EN].fun, arrow[A_K_EN].type);
-
- if (el->el_map.type != MAP_VI)
- return;
- keymacro_add(el, &strA[1], &arrow[A_K_UP].fun, arrow[A_K_UP].type);
- keymacro_add(el, &strB[1], &arrow[A_K_DN].fun, arrow[A_K_DN].type);
- keymacro_add(el, &strC[1], &arrow[A_K_RT].fun, arrow[A_K_RT].type);
- keymacro_add(el, &strD[1], &arrow[A_K_LT].fun, arrow[A_K_LT].type);
- keymacro_add(el, &strH[1], &arrow[A_K_HO].fun, arrow[A_K_HO].type);
- keymacro_add(el, &strF[1], &arrow[A_K_EN].fun, arrow[A_K_EN].type);
- keymacro_add(el, &stOA[1], &arrow[A_K_UP].fun, arrow[A_K_UP].type);
- keymacro_add(el, &stOB[1], &arrow[A_K_DN].fun, arrow[A_K_DN].type);
- keymacro_add(el, &stOC[1], &arrow[A_K_RT].fun, arrow[A_K_RT].type);
- keymacro_add(el, &stOD[1], &arrow[A_K_LT].fun, arrow[A_K_LT].type);
- keymacro_add(el, &stOH[1], &arrow[A_K_HO].fun, arrow[A_K_HO].type);
- keymacro_add(el, &stOF[1], &arrow[A_K_EN].fun, arrow[A_K_EN].type);
+ fkey_t *arrow = el->el_term.t_fkey;
+ static const char strA[] = {033, '[', 'A', '\0'};
+ static const char strB[] = {033, '[', 'B', '\0'};
+ static const char strC[] = {033, '[', 'C', '\0'};
+ static const char strD[] = {033, '[', 'D', '\0'};
+ static const char strH[] = {033, '[', 'H', '\0'};
+ static const char strF[] = {033, '[', 'F', '\0'};
+ static const char str1[] = {033, '[', '1', '~', '\0'};
+ static const char str4[] = {033, '[', '4', '~', '\0'};
+ static const char stOA[] = {033, 'O', 'A', '\0'};
+ static const char stOB[] = {033, 'O', 'B', '\0'};
+ static const char stOC[] = {033, 'O', 'C', '\0'};
+ static const char stOD[] = {033, 'O', 'D', '\0'};
+ static const char stOH[] = {033, 'O', 'H', '\0'};
+ static const char stOF[] = {033, 'O', 'F', '\0'};
+
+ key_add(el, strA, &arrow[A_K_UP].fun, arrow[A_K_UP].type);
+ key_add(el, strB, &arrow[A_K_DN].fun, arrow[A_K_DN].type);
+ key_add(el, strC, &arrow[A_K_RT].fun, arrow[A_K_RT].type);
+ key_add(el, strD, &arrow[A_K_LT].fun, arrow[A_K_LT].type);
+ key_add(el, strH, &arrow[A_K_HO].fun, arrow[A_K_HO].type);
+ key_add(el, strF, &arrow[A_K_EN].fun, arrow[A_K_EN].type);
+ key_add(el, str1, &arrow[A_K_HO].fun, arrow[A_K_HO].type);
+ key_add(el, str4, &arrow[A_K_EN].fun, arrow[A_K_EN].type);
+ key_add(el, stOA, &arrow[A_K_UP].fun, arrow[A_K_UP].type);
+ key_add(el, stOB, &arrow[A_K_DN].fun, arrow[A_K_DN].type);
+ key_add(el, stOC, &arrow[A_K_RT].fun, arrow[A_K_RT].type);
+ key_add(el, stOD, &arrow[A_K_LT].fun, arrow[A_K_LT].type);
+ key_add(el, stOH, &arrow[A_K_HO].fun, arrow[A_K_HO].type);
+ key_add(el, stOF, &arrow[A_K_EN].fun, arrow[A_K_EN].type);
+
+ if (el->el_map.type == MAP_VI) {
+ key_add(el, &strA[1], &arrow[A_K_UP].fun, arrow[A_K_UP].type);
+ key_add(el, &strB[1], &arrow[A_K_DN].fun, arrow[A_K_DN].type);
+ key_add(el, &strC[1], &arrow[A_K_RT].fun, arrow[A_K_RT].type);
+ key_add(el, &strD[1], &arrow[A_K_LT].fun, arrow[A_K_LT].type);
+ key_add(el, &strH[1], &arrow[A_K_HO].fun, arrow[A_K_HO].type);
+ key_add(el, &strF[1], &arrow[A_K_EN].fun, arrow[A_K_EN].type);
+ key_add(el, &str1[1], &arrow[A_K_HO].fun, arrow[A_K_HO].type);
+ key_add(el, &str4[1], &arrow[A_K_EN].fun, arrow[A_K_EN].type);
+ key_add(el, &stOA[1], &arrow[A_K_UP].fun, arrow[A_K_UP].type);
+ key_add(el, &stOB[1], &arrow[A_K_DN].fun, arrow[A_K_DN].type);
+ key_add(el, &stOC[1], &arrow[A_K_RT].fun, arrow[A_K_RT].type);
+ key_add(el, &stOD[1], &arrow[A_K_LT].fun, arrow[A_K_LT].type);
+ key_add(el, &stOH[1], &arrow[A_K_HO].fun, arrow[A_K_HO].type);
+ key_add(el, &stOF[1], &arrow[A_K_EN].fun, arrow[A_K_EN].type);
+ }
}
-/* terminal_set_arrow():
+/* term_set_arrow():
* Set an arrow key binding
*/
protected int
-terminal_set_arrow(EditLine *el, const Char *name, keymacro_value_t *fun,
- int type)
+term_set_arrow(EditLine *el, const char *name, key_value_t *fun, int type)
{
- funckey_t *arrow = el->el_terminal.t_fkey;
+ fkey_t *arrow = el->el_term.t_fkey;
int i;
for (i = 0; i < A_K_NKEYS; i++)
- if (Strcmp(name, arrow[i].name) == 0) {
+ if (strcmp(name, arrow[i].name) == 0) {
arrow[i].fun = *fun;
arrow[i].type = type;
- return 0;
+ return (0);
}
- return -1;
+ return (-1);
}
-/* terminal_clear_arrow():
+/* term_clear_arrow():
* Clear an arrow key binding
*/
protected int
-terminal_clear_arrow(EditLine *el, const Char *name)
+term_clear_arrow(EditLine *el, const char *name)
{
- funckey_t *arrow = el->el_terminal.t_fkey;
+ fkey_t *arrow = el->el_term.t_fkey;
int i;
for (i = 0; i < A_K_NKEYS; i++)
- if (Strcmp(name, arrow[i].name) == 0) {
+ if (strcmp(name, arrow[i].name) == 0) {
arrow[i].type = XK_NOD;
- return 0;
+ return (0);
}
- return -1;
+ return (-1);
}
-/* terminal_print_arrow():
+/* term_print_arrow():
* Print the arrow key bindings
*/
protected void
-terminal_print_arrow(EditLine *el, const Char *name)
+term_print_arrow(EditLine *el, const char *name)
{
int i;
- funckey_t *arrow = el->el_terminal.t_fkey;
+ fkey_t *arrow = el->el_term.t_fkey;
for (i = 0; i < A_K_NKEYS; i++)
- if (*name == '\0' || Strcmp(name, arrow[i].name) == 0)
+ if (*name == '\0' || strcmp(name, arrow[i].name) == 0)
if (arrow[i].type != XK_NOD)
- keymacro_kprint(el, arrow[i].name,
- &arrow[i].fun, arrow[i].type);
+ key_kprint(el, arrow[i].name, &arrow[i].fun,
+ arrow[i].type);
}
-/* terminal_bind_arrow():
+/* term_bind_arrow():
* Bind the arrow keys
*/
protected void
-terminal_bind_arrow(EditLine *el)
+term_bind_arrow(EditLine *el)
{
el_action_t *map;
const el_action_t *dmap;
int i, j;
char *p;
- funckey_t *arrow = el->el_terminal.t_fkey;
+ fkey_t *arrow = el->el_term.t_fkey;
/* Check if the components needed are initialized */
- if (el->el_terminal.t_buf == NULL || el->el_map.key == NULL)
+ if (el->el_term.t_buf == NULL || el->el_map.key == NULL)
return;
map = el->el_map.type == MAP_VI ? el->el_map.alt : el->el_map.key;
dmap = el->el_map.type == MAP_VI ? el->el_map.vic : el->el_map.emacs;
- terminal_reset_arrow(el);
+ term_reset_arrow(el);
for (i = 0; i < A_K_NKEYS; i++) {
- Char wt_str[VISUAL_WIDTH_MAX];
- Char *px;
- size_t n;
-
- p = el->el_terminal.t_str[arrow[i].key];
- if (!p || !*p)
- continue;
- for (n = 0; n < VISUAL_WIDTH_MAX && p[n]; ++n)
- wt_str[n] = p[n];
- while (n < VISUAL_WIDTH_MAX)
- wt_str[n++] = '\0';
- px = wt_str;
- j = (unsigned char) *p;
- /*
- * Assign the arrow keys only if:
- *
- * 1. They are multi-character arrow keys and the user
- * has not re-assigned the leading character, or
- * has re-assigned the leading character to be
- * ED_SEQUENCE_LEAD_IN
- * 2. They are single arrow keys pointing to an
- * unassigned key.
- */
- if (arrow[i].type == XK_NOD)
- keymacro_clear(el, map, px);
- else {
- if (p[1] && (dmap[j] == map[j] ||
- map[j] == ED_SEQUENCE_LEAD_IN)) {
- keymacro_add(el, px, &arrow[i].fun,
- arrow[i].type);
- map[j] = ED_SEQUENCE_LEAD_IN;
- } else if (map[j] == ED_UNASSIGNED) {
- keymacro_clear(el, map, px);
- if (arrow[i].type == XK_CMD)
- map[j] = arrow[i].fun.cmd;
- else
- keymacro_add(el, px, &arrow[i].fun,
+ p = el->el_term.t_str[arrow[i].key];
+ if (p && *p) {
+ j = (unsigned char) *p;
+ /*
+ * Assign the arrow keys only if:
+ *
+ * 1. They are multi-character arrow keys and the user
+ * has not re-assigned the leading character, or
+ * has re-assigned the leading character to be
+ * ED_SEQUENCE_LEAD_IN
+ * 2. They are single arrow keys pointing to an
+ * unassigned key.
+ */
+ if (arrow[i].type == XK_NOD)
+ key_clear(el, map, p);
+ else {
+ if (p[1] && (dmap[j] == map[j] ||
+ map[j] == ED_SEQUENCE_LEAD_IN)) {
+ key_add(el, p, &arrow[i].fun,
arrow[i].type);
+ map[j] = ED_SEQUENCE_LEAD_IN;
+ } else if (map[j] == ED_UNASSIGNED) {
+ key_clear(el, map, p);
+ if (arrow[i].type == XK_CMD)
+ map[j] = arrow[i].fun.cmd;
+ else
+ key_add(el, p, &arrow[i].fun,
+ arrow[i].type);
+ }
}
}
}
}
-/* terminal_putc():
+/* term_putc():
* Add a character
*/
private int
-terminal_putc(int c)
+term_putc(int c)
{
- if (terminal_outfile == NULL)
+
+ if (term_outfile == NULL)
return -1;
- return fputc(c, terminal_outfile);
+ return fputc(c, term_outfile);
}
private void
-terminal_tputs(EditLine *el, const char *cap, int affcnt)
+term_tputs(EditLine *el, const char *cap, int affcnt)
{
#ifdef _REENTRANT
- pthread_mutex_lock(&terminal_mutex);
+ pthread_mutex_lock(&term_mutex);
#endif
- terminal_outfile = el->el_outfile;
- (void)tputs(cap, affcnt, terminal_putc);
+ term_outfile = el->el_outfile;
+ (void)tputs(cap, affcnt, term_putc);
#ifdef _REENTRANT
- pthread_mutex_unlock(&terminal_mutex);
+ pthread_mutex_unlock(&term_mutex);
#endif
}
-/* terminal__putc():
+/* term__putc():
* Add a character
*/
protected int
-terminal__putc(EditLine *el, Int c)
+term__putc(EditLine *el, int c)
{
- char buf[MB_LEN_MAX +1];
- ssize_t i;
- if (c == (Int)MB_FILL_CHAR)
- return 0;
- i = ct_encode_char(buf, (size_t)MB_LEN_MAX, c);
- if (i <= 0)
- return (int)i;
- buf[i] = '\0';
- return fputs(buf, el->el_outfile);
+
+ return fputc(c, el->el_outfile);
}
-/* terminal__flush():
+/* term__flush():
* Flush output
*/
protected void
-terminal__flush(EditLine *el)
+term__flush(EditLine *el)
{
(void) fflush(el->el_outfile);
}
-/* terminal_writec():
+/* term_writec():
* Write the given character out, in a human readable form
*/
protected void
-terminal_writec(EditLine *el, Int c)
+term_writec(EditLine *el, int c)
{
- Char visbuf[VISUAL_WIDTH_MAX +1];
- ssize_t vcnt = ct_visual_char(visbuf, VISUAL_WIDTH_MAX, c);
- if (vcnt < 0)
- vcnt = 0;
- visbuf[vcnt] = '\0';
- terminal_overwrite(el, visbuf, (size_t)vcnt);
- terminal__flush(el);
+ char buf[8];
+ size_t cnt = key__decode_char(buf, sizeof(buf), 0, c);
+ buf[cnt] = '\0';
+ term_overwrite(el, buf, (size_t)cnt);
+ term__flush(el);
}
-/* terminal_telltc():
+/* term_telltc():
* Print the current termcap characteristics
*/
protected int
/*ARGSUSED*/
-terminal_telltc(EditLine *el, int argc __attribute__((__unused__)),
- const Char **argv __attribute__((__unused__)))
+term_telltc(EditLine *el, int argc __unused,
+ const char **argv __unused)
{
const struct termcapstr *t;
char **ts;
+ char upbuf[EL_BUFSIZ];
(void) fprintf(el->el_outfile, "\n\tYour terminal has the\n");
(void) fprintf(el->el_outfile, "\tfollowing characteristics:\n\n");
@@ -1305,42 +1323,39 @@ terminal_telltc(EditLine *el, int argc __attribute__((__unused__)),
(void) fprintf(el->el_outfile, "\tIt %s magic margins\n",
EL_HAS_MAGIC_MARGINS ? "has" : "does not have");
- for (t = tstr, ts = el->el_terminal.t_str; t->name != NULL; t++, ts++) {
+ for (t = tstr, ts = el->el_term.t_str; t->name != NULL; t++, ts++) {
const char *ub;
if (*ts && **ts) {
- ub = ct_encode_string(ct_visual_string(
- ct_decode_string(*ts, &el->el_scratch)),
- &el->el_scratch);
+ (void) key__decode_str(*ts, upbuf, sizeof(upbuf), "");
+ ub = upbuf;
} else {
- ub = "(empty)";
+ ub = "(empty)";
}
(void) fprintf(el->el_outfile, "\t%25s (%s) == %s\n",
t->long_name, t->name, ub);
}
(void) fputc('\n', el->el_outfile);
- return 0;
+ return (0);
}
-/* terminal_settc():
+/* term_settc():
* Change the current terminal characteristics
*/
protected int
/*ARGSUSED*/
-terminal_settc(EditLine *el, int argc __attribute__((__unused__)),
- const Char **argv)
+term_settc(EditLine *el, int argc __unused,
+ const char **argv)
{
const struct termcapstr *ts;
const struct termcapval *tv;
- char what[8], how[8];
+ const char *what, *how;
if (argv == NULL || argv[1] == NULL || argv[2] == NULL)
return -1;
- strncpy(what, ct_encode_string(argv[1], &el->el_scratch), sizeof(what));
- what[sizeof(what) - 1] = '\0';
- strncpy(how, ct_encode_string(argv[2], &el->el_scratch), sizeof(how));
- how[sizeof(how) - 1] = '\0';
+ what = argv[1];
+ how = argv[2];
/*
* Do the strings first
@@ -1350,8 +1365,8 @@ terminal_settc(EditLine *el, int argc __attribute__((__unused__)),
break;
if (ts->name != NULL) {
- terminal_alloc(el, ts, how);
- terminal_setflags(el);
+ term_alloc(el, ts, how);
+ term_setflags(el);
return 0;
}
/*
@@ -1367,16 +1382,16 @@ terminal_settc(EditLine *el, int argc __attribute__((__unused__)),
if (tv == &tval[T_pt] || tv == &tval[T_km] ||
tv == &tval[T_am] || tv == &tval[T_xn]) {
if (strcmp(how, "yes") == 0)
- el->el_terminal.t_val[tv - tval] = 1;
+ el->el_term.t_val[tv - tval] = 1;
else if (strcmp(how, "no") == 0)
- el->el_terminal.t_val[tv - tval] = 0;
+ el->el_term.t_val[tv - tval] = 0;
else {
(void) fprintf(el->el_errfile,
- "" FSTR ": Bad value `%s'.\n", argv[0], how);
+ "%s: Bad value `%s'.\n", argv[0], how);
return -1;
}
- terminal_setflags(el);
- if (terminal_change_size(el, Val(T_li), Val(T_co)) == -1)
+ term_setflags(el);
+ if (term_change_size(el, Val(T_li), Val(T_co)) == -1)
return -1;
return 0;
} else {
@@ -1386,14 +1401,14 @@ terminal_settc(EditLine *el, int argc __attribute__((__unused__)),
i = strtol(how, &ep, 10);
if (*ep != '\0') {
(void) fprintf(el->el_errfile,
- "" FSTR ": Bad value `%s'.\n", argv[0], how);
+ "%s: Bad value `%s'.\n", argv[0], how);
return -1;
}
- el->el_terminal.t_val[tv - tval] = (int) i;
- el->el_terminal.t_size.v = Val(T_co);
- el->el_terminal.t_size.h = Val(T_li);
+ el->el_term.t_val[tv - tval] = (int) i;
+ el->el_term.t_size.v = Val(T_co);
+ el->el_term.t_size.h = Val(T_li);
if (tv == &tval[T_co] || tv == &tval[T_li])
- if (terminal_change_size(el, Val(T_li), Val(T_co))
+ if (term_change_size(el, Val(T_li), Val(T_co))
== -1)
return -1;
return 0;
@@ -1401,12 +1416,12 @@ terminal_settc(EditLine *el, int argc __attribute__((__unused__)),
}
-/* terminal_gettc():
+/* term_gettc():
* Get the current terminal characteristics
*/
protected int
/*ARGSUSED*/
-terminal_gettc(EditLine *el, int argc __attribute__((__unused__)), char **argv)
+term_gettc(EditLine *el, int argc __unused, char **argv)
{
const struct termcapstr *ts;
const struct termcapval *tv;
@@ -1414,7 +1429,7 @@ terminal_gettc(EditLine *el, int argc __attribute__((__unused__)), char **argv)
void *how;
if (argv == NULL || argv[1] == NULL || argv[2] == NULL)
- return -1;
+ return (-1);
what = argv[1];
how = argv[2];
@@ -1427,7 +1442,7 @@ terminal_gettc(EditLine *el, int argc __attribute__((__unused__)), char **argv)
break;
if (ts->name != NULL) {
- *(char **)how = el->el_terminal.t_str[ts - tstr];
+ *(char **)how = el->el_term.t_str[ts - tstr];
return 0;
}
/*
@@ -1444,27 +1459,26 @@ terminal_gettc(EditLine *el, int argc __attribute__((__unused__)), char **argv)
tv == &tval[T_am] || tv == &tval[T_xn]) {
static char yes[] = "yes";
static char no[] = "no";
- if (el->el_terminal.t_val[tv - tval])
+ if (el->el_term.t_val[tv - tval])
*(char **)how = yes;
else
*(char **)how = no;
return 0;
} else {
- *(int *)how = el->el_terminal.t_val[tv - tval];
+ *(int *)how = el->el_term.t_val[tv - tval];
return 0;
}
}
-/* terminal_echotc():
+/* term_echotc():
* Print the termcap string out with variable substitution
*/
protected int
/*ARGSUSED*/
-terminal_echotc(EditLine *el, int argc __attribute__((__unused__)),
- const Char **argv)
+term_echotc(EditLine *el, int argc __unused,
+ const char **argv)
{
- char *cap, *scap;
- Char *ep;
+ char *cap, *scap, *ep;
int arg_need, arg_cols, arg_rows;
int verbose = 0, silent = 0;
char *area;
@@ -1476,7 +1490,7 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)),
area = buf;
if (argv == NULL || argv[1] == NULL)
- return -1;
+ return (-1);
argv++;
if (argv[0][0] == '-') {
@@ -1494,52 +1508,62 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)),
argv++;
}
if (!*argv || *argv[0] == '\0')
- return 0;
- if (Strcmp(*argv, STR("tabs")) == 0) {
+ return (0);
+ if (strcmp(*argv, "tabs") == 0) {
(void) fprintf(el->el_outfile, fmts, EL_CAN_TAB ? "yes" : "no");
- return 0;
- } else if (Strcmp(*argv, STR("meta")) == 0) {
+ return (0);
+ } else if (strcmp(*argv, "meta") == 0) {
(void) fprintf(el->el_outfile, fmts, Val(T_km) ? "yes" : "no");
- return 0;
- } else if (Strcmp(*argv, STR("xn")) == 0) {
+ return (0);
+ } else if (strcmp(*argv, "xn") == 0) {
(void) fprintf(el->el_outfile, fmts, EL_HAS_MAGIC_MARGINS ?
"yes" : "no");
- return 0;
- } else if (Strcmp(*argv, STR("am")) == 0) {
+ return (0);
+ } else if (strcmp(*argv, "am") == 0) {
(void) fprintf(el->el_outfile, fmts, EL_HAS_AUTO_MARGINS ?
"yes" : "no");
- return 0;
- } else if (Strcmp(*argv, STR("baud")) == 0) {
+ return (0);
+ } else if (strcmp(*argv, "baud") == 0) {
+#ifdef notdef
+ int i;
+
+ for (i = 0; baud_rate[i].b_name != NULL; i++)
+ if (el->el_tty.t_speed == baud_rate[i].b_rate) {
+ (void) fprintf(el->el_outfile, fmts,
+ baud_rate[i].b_name);
+ return (0);
+ }
+ (void) fprintf(el->el_outfile, fmtd, 0);
+#else
(void) fprintf(el->el_outfile, fmtd, (int)el->el_tty.t_speed);
- return 0;
- } else if (Strcmp(*argv, STR("rows")) == 0 ||
- Strcmp(*argv, STR("lines")) == 0) {
+#endif
+ return (0);
+ } else if (strcmp(*argv, "rows") == 0 || strcmp(*argv, "lines") == 0) {
(void) fprintf(el->el_outfile, fmtd, Val(T_li));
- return 0;
- } else if (Strcmp(*argv, STR("cols")) == 0) {
+ return (0);
+ } else if (strcmp(*argv, "cols") == 0) {
(void) fprintf(el->el_outfile, fmtd, Val(T_co));
- return 0;
+ return (0);
}
/*
* Try to use our local definition first
*/
scap = NULL;
for (t = tstr; t->name != NULL; t++)
- if (strcmp(t->name,
- ct_encode_string(*argv, &el->el_scratch)) == 0) {
- scap = el->el_terminal.t_str[t - tstr];
+ if (strcmp(t->name, *argv) == 0) {
+ scap = el->el_term.t_str[t - tstr];
break;
}
if (t->name == NULL) {
/* XXX: some systems' tgetstr needs non const */
- scap = tgetstr(ct_encode_string(*argv, &el->el_scratch), &area);
+ scap = tgetstr(strchr(*argv, **argv), &area);
}
if (!scap || scap[0] == '\0') {
if (!silent)
(void) fprintf(el->el_errfile,
- "echotc: Termcap parameter `" FSTR "' not found.\n",
+ "echotc: Termcap parameter `%s' not found.\n",
*argv);
- return -1;
+ return (-1);
}
/*
* Count home many values we need for this capability.
@@ -1580,11 +1604,11 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)),
if (*argv && *argv[0]) {
if (!silent)
(void) fprintf(el->el_errfile,
- "echotc: Warning: Extra argument `" FSTR "'.\n",
+ "echotc: Warning: Extra argument `%s'.\n",
*argv);
- return -1;
+ return (-1);
}
- terminal_tputs(el, scap, 1);
+ term_tputs(el, scap, 1);
break;
case 1:
argv++;
@@ -1592,27 +1616,27 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)),
if (!silent)
(void) fprintf(el->el_errfile,
"echotc: Warning: Missing argument.\n");
- return -1;
+ return (-1);
}
arg_cols = 0;
- i = Strtol(*argv, &ep, 10);
+ i = strtol(*argv, &ep, 10);
if (*ep != '\0' || i < 0) {
if (!silent)
(void) fprintf(el->el_errfile,
- "echotc: Bad value `" FSTR "' for rows.\n",
+ "echotc: Bad value `%s' for rows.\n",
*argv);
- return -1;
+ return (-1);
}
arg_rows = (int) i;
argv++;
if (*argv && *argv[0]) {
if (!silent)
(void) fprintf(el->el_errfile,
- "echotc: Warning: Extra argument `" FSTR
- "'.\n", *argv);
- return -1;
+ "echotc: Warning: Extra argument `%s'.\n",
+ *argv);
+ return (-1);
}
- terminal_tputs(el, tgoto(scap, arg_cols, arg_rows), 1);
+ term_tputs(el, tgoto(scap, arg_cols, arg_rows), 1);
break;
default:
/* This is wrong, but I will ignore it... */
@@ -1627,15 +1651,15 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)),
if (!silent)
(void) fprintf(el->el_errfile,
"echotc: Warning: Missing argument.\n");
- return -1;
+ return (-1);
}
- i = Strtol(*argv, &ep, 10);
+ i = strtol(*argv, &ep, 10);
if (*ep != '\0' || i < 0) {
if (!silent)
(void) fprintf(el->el_errfile,
- "echotc: Bad value `" FSTR "' for cols.\n",
+ "echotc: Bad value `%s' for cols.\n",
*argv);
- return -1;
+ return (-1);
}
arg_cols = (int) i;
argv++;
@@ -1643,33 +1667,33 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)),
if (!silent)
(void) fprintf(el->el_errfile,
"echotc: Warning: Missing argument.\n");
- return -1;
+ return (-1);
}
- i = Strtol(*argv, &ep, 10);
+ i = strtol(*argv, &ep, 10);
if (*ep != '\0' || i < 0) {
if (!silent)
(void) fprintf(el->el_errfile,
- "echotc: Bad value `" FSTR "' for rows.\n",
+ "echotc: Bad value `%s' for rows.\n",
*argv);
- return -1;
+ return (-1);
}
arg_rows = (int) i;
if (*ep != '\0') {
if (!silent)
(void) fprintf(el->el_errfile,
- "echotc: Bad value `" FSTR "'.\n", *argv);
- return -1;
+ "echotc: Bad value `%s'.\n", *argv);
+ return (-1);
}
argv++;
if (*argv && *argv[0]) {
if (!silent)
(void) fprintf(el->el_errfile,
- "echotc: Warning: Extra argument `" FSTR
- "'.\n", *argv);
- return -1;
+ "echotc: Warning: Extra argument `%s'.\n",
+ *argv);
+ return (-1);
}
- terminal_tputs(el, tgoto(scap, arg_cols, arg_rows), arg_rows);
+ term_tputs(el, tgoto(scap, arg_cols, arg_rows), arg_rows);
break;
}
- return 0;
+ return (0);
}
diff --git a/lib/libedit/terminal.h b/lib/libedit/term.h
index f26f5e1..cf7a909 100644
--- a/lib/libedit/terminal.h
+++ b/lib/libedit/term.h
@@ -1,5 +1,3 @@
-/* $NetBSD: terminal.h,v 1.4 2012/03/24 20:09:30 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,23 +30,24 @@
* SUCH DAMAGE.
*
* @(#)term.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: term.h,v 1.20 2009/03/31 17:38:27 christos Exp $
* $FreeBSD$
*/
/*
* el.term.h: Termcap header
*/
-#ifndef _h_el_terminal
-#define _h_el_terminal
+#ifndef _h_el_term
+#define _h_el_term
#include "histedit.h"
typedef struct { /* Symbolic function key bindings */
- const Char *name; /* name of the key */
+ const char *name; /* name of the key */
int key; /* Index in termcap table */
- keymacro_value_t fun; /* Function bound to it */
+ key_value_t fun; /* Function bound to it */
int type; /* Type of function */
-} funckey_t;
+} fkey_t;
typedef struct {
const char *t_name; /* the terminal name */
@@ -64,12 +63,12 @@ typedef struct {
#define TERM_HAS_AUTO_MARGINS 0x080 /* Has auto margins */
#define TERM_HAS_MAGIC_MARGINS 0x100 /* Has magic margins */
char *t_buf; /* Termcap buffer */
- size_t t_loc; /* location used */
+ int t_loc; /* location used */
char **t_str; /* termcap strings */
int *t_val; /* termcap values */
char *t_cap; /* Termcap buffer */
- funckey_t *t_fkey; /* Array of keys */
-} el_terminal_t;
+ fkey_t *t_fkey; /* Array of keys */
+} el_term_t;
/*
* fKey indexes
@@ -83,36 +82,36 @@ typedef struct {
#define A_K_DE 6
#define A_K_NKEYS 7
-protected void terminal_move_to_line(EditLine *, int);
-protected void terminal_move_to_char(EditLine *, int);
-protected void terminal_clear_EOL(EditLine *, int);
-protected void terminal_overwrite(EditLine *, const Char *, size_t);
-protected void terminal_insertwrite(EditLine *, Char *, int);
-protected void terminal_deletechars(EditLine *, int);
-protected void terminal_clear_screen(EditLine *);
-protected void terminal_beep(EditLine *);
-protected int terminal_change_size(EditLine *, int, int);
-protected int terminal_get_size(EditLine *, int *, int *);
-protected int terminal_init(EditLine *);
-protected void terminal_bind_arrow(EditLine *);
-protected void terminal_print_arrow(EditLine *, const Char *);
-protected int terminal_clear_arrow(EditLine *, const Char *);
-protected int terminal_set_arrow(EditLine *, const Char *, keymacro_value_t *, int);
-protected void terminal_end(EditLine *);
-protected void terminal_get(EditLine *, const char **);
-protected int terminal_set(EditLine *, const char *);
-protected int terminal_settc(EditLine *, int, const Char **);
-protected int terminal_gettc(EditLine *, int, char **);
-protected int terminal_telltc(EditLine *, int, const Char **);
-protected int terminal_echotc(EditLine *, int, const Char **);
-protected void terminal_writec(EditLine *, Int);
-protected int terminal__putc(EditLine *, Int);
-protected void terminal__flush(EditLine *);
+protected void term_move_to_line(EditLine *, int);
+protected void term_move_to_char(EditLine *, int);
+protected void term_clear_EOL(EditLine *, int);
+protected void term_overwrite(EditLine *, const char *, size_t);
+protected void term_insertwrite(EditLine *, char *, int);
+protected void term_deletechars(EditLine *, int);
+protected void term_clear_screen(EditLine *);
+protected void term_beep(EditLine *);
+protected int term_change_size(EditLine *, int, int);
+protected int term_get_size(EditLine *, int *, int *);
+protected int term_init(EditLine *);
+protected void term_bind_arrow(EditLine *);
+protected void term_print_arrow(EditLine *, const char *);
+protected int term_clear_arrow(EditLine *, const char *);
+protected int term_set_arrow(EditLine *, const char *, key_value_t *, int);
+protected void term_end(EditLine *);
+protected void term_get(EditLine *, const char **);
+protected int term_set(EditLine *, const char *);
+protected int term_settc(EditLine *, int, const char **);
+protected int term_gettc(EditLine *, int, char **);
+protected int term_telltc(EditLine *, int, const char **);
+protected int term_echotc(EditLine *, int, const char **);
+protected void term_writec(EditLine *, int);
+protected int term__putc(EditLine *, int);
+protected void term__flush(EditLine *);
/*
* Easy access macros
*/
-#define EL_FLAGS (el)->el_terminal.t_flags
+#define EL_FLAGS (el)->el_term.t_flags
#define EL_CAN_INSERT (EL_FLAGS & TERM_CAN_INSERT)
#define EL_CAN_DELETE (EL_FLAGS & TERM_CAN_DELETE)
@@ -124,4 +123,4 @@ protected void terminal__flush(EditLine *);
#define EL_HAS_AUTO_MARGINS (EL_FLAGS & TERM_HAS_AUTO_MARGINS)
#define EL_HAS_MAGIC_MARGINS (EL_FLAGS & TERM_HAS_MAGIC_MARGINS)
-#endif /* _h_el_terminal */
+#endif /* _h_el_term */
diff --git a/lib/libedit/tokenizer.c b/lib/libedit/tokenizer.c
index e61ecaf..41284e8 100644
--- a/lib/libedit/tokenizer.c
+++ b/lib/libedit/tokenizer.c
@@ -1,5 +1,3 @@
-/* $NetBSD: tokenizer.c,v 1.21 2011/08/16 16:25:15 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,66 +28,62 @@
* LIABILITY, OR TORT (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: tokenizer.c,v 1.15 2009/02/15 21:55:23 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: tokenizer.c,v 1.21 2011/08/16 16:25:15 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* We build this file twice, once as NARROW, once as WIDE. */
/*
* tokenize.c: Bourne shell like tokenizer
*/
+#include "sys.h"
#include <string.h>
#include <stdlib.h>
#include "histedit.h"
-#include "chartype.h"
typedef enum {
Q_none, Q_single, Q_double, Q_one, Q_doubleone
} quote_t;
+#define IFS "\t \n"
+
#define TOK_KEEP 1
#define TOK_EAT 2
#define WINCR 20
#define AINCR 10
-#define IFS STR("\t \n")
-
+#define tok_strdup(a) strdup(a)
#define tok_malloc(a) malloc(a)
#define tok_free(a) free(a)
#define tok_realloc(a, b) realloc(a, b)
-#define tok_strdup(a) Strdup(a)
-struct TYPE(tokenizer) {
- Char *ifs; /* In field separator */
- size_t argc, amax; /* Current and maximum number of args */
- Char **argv; /* Argument list */
- Char *wptr, *wmax; /* Space and limit on the word buffer */
- Char *wstart; /* Beginning of next word */
- Char *wspace; /* Space of word buffer */
+struct tokenizer {
+ char *ifs; /* In field separator */
+ int argc, amax; /* Current and maximum number of args */
+ char **argv; /* Argument list */
+ char *wptr, *wmax; /* Space and limit on the word buffer */
+ char *wstart; /* Beginning of next word */
+ char *wspace; /* Space of word buffer */
quote_t quote; /* Quoting state */
int flags; /* flags; */
};
-private void FUN(tok,finish)(TYPE(Tokenizer) *);
+private void tok_finish(Tokenizer *);
-/* FUN(tok,finish)():
+/* tok_finish():
* Finish a word in the tokenizer.
*/
private void
-FUN(tok,finish)(TYPE(Tokenizer) *tok)
+tok_finish(Tokenizer *tok)
{
*tok->wptr = '\0';
@@ -102,35 +96,35 @@ FUN(tok,finish)(TYPE(Tokenizer) *tok)
}
-/* FUN(tok,init)():
+/* tok_init():
* Initialize the tokenizer
*/
-public TYPE(Tokenizer) *
-FUN(tok,init)(const Char *ifs)
+public Tokenizer *
+tok_init(const char *ifs)
{
- TYPE(Tokenizer) *tok = tok_malloc(sizeof(*tok));
+ Tokenizer *tok = (Tokenizer *) tok_malloc(sizeof(Tokenizer));
if (tok == NULL)
return NULL;
tok->ifs = tok_strdup(ifs ? ifs : IFS);
if (tok->ifs == NULL) {
- tok_free(tok);
+ tok_free((ptr_t)tok);
return NULL;
}
tok->argc = 0;
tok->amax = AINCR;
- tok->argv = tok_malloc(sizeof(*tok->argv) * tok->amax);
+ tok->argv = (char **) tok_malloc(sizeof(char *) * tok->amax);
if (tok->argv == NULL) {
- tok_free(tok->ifs);
- tok_free(tok);
+ tok_free((ptr_t)tok->ifs);
+ tok_free((ptr_t)tok);
return NULL;
}
tok->argv[0] = NULL;
- tok->wspace = tok_malloc(WINCR * sizeof(*tok->wspace));
+ tok->wspace = (char *) tok_malloc(WINCR);
if (tok->wspace == NULL) {
- tok_free(tok->argv);
- tok_free(tok->ifs);
- tok_free(tok);
+ tok_free((ptr_t)tok->argv);
+ tok_free((ptr_t)tok->ifs);
+ tok_free((ptr_t)tok);
return NULL;
}
tok->wmax = tok->wspace + WINCR;
@@ -139,15 +133,15 @@ FUN(tok,init)(const Char *ifs)
tok->flags = 0;
tok->quote = Q_none;
- return tok;
+ return (tok);
}
-/* FUN(tok,reset)():
+/* tok_reset():
* Reset the tokenizer
*/
public void
-FUN(tok,reset)(TYPE(Tokenizer) *tok)
+tok_reset(Tokenizer *tok)
{
tok->argc = 0;
@@ -158,25 +152,25 @@ FUN(tok,reset)(TYPE(Tokenizer) *tok)
}
-/* FUN(tok,end)():
+/* tok_end():
* Clean up
*/
public void
-FUN(tok,end)(TYPE(Tokenizer) *tok)
+tok_end(Tokenizer *tok)
{
- tok_free(tok->ifs);
- tok_free(tok->wspace);
- tok_free(tok->argv);
- tok_free(tok);
+ tok_free((ptr_t) tok->ifs);
+ tok_free((ptr_t) tok->wspace);
+ tok_free((ptr_t) tok->argv);
+ tok_free((ptr_t) tok);
}
-/* FUN(tok,line)():
+/* tok_line():
* Bourne shell (sh(1)) like tokenizing
* Arguments:
- * tok current tokenizer state (setup with FUN(tok,init)())
+ * tok current tokenizer state (setup with tok_init())
* line line to parse
* Returns:
* -1 Internal error
@@ -191,19 +185,19 @@ FUN(tok,end)(TYPE(Tokenizer) *tok)
* cursorv if !NULL, offset in argv[cursorc] of cursor
*/
public int
-FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
- int *argc, const Char ***argv, int *cursorc, int *cursoro)
+tok_line(Tokenizer *tok, const LineInfo *line,
+ int *argc, const char ***argv, int *cursorc, int *cursoro)
{
- const Char *ptr;
+ const char *ptr;
int cc, co;
cc = co = -1;
ptr = line->buffer;
for (ptr = line->buffer; ;ptr++) {
if (ptr >= line->lastchar)
- ptr = STR("");
+ ptr = "";
if (ptr == line->cursor) {
- cc = (int)tok->argc;
+ cc = tok->argc;
co = (int)(tok->wptr - tok->wstart);
}
switch (*ptr) {
@@ -235,7 +229,7 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
break;
default:
- return -1;
+ return (-1);
}
break;
@@ -266,7 +260,7 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
break;
default:
- return -1;
+ return (-1);
}
break;
@@ -297,7 +291,7 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
break;
default:
- return -1;
+ return (-1);
}
break;
@@ -323,7 +317,7 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
break;
default:
- return 0;
+ return (0);
}
break;
@@ -333,15 +327,15 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
/* Finish word and return */
if (tok->flags & TOK_EAT) {
tok->flags &= ~TOK_EAT;
- return 3;
+ return (3);
}
goto tok_line_outok;
case Q_single:
- return 1;
+ return (1);
case Q_double:
- return 2;
+ return (2);
case Q_doubleone:
tok->quote = Q_double;
@@ -354,7 +348,7 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
break;
default:
- return -1;
+ return (-1);
}
break;
@@ -362,8 +356,8 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
tok->flags &= ~TOK_EAT;
switch (tok->quote) {
case Q_none:
- if (Strchr(tok->ifs, *ptr) != NULL)
- FUN(tok,finish)(tok);
+ if (strchr(tok->ifs, *ptr) != NULL)
+ tok_finish(tok);
else
*tok->wptr++ = *ptr;
break;
@@ -386,21 +380,20 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
break;
default:
- return -1;
+ return (-1);
}
break;
}
if (tok->wptr >= tok->wmax - 4) {
- size_t size = (size_t)(tok->wmax - tok->wspace + WINCR);
- Char *s = tok_realloc(tok->wspace,
- size * sizeof(*s));
+ size_t size = tok->wmax - tok->wspace + WINCR;
+ char *s = (char *) tok_realloc(tok->wspace, size);
if (s == NULL)
- return -1;
+ return (-1);
if (s != tok->wspace) {
- size_t i;
+ int i;
for (i = 0; i < tok->argc; i++) {
tok->argv[i] =
(tok->argv[i] - tok->wspace) + s;
@@ -412,41 +405,41 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
tok->wmax = s + size;
}
if (tok->argc >= tok->amax - 4) {
- Char **p;
+ char **p;
tok->amax += AINCR;
- p = tok_realloc(tok->argv, tok->amax * sizeof(*p));
+ p = (char **) tok_realloc(tok->argv,
+ tok->amax * sizeof(char *));
if (p == NULL)
- return -1;
+ return (-1);
tok->argv = p;
}
}
tok_line_outok:
if (cc == -1 && co == -1) {
- cc = (int)tok->argc;
+ cc = tok->argc;
co = (int)(tok->wptr - tok->wstart);
}
if (cursorc != NULL)
*cursorc = cc;
if (cursoro != NULL)
*cursoro = co;
- FUN(tok,finish)(tok);
- *argv = (const Char **)tok->argv;
- *argc = (int)tok->argc;
- return 0;
+ tok_finish(tok);
+ *argv = (const char **)tok->argv;
+ *argc = tok->argc;
+ return (0);
}
-/* FUN(tok,str)():
+/* tok_str():
* Simpler version of tok_line, taking a NUL terminated line
* and splitting into words, ignoring cursor state.
*/
public int
-FUN(tok,str)(TYPE(Tokenizer) *tok, const Char *line, int *argc,
- const Char ***argv)
+tok_str(Tokenizer *tok, const char *line, int *argc, const char ***argv)
{
- TYPE(LineInfo) li;
+ LineInfo li;
memset(&li, 0, sizeof(li));
li.buffer = line;
- li.cursor = li.lastchar = Strchr(line, '\0');
- return FUN(tok,line(tok, &li, argc, argv, NULL, NULL));
+ li.cursor = li.lastchar = strchr(line, '\0');
+ return (tok_line(tok, &li, argc, argv, NULL, NULL));
}
diff --git a/lib/libedit/tty.c b/lib/libedit/tty.c
index ecf2e2a..f8bae94 100644
--- a/lib/libedit/tty.c
+++ b/lib/libedit/tty.c
@@ -1,5 +1,3 @@
-/* $NetBSD: tty.c,v 1.47 2015/05/14 10:44:15 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,15 +28,12 @@
* LIABILITY, OR TORT (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: tty.c,v 1.31 2009/07/22 15:58:09 christos Exp $
*/
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: tty.c,v 1.47 2015/05/14 10:44:15 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -47,12 +42,9 @@ __FBSDID("$FreeBSD$");
* tty.c: tty interface stuff
*/
#include <assert.h>
-#include <errno.h>
-#include <unistd.h> /* for isatty */
-#include <strings.h> /* for ffs */
-#include <stdlib.h> /* for abort */
-#include "el.h"
+#include "sys.h"
#include "tty.h"
+#include "el.h"
typedef struct ttymodes_t {
const char *m_name;
@@ -61,7 +53,7 @@ typedef struct ttymodes_t {
} ttymodes_t;
typedef struct ttymap_t {
- Int nch, och; /* Internal and termio rep of chars */
+ int nch, och; /* Internal and termio rep of chars */
el_action_t bind[3]; /* emacs, vi, and vi-cmd */
} ttymap_t;
@@ -157,7 +149,7 @@ private const ttymap_t tty_map[] = {
{C_LNEXT, VLNEXT,
{ED_QUOTED_INSERT, ED_QUOTED_INSERT, ED_UNASSIGNED}},
#endif /* VLNEXT */
- {(Int)-1, (Int)-1,
+ {-1, -1,
{ED_UNASSIGNED, ED_UNASSIGNED, ED_UNASSIGNED}}
};
@@ -462,7 +454,6 @@ private void tty__getchar(struct termios *, unsigned char *);
private void tty__setchar(struct termios *, unsigned char *);
private speed_t tty__getspeed(struct termios *);
private int tty_setup(EditLine *);
-private void tty_setup_flags(EditLine *, struct termios *, int);
#define t_qu t_ts
@@ -499,30 +490,21 @@ tty_setup(EditLine *el)
int rst = 1;
if (el->el_flags & EDIT_DISABLED)
- return 0;
+ return (0);
- if (!isatty(el->el_outfd)) {
-#ifdef DEBUG_TTY
- (void) fprintf(el->el_errfile, "%s: isatty: %s\n", __func__,
- strerror(errno));
-#endif /* DEBUG_TTY */
- return -1;
- }
- if (tty_getty(el, &el->el_tty.t_or) == -1) {
+ if (tty_getty(el, &el->el_tty.t_ed) == -1) {
#ifdef DEBUG_TTY
- (void) fprintf(el->el_errfile, "%s: tty_getty: %s\n", __func__,
- strerror(errno));
+ (void) fprintf(el->el_errfile,
+ "tty_setup: tty_getty: %s\n", strerror(errno));
#endif /* DEBUG_TTY */
- return -1;
+ return (-1);
}
- el->el_tty.t_ts = el->el_tty.t_ex = el->el_tty.t_ed = el->el_tty.t_or;
+ el->el_tty.t_ts = el->el_tty.t_ex = el->el_tty.t_ed;
el->el_tty.t_speed = tty__getspeed(&el->el_tty.t_ex);
el->el_tty.t_tabs = tty__gettabs(&el->el_tty.t_ex);
el->el_tty.t_eight = tty__geteightbit(&el->el_tty.t_ex);
- tty_setup_flags(el, &el->el_tty.t_ex, EX_IO);
-
/*
* Reset the tty chars to reasonable defaults
* If they are disabled, then enable them.
@@ -546,21 +528,23 @@ tty_setup(EditLine *el)
el->el_tty.t_c[EX_IO][rst] =
el->el_tty.t_c[TS_IO][rst];
}
- tty__setchar(&el->el_tty.t_ex, el->el_tty.t_c[EX_IO]);
- if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ex) == -1) {
-#ifdef DEBUG_TTY
- (void) fprintf(el->el_errfile, "%s: tty_setty: %s\n",
- __func__, strerror(errno));
-#endif /* DEBUG_TTY */
- return -1;
- }
}
- tty_setup_flags(el, &el->el_tty.t_ed, ED_IO);
+ el->el_tty.t_ed.c_iflag &= ~el->el_tty.t_t[ED_IO][MD_INP].t_clrmask;
+ el->el_tty.t_ed.c_iflag |= el->el_tty.t_t[ED_IO][MD_INP].t_setmask;
+
+ el->el_tty.t_ed.c_oflag &= ~el->el_tty.t_t[ED_IO][MD_OUT].t_clrmask;
+ el->el_tty.t_ed.c_oflag |= el->el_tty.t_t[ED_IO][MD_OUT].t_setmask;
+
+ el->el_tty.t_ed.c_cflag &= ~el->el_tty.t_t[ED_IO][MD_CTL].t_clrmask;
+ el->el_tty.t_ed.c_cflag |= el->el_tty.t_t[ED_IO][MD_CTL].t_setmask;
+
+ el->el_tty.t_ed.c_lflag &= ~el->el_tty.t_t[ED_IO][MD_LIN].t_clrmask;
+ el->el_tty.t_ed.c_lflag |= el->el_tty.t_t[ED_IO][MD_LIN].t_setmask;
tty__setchar(&el->el_tty.t_ed, el->el_tty.t_c[ED_IO]);
tty_bind_char(el, 1);
- return 0;
+ return (0);
}
protected int
@@ -571,7 +555,7 @@ tty_init(EditLine *el)
el->el_tty.t_vdisable = _POSIX_VDISABLE;
(void) memcpy(el->el_tty.t_t, ttyperm, sizeof(ttyperm_t));
(void) memcpy(el->el_tty.t_c, ttychar, sizeof(ttychar_t));
- return tty_setup(el);
+ return (tty_setup(el));
}
@@ -580,14 +564,10 @@ tty_init(EditLine *el)
*/
protected void
/*ARGSUSED*/
-tty_end(EditLine *el)
+tty_end(EditLine *el __unused)
{
- if (tty_setty(el, TCSAFLUSH, &el->el_tty.t_or) == -1) {
-#ifdef DEBUG_TTY
- (void) fprintf(el->el_errfile,
- "%s: tty_setty: %s\n", __func__, strerror(errno));
-#endif /* DEBUG_TTY */
- }
+
+ /* XXX: Maybe reset to an initial state? */
}
@@ -601,7 +581,7 @@ tty__getspeed(struct termios *td)
if ((spd = cfgetispeed(td)) == 0)
spd = cfgetospeed(td);
- return spd;
+ return (spd);
}
/* tty__getspeed():
@@ -885,7 +865,7 @@ tty_bind_char(EditLine *el, int force)
unsigned char *t_n = el->el_tty.t_c[ED_IO];
unsigned char *t_o = el->el_tty.t_ed.c_cc;
- Char new[2], old[2];
+ unsigned char new[2], old[2];
const ttymap_t *tp;
el_action_t *map, *alt;
const el_action_t *dmap, *dalt;
@@ -901,79 +881,27 @@ tty_bind_char(EditLine *el, int force)
dalt = NULL;
}
- for (tp = tty_map; tp->nch != (Int)-1; tp++) {
+ for (tp = tty_map; tp->nch != -1; tp++) {
new[0] = t_n[tp->nch];
old[0] = t_o[tp->och];
if (new[0] == old[0] && !force)
continue;
/* Put the old default binding back, and set the new binding */
- keymacro_clear(el, map, old);
- map[UC(old[0])] = dmap[UC(old[0])];
- keymacro_clear(el, map, new);
+ key_clear(el, map, (char *)old);
+ map[old[0]] = dmap[old[0]];
+ key_clear(el, map, (char *)new);
/* MAP_VI == 1, MAP_EMACS == 0... */
- map[UC(new[0])] = tp->bind[el->el_map.type];
+ map[new[0]] = tp->bind[el->el_map.type];
if (dalt) {
- keymacro_clear(el, alt, old);
- alt[UC(old[0])] = dalt[UC(old[0])];
- keymacro_clear(el, alt, new);
- alt[UC(new[0])] = tp->bind[el->el_map.type + 1];
+ key_clear(el, alt, (char *)old);
+ alt[old[0]] = dalt[old[0]];
+ key_clear(el, alt, (char *)new);
+ alt[new[0]] = tp->bind[el->el_map.type + 1];
}
}
}
-private tcflag_t *
-tty__get_flag(struct termios *t, int kind) {
- switch (kind) {
- case MD_INP:
- return &t->c_iflag;
- case MD_OUT:
- return &t->c_oflag;
- case MD_CTL:
- return &t->c_cflag;
- case MD_LIN:
- return &t->c_lflag;
- default:
- abort();
- /*NOTREACHED*/
- }
-}
-
-
-private tcflag_t
-tty_update_flag(EditLine *el, tcflag_t f, int mode, int kind)
-{
- f &= ~el->el_tty.t_t[mode][kind].t_clrmask;
- f |= el->el_tty.t_t[mode][kind].t_setmask;
- return f;
-}
-
-
-private void
-tty_update_flags(EditLine *el, int kind)
-{
- tcflag_t *tt, *ed, *ex;
- tt = tty__get_flag(&el->el_tty.t_ts, kind);
- ed = tty__get_flag(&el->el_tty.t_ed, kind);
- ex = tty__get_flag(&el->el_tty.t_ex, kind);
-
- if (*tt != *ex && (kind != MD_CTL || *tt != *ed)) {
- *ed = tty_update_flag(el, *tt, ED_IO, kind);
- *ex = tty_update_flag(el, *tt, EX_IO, kind);
- }
-}
-
-
-private void
-tty_update_char(EditLine *el, int mode, int c) {
- if (!((el->el_tty.t_t[mode][MD_CHAR].t_setmask & C_SH(c)))
- && (el->el_tty.t_c[TS_IO][c] != el->el_tty.t_c[EX_IO][c]))
- el->el_tty.t_c[mode][c] = el->el_tty.t_c[TS_IO][c];
- if (el->el_tty.t_t[mode][MD_CHAR].t_clrmask & C_SH(c))
- el->el_tty.t_c[mode][c] = el->el_tty.t_vdisable;
-}
-
-
/* tty_rawmode():
* Set terminal into 1 character at a time mode.
*/
@@ -982,80 +910,123 @@ tty_rawmode(EditLine *el)
{
if (el->el_tty.t_mode == ED_IO || el->el_tty.t_mode == QU_IO)
- return 0;
+ return (0);
if (el->el_flags & EDIT_DISABLED)
- return 0;
+ return (0);
if (tty_getty(el, &el->el_tty.t_ts) == -1) {
#ifdef DEBUG_TTY
- (void) fprintf(el->el_errfile, "%s: tty_getty: %s\n", __func__,
+ (void) fprintf(el->el_errfile, "tty_rawmode: tty_getty: %s\n",
strerror(errno));
#endif /* DEBUG_TTY */
- return -1;
+ return (-1);
}
/*
* We always keep up with the eight bit setting and the speed of the
- * tty. But we only believe changes that are made to cooked mode!
+ * tty. But only we only believe changes that are made to cooked mode!
*/
el->el_tty.t_eight = tty__geteightbit(&el->el_tty.t_ts);
el->el_tty.t_speed = tty__getspeed(&el->el_tty.t_ts);
- if (tty__getspeed(&el->el_tty.t_ex) != el->el_tty.t_speed ||
- tty__getspeed(&el->el_tty.t_ed) != el->el_tty.t_speed) {
- (void) cfsetispeed(&el->el_tty.t_ex, el->el_tty.t_speed);
- (void) cfsetospeed(&el->el_tty.t_ex, el->el_tty.t_speed);
+ if (tty__getspeed(&el->el_tty.t_ed) != el->el_tty.t_speed) {
(void) cfsetispeed(&el->el_tty.t_ed, el->el_tty.t_speed);
(void) cfsetospeed(&el->el_tty.t_ed, el->el_tty.t_speed);
}
if (tty__cooked_mode(&el->el_tty.t_ts)) {
- int i;
-
- for (i = MD_INP; i <= MD_LIN; i++)
- tty_update_flags(el, i);
-
+ if ((el->el_tty.t_ts.c_cflag != el->el_tty.t_ex.c_cflag) &&
+ (el->el_tty.t_ts.c_cflag != el->el_tty.t_ed.c_cflag)) {
+ el->el_tty.t_ed.c_cflag =
+ el->el_tty.t_ts.c_cflag;
+ el->el_tty.t_ed.c_cflag &=
+ ~el->el_tty.t_t[ED_IO][MD_CTL].t_clrmask;
+ el->el_tty.t_ed.c_cflag |=
+ el->el_tty.t_t[ED_IO][MD_CTL].t_setmask;
+ }
+ if ((el->el_tty.t_ts.c_lflag != el->el_tty.t_ex.c_lflag) &&
+ (el->el_tty.t_ts.c_lflag != el->el_tty.t_ed.c_lflag)) {
+ el->el_tty.t_ed.c_lflag =
+ el->el_tty.t_ts.c_lflag;
+ el->el_tty.t_ed.c_lflag &=
+ ~el->el_tty.t_t[ED_IO][MD_LIN].t_clrmask;
+ el->el_tty.t_ed.c_lflag |=
+ el->el_tty.t_t[ED_IO][MD_LIN].t_setmask;
+ }
+ if ((el->el_tty.t_ts.c_iflag != el->el_tty.t_ex.c_iflag) &&
+ (el->el_tty.t_ts.c_iflag != el->el_tty.t_ed.c_iflag)) {
+ el->el_tty.t_ed.c_iflag =
+ el->el_tty.t_ts.c_iflag;
+ el->el_tty.t_ed.c_iflag &=
+ ~el->el_tty.t_t[ED_IO][MD_INP].t_clrmask;
+ el->el_tty.t_ed.c_iflag |=
+ el->el_tty.t_t[ED_IO][MD_INP].t_setmask;
+ }
+ if ((el->el_tty.t_ts.c_oflag != el->el_tty.t_ex.c_oflag) &&
+ (el->el_tty.t_ts.c_oflag != el->el_tty.t_ed.c_oflag)) {
+ el->el_tty.t_ed.c_oflag =
+ el->el_tty.t_ts.c_oflag;
+ el->el_tty.t_ed.c_oflag &=
+ ~el->el_tty.t_t[ED_IO][MD_OUT].t_clrmask;
+ el->el_tty.t_ed.c_oflag |=
+ el->el_tty.t_t[ED_IO][MD_OUT].t_setmask;
+ }
if (tty__gettabs(&el->el_tty.t_ex) == 0)
el->el_tty.t_tabs = 0;
else
el->el_tty.t_tabs = EL_CAN_TAB ? 1 : 0;
- tty__getchar(&el->el_tty.t_ts, el->el_tty.t_c[TS_IO]);
- /*
- * Check if the user made any changes.
- * If he did, then propagate the changes to the
- * edit and execute data structures.
- */
- for (i = 0; i < C_NCC; i++)
- if (el->el_tty.t_c[TS_IO][i] !=
- el->el_tty.t_c[EX_IO][i])
- break;
+ {
+ int i;
- if (i != C_NCC) {
+ tty__getchar(&el->el_tty.t_ts, el->el_tty.t_c[TS_IO]);
/*
- * Propagate changes only to the unprotected
- * chars that have been modified just now.
- */
- for (i = 0; i < C_NCC; i++)
- tty_update_char(el, ED_IO, i);
-
- tty_bind_char(el, 0);
- tty__setchar(&el->el_tty.t_ed, el->el_tty.t_c[ED_IO]);
-
+ * Check if the user made any changes.
+ * If he did, then propagate the changes to the
+ * edit and execute data structures.
+ */
for (i = 0; i < C_NCC; i++)
- tty_update_char(el, EX_IO, i);
-
- tty__setchar(&el->el_tty.t_ex, el->el_tty.t_c[EX_IO]);
+ if (el->el_tty.t_c[TS_IO][i] !=
+ el->el_tty.t_c[EX_IO][i])
+ break;
+
+ if (i != C_NCC) {
+ /*
+ * Propagate changes only to the unprotected
+ * chars that have been modified just now.
+ */
+ for (i = 0; i < C_NCC; i++) {
+ if (!((el->el_tty.t_t[ED_IO][MD_CHAR].t_setmask & C_SH(i)))
+ && (el->el_tty.t_c[TS_IO][i] != el->el_tty.t_c[EX_IO][i]))
+ el->el_tty.t_c[ED_IO][i] = el->el_tty.t_c[TS_IO][i];
+ if (el->el_tty.t_t[ED_IO][MD_CHAR].t_clrmask & C_SH(i))
+ el->el_tty.t_c[ED_IO][i] = el->el_tty.t_vdisable;
+ }
+ tty_bind_char(el, 0);
+ tty__setchar(&el->el_tty.t_ed, el->el_tty.t_c[ED_IO]);
+
+ for (i = 0; i < C_NCC; i++) {
+ if (!((el->el_tty.t_t[EX_IO][MD_CHAR].t_setmask & C_SH(i)))
+ && (el->el_tty.t_c[TS_IO][i] != el->el_tty.t_c[EX_IO][i]))
+ el->el_tty.t_c[EX_IO][i] = el->el_tty.t_c[TS_IO][i];
+ if (el->el_tty.t_t[EX_IO][MD_CHAR].t_clrmask & C_SH(i))
+ el->el_tty.t_c[EX_IO][i] = el->el_tty.t_vdisable;
+ }
+ }
}
}
+
+ if (el->el_tty.t_mode == EX_IO)
+ el->el_tty.t_ex = el->el_tty.t_ts;
+
if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ed) == -1) {
#ifdef DEBUG_TTY
- (void) fprintf(el->el_errfile, "%s: tty_setty: %s\n", __func__,
+ (void) fprintf(el->el_errfile, "tty_rawmode: tty_setty: %s\n",
strerror(errno));
#endif /* DEBUG_TTY */
- return -1;
+ return (-1);
}
el->el_tty.t_mode = ED_IO;
- return 0;
+ return (0);
}
@@ -1067,20 +1038,21 @@ tty_cookedmode(EditLine *el)
{ /* set tty in normal setup */
if (el->el_tty.t_mode == EX_IO)
- return 0;
+ return (0);
if (el->el_flags & EDIT_DISABLED)
- return 0;
+ return (0);
if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ex) == -1) {
#ifdef DEBUG_TTY
- (void) fprintf(el->el_errfile, "%s: tty_setty: %s\n", __func__,
+ (void) fprintf(el->el_errfile,
+ "tty_cookedmode: tty_setty: %s\n",
strerror(errno));
#endif /* DEBUG_TTY */
- return -1;
+ return (-1);
}
el->el_tty.t_mode = EX_IO;
- return 0;
+ return (0);
}
@@ -1091,21 +1063,31 @@ protected int
tty_quotemode(EditLine *el)
{
if (el->el_tty.t_mode == QU_IO)
- return 0;
+ return (0);
el->el_tty.t_qu = el->el_tty.t_ed;
- tty_setup_flags(el, &el->el_tty.t_qu, QU_IO);
+ el->el_tty.t_qu.c_iflag &= ~el->el_tty.t_t[QU_IO][MD_INP].t_clrmask;
+ el->el_tty.t_qu.c_iflag |= el->el_tty.t_t[QU_IO][MD_INP].t_setmask;
+
+ el->el_tty.t_qu.c_oflag &= ~el->el_tty.t_t[QU_IO][MD_OUT].t_clrmask;
+ el->el_tty.t_qu.c_oflag |= el->el_tty.t_t[QU_IO][MD_OUT].t_setmask;
+
+ el->el_tty.t_qu.c_cflag &= ~el->el_tty.t_t[QU_IO][MD_CTL].t_clrmask;
+ el->el_tty.t_qu.c_cflag |= el->el_tty.t_t[QU_IO][MD_CTL].t_setmask;
+
+ el->el_tty.t_qu.c_lflag &= ~el->el_tty.t_t[QU_IO][MD_LIN].t_clrmask;
+ el->el_tty.t_qu.c_lflag |= el->el_tty.t_t[QU_IO][MD_LIN].t_setmask;
if (tty_setty(el, TCSADRAIN, &el->el_tty.t_qu) == -1) {
#ifdef DEBUG_TTY
- (void) fprintf(el->el_errfile, "%s: tty_setty: %s\n", __func__,
+ (void) fprintf(el->el_errfile, "QuoteModeOn: tty_setty: %s\n",
strerror(errno));
#endif /* DEBUG_TTY */
- return -1;
+ return (-1);
}
el->el_tty.t_mode = QU_IO;
- return 0;
+ return (0);
}
@@ -1117,16 +1099,16 @@ tty_noquotemode(EditLine *el)
{
if (el->el_tty.t_mode != QU_IO)
- return 0;
+ return (0);
if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ed) == -1) {
#ifdef DEBUG_TTY
- (void) fprintf(el->el_errfile, "%s: tty_setty: %s\n", __func__,
+ (void) fprintf(el->el_errfile, "QuoteModeOff: tty_setty: %s\n",
strerror(errno));
#endif /* DEBUG_TTY */
- return -1;
+ return (-1);
}
el->el_tty.t_mode = ED_IO;
- return 0;
+ return (0);
}
@@ -1135,20 +1117,19 @@ tty_noquotemode(EditLine *el)
*/
protected int
/*ARGSUSED*/
-tty_stty(EditLine *el, int argc __attribute__((__unused__)), const Char **argv)
+tty_stty(EditLine *el, int argc __unused, const char **argv)
{
const ttymodes_t *m;
char x;
int aflag = 0;
- const Char *s, *d;
- char name[EL_BUFSIZ];
+ const char *s, *d;
+ const char *name;
struct termios *tios = &el->el_tty.t_ex;
int z = EX_IO;
if (argv == NULL)
- return -1;
- strncpy(name, ct_encode_string(*argv++, &el->el_scratch), sizeof(name));
- name[sizeof(name) - 1] = '\0';
+ return (-1);
+ name = *argv++;
while (argv && *argv && argv[0][0] == '-' && argv[0][2] == '\0')
switch (argv[0][1]) {
@@ -1173,9 +1154,9 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const Char **argv)
break;
default:
(void) fprintf(el->el_errfile,
- "%s: Unknown switch `" FCHAR "'.\n",
- name, (Int)argv[0][1]);
- return -1;
+ "%s: Unknown switch `%c'.\n",
+ name, argv[0][1]);
+ return (-1);
}
if (!argv || !*argv) {
@@ -1193,9 +1174,8 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const Char **argv)
if (i != -1) {
x = (el->el_tty.t_t[z][i].t_setmask & m->m_value)
? '+' : '\0';
-
- if (el->el_tty.t_t[z][i].t_clrmask & m->m_value)
- x = '-';
+ x = (el->el_tty.t_t[z][i].t_clrmask & m->m_value)
+ ? '-' : x;
} else {
x = '\0';
}
@@ -1204,8 +1184,7 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const Char **argv)
cu = strlen(m->m_name) + (x != '\0') + 1;
- if (len + cu >=
- (size_t)el->el_terminal.t_size.h) {
+ if (len + cu >= (size_t)el->el_term.t_size.h) {
(void) fprintf(el->el_outfile, "\n%*s",
(int)st, "");
len = st + cu;
@@ -1221,43 +1200,41 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const Char **argv)
}
}
(void) fprintf(el->el_outfile, "\n");
- return 0;
+ return (0);
}
while (argv && (s = *argv++)) {
- const Char *p;
+ const char *p;
switch (*s) {
case '+':
case '-':
- x = (char)*s++;
+ x = *s++;
break;
default:
x = '\0';
break;
}
d = s;
- p = Strchr(s, '=');
+ p = strchr(s, '=');
for (m = ttymodes; m->m_name; m++)
- if ((p ? strncmp(m->m_name, ct_encode_string(d,
- &el->el_scratch), (size_t)(p - d)) :
- strcmp(m->m_name, ct_encode_string(d,
- &el->el_scratch))) == 0 &&
+ if ((p ? strncmp(m->m_name, d, (size_t)(p - d)) :
+ strcmp(m->m_name, d)) == 0 &&
(p == NULL || m->m_type == MD_CHAR))
break;
if (!m->m_name) {
(void) fprintf(el->el_errfile,
- "%s: Invalid argument `" FSTR "'.\n", name, d);
- return -1;
+ "%s: Invalid argument `%s'.\n", name, d);
+ return (-1);
}
if (p) {
int c = ffs((int)m->m_value);
- int v = *++p ? parse__escape(&p) :
+ int v = *++p ? parse__escape((const char **) &p) :
el->el_tty.t_vdisable;
assert(c != 0);
c--;
c = tty__getcharindex(c);
assert(c != -1);
- tios->c_cc[c] = (cc_t)v;
+ tios->c_cc[c] = v;
continue;
}
switch (x) {
@@ -1276,18 +1253,17 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const Char **argv)
}
}
- tty_setup_flags(el, tios, z);
if (el->el_tty.t_mode == z) {
if (tty_setty(el, TCSADRAIN, tios) == -1) {
#ifdef DEBUG_TTY
- (void) fprintf(el->el_errfile, "%s: tty_setty: %s\n",
- __func__, strerror(errno));
+ (void) fprintf(el->el_errfile,
+ "tty_stty: tty_setty: %s\n", strerror(errno));
#endif /* DEBUG_TTY */
- return -1;
+ return (-1);
}
}
- return 0;
+ return (0);
}
@@ -1314,14 +1290,3 @@ tty_printchar(EditLine *el, unsigned char *s)
(void) fprintf(el->el_errfile, "\n");
}
#endif /* notyet */
-
-
-private void
-tty_setup_flags(EditLine *el, struct termios *tios, int mode)
-{
- int kind;
- for (kind = MD_INP; kind <= MD_LIN; kind++) {
- tcflag_t *f = tty__get_flag(tios, kind);
- *f = tty_update_flag(el, *f, mode, kind);
- }
-}
diff --git a/lib/libedit/tty.h b/lib/libedit/tty.h
index b1fc76e..3a4e94a 100644
--- a/lib/libedit/tty.h
+++ b/lib/libedit/tty.h
@@ -1,5 +1,3 @@
-/* $NetBSD: tty.h,v 1.15 2014/05/19 19:54:12 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +30,7 @@
* SUCH DAMAGE.
*
* @(#)tty.h 8.1 (Berkeley) 6/4/93
+ * $NetBSD: tty.h,v 1.11 2005/06/01 11:37:52 lukem Exp $
* $FreeBSD$
*/
@@ -41,7 +40,6 @@
#ifndef _h_el_tty
#define _h_el_tty
-#include "sys.h"
#include "histedit.h"
#include <termios.h>
#include <unistd.h>
@@ -432,7 +430,7 @@
#define C_MIN 23
#define C_TIME 24
#define C_NCC 25
-#define C_SH(A) ((unsigned int)(1 << (A)))
+#define C_SH(A) (1 << (A))
/*
* Terminal dependend data structures
@@ -443,7 +441,6 @@
#define QU_IO 2 /* used only for quoted chars */
#define NN_IO 3 /* The number of entries */
-/* Don't re-order */
#define MD_INP 0
#define MD_OUT 1
#define MD_CTL 2
@@ -461,7 +458,7 @@ typedef unsigned char ttychar_t[NN_IO][C_NCC];
protected int tty_init(EditLine *);
protected void tty_end(EditLine *);
-protected int tty_stty(EditLine *, int, const Char **);
+protected int tty_stty(EditLine *, int, const char **);
protected int tty_rawmode(EditLine *);
protected int tty_cookedmode(EditLine *);
protected int tty_quotemode(EditLine *);
@@ -471,7 +468,7 @@ protected void tty_bind_char(EditLine *, int);
typedef struct {
ttyperm_t t_t;
ttychar_t t_c;
- struct termios t_or, t_ex, t_ed, t_ts;
+ struct termios t_ex, t_ed, t_ts;
int t_tabs;
int t_eight;
speed_t t_speed;
diff --git a/lib/libedit/vi.c b/lib/libedit/vi.c
index dfd17e3..4826901 100644
--- a/lib/libedit/vi.c
+++ b/lib/libedit/vi.c
@@ -1,5 +1,3 @@
-/* $NetBSD: vi.c,v 1.45 2014/06/18 18:12:28 christos Exp $ */
-
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,20 +28,12 @@
* LIABILITY, OR TORT (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: vi.c,v 1.30 2009/02/21 23:31:56 christos Exp $
*/
-#include "config.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <limits.h>
-#include <sys/wait.h>
-
#if !defined(lint) && !defined(SCCSID)
-#if 0
static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: vi.c,v 1.45 2014/06/18 18:12:28 christos Exp $");
-#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -51,21 +41,23 @@ __FBSDID("$FreeBSD$");
/*
* vi.c: Vi mode commands.
*/
+#include <sys/wait.h>
+#include "sys.h"
#include "el.h"
-private el_action_t cv_action(EditLine *, Int);
-private el_action_t cv_paste(EditLine *, Int);
+private el_action_t cv_action(EditLine *, int);
+private el_action_t cv_paste(EditLine *, int);
/* cv_action():
* Handle vi actions.
*/
private el_action_t
-cv_action(EditLine *el, Int c)
+cv_action(EditLine *el, int c)
{
if (el->el_chared.c_vcmd.action != NOP) {
/* 'cc', 'dd' and (possibly) friends */
- if (c != (Int)el->el_chared.c_vcmd.action)
+ if (c != el->el_chared.c_vcmd.action)
return CC_ERROR;
if (!(c & YANK))
@@ -81,24 +73,24 @@ cv_action(EditLine *el, Int c)
if (c & INSERT)
el->el_map.current = el->el_map.key;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
el->el_chared.c_vcmd.pos = el->el_line.cursor;
el->el_chared.c_vcmd.action = c;
- return CC_ARGHACK;
+ return (CC_ARGHACK);
}
/* cv_paste():
* Paste previous deletion before or after the cursor
*/
private el_action_t
-cv_paste(EditLine *el, Int c)
+cv_paste(EditLine *el, int c)
{
c_kill_t *k = &el->el_chared.c_kill;
size_t len = (size_t)(k->last - k->buf);
if (k->buf == NULL || len == 0)
- return CC_ERROR;
+ return (CC_ERROR);
#ifdef DEBUG_PASTE
(void) fprintf(el->el_errfile, "Paste: \"%.*s\"\n", (int)len, k->buf);
#endif
@@ -110,11 +102,10 @@ cv_paste(EditLine *el, Int c)
c_insert(el, (int)len);
if (el->el_line.cursor + len > el->el_line.lastchar)
- return CC_ERROR;
- (void) memcpy(el->el_line.cursor, k->buf, len *
- sizeof(*el->el_line.cursor));
+ return (CC_ERROR);
+ (void) memcpy(el->el_line.cursor, k->buf, len);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -124,10 +115,10 @@ cv_paste(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_paste_next(EditLine *el, Int c __attribute__((__unused__)))
+vi_paste_next(EditLine *el, int c __unused)
{
- return cv_paste(el, 0);
+ return (cv_paste(el, 0));
}
@@ -137,10 +128,10 @@ vi_paste_next(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_paste_prev(EditLine *el, Int c __attribute__((__unused__)))
+vi_paste_prev(EditLine *el, int c __unused)
{
- return cv_paste(el, 1);
+ return (cv_paste(el, 1));
}
@@ -150,11 +141,11 @@ vi_paste_prev(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_prev_big_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_prev_big_word(EditLine *el, int c)
{
if (el->el_line.cursor == el->el_line.buffer)
- return CC_ERROR;
+ return (CC_ERROR);
el->el_line.cursor = cv_prev_word(el->el_line.cursor,
el->el_line.buffer,
@@ -163,9 +154,9 @@ vi_prev_big_word(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -175,11 +166,11 @@ vi_prev_big_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_prev_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_prev_word(EditLine *el, int c __unused)
{
if (el->el_line.cursor == el->el_line.buffer)
- return CC_ERROR;
+ return (CC_ERROR);
el->el_line.cursor = cv_prev_word(el->el_line.cursor,
el->el_line.buffer,
@@ -188,9 +179,9 @@ vi_prev_word(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -200,11 +191,11 @@ vi_prev_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_next_big_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_next_big_word(EditLine *el, int c)
{
if (el->el_line.cursor >= el->el_line.lastchar - 1)
- return CC_ERROR;
+ return (CC_ERROR);
el->el_line.cursor = cv_next_word(el, el->el_line.cursor,
el->el_line.lastchar, el->el_state.argument, cv__isWord);
@@ -212,9 +203,9 @@ vi_next_big_word(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_map.type == MAP_VI)
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -224,11 +215,11 @@ vi_next_big_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_next_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_next_word(EditLine *el, int c __unused)
{
if (el->el_line.cursor >= el->el_line.lastchar - 1)
- return CC_ERROR;
+ return (CC_ERROR);
el->el_line.cursor = cv_next_word(el, el->el_line.cursor,
el->el_line.lastchar, el->el_state.argument, cv__isword);
@@ -236,9 +227,9 @@ vi_next_word(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_map.type == MAP_VI)
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -247,20 +238,20 @@ vi_next_word(EditLine *el, Int c __attribute__((__unused__)))
* [~]
*/
protected el_action_t
-vi_change_case(EditLine *el, Int c)
+vi_change_case(EditLine *el, int c)
{
int i;
if (el->el_line.cursor >= el->el_line.lastchar)
- return CC_ERROR;
+ return (CC_ERROR);
cv_undo(el);
for (i = 0; i < el->el_state.argument; i++) {
- c = *el->el_line.cursor;
- if (Isupper(c))
- *el->el_line.cursor = Tolower(c);
- else if (Islower(c))
- *el->el_line.cursor = Toupper(c);
+ c = *(unsigned char *)el->el_line.cursor;
+ if (isupper(c))
+ *el->el_line.cursor = tolower(c);
+ else if (islower(c))
+ *el->el_line.cursor = toupper(c);
if (++el->el_line.cursor >= el->el_line.lastchar) {
el->el_line.cursor--;
@@ -279,14 +270,14 @@ vi_change_case(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_change_meta(EditLine *el, Int c __attribute__((__unused__)))
+vi_change_meta(EditLine *el, int c __unused)
{
/*
* Delete with insert == change: first we delete and then we leave in
* insert mode.
*/
- return cv_action(el, DELETE | INSERT);
+ return (cv_action(el, DELETE | INSERT));
}
@@ -296,13 +287,13 @@ vi_change_meta(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_insert_at_bol(EditLine *el, Int c __attribute__((__unused__)))
+vi_insert_at_bol(EditLine *el, int c __unused)
{
el->el_line.cursor = el->el_line.buffer;
cv_undo(el);
el->el_map.current = el->el_map.key;
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -312,7 +303,7 @@ vi_insert_at_bol(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_replace_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_replace_char(EditLine *el, int c __unused)
{
if (el->el_line.cursor >= el->el_line.lastchar)
@@ -321,7 +312,7 @@ vi_replace_char(EditLine *el, Int c __attribute__((__unused__)))
el->el_map.current = el->el_map.key;
el->el_state.inputmode = MODE_REPLACE_1;
cv_undo(el);
- return CC_ARGHACK;
+ return (CC_ARGHACK);
}
@@ -331,13 +322,13 @@ vi_replace_char(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_replace_mode(EditLine *el, Int c __attribute__((__unused__)))
+vi_replace_mode(EditLine *el, int c __unused)
{
el->el_map.current = el->el_map.key;
el->el_state.inputmode = MODE_REPLACE;
cv_undo(el);
- return CC_NORM;
+ return (CC_NORM);
}
@@ -347,12 +338,12 @@ vi_replace_mode(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_substitute_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_substitute_char(EditLine *el, int c __unused)
{
c_delafter(el, el->el_state.argument);
el->el_map.current = el->el_map.key;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -362,7 +353,7 @@ vi_substitute_char(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_substitute_line(EditLine *el, Int c __attribute__((__unused__)))
+vi_substitute_line(EditLine *el, int c __unused)
{
cv_undo(el);
@@ -370,7 +361,7 @@ vi_substitute_line(EditLine *el, Int c __attribute__((__unused__)))
(int)(el->el_line.lastchar - el->el_line.buffer));
(void) em_kill_line(el, 0);
el->el_map.current = el->el_map.key;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -380,7 +371,7 @@ vi_substitute_line(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_change_to_eol(EditLine *el, Int c __attribute__((__unused__)))
+vi_change_to_eol(EditLine *el, int c __unused)
{
cv_undo(el);
@@ -388,7 +379,7 @@ vi_change_to_eol(EditLine *el, Int c __attribute__((__unused__)))
(int)(el->el_line.lastchar - el->el_line.cursor));
(void) ed_kill_line(el, 0);
el->el_map.current = el->el_map.key;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -398,12 +389,12 @@ vi_change_to_eol(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_insert(EditLine *el, Int c __attribute__((__unused__)))
+vi_insert(EditLine *el, int c __unused)
{
el->el_map.current = el->el_map.key;
cv_undo(el);
- return CC_NORM;
+ return (CC_NORM);
}
@@ -413,7 +404,7 @@ vi_insert(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_add(EditLine *el, Int c __attribute__((__unused__)))
+vi_add(EditLine *el, int c __unused)
{
int ret;
@@ -428,7 +419,7 @@ vi_add(EditLine *el, Int c __attribute__((__unused__)))
cv_undo(el);
- return (el_action_t)ret;
+ return (ret);
}
@@ -438,13 +429,13 @@ vi_add(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_add_at_eol(EditLine *el, Int c __attribute__((__unused__)))
+vi_add_at_eol(EditLine *el, int c __unused)
{
el->el_map.current = el->el_map.key;
el->el_line.cursor = el->el_line.lastchar;
cv_undo(el);
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -454,10 +445,10 @@ vi_add_at_eol(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_delete_meta(EditLine *el, Int c __attribute__((__unused__)))
+vi_delete_meta(EditLine *el, int c __unused)
{
- return cv_action(el, DELETE);
+ return (cv_action(el, DELETE));
}
@@ -467,11 +458,11 @@ vi_delete_meta(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_end_big_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_end_big_word(EditLine *el, int c)
{
if (el->el_line.cursor == el->el_line.lastchar)
- return CC_ERROR;
+ return (CC_ERROR);
el->el_line.cursor = cv__endword(el->el_line.cursor,
el->el_line.lastchar, el->el_state.argument, cv__isWord);
@@ -479,9 +470,9 @@ vi_end_big_word(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_chared.c_vcmd.action != NOP) {
el->el_line.cursor++;
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -491,11 +482,11 @@ vi_end_big_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_end_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_end_word(EditLine *el, int c __unused)
{
if (el->el_line.cursor == el->el_line.lastchar)
- return CC_ERROR;
+ return (CC_ERROR);
el->el_line.cursor = cv__endword(el->el_line.cursor,
el->el_line.lastchar, el->el_state.argument, cv__isword);
@@ -503,9 +494,9 @@ vi_end_word(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_chared.c_vcmd.action != NOP) {
el->el_line.cursor++;
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -515,7 +506,7 @@ vi_end_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_undo(EditLine *el, Int c __attribute__((__unused__)))
+vi_undo(EditLine *el, int c __unused)
{
c_undo_t un = el->el_chared.c_undo;
@@ -532,7 +523,7 @@ vi_undo(EditLine *el, Int c __attribute__((__unused__)))
el->el_line.cursor = un.buf + un.cursor;
el->el_line.lastchar = un.buf + un.len;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -542,7 +533,7 @@ vi_undo(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_command_mode(EditLine *el, Int c __attribute__((__unused__)))
+vi_command_mode(EditLine *el, int c __unused)
{
/* [Esc] cancels pending action */
@@ -557,7 +548,7 @@ vi_command_mode(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_line.cursor > el->el_line.buffer)
el->el_line.cursor--;
#endif
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -566,7 +557,7 @@ vi_command_mode(EditLine *el, Int c __attribute__((__unused__)))
* [0]
*/
protected el_action_t
-vi_zero(EditLine *el, Int c)
+vi_zero(EditLine *el, int c)
{
if (el->el_state.doingarg)
@@ -575,9 +566,9 @@ vi_zero(EditLine *el, Int c)
el->el_line.cursor = el->el_line.buffer;
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
@@ -587,15 +578,15 @@ vi_zero(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_delete_prev_char(EditLine *el, int c __unused)
{
if (el->el_line.cursor <= el->el_line.buffer)
- return CC_ERROR;
+ return (CC_ERROR);
c_delbefore1(el);
el->el_line.cursor--;
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -605,32 +596,32 @@ vi_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_list_or_eof(EditLine *el, Int c)
+vi_list_or_eof(EditLine *el, int c)
{
if (el->el_line.cursor == el->el_line.lastchar) {
if (el->el_line.cursor == el->el_line.buffer) {
- terminal_writec(el, c); /* then do a EOF */
- return CC_EOF;
+ term_writec(el, c); /* then do a EOF */
+ return (CC_EOF);
} else {
/*
* Here we could list completions, but it is an
* error right now
*/
- terminal_beep(el);
- return CC_ERROR;
+ term_beep(el);
+ return (CC_ERROR);
}
} else {
#ifdef notyet
re_goto_bottom(el);
*el->el_line.lastchar = '\0'; /* just in case */
- return CC_LIST_CHOICES;
+ return (CC_LIST_CHOICES);
#else
/*
* Just complain for now.
*/
- terminal_beep(el);
- return CC_ERROR;
+ term_beep(el);
+ return (CC_ERROR);
#endif
}
}
@@ -642,9 +633,9 @@ vi_list_or_eof(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_kill_line_prev(EditLine *el, Int c __attribute__((__unused__)))
+vi_kill_line_prev(EditLine *el, int c __unused)
{
- Char *kp, *cp;
+ char *kp, *cp;
cp = el->el_line.buffer;
kp = el->el_chared.c_kill.buf;
@@ -653,7 +644,7 @@ vi_kill_line_prev(EditLine *el, Int c __attribute__((__unused__)))
el->el_chared.c_kill.last = kp;
c_delbefore(el, (int)(el->el_line.cursor - el->el_line.buffer));
el->el_line.cursor = el->el_line.buffer; /* zap! */
- return CC_REFRESH;
+ return (CC_REFRESH);
}
@@ -663,10 +654,10 @@ vi_kill_line_prev(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_search_prev(EditLine *el, Int c __attribute__((__unused__)))
+vi_search_prev(EditLine *el, int c __unused)
{
- return cv_search(el, ED_SEARCH_PREV_HISTORY);
+ return (cv_search(el, ED_SEARCH_PREV_HISTORY));
}
@@ -676,10 +667,10 @@ vi_search_prev(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_search_next(EditLine *el, Int c __attribute__((__unused__)))
+vi_search_next(EditLine *el, int c __unused)
{
- return cv_search(el, ED_SEARCH_NEXT_HISTORY);
+ return (cv_search(el, ED_SEARCH_NEXT_HISTORY));
}
@@ -689,13 +680,13 @@ vi_search_next(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_repeat_search_next(EditLine *el, Int c __attribute__((__unused__)))
+vi_repeat_search_next(EditLine *el, int c __unused)
{
if (el->el_search.patlen == 0)
- return CC_ERROR;
+ return (CC_ERROR);
else
- return cv_repeat_srch(el, el->el_search.patdir);
+ return (cv_repeat_srch(el, el->el_search.patdir));
}
@@ -705,11 +696,11 @@ vi_repeat_search_next(EditLine *el, Int c __attribute__((__unused__)))
*/
/*ARGSUSED*/
protected el_action_t
-vi_repeat_search_prev(EditLine *el, Int c __attribute__((__unused__)))
+vi_repeat_search_prev(EditLine *el, int c __unused)
{
if (el->el_search.patlen == 0)
- return CC_ERROR;
+ return (CC_ERROR);
else
return (cv_repeat_srch(el,
el->el_search.patdir == ED_SEARCH_PREV_HISTORY ?
@@ -723,7 +714,7 @@ vi_repeat_search_prev(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_next_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_next_char(EditLine *el, int c __unused)
{
return cv_csearch(el, CHAR_FWD, -1, el->el_state.argument, 0);
}
@@ -735,7 +726,7 @@ vi_next_char(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_prev_char(EditLine *el, int c __unused)
{
return cv_csearch(el, CHAR_BACK, -1, el->el_state.argument, 0);
}
@@ -747,7 +738,7 @@ vi_prev_char(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_next_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_to_next_char(EditLine *el, int c __unused)
{
return cv_csearch(el, CHAR_FWD, -1, el->el_state.argument, 1);
}
@@ -759,7 +750,7 @@ vi_to_next_char(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_to_prev_char(EditLine *el, int c __unused)
{
return cv_csearch(el, CHAR_BACK, -1, el->el_state.argument, 1);
}
@@ -771,7 +762,7 @@ vi_to_prev_char(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_repeat_next_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_repeat_next_char(EditLine *el, int c __unused)
{
return cv_csearch(el, el->el_search.chadir, el->el_search.chacha,
@@ -785,7 +776,7 @@ vi_repeat_next_char(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_repeat_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_repeat_prev_char(EditLine *el, int c __unused)
{
el_action_t r;
int dir = el->el_search.chadir;
@@ -803,20 +794,20 @@ vi_repeat_prev_char(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_match(EditLine *el, Int c __attribute__((__unused__)))
+vi_match(EditLine *el, int c)
{
- const Char match_chars[] = STR("()[]{}");
- Char *cp;
+ const char match_chars[] = "()[]{}";
+ char *cp;
size_t delta, i, count;
- Char o_ch, c_ch;
+ char o_ch, c_ch;
*el->el_line.lastchar = '\0'; /* just in case */
- i = Strcspn(el->el_line.cursor, match_chars);
+ i = strcspn(el->el_line.cursor, match_chars);
o_ch = el->el_line.cursor[i];
if (o_ch == 0)
return CC_ERROR;
- delta = (size_t)(Strchr(match_chars, o_ch) - match_chars);
+ delta = strchr(match_chars, o_ch) - match_chars;
c_ch = match_chars[delta ^ 1];
count = 1;
delta = 1 - (delta & 1) * 2;
@@ -839,9 +830,9 @@ vi_match(EditLine *el, Int c __attribute__((__unused__)))
if (delta > 0)
el->el_line.cursor++;
cv_delfini(el);
- return CC_REFRESH;
+ return (CC_REFRESH);
}
- return CC_CURSOR;
+ return (CC_CURSOR);
}
/* vi_undo_line():
@@ -850,7 +841,7 @@ vi_match(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_undo_line(EditLine *el, Int c __attribute__((__unused__)))
+vi_undo_line(EditLine *el, int c)
{
cv_undo(el);
@@ -864,7 +855,7 @@ vi_undo_line(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_column(EditLine *el, Int c __attribute__((__unused__)))
+vi_to_column(EditLine *el, int c)
{
el->el_line.cursor = el->el_line.buffer;
@@ -878,7 +869,7 @@ vi_to_column(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_yank_end(EditLine *el, Int c __attribute__((__unused__)))
+vi_yank_end(EditLine *el, int c)
{
cv_yank(el, el->el_line.cursor,
@@ -892,7 +883,7 @@ vi_yank_end(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_yank(EditLine *el, Int c __attribute__((__unused__)))
+vi_yank(EditLine *el, int c)
{
return cv_action(el, YANK);
@@ -904,7 +895,7 @@ vi_yank(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_comment_out(EditLine *el, Int c __attribute__((__unused__)))
+vi_comment_out(EditLine *el, int c)
{
el->el_line.cursor = el->el_line.buffer;
@@ -922,24 +913,30 @@ vi_comment_out(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_alias(EditLine *el, Int c __attribute__((__unused__)))
+vi_alias(EditLine *el, int c)
{
+#ifdef __weak_extern
char alias_name[3];
- const char *alias_text;
+ char *alias_text;
+ extern char *get_alias_text(const char *);
+ __weak_extern(get_alias_text);
- if (el->el_chared.c_aliasfun == NULL)
+ if (get_alias_text == 0) {
return CC_ERROR;
+ }
alias_name[0] = '_';
alias_name[2] = 0;
if (el_getc(el, &alias_name[1]) != 1)
return CC_ERROR;
- alias_text = (*el->el_chared.c_aliasfun)(el->el_chared.c_aliasarg,
- alias_name);
+ alias_text = get_alias_text(alias_name);
if (alias_text != NULL)
- FUN(el,push)(el, ct_decode_string(alias_text, &el->el_scratch));
+ el_push(el, alias_text);
return CC_NORM;
+#else
+ return CC_ERROR;
+#endif
}
/* vi_to_history_line():
@@ -948,14 +945,14 @@ vi_alias(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_history_line(EditLine *el, Int c __attribute__((__unused__)))
+vi_to_history_line(EditLine *el, int c)
{
int sv_event_no = el->el_history.eventno;
el_action_t rval;
if (el->el_history.eventno == 0) {
- (void) Strncpy(el->el_history.buf, el->el_line.buffer,
+ (void) strncpy(el->el_history.buf, el->el_line.buffer,
EL_BUFSIZ);
el->el_history.last = el->el_history.buf +
(el->el_line.lastchar - el->el_line.buffer);
@@ -993,16 +990,14 @@ vi_to_history_line(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_histedit(EditLine *el, Int c __attribute__((__unused__)))
+vi_histedit(EditLine *el, int c)
{
int fd;
pid_t pid;
ssize_t st;
int status;
char tempfile[] = "/tmp/histedit.XXXXXXXXXX";
- char *cp = NULL;
- size_t len;
- Char *line = NULL;
+ char *cp;
if (el->el_state.doingarg) {
if (vi_to_history_line(el, 0) == CC_ERROR)
@@ -1012,25 +1007,15 @@ vi_histedit(EditLine *el, Int c __attribute__((__unused__)))
fd = mkstemp(tempfile);
if (fd < 0)
return CC_ERROR;
- len = (size_t)(el->el_line.lastchar - el->el_line.buffer);
-#define TMP_BUFSIZ (EL_BUFSIZ * MB_LEN_MAX)
- cp = el_malloc(TMP_BUFSIZ * sizeof(*cp));
- if (cp == NULL)
- goto error;
- line = el_malloc(len * sizeof(*line) + 1);
- if (line == NULL)
- goto error;
- Strncpy(line, el->el_line.buffer, len);
- line[len] = '\0';
- ct_wcstombs(cp, line, TMP_BUFSIZ - 1);
- cp[TMP_BUFSIZ - 1] = '\0';
- len = strlen(cp);
- write(fd, cp, len);
- write(fd, "\n", (size_t)1);
+ cp = el->el_line.buffer;
+ write(fd, cp, (size_t)(el->el_line.lastchar - cp));
+ write(fd, "\n", 1);
pid = fork();
switch (pid) {
case -1:
- goto error;
+ close(fd);
+ unlink(tempfile);
+ return CC_ERROR;
case 0:
close(fd);
execlp("vi", "vi", tempfile, (char *)NULL);
@@ -1040,20 +1025,11 @@ vi_histedit(EditLine *el, Int c __attribute__((__unused__)))
while (waitpid(pid, &status, 0) != pid)
continue;
lseek(fd, (off_t)0, SEEK_SET);
- st = read(fd, cp, TMP_BUFSIZ);
- if (st > 0) {
- len = (size_t)(el->el_line.lastchar -
- el->el_line.buffer);
- len = ct_mbstowcs(el->el_line.buffer, cp, len);
- if (len > 0 && el->el_line.buffer[len -1] == '\n')
- --len;
- }
- else
- len = 0;
- el->el_line.cursor = el->el_line.buffer;
- el->el_line.lastchar = el->el_line.buffer + len;
- el_free(cp);
- el_free(line);
+ st = read(fd, cp, (size_t)(el->el_line.limit - cp));
+ if (st > 0 && cp[st - 1] == '\n')
+ st--;
+ el->el_line.cursor = cp;
+ el->el_line.lastchar = cp + st;
break;
}
@@ -1061,12 +1037,6 @@ vi_histedit(EditLine *el, Int c __attribute__((__unused__)))
unlink(tempfile);
/* return CC_REFRESH; */
return ed_newline(el, 0);
-error:
- el_free(line);
- el_free(cp);
- close(fd);
- unlink(tempfile);
- return CC_ERROR;
}
/* vi_history_word():
@@ -1077,29 +1047,28 @@ error:
*/
protected el_action_t
/*ARGSUSED*/
-vi_history_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_history_word(EditLine *el, int c)
{
- const Char *wp = HIST_FIRST(el);
- const Char *wep, *wsp;
+ const char *wp = HIST_FIRST(el);
+ const char *wep, *wsp;
int len;
- Char *cp;
- const Char *lim;
+ char *cp;
+ const char *lim;
if (wp == NULL)
return CC_ERROR;
wep = wsp = 0;
do {
- while (Isspace(*wp))
+ while (isspace((unsigned char)*wp))
wp++;
if (*wp == 0)
break;
wsp = wp;
- while (*wp && !Isspace(*wp))
+ while (*wp && !isspace((unsigned char)*wp))
wp++;
wep = wp;
- } while ((!el->el_state.doingarg || --el->el_state.argument > 0)
- && *wp != 0);
+ } while ((!el->el_state.doingarg || --el->el_state.argument > 0) && *wp != 0);
if (wsp == 0 || (el->el_state.doingarg && el->el_state.argument != 0))
return CC_ERROR;
@@ -1127,7 +1096,7 @@ vi_history_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_redo(EditLine *el, Int c __attribute__((__unused__)))
+vi_redo(EditLine *el, int c)
{
c_redo_t *r = &el->el_chared.c_redo;
@@ -1143,10 +1112,10 @@ vi_redo(EditLine *el, Int c __attribute__((__unused__)))
/* sanity */
r->pos = r->lim - 1;
r->pos[0] = 0;
- FUN(el,push)(el, r->buf);
+ el_push(el, r->buf);
}
el->el_state.thiscmd = r->cmd;
el->el_state.thisch = r->ch;
- return (*el->el_map.func[r->cmd])(el, r->ch);
+ return (*el->el_map.func[r->cmd])(el, r->ch);
}
diff --git a/lib/libelf/Makefile.depend b/lib/libelf/Makefile.depend
new file mode 100644
index 0000000..b2c79ae
--- /dev/null
+++ b/lib/libelf/Makefile.depend
@@ -0,0 +1,29 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+libelf_convert.So: libelf_convert.c
+libelf_convert.o: libelf_convert.c
+libelf_convert.po: libelf_convert.c
+libelf_fsize.So: libelf_fsize.c
+libelf_fsize.o: libelf_fsize.c
+libelf_fsize.po: libelf_fsize.c
+libelf_msize.So: libelf_msize.c
+libelf_msize.o: libelf_msize.c
+libelf_msize.po: libelf_msize.c
+.endif
diff --git a/lib/libelftc/Makefile b/lib/libelftc/Makefile
deleted file mode 100644
index ccae1a5..0000000
--- a/lib/libelftc/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-# $FreeBSD$
-.include <bsd.own.mk>
-
-INTERNALLIB=
-
-ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain
-
-.PATH: ${ELFTCDIR}/libelftc
-
-LIB= elftc
-
-SRCS= elftc_bfdtarget.c \
- elftc_copyfile.c \
- elftc_demangle.c \
- elftc_set_timestamps.c \
- elftc_string_table.c \
- elftc_version.c \
- libelftc_bfdtarget.c \
- libelftc_dem_arm.c \
- libelftc_dem_gnu2.c \
- libelftc_dem_gnu3.c \
- libelftc_hash.c \
- libelftc_vstr.c
-
-INCS= libelftc.h
-CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
-
-NO_MAN= yes
-
-.include <bsd.lib.mk>
diff --git a/lib/libelftc/elftc_version.c b/lib/libelftc/elftc_version.c
deleted file mode 100644
index fb0a731..0000000
--- a/lib/libelftc/elftc_version.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $FreeBSD$ */
-
-#include <sys/types.h>
-#include <libelftc.h>
-
-const char *
-elftc_version(void)
-{
- return "elftoolchain r3197M";
-}
diff --git a/lib/libevent/Makefile b/lib/libevent/Makefile
index 1d20bcd..d8b1e20 100644
--- a/lib/libevent/Makefile
+++ b/lib/libevent/Makefile
@@ -7,6 +7,7 @@
LIB= event
SHLIB_MAJOR= 1
PRIVATELIB=
+INTERNALLIB=
SRCS= buffer.c evbuffer.c event.c kqueue.c log.c poll.c select.c signal.c
HDRS= event.h
diff --git a/lib/libevent/Makefile.depend b/lib/libevent/Makefile.depend
new file mode 100644
index 0000000..639d45d
--- /dev/null
+++ b/lib/libevent/Makefile.depend
@@ -0,0 +1,14 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libexecinfo/Makefile b/lib/libexecinfo/Makefile
index 5f9aac5..81fa82a 100644
--- a/lib/libexecinfo/Makefile
+++ b/lib/libexecinfo/Makefile
@@ -10,7 +10,8 @@ SHLIB_MAJOR= 1
INCS= execinfo.h
SRCS= backtrace.c symtab.c unwind.c
-LIBADD= elf
+DPADD= ${LIBELF}
+LDADD= -lelf
MAN= backtrace.3
diff --git a/lib/libexecinfo/Makefile.depend b/lib/libexecinfo/Makefile.depend
new file mode 100644
index 0000000..f8f5a36
--- /dev/null
+++ b/lib/libexecinfo/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libelf \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libexpat/Makefile b/lib/libexpat/Makefile
index 0d4bef5..523a74e 100644
--- a/lib/libexpat/Makefile
+++ b/lib/libexpat/Makefile
@@ -28,6 +28,6 @@ bsdxml.h: expat.h
> ${.TARGET}
bsdxml_external.h: expat_external.h
- ${CP} ${.ALLSRC} ${.TARGET}
+ cp -f ${.ALLSRC} ${.TARGET}
.include <bsd.lib.mk>
diff --git a/lib/libexpat/Makefile.depend b/lib/libexpat/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libexpat/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libfetch/Makefile b/lib/libfetch/Makefile
index 4f56552..cef5f5a 100644
--- a/lib/libfetch/Makefile
+++ b/lib/libfetch/Makefile
@@ -16,9 +16,11 @@ CFLAGS+= -DINET6
.if ${MK_OPENSSL} != "no"
CFLAGS+= -DWITH_SSL
-LIBADD+= ssl crypto
+DPADD= ${LIBSSL} ${LIBCRYPTO}
+LDADD= -lssl -lcrypto
.else
-LIBADD+= md
+DPADD= ${LIBMD}
+LDADD= -lmd
.endif
CFLAGS+= -DFTP_COMBINE_CWDS
diff --git a/lib/libfetch/Makefile.depend b/lib/libfetch/Makefile.depend
new file mode 100644
index 0000000..4bedb02
--- /dev/null
+++ b/lib/libfetch/Makefile.depend
@@ -0,0 +1,29 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ secure/lib/libcrypto \
+ secure/lib/libssl \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ftp.So: ftperr.h
+ftp.o: ftperr.h
+ftp.po: ftperr.h
+http.So: httperr.h
+http.o: httperr.h
+http.po: httperr.h
+.endif
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index 3095e06..eabea2b 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -672,7 +672,9 @@ fetch_ssl_setup_transport_layer(SSL_CTX *ctx, int verbose)
{
long ssl_ctx_options;
- ssl_ctx_options = SSL_OP_ALL | SSL_OP_NO_SSLv2 | SSL_OP_NO_TICKET;
+ ssl_ctx_options = SSL_OP_ALL | SSL_OP_NO_TICKET;
+ if (getenv("SSL_ALLOW_SSL2") == NULL)
+ ssl_ctx_options |= SSL_OP_NO_SSLv2;
if (getenv("SSL_ALLOW_SSL3") == NULL)
ssl_ctx_options |= SSL_OP_NO_SSLv3;
if (getenv("SSL_NO_TLS1") != NULL)
diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3
index 53a4e42..5b9f0db 100644
--- a/lib/libfetch/fetch.3
+++ b/lib/libfetch/fetch.3
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 25, 2015
+.Dd October 15, 2014
.Dt FETCH 3
.Os
.Sh NAME
@@ -441,8 +441,10 @@ By default
allows TLSv1 and newer when negotiating the connecting with the remote
peer.
You can change this behavior by setting the
+.Ev SSL_ALLOW_SSL2
+and
.Ev SSL_ALLOW_SSL3
-environment variable to allow SSLv3 and
+environment variables to allow SSLv2 and SSLv3, respectively, and
.Ev SSL_NO_TLS1 ,
.Ev SSL_NO_TLS1_1 and
.Ev SSL_NO_TLS1_2
@@ -644,6 +646,8 @@ which proxies should not be used.
Same as
.Ev NO_PROXY ,
for compatibility.
+.It Ev SSL_ALLOW_SSL2
+Allow SSL version 2 when negotiating the connection (not recommended).
.It Ev SSL_ALLOW_SSL3
Allow SSL version 3 when negotiating the connection (not recommended).
.It Ev SSL_CA_CERT_FILE
diff --git a/lib/libgeom/Makefile b/lib/libgeom/Makefile
index 20b7a4c..b19faf6 100644
--- a/lib/libgeom/Makefile
+++ b/lib/libgeom/Makefile
@@ -13,7 +13,8 @@ CFLAGS += -I${.CURDIR}
WARNS?= 3
-LIBADD+= bsdxml sbuf
+DPADD= ${LIBBSDXML} ${LIBSBUF}
+LDADD= -lbsdxml -lsbuf
MAN= libgeom.3
diff --git a/lib/libgeom/Makefile.depend b/lib/libgeom/Makefile.depend
new file mode 100644
index 0000000..acc7f35
--- /dev/null
+++ b/lib/libgeom/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libexpat \
+ lib/libsbuf \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libgeom/geom_xml2tree.c b/lib/libgeom/geom_xml2tree.c
index 2c23361..2874cd0 100644
--- a/lib/libgeom/geom_xml2tree.c
+++ b/lib/libgeom/geom_xml2tree.c
@@ -186,7 +186,6 @@ static void
EndElement(void *userData, const char *name)
{
struct mystate *mt;
- struct gconf *c;
struct gconfig *gc;
char *p;
@@ -257,18 +256,10 @@ EndElement(void *userData, const char *name)
if (!strcmp(name, "config")) {
mt->config = NULL;
- free(p);
return;
}
- if (mt->config != NULL || (!strcmp(name, "wither") &&
- (mt->provider != NULL || mt->geom != NULL))) {
- if (mt->config != NULL)
- c = mt->config;
- else if (mt->provider != NULL)
- c = &mt->provider->lg_config;
- else
- c = &mt->geom->lg_config;
+ if (mt->config != NULL) {
gc = calloc(1, sizeof *gc);
if (gc == NULL) {
mt->error = errno;
@@ -279,15 +270,14 @@ EndElement(void *userData, const char *name)
}
gc->lg_name = strdup(name);
if (gc->lg_name == NULL) {
- free(gc);
mt->error = errno;
XML_StopParser(mt->parser, 0);
warn("Cannot allocate memory during processing of '%s' "
"element", name);
return;
}
- gc->lg_val = p ? p : strdup("1");
- LIST_INSERT_HEAD(c, gc, lg_config);
+ gc->lg_val = p;
+ LIST_INSERT_HEAD(mt->config, gc, lg_config);
return;
}
diff --git a/lib/libgpib/Makefile.depend b/lib/libgpib/Makefile.depend
new file mode 100644
index 0000000..7cedd5f
--- /dev/null
+++ b/lib/libgpib/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libgpio/Makefile b/lib/libgpio/Makefile
deleted file mode 100644
index 4393c79..0000000
--- a/lib/libgpio/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-# $FreeBSD$
-
-LIB= gpio
-SHLIB_MAJOR= 0
-
-SRCS= gpio.c
-INCS= libgpio.h
-MAN+= gpio.3
-
-CFLAGS+= -I${.CURDIR}
-
-MLINKS= gpio.3 gpio_open.3 \
- gpio.3 gpio_open_device.3 \
- gpio.3 gpio_close.3 \
- gpio.3 gpio_pin_list.3 \
- gpio.3 gpio_pin_config.3 \
- gpio.3 gpio_pin_set_flags.3 \
- gpio.3 gpio_pin_set_name.3 \
- gpio.3 gpio_pin_get.3 \
- gpio.3 gpio_pin_set.3 \
- gpio.3 gpio_pin_low.3 \
- gpio.3 gpio_pin_high.3 \
- gpio.3 gpio_pin_input.3 \
- gpio.3 gpio_pin_output.3 \
- gpio.3 gpio_pin_opendrain.3 \
- gpio.3 gpio_pin_pushpull.3 \
- gpio.3 gpio_pin_tristate.3 \
- gpio.3 gpio_pin_pullup.3 \
- gpio.3 gpio_pin_pulldown.3 \
- gpio.3 gpio_pin_invin.3 \
- gpio.3 gpio_pin_invout.3 \
- gpio.3 gpio_pin_pulsate.3
-
-WARNS?= 6
-
-.include <bsd.lib.mk>
diff --git a/lib/libgpio/gpio.3 b/lib/libgpio/gpio.3
deleted file mode 100644
index 70f6b38..0000000
--- a/lib/libgpio/gpio.3
+++ /dev/null
@@ -1,198 +0,0 @@
-.\"
-.\" Copyright (c) 2014 Rui Paulo
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must 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 8, 2015
-.Dt GPIO 3
-.Os
-.Sh NAME
-.Nm gpio_open ,
-.Nm gpio_close
-.Nd "library to handle GPIO pins"
-.Sh LIBRARY
-.Lb libgpio
-.Sh SYNOPSIS
-.In libgpio.h
-.Ft "gpio_handle_t"
-.Fn gpio_open "unsigned int unit"
-.Ft "gpio_handle_t"
-.Fn gpio_open_device "const char *device"
-.Ft void
-.Fn gpio_close "gpio_handle_t handle"
-.Ft int
-.Fn gpio_pin_list "gpio_handle_t handle" "gpio_config_t **pcfgs"
-.Ft int
-.Fn gpio_pin_config "gpio_handle_t handle" "gpio_config_t *cfg"
-.Ft int
-.Fn gpio_pin_set_name "gpio_handle_t handle" "gpio_pin_t pin" "char *name"
-.Ft int
-.Fn gpio_pin_set_flags "gpio_handle_t handle" "gpio_config_t *cfg"
-.Ft gpio_value_t
-.Fn gpio_pin_get "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_set "gpio_handle_t handle" "gpio_pin_t pin" "gpio_value_t value"
-.Ft int
-.Fn gpio_pin_toggle "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_low "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_high "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_input "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_output "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_opendrain "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_pushpull "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_tristate "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_pullup "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_pulldown "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_invin "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_invout "gpio_handle_t handle" "gpio_pin_t pin"
-.Ft int
-.Fn gpio_pin_pulsate "gpio_handle_t handle" "gpio_pin_t pin"
-.Sh DESCRIPTION
-The
-.Nm libgpio
-library provides an interface to configure GPIO pins.
-The library operates with a
-.Ft gpio_handle_t
-opaque type which can be created with
-.Fn gpio_open
-or
-.Fn gpio_open_device .
-When no more GPIO operations are needed, this handle can be destroyed
-with
-.Fn gpio_close .
-.Pp
-To get a list of all available pins, one can call
-.Fn gpio_pin_list .
-This function takes a pointer to a
-.Ft gpio_config_t
-which is dynamically allocated.
-This pointer should be freed with
-.Xr free 3
-when it is no longer necessary.
-.Pp
-The function
-.Fn gpio_pin_config
-retrieves the current configuration of a pin.
-The pin number should be passed in via the
-.Ft g_pin
-variable which is part of the
-.Ft gpio_config_t
-structure.
-.Pp
-The function
-.Fn gpio_pin_set_name
-sets the name used to describe a pin.
-.Pp
-The function
-.Fn gpio_pin_set_flags
-configures a pin with the flags passed in by the
-.Ft gpio_config_t
-structure.
-The pin number should also be passed in through the
-.Ft g_pin
-variable.
-All other structure members will be ignored by this function.
-The list of flags can be found in
-.Pa /usr/include/sys/gpio.h .
-.Pp
-The get or set the state of a GPIO pin, the functions
-.Fn gpio_pin_get
-and
-.Fn gpio_pin_set
-are available, respectively.
-To toggle the state, use
-.Fn gpio_pin_toggle .
-.Pp
-The functions
-.Fn gpio_pin_low
-and
-.Fn gpio_pin_high
-are wrappers around
-.Fn gpio_pin_set .
-.Pp
-The functions
-.Fn gpio_pin_input ,
-.Fn gpio_pin_output ,
-.Fn gpio_pin_opendrain ,
-.Fn gpio_pin_pushpull ,
-.Fn gpio_pin_tristate ,
-.Fn gpio_pin_pullup ,
-.Fn gpio_pin_pulldown ,
-.Fn gpio_pin_invin ,
-.Fn gpio_pin_invout
-and
-.Fn gpio_pin_pulsate
-are wrappers around
-.Fn gpio_pin_set_flags .
-.Sh EXAMPLES
-The following example shows how to configure pin 16 as output and then
-drive it high:
-.Bd -literal
-#include <err.h>
-#include <libgpio.h>
-
-gpio_handle_t handle;
-
-handle = gpio_open(0);
-if (handle == GPIO_HANDLE_INVALID)
- err(1, "gpio_open failed");
-gpio_pin_output(handle, 16);
-gpio_pin_high(handle, 16);
-gpio_close(handle);
-.Ed
-.Pp
-The following example shows how to get a configuration of a pin:
-.Bd -literal
-gpio_config_t cfg;
-
-cfg.g_pin = 32;
-gpio_pin_config(handle, &cfg);
-.Ed
-.Pp
-The structure will contain the name of the pin and its flags.
-.Sh SEE ALSO
-.Xr gpiobus 4 ,
-.Xr gpioctl 8
-.Sh HISTORY
-The
-.Nm libgpio
-library first appeared in
-.Fx 11.0 .
-.Sh AUTHORS
-The
-.Nm libgpio
-library was implemented by
-.An Rui Paulo Aq Mt rpaulo@FreeBSD.org .
diff --git a/lib/libgpio/gpio.c b/lib/libgpio/gpio.c
deleted file mode 100644
index 7ec0955..0000000
--- a/lib/libgpio/gpio.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/*-
- * Copyright (c) 2013-2014 Rui Paulo <rpaulo@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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$
- */
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/ioctl.h>
-#include <sys/types.h>
-
-#include <libgpio.h>
-
-gpio_handle_t
-gpio_open(unsigned int unit)
-{
- char device[16];
-
- snprintf(device, sizeof(device), "/dev/gpioc%u", unit);
-
- return (gpio_open_device(device));
-}
-
-gpio_handle_t
-gpio_open_device(const char *device)
-{
- int fd, maxpins;
- int serr;
-
- fd = open(device, O_RDONLY);
- if (fd < 0)
- return (GPIO_INVALID_HANDLE);
- /*
- * Check whether a simple ioctl works.
- */
- if (ioctl(fd, GPIOMAXPIN, &maxpins) < 0) {
- serr = errno;
- close(fd);
- errno = serr;
- return (GPIO_INVALID_HANDLE);
- }
-
- return (fd);
-}
-
-void
-gpio_close(gpio_handle_t handle)
-{
- close(handle);
-}
-
-int
-gpio_pin_list(gpio_handle_t handle, gpio_config_t **pcfgs)
-{
- int maxpins, i;
- gpio_config_t *cfgs;
-
- *pcfgs = NULL;
- if (ioctl(handle, GPIOMAXPIN, &maxpins) < 0)
- return (-1);
- /* Reasonable values. */
- if (maxpins < 0 || maxpins > 4096) {
- errno = EINVAL;
- return (-1);
- }
- cfgs = calloc(maxpins + 1, sizeof(*cfgs));
- if (cfgs == NULL)
- return (-1);
- for (i = 0; i <= maxpins; i++) {
- cfgs[i].g_pin = i;
- gpio_pin_config(handle, &cfgs[i]);
- }
- *pcfgs = cfgs;
-
- return (maxpins);
-}
-
-int
-gpio_pin_config(gpio_handle_t handle, gpio_config_t *cfg)
-{
- struct gpio_pin gppin;
-
- if (cfg == NULL)
- return (-1);
- gppin.gp_pin = cfg->g_pin;
- if (ioctl(handle, GPIOGETCONFIG, &gppin) < 0)
- return (-1);
- strlcpy(cfg->g_name, gppin.gp_name, GPIOMAXNAME);
- cfg->g_caps = gppin.gp_caps;
- cfg->g_flags = gppin.gp_flags;
-
- return (0);
-}
-
-int
-gpio_pin_set_name(gpio_handle_t handle, gpio_pin_t pin, char *name)
-{
- struct gpio_pin gppin;
-
- if (name == NULL)
- return (-1);
- bzero(&gppin, sizeof(gppin));
- gppin.gp_pin = pin;
- strlcpy(gppin.gp_name, name, GPIOMAXNAME);
- if (ioctl(handle, GPIOSETNAME, &gppin) < 0)
- return (-1);
-
- return (0);
-}
-
-int
-gpio_pin_set_flags(gpio_handle_t handle, gpio_config_t *cfg)
-{
- struct gpio_pin gppin;
-
- if (cfg == NULL)
- return (-1);
- gppin.gp_pin = cfg->g_pin;
- gppin.gp_flags = cfg->g_flags;
- if (ioctl(handle, GPIOSETCONFIG, &gppin) < 0)
- return (-1);
-
- return (0);
-}
-
-gpio_value_t
-gpio_pin_get(gpio_handle_t handle, gpio_pin_t pin)
-{
- struct gpio_req gpreq;
-
- bzero(&gpreq, sizeof(gpreq));
- gpreq.gp_pin = pin;
- if (ioctl(handle, GPIOGET, &gpreq) < 0)
- return (GPIO_VALUE_INVALID);
-
- return (gpreq.gp_value);
-}
-
-int
-gpio_pin_set(gpio_handle_t handle, gpio_pin_t pin, gpio_value_t value)
-{
- struct gpio_req gpreq;
-
- if (value == GPIO_VALUE_INVALID)
- return (-1);
- bzero(&gpreq, sizeof(gpreq));
- gpreq.gp_pin = pin;
- gpreq.gp_value = value;
- if (ioctl(handle, GPIOSET, &gpreq) < 0)
- return (-1);
-
- return (0);
-}
-
-int
-gpio_pin_toggle(gpio_handle_t handle, gpio_pin_t pin)
-{
- gpio_value_t value;
-
- value = gpio_pin_get(handle, pin);
- if (value == GPIO_VALUE_INVALID)
- return (-1);
- value = !value;
-
- return (gpio_pin_set(handle, pin, value));
-}
-
-int
-gpio_pin_low(gpio_handle_t handle, gpio_pin_t pin)
-{
- return (gpio_pin_set(handle, pin, GPIO_VALUE_LOW));
-}
-
-int
-gpio_pin_high(gpio_handle_t handle, gpio_pin_t pin)
-{
- return (gpio_pin_set(handle, pin, GPIO_VALUE_HIGH));
-}
-
-static int
-gpio_pin_set_flag(gpio_handle_t handle, gpio_pin_t pin, uint32_t flag)
-{
- gpio_config_t cfg;
-
- bzero(&cfg, sizeof(cfg));
- cfg.g_pin = pin;
- if (gpio_pin_config(handle, &cfg) < 0)
- return (-1);
- cfg.g_flags = flag;
-
- return (gpio_pin_set_flags(handle, &cfg));
-}
-
-int
-gpio_pin_input(gpio_handle_t handle, gpio_pin_t pin)
-{
- return (gpio_pin_set_flag(handle, pin, GPIO_PIN_INPUT));
-}
-
-int
-gpio_pin_output(gpio_handle_t handle, gpio_pin_t pin)
-{
- return (gpio_pin_set_flag(handle, pin, GPIO_PIN_OUTPUT));
-}
-
-int
-gpio_pin_opendrain(gpio_handle_t handle, gpio_pin_t pin)
-{
- return (gpio_pin_set_flag(handle, pin, GPIO_PIN_OPENDRAIN));
-}
-
-int
-gpio_pin_pushpull(gpio_handle_t handle, gpio_pin_t pin)
-{
- return (gpio_pin_set_flag(handle, pin, GPIO_PIN_PUSHPULL));
-}
-
-int
-gpio_pin_tristate(gpio_handle_t handle, gpio_pin_t pin)
-{
- return (gpio_pin_set_flag(handle, pin, GPIO_PIN_TRISTATE));
-}
-
-int
-gpio_pin_pullup(gpio_handle_t handle, gpio_pin_t pin)
-{
- return (gpio_pin_set_flag(handle, pin, GPIO_PIN_PULLUP));
-}
-
-int
-gpio_pin_pulldown(gpio_handle_t handle, gpio_pin_t pin)
-{
- return (gpio_pin_set_flag(handle, pin, GPIO_PIN_PULLDOWN));
-}
-
-int
-gpio_pin_invin(gpio_handle_t handle, gpio_pin_t pin)
-{
- return (gpio_pin_set_flag(handle, pin, GPIO_PIN_INVIN));
-}
-
-int
-gpio_pin_invout(gpio_handle_t handle, gpio_pin_t pin)
-{
- return (gpio_pin_set_flag(handle, pin, GPIO_PIN_INVOUT));
-}
-
-int
-gpio_pin_pulsate(gpio_handle_t handle, gpio_pin_t pin)
-{
- return (gpio_pin_set_flag(handle, pin, GPIO_PIN_PULSATE));
-}
diff --git a/lib/libgpio/libgpio.h b/lib/libgpio/libgpio.h
deleted file mode 100644
index a832234..0000000
--- a/lib/libgpio/libgpio.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*-
- * Copyright (c) 2013-2014 Rui Paulo <rpaulo@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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$
- */
-
-#ifndef _LIBGPIO_H_
-#define _LIBGPIO_H_
-
-#include <sys/gpio.h>
-
-__BEGIN_DECLS
-
-#define GPIO_INVALID_HANDLE -1
-typedef int gpio_handle_t;
-typedef uint32_t gpio_pin_t;
-
-/*
- * Structure describing a GPIO pin configuration.
- */
-typedef struct {
- gpio_pin_t g_pin;
- char g_name[GPIOMAXNAME];
- uint32_t g_caps;
- uint32_t g_flags;
-} gpio_config_t;
-
-typedef enum {
- GPIO_VALUE_INVALID = -1,
- GPIO_VALUE_LOW = GPIO_PIN_LOW,
- GPIO_VALUE_HIGH = GPIO_PIN_HIGH
-} gpio_value_t;
-
-/*
- * Open /dev/gpiocN or a specific device.
- */
-gpio_handle_t gpio_open(unsigned int);
-gpio_handle_t gpio_open_device(const char *);
-void gpio_close(gpio_handle_t);
-/*
- * Get a list of all the GPIO pins.
- */
-int gpio_pin_list(gpio_handle_t, gpio_config_t **);
-/*
- * GPIO pin configuration.
- *
- * Retrieve the configuration of a specific GPIO pin. The pin number is
- * passed through the gpio_config_t structure.
- */
-int gpio_pin_config(gpio_handle_t, gpio_config_t *);
-/*
- * Sets the GPIO pin name. The pin number and pin name to be set are passed
- * as parameters.
- */
-int gpio_pin_set_name(gpio_handle_t, gpio_pin_t, char *);
-/*
- * Sets the GPIO flags on a specific GPIO pin. The pin number and the flags
- * to be set are passed through the gpio_config_t structure.
- */
-int gpio_pin_set_flags(gpio_handle_t, gpio_config_t *);
-/*
- * GPIO pin values.
- */
-int gpio_pin_get(gpio_handle_t, gpio_pin_t);
-int gpio_pin_set(gpio_handle_t, gpio_pin_t, int);
-int gpio_pin_toggle(gpio_handle_t, gpio_pin_t);
-/*
- * Helper functions to set pin states.
- */
-int gpio_pin_low(gpio_handle_t, gpio_pin_t);
-int gpio_pin_high(gpio_handle_t, gpio_pin_t);
-/*
- * Helper functions to configure pins.
- */
-int gpio_pin_input(gpio_handle_t, gpio_pin_t);
-int gpio_pin_output(gpio_handle_t, gpio_pin_t);
-int gpio_pin_opendrain(gpio_handle_t, gpio_pin_t);
-int gpio_pin_pushpull(gpio_handle_t, gpio_pin_t);
-int gpio_pin_tristate(gpio_handle_t, gpio_pin_t);
-int gpio_pin_pullup(gpio_handle_t, gpio_pin_t);
-int gpio_pin_pulldown(gpio_handle_t, gpio_pin_t);
-int gpio_pin_invin(gpio_handle_t, gpio_pin_t);
-int gpio_pin_invout(gpio_handle_t, gpio_pin_t);
-int gpio_pin_pulsate(gpio_handle_t, gpio_pin_t);
-
-__END_DECLS
-
-#endif /* _LIBGPIO_H_ */
diff --git a/lib/libgssapi/Makefile.depend b/lib/libgssapi/Makefile.depend
new file mode 100644
index 0000000..cf58a7b
--- /dev/null
+++ b/lib/libgssapi/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/gssapi \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libgssapi/gss_acquire_cred.3 b/lib/libgssapi/gss_acquire_cred.3
index 29652a3..0a6caad 100644
--- a/lib/libgssapi/gss_acquire_cred.3
+++ b/lib/libgssapi/gss_acquire_cred.3
@@ -189,10 +189,10 @@ The credentials could not be acquired because they have expired.
No credentials were found for the specified name.
.El
.Sh SEE ALSO
-.Xr gss_accept_sec_context 3 ,
.Xr gss_init_sec_context 3 ,
-.Xr gss_inquire_context 3 ,
+.Xr gss_accept_sec_context 3 ,
.Xr gss_inquire_cred 3 ,
+.Xr gss_inquire_context 3 ,
.Xr gss_release_cred 3 ,
.Xr gss_release_oid_set 3
.Sh STANDARDS
diff --git a/lib/libgssapi/gss_add_cred.3 b/lib/libgssapi/gss_add_cred.3
index 53648d7..32d9885 100644
--- a/lib/libgssapi/gss_add_cred.3
+++ b/lib/libgssapi/gss_add_cred.3
@@ -288,11 +288,11 @@ The required credentials could not be added because they have expired.
No credentials were found for the specified name.
.El
.Sh SEE ALSO
+.Xr gss_init_sec_context 3 ,
.Xr gss_accept_sec_context 3 ,
.Xr gss_acquire_cred 3 ,
-.Xr gss_init_sec_context 3 ,
-.Xr gss_inquire_context 3 ,
.Xr gss_inquire_cred 3 ,
+.Xr gss_inquire_context 3 ,
.Xr gss_release_cred 3 ,
.Xr gss_release_oid_set 3
.Sh STANDARDS
diff --git a/lib/libgssapi/gss_add_oid_set_member.3 b/lib/libgssapi/gss_add_oid_set_member.3
index 2b3bf55..e812681 100644
--- a/lib/libgssapi/gss_add_oid_set_member.3
+++ b/lib/libgssapi/gss_add_oid_set_member.3
@@ -85,8 +85,8 @@ The set in which the object identifier should be inserted.
Successful completion
.El
.Sh SEE ALSO
-.Xr gss_acquire_cred 3 ,
-.Xr gss_create_empty_oid_set 3
+.Xr gss_create_empty_oid_set 3 ,
+.Xr gss_acquire_cred 3
.Sh STANDARDS
.Bl -tag -width ".It RFC 2743"
.It RFC 2743
diff --git a/lib/libgssapi/gss_create_empty_oid_set.3 b/lib/libgssapi/gss_create_empty_oid_set.3
index a561be1..466ea01 100644
--- a/lib/libgssapi/gss_create_empty_oid_set.3
+++ b/lib/libgssapi/gss_create_empty_oid_set.3
@@ -66,8 +66,8 @@ which the application must free after use with a call to
Successful completion
.El
.Sh SEE ALSO
-.Xr gss_acquire_cred 3 ,
-.Xr gss_add_oid_set_member 3
+.Xr gss_add_oid_set_member 3 ,
+.Xr gss_acquire_cred 3
.Sh STANDARDS
.Bl -tag -width ".It RFC 2743"
.It RFC 2743
diff --git a/lib/libgssapi/gss_delete_sec_context.3 b/lib/libgssapi/gss_delete_sec_context.3
index 4bfa984..be12165 100644
--- a/lib/libgssapi/gss_delete_sec_context.3
+++ b/lib/libgssapi/gss_delete_sec_context.3
@@ -117,9 +117,9 @@ Successful completion
No valid context was supplied
.El
.Sh SEE ALSO
-.Xr gss_accept_sec_context 3 ,
+.Xr gss_process_context_token 3 ,
.Xr gss_init_sec_context 3 ,
-.Xr gss_process_context_token 3
+.Xr gss_accept_sec_context 3
.Sh STANDARDS
.Bl -tag -width ".It RFC 2743"
.It RFC 2743
diff --git a/lib/libgssapi/gss_get_mic.3 b/lib/libgssapi/gss_get_mic.3
index cda037a..431f9e3 100644
--- a/lib/libgssapi/gss_get_mic.3
+++ b/lib/libgssapi/gss_get_mic.3
@@ -120,8 +120,8 @@ The context_handle parameter did not identify a valid context
The specified QOP is not supported by the mechanism
.El
.Sh SEE ALSO
-.Xr gss_release_buffer 3 ,
-.Xr gss_wrap 3
+.Xr gss_wrap 3 ,
+.Xr gss_release_buffer 3
.Sh STANDARDS
.Bl -tag -width ".It RFC 2743"
.It RFC 2743
diff --git a/lib/libgssapi/gss_import_sec_context.3 b/lib/libgssapi/gss_import_sec_context.3
index 4d1bc47..b2e1c78 100644
--- a/lib/libgssapi/gss_import_sec_context.3
+++ b/lib/libgssapi/gss_import_sec_context.3
@@ -75,8 +75,8 @@ The operation is unavailable
Local policy prevents the import of this context by the current process
.El
.Sh SEE ALSO
-.Xr gss_delete_sec_context 3 ,
-.Xr gss_export_sec_context 3
+.Xr gss_export_sec_context 3 ,
+.Xr gss_delete_sec_context 3
.Sh STANDARDS
.Bl -tag -width ".It RFC 2743"
.It RFC 2743
diff --git a/lib/libgssapi/gss_inquire_context.3 b/lib/libgssapi/gss_inquire_context.3
index 9ab2b64..d318234 100644
--- a/lib/libgssapi/gss_inquire_context.3
+++ b/lib/libgssapi/gss_inquire_context.3
@@ -236,11 +236,11 @@ Successful completion
The referenced context could not be accessed
.El
.Sh SEE ALSO
-.Xr gss_export_sec_context 3 ,
-.Xr gss_get_mic 3 ,
-.Xr gss_init_sec_context 3 ,
.Xr gss_release_name 3 ,
-.Xr gss_wrap 3
+.Xr gss_init_sec_context 3 ,
+.Xr gss_wrap 3 ,
+.Xr gss_get_mic 3 ,
+.Xr gss_export_sec_context 3
.Sh STANDARDS
.Bl -tag -width ".It RFC 2743"
.It RFC 2743
diff --git a/lib/libgssapi/gss_process_context_token.3 b/lib/libgssapi/gss_process_context_token.3
index 086dc6c..a7e0ab4 100644
--- a/lib/libgssapi/gss_process_context_token.3
+++ b/lib/libgssapi/gss_process_context_token.3
@@ -91,8 +91,8 @@ The
did not refer to a valid context
.El
.Sh SEE ALSO
-.Xr gss_accept_sec_context 3 ,
-.Xr gss_init_sec_context 3
+.Xr gss_init_sec_context 3 ,
+.Xr gss_accept_sec_context 3
.Sh STANDARDS
.Bl -tag -width ".It RFC 2743"
.It RFC 2743
diff --git a/lib/libgssapi/gss_test_oid_set_member.3 b/lib/libgssapi/gss_test_oid_set_member.3
index 688bf9e..5588e8a 100644
--- a/lib/libgssapi/gss_test_oid_set_member.3
+++ b/lib/libgssapi/gss_test_oid_set_member.3
@@ -70,8 +70,8 @@ Non-zero if the specified OID is a member of the set, zero if not.
Successful completion
.El
.Sh SEE ALSO
-.Xr gss_acquire_cred 3 ,
.Xr gss_indicate_mechs 3 ,
+.Xr gss_acquire_cred 3 ,
.Xr gss_inquire_cred 3
.Sh STANDARDS
.Bl -tag -width ".It RFC 2743"
diff --git a/lib/libgssapi/gss_unwrap.3 b/lib/libgssapi/gss_unwrap.3
index 3f9cc9c..368b361 100644
--- a/lib/libgssapi/gss_unwrap.3
+++ b/lib/libgssapi/gss_unwrap.3
@@ -147,8 +147,8 @@ The context has already expired.
The context_handle parameter did not identify a valid context.
.El
.Sh SEE ALSO
-.Xr gss_release_buffer 3 ,
-.Xr gss_wrap 3
+.Xr gss_wrap 3 ,
+.Xr gss_release_buffer 3
.Sh STANDARDS
.Bl -tag -width ".It RFC 2743"
.It RFC 2743
diff --git a/lib/libgssapi/gss_wrap.3 b/lib/libgssapi/gss_wrap.3
index fe91853..edc1345 100644
--- a/lib/libgssapi/gss_wrap.3
+++ b/lib/libgssapi/gss_wrap.3
@@ -134,8 +134,8 @@ The context_handle parameter did not identify a valid context.
The specified QOP is not supported by the mechanism.
.El
.Sh SEE ALSO
-.Xr gss_release_buffer 3 ,
-.Xr gss_unwrap 3
+.Xr gss_unwrap 3 ,
+.Xr gss_release_buffer 3
.Sh STANDARDS
.Bl -tag -width ".It RFC 2743"
.It RFC 2743
diff --git a/lib/libiconv/Makefile b/lib/libiconv/Makefile
new file mode 100644
index 0000000..1949597
--- /dev/null
+++ b/lib/libiconv/Makefile
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../libc/iconv
+
+LIB= iconv
+SHLIB_MAJOR= 4
+MAN= iconv.3 iconvctl.3 iconv_canonicalize.3 iconvlist.3 \
+ __iconv_get_list.3
+MLNKS= iconv.3 iconv_open.3 \
+ iconv.3 iconv_open_into.3 \
+ iconv.3 iconv_close.3 \
+ iconv.3 __iconv.3 \
+ __iconv_get_list.3 __iconv_free_list.3
+SRCS= citrus_bcs.c citrus_bcs_strtol.c citrus_bcs_strtoul.c \
+ citrus_csmapper.c citrus_db.c citrus_db_factory.c \
+ citrus_db_hash.c citrus_esdb.c citrus_hash.c \
+ citrus_iconv.c citrus_lookup.c citrus_lookup_factory.c \
+ citrus_mapper.c citrus_memstream.c citrus_mmap.c \
+ citrus_module.c citrus_none.c citrus_pivot_factory.c \
+ citrus_prop.c citrus_stdenc.c iconv.c
+
+CFLAGS.gcc+= --param max-inline-insns-single=128
+CFLAGS+= -I ${.CURDIR}/../../include -I${.CURDIR}/../libc/include
+
+.include <bsd.lib.mk>
diff --git a/lib/libiconv_modules/BIG5/Makefile.depend b/lib/libiconv_modules/BIG5/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/BIG5/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/BIG5/citrus_big5.c b/lib/libiconv_modules/BIG5/citrus_big5.c
index 8dffc65..a8376eb 100644
--- a/lib/libiconv_modules/BIG5/citrus_big5.c
+++ b/lib/libiconv_modules/BIG5/citrus_big5.c
@@ -269,12 +269,12 @@ static int
/*ARGSUSED*/
_citrus_BIG5_mbrtowc_priv(_BIG5EncodingInfo * __restrict ei,
wchar_t * __restrict pwc,
- char ** __restrict s, size_t n,
+ const char ** __restrict s, size_t n,
_BIG5State * __restrict psenc,
size_t * __restrict nresult)
{
wchar_t wchar;
- char *s0;
+ const char *s0;
int c, chlenbak;
s0 = *s;
diff --git a/lib/libiconv_modules/DECHanyu/Makefile.depend b/lib/libiconv_modules/DECHanyu/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/DECHanyu/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c b/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
index ec2c597..fc32018 100644
--- a/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
+++ b/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
@@ -165,10 +165,10 @@ is_94charset(int c)
static int
/*ARGSUSED*/
_citrus_DECHanyu_mbrtowc_priv(_DECHanyuEncodingInfo * __restrict ei,
- wchar_t * __restrict pwc, char ** __restrict s, size_t n,
+ wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_DECHanyuState * __restrict psenc, size_t * __restrict nresult)
{
- char *s0;
+ const char *s0;
wchar_t wc;
int ch;
diff --git a/lib/libiconv_modules/EUC/Makefile.depend b/lib/libiconv_modules/EUC/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/EUC/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/EUC/citrus_euc.c b/lib/libiconv_modules/EUC/citrus_euc.c
index e0c2d23..6483eb5 100644
--- a/lib/libiconv_modules/EUC/citrus_euc.c
+++ b/lib/libiconv_modules/EUC/citrus_euc.c
@@ -190,12 +190,12 @@ _citrus_EUC_unpack_state(_EUCEncodingInfo *ei __unused, _EUCState *s,
#endif
static int
-_citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, char **s,
+_citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, const char **s,
size_t n, _EUCState *psenc, size_t *nresult)
{
wchar_t wchar;
int c, chlenbak, cs, len;
- char *s0, *s1 = NULL;
+ const char *s0, *s1 = NULL;
s0 = *s;
diff --git a/lib/libiconv_modules/EUCTW/Makefile.depend b/lib/libiconv_modules/EUCTW/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/EUCTW/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/EUCTW/citrus_euctw.c b/lib/libiconv_modules/EUCTW/citrus_euctw.c
index 6c3e9f6..c35423e 100644
--- a/lib/libiconv_modules/EUCTW/citrus_euctw.c
+++ b/lib/libiconv_modules/EUCTW/citrus_euctw.c
@@ -176,10 +176,10 @@ _citrus_EUCTW_encoding_module_uninit(_EUCTWEncodingInfo *ei __unused)
static int
_citrus_EUCTW_mbrtowc_priv(_EUCTWEncodingInfo * __restrict ei,
- wchar_t * __restrict pwc, char ** __restrict s,
+ wchar_t * __restrict pwc, const char ** __restrict s,
size_t n, _EUCTWState * __restrict psenc, size_t * __restrict nresult)
{
- char *s0;
+ const char *s0;
wchar_t wchar;
int c, chlenbak, cs;
diff --git a/lib/libiconv_modules/GBK2K/Makefile.depend b/lib/libiconv_modules/GBK2K/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/GBK2K/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/GBK2K/citrus_gbk2k.c b/lib/libiconv_modules/GBK2K/citrus_gbk2k.c
index b64c7e0..50ea2da 100644
--- a/lib/libiconv_modules/GBK2K/citrus_gbk2k.c
+++ b/lib/libiconv_modules/GBK2K/citrus_gbk2k.c
@@ -149,10 +149,10 @@ _mb_count(wchar_t v)
static int
_citrus_GBK2K_mbrtowc_priv(_GBK2KEncodingInfo * __restrict ei,
- wchar_t * __restrict pwc, char ** __restrict s, size_t n,
+ wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_GBK2KState * __restrict psenc, size_t * __restrict nresult)
{
- char *s0, *s1;
+ const char *s0, *s1;
wchar_t wc;
int chlenbak, len;
diff --git a/lib/libiconv_modules/HZ/Makefile.depend b/lib/libiconv_modules/HZ/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/HZ/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/HZ/citrus_hz.c b/lib/libiconv_modules/HZ/citrus_hz.c
index 13d2f2c..d772b38 100644
--- a/lib/libiconv_modules/HZ/citrus_hz.c
+++ b/lib/libiconv_modules/HZ/citrus_hz.c
@@ -175,13 +175,13 @@ _citrus_HZ_unpack_state(_HZEncodingInfo * __restrict ei __unused,
static int
_citrus_HZ_mbrtowc_priv(_HZEncodingInfo * __restrict ei,
- wchar_t * __restrict pwc, char ** __restrict s, size_t n,
+ wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_HZState * __restrict psenc, size_t * __restrict nresult)
{
escape_t *candidate, *init;
graphic_t *graphic;
const range_t *range;
- char *s0;
+ const char *s0;
wchar_t wc;
int bit, ch, head, len, tail;
diff --git a/lib/libiconv_modules/ISO2022/Makefile.depend b/lib/libiconv_modules/ISO2022/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/ISO2022/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/ISO2022/citrus_iso2022.c b/lib/libiconv_modules/ISO2022/citrus_iso2022.c
index f3613d6..3402ba8 100644
--- a/lib/libiconv_modules/ISO2022/citrus_iso2022.c
+++ b/lib/libiconv_modules/ISO2022/citrus_iso2022.c
@@ -574,7 +574,7 @@ terminate:
static wchar_t
_ISO2022_sgetwchar(_ISO2022EncodingInfo * __restrict ei __unused,
- char * __restrict string, size_t n, char ** __restrict result,
+ const char * __restrict string, size_t n, const char ** __restrict result,
_ISO2022State * __restrict psenc)
{
const struct seqtable *sp;
@@ -842,10 +842,10 @@ asis:
static int
_citrus_ISO2022_mbrtowc_priv(_ISO2022EncodingInfo * __restrict ei,
- wchar_t * __restrict pwc, char ** __restrict s,
+ wchar_t * __restrict pwc, const char ** __restrict s,
size_t n, _ISO2022State * __restrict psenc, size_t * __restrict nresult)
{
- char *p, *result, *s0;
+ const char *p, *result, *s0;
wchar_t wchar;
int c, chlenbak;
diff --git a/lib/libiconv_modules/JOHAB/Makefile.depend b/lib/libiconv_modules/JOHAB/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/JOHAB/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/JOHAB/citrus_johab.c b/lib/libiconv_modules/JOHAB/citrus_johab.c
index 459f8c9..a533a85 100644
--- a/lib/libiconv_modules/JOHAB/citrus_johab.c
+++ b/lib/libiconv_modules/JOHAB/citrus_johab.c
@@ -145,10 +145,10 @@ ishanja(int l, int t)
static int
/*ARGSUSED*/
_citrus_JOHAB_mbrtowc_priv(_JOHABEncodingInfo * __restrict ei,
- wchar_t * __restrict pwc, char ** __restrict s, size_t n,
+ wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_JOHABState * __restrict psenc, size_t * __restrict nresult)
{
- char *s0;
+ const char *s0;
int l, t;
if (*s == NULL) {
diff --git a/lib/libiconv_modules/MSKanji/Makefile.depend b/lib/libiconv_modules/MSKanji/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/MSKanji/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/MSKanji/citrus_mskanji.c b/lib/libiconv_modules/MSKanji/citrus_mskanji.c
index 4330cc8..8549699 100644
--- a/lib/libiconv_modules/MSKanji/citrus_mskanji.c
+++ b/lib/libiconv_modules/MSKanji/citrus_mskanji.c
@@ -153,10 +153,10 @@ _citrus_MSKanji_unpack_state(_MSKanjiEncodingInfo * __restrict ei __unused,
static int
/*ARGSUSED*/
_citrus_MSKanji_mbrtowc_priv(_MSKanjiEncodingInfo * __restrict ei,
- wchar_t * __restrict pwc, char ** __restrict s, size_t n,
+ wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_MSKanjiState * __restrict psenc, size_t * __restrict nresult)
{
- char *s0;
+ const char *s0;
wchar_t wchar;
int chlenbak, len;
diff --git a/lib/libiconv_modules/UES/Makefile.depend b/lib/libiconv_modules/UES/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/UES/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/UES/citrus_ues.c b/lib/libiconv_modules/UES/citrus_ues.c
index 8516c2a..45f5416 100644
--- a/lib/libiconv_modules/UES/citrus_ues.c
+++ b/lib/libiconv_modules/UES/citrus_ues.c
@@ -185,10 +185,10 @@ is_basic(wchar_t wc)
static int
_citrus_UES_mbrtowc_priv(_UESEncodingInfo * __restrict ei,
- wchar_t * __restrict pwc, char ** __restrict s, size_t n,
+ wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_UESState * __restrict psenc, size_t * __restrict nresult)
{
- char *s0;
+ const char *s0;
int ch, head, num, tail;
wchar_t hi, wc;
diff --git a/lib/libiconv_modules/UTF1632/Makefile.depend b/lib/libiconv_modules/UTF1632/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/UTF1632/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/UTF1632/citrus_utf1632.c b/lib/libiconv_modules/UTF1632/citrus_utf1632.c
index 6682ab2..4ef4db1 100644
--- a/lib/libiconv_modules/UTF1632/citrus_utf1632.c
+++ b/lib/libiconv_modules/UTF1632/citrus_utf1632.c
@@ -97,9 +97,9 @@ _citrus_UTF1632_init_state(_UTF1632EncodingInfo *ei __unused,
static int
_citrus_UTF1632_mbrtowc_priv(_UTF1632EncodingInfo *ei, wchar_t *pwc,
- char **s, size_t n, _UTF1632State *psenc, size_t *nresult)
+ const char **s, size_t n, _UTF1632State *psenc, size_t *nresult)
{
- char *s0;
+ const char *s0;
size_t result;
wchar_t wc = L'\0';
int chlenbak, endian, needlen;
diff --git a/lib/libiconv_modules/UTF7/Makefile.depend b/lib/libiconv_modules/UTF7/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/UTF7/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/UTF7/citrus_utf7.c b/lib/libiconv_modules/UTF7/citrus_utf7.c
index ce74cfe..53f4f77 100644
--- a/lib/libiconv_modules/UTF7/citrus_utf7.c
+++ b/lib/libiconv_modules/UTF7/citrus_utf7.c
@@ -151,11 +151,11 @@ static const char spaces[] = " \t\r\n";
static int
_citrus_UTF7_mbtoutf16(_UTF7EncodingInfo * __restrict ei,
- uint16_t * __restrict u16, char ** __restrict s, size_t n,
+ uint16_t * __restrict u16, const char ** __restrict s, size_t n,
_UTF7State * __restrict psenc, size_t * __restrict nresult)
{
_UTF7State sv;
- char *s0;
+ const char *s0;
int done, i, len;
s0 = *s;
@@ -244,7 +244,7 @@ ilseq:
static int
_citrus_UTF7_mbrtowc_priv(_UTF7EncodingInfo * __restrict ei,
- wchar_t * __restrict pwc, char ** __restrict s, size_t n,
+ wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_UTF7State * __restrict psenc, size_t * __restrict nresult)
{
uint32_t u32;
diff --git a/lib/libiconv_modules/UTF8/Makefile.depend b/lib/libiconv_modules/UTF8/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/UTF8/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/UTF8/citrus_utf8.c b/lib/libiconv_modules/UTF8/citrus_utf8.c
index 1bf433e..d7c78d3 100644
--- a/lib/libiconv_modules/UTF8/citrus_utf8.c
+++ b/lib/libiconv_modules/UTF8/citrus_utf8.c
@@ -177,10 +177,10 @@ _citrus_UTF8_unpack_state(_UTF8EncodingInfo *ei __unused, _UTF8State *s,
#endif
static int
-_citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, char **s,
+_citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, const char **s,
size_t n, _UTF8State *psenc, size_t *nresult)
{
- char *s0;
+ const char *s0;
wchar_t wchar;
int i;
uint8_t c;
diff --git a/lib/libiconv_modules/VIQR/Makefile.depend b/lib/libiconv_modules/VIQR/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/VIQR/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/VIQR/citrus_viqr.c b/lib/libiconv_modules/VIQR/citrus_viqr.c
index ed91cf6..dddb0b0 100644
--- a/lib/libiconv_modules/VIQR/citrus_viqr.c
+++ b/lib/libiconv_modules/VIQR/citrus_viqr.c
@@ -252,11 +252,11 @@ _citrus_VIQR_unpack_state(_VIQREncodingInfo * __restrict ei __unused,
static int
_citrus_VIQR_mbrtowc_priv(_VIQREncodingInfo * __restrict ei,
- wchar_t * __restrict pwc, char ** __restrict s, size_t n,
+ wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_VIQRState * __restrict psenc, size_t * __restrict nresult)
{
mnemonic_t *m, *m0;
- char *s0;
+ const char *s0;
wchar_t wc;
ssize_t i;
int ch, escape;
diff --git a/lib/libiconv_modules/ZW/Makefile.depend b/lib/libiconv_modules/ZW/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/ZW/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/ZW/citrus_zw.c b/lib/libiconv_modules/ZW/citrus_zw.c
index 1728e3b..097fcfe 100644
--- a/lib/libiconv_modules/ZW/citrus_zw.c
+++ b/lib/libiconv_modules/ZW/citrus_zw.c
@@ -107,10 +107,10 @@ _citrus_ZW_unpack_state(_ZWEncodingInfo * __restrict ei __unused,
static int
_citrus_ZW_mbrtowc_priv(_ZWEncodingInfo * __restrict ei,
- wchar_t * __restrict pwc, char **__restrict s, size_t n,
+ wchar_t * __restrict pwc, const char **__restrict s, size_t n,
_ZWState * __restrict psenc, size_t * __restrict nresult)
{
- char *s0;
+ const char *s0;
wchar_t wc;
int ch, len;
diff --git a/lib/libiconv_modules/iconv_none/Makefile.depend b/lib/libiconv_modules/iconv_none/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/iconv_none/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/iconv_none/citrus_iconv_none.c b/lib/libiconv_modules/iconv_none/citrus_iconv_none.c
index 9d6cd31..967ee13 100644
--- a/lib/libiconv_modules/iconv_none/citrus_iconv_none.c
+++ b/lib/libiconv_modules/iconv_none/citrus_iconv_none.c
@@ -97,7 +97,7 @@ _citrus_iconv_none_iconv_uninit_context(struct _citrus_iconv *cv __unused)
static int
/*ARGSUSED*/
_citrus_iconv_none_iconv_convert(struct _citrus_iconv * __restrict ci __unused,
- char * __restrict * __restrict in, size_t * __restrict inbytes,
+ const char * __restrict * __restrict in, size_t * __restrict inbytes,
char * __restrict * __restrict out, size_t * __restrict outbytes,
uint32_t flags __unused, size_t * __restrict invalids)
{
diff --git a/lib/libiconv_modules/iconv_std/Makefile.depend b/lib/libiconv_modules/iconv_std/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/iconv_std/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/iconv_std/citrus_iconv_std.c b/lib/libiconv_modules/iconv_std/citrus_iconv_std.c
index fd9a68c..7c9b064 100644
--- a/lib/libiconv_modules/iconv_std/citrus_iconv_std.c
+++ b/lib/libiconv_modules/iconv_std/citrus_iconv_std.c
@@ -104,7 +104,7 @@ init_encoding_state(struct _citrus_iconv_std_encoding *se)
static __inline int
mbtocsx(struct _citrus_iconv_std_encoding *se,
- _csid_t *csid, _index_t *idx, char **s, size_t n, size_t *nresult,
+ _csid_t *csid, _index_t *idx, const char **s, size_t n, size_t *nresult,
struct iconv_hooks *hooks)
{
@@ -461,7 +461,7 @@ _citrus_iconv_std_iconv_uninit_context(struct _citrus_iconv *cv)
static int
_citrus_iconv_std_iconv_convert(struct _citrus_iconv * __restrict cv,
- char * __restrict * __restrict in, size_t * __restrict inbytes,
+ const char * __restrict * __restrict in, size_t * __restrict inbytes,
char * __restrict * __restrict out, size_t * __restrict outbytes,
uint32_t flags, size_t * __restrict invalids)
{
@@ -469,7 +469,7 @@ _citrus_iconv_std_iconv_convert(struct _citrus_iconv * __restrict cv,
struct _citrus_iconv_std_context *sc = cv->cv_closure;
_csid_t csid;
_index_t idx;
- char *tmpin;
+ const char *tmpin;
size_t inval, szrin, szrout;
int ret, state = 0;
diff --git a/lib/libiconv_modules/mapper_646/Makefile.depend b/lib/libiconv_modules/mapper_646/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/mapper_646/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/mapper_none/Makefile.depend b/lib/libiconv_modules/mapper_none/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/mapper_none/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/mapper_parallel/Makefile.depend b/lib/libiconv_modules/mapper_parallel/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/mapper_parallel/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/mapper_serial/Makefile.depend b/lib/libiconv_modules/mapper_serial/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/mapper_serial/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/mapper_std/Makefile.depend b/lib/libiconv_modules/mapper_std/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/mapper_std/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libiconv_modules/mapper_zone/Makefile.depend b/lib/libiconv_modules/mapper_zone/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libiconv_modules/mapper_zone/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libipsec/Makefile.depend b/lib/libipsec/Makefile.depend
new file mode 100644
index 0000000..f48095a
--- /dev/null
+++ b/lib/libipsec/Makefile.depend
@@ -0,0 +1,30 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+policy_parse.So: policy_parse.c
+policy_parse.o: policy_parse.c
+policy_parse.po: policy_parse.c
+policy_token.So: policy_token.c
+policy_token.So: y.tab.h
+policy_token.o: policy_token.c
+policy_token.o: y.tab.h
+policy_token.po: policy_token.c
+policy_token.po: y.tab.h
+.endif
diff --git a/lib/libjail/Makefile.depend b/lib/libjail/Makefile.depend
new file mode 100644
index 0000000..807c0a4
--- /dev/null
+++ b/lib/libjail/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libjail/jail.c b/lib/libjail/jail.c
index 0edfb3f..207b9f2 100644
--- a/lib/libjail/jail.c
+++ b/lib/libjail/jail.c
@@ -531,7 +531,7 @@ jailparam_set(struct jailparam *jp, unsigned njp, int flags)
}
i++;
}
- jiov[i].iov_base = __DECONST(char *, "errmsg");
+ *(const void **)&jiov[i].iov_base = "errmsg";
jiov[i].iov_len = sizeof("errmsg");
i++;
jiov[i].iov_base = jail_errmsg;
@@ -601,7 +601,7 @@ jailparam_get(struct jailparam *jp, unsigned njp, int flags)
jiov[ki].iov_len = (jp_key->jp_ctltype & CTLTYPE) == CTLTYPE_STRING
? strlen(jp_key->jp_value) + 1 : jp_key->jp_valuelen;
ki++;
- jiov[ki].iov_base = __DECONST(char *, "errmsg");
+ *(const void **)&jiov[ki].iov_base = "errmsg";
jiov[ki].iov_len = sizeof("errmsg");
ki++;
jiov[ki].iov_base = jail_errmsg;
diff --git a/lib/libjail/jail_getid.c b/lib/libjail/jail_getid.c
index dab2dcf..fa10424 100644
--- a/lib/libjail/jail_getid.c
+++ b/lib/libjail/jail_getid.c
@@ -53,12 +53,12 @@ jail_getid(const char *name)
jid = strtoul(name, &ep, 10);
if (*name && !*ep)
return jid;
- jiov[0].iov_base = __DECONST(char *, "name");
+ *(const void **)&jiov[0].iov_base = "name";
jiov[0].iov_len = sizeof("name");
jiov[1].iov_len = strlen(name) + 1;
jiov[1].iov_base = alloca(jiov[1].iov_len);
strcpy(jiov[1].iov_base, name);
- jiov[2].iov_base = __DECONST(char *, "errmsg");
+ *(const void **)&jiov[2].iov_base = "errmsg";
jiov[2].iov_len = sizeof("errmsg");
jiov[3].iov_base = jail_errmsg;
jiov[3].iov_len = JAIL_ERRMSGLEN;
@@ -80,15 +80,15 @@ jail_getname(int jid)
char *name;
char namebuf[MAXHOSTNAMELEN];
- jiov[0].iov_base = __DECONST(char *, "jid");
+ *(const void **)&jiov[0].iov_base = "jid";
jiov[0].iov_len = sizeof("jid");
jiov[1].iov_base = &jid;
jiov[1].iov_len = sizeof(jid);
- jiov[2].iov_base = __DECONST(char *, "name");
+ *(const void **)&jiov[2].iov_base = "name";
jiov[2].iov_len = sizeof("name");
jiov[3].iov_base = namebuf;
jiov[3].iov_len = sizeof(namebuf);
- jiov[4].iov_base = __DECONST(char *, "errmsg");
+ *(const void **)&jiov[4].iov_base = "errmsg";
jiov[4].iov_len = sizeof("errmsg");
jiov[5].iov_base = jail_errmsg;
jiov[5].iov_len = JAIL_ERRMSGLEN;
diff --git a/lib/libkiconv/Makefile.depend b/lib/libkiconv/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libkiconv/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libkiconv/xlat16_iconv.c b/lib/libkiconv/xlat16_iconv.c
index 3efb779..fee3c77 100644
--- a/lib/libkiconv/xlat16_iconv.c
+++ b/lib/libkiconv/xlat16_iconv.c
@@ -62,7 +62,7 @@ static int chklocale(int, const char *);
typedef void *iconv_t;
static int my_iconv_init(void);
static iconv_t (*my_iconv_open)(const char *, const char *);
-static size_t (*my_iconv)(iconv_t, char **, size_t *, char **, size_t *);
+static size_t (*my_iconv)(iconv_t, const char **, size_t *, char **, size_t *);
static int (*my_iconv_close)(iconv_t);
#else
#include <iconv.h>
@@ -71,7 +71,7 @@ static int (*my_iconv_close)(iconv_t);
#define my_iconv iconv
#define my_iconv_close iconv_close
#endif
-static size_t my_iconv_char(iconv_t, u_char **, size_t *, u_char **, size_t *);
+static size_t my_iconv_char(iconv_t, const u_char **, size_t *, u_char **, size_t *);
int
kiconv_add_xlat16_cspair(const char *tocode, const char *fromcode, int flag)
@@ -221,8 +221,8 @@ kiconv_xlat16_open(const char *tocode, const char *fromcode, int lcase)
src[0] = (u_char)(c >> 8);
src[1] = (u_char)c;
- ret = my_iconv_char(cd, &srcp, &inbytesleft,
- &dstp, &outbytesleft);
+ ret = my_iconv_char(cd, (const u_char **)&srcp,
+ &inbytesleft, &dstp, &outbytesleft);
if (ret == -1) {
table[us] = 0;
continue;
@@ -338,10 +338,11 @@ my_iconv_init(void)
#endif
static size_t
-my_iconv_char(iconv_t cd, u_char **ibuf, size_t * ilen, u_char **obuf,
+my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf,
size_t * olen)
{
- u_char *sp, *dp, ilocal[3], olocal[3];
+ const u_char *sp;
+ u_char *dp, ilocal[3], olocal[3];
u_char c1, c2;
int ret;
size_t ir, or;
@@ -351,7 +352,7 @@ my_iconv_char(iconv_t cd, u_char **ibuf, size_t * ilen, u_char **obuf,
ir = *ilen;
bzero(*obuf, *olen);
- ret = my_iconv(cd, (char **)&sp, ilen, (char **)&dp, olen);
+ ret = my_iconv(cd, (const char **)&sp, ilen, (char **)&dp, olen);
c1 = (*obuf)[0];
c2 = (*obuf)[1];
@@ -374,7 +375,7 @@ my_iconv_char(iconv_t cd, u_char **ibuf, size_t * ilen, u_char **obuf,
sp = ilocal;
dp = olocal;
- if ((my_iconv(cd,(char **)&sp, &ir, (char **)&dp, &or)) != -1) {
+ if ((my_iconv(cd,(const char **)&sp, &ir, (char **)&dp, &or)) != -1) {
if (olocal[0] != c1)
return (ret);
@@ -428,7 +429,7 @@ my_iconv_char(iconv_t cd, u_char **ibuf, size_t * ilen, u_char **obuf,
sp = ilocal + 1;
dp = olocal;
- if ((my_iconv(cd,(char **)&sp, &ir, (char **)&dp, &or)) != -1) {
+ if ((my_iconv(cd,(const char **)&sp, &ir, (char **)&dp, &or)) != -1) {
if (olocal[0] == c2)
/*
* inbuf is a single byte char
diff --git a/lib/libkvm/Makefile.depend b/lib/libkvm/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libkvm/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libldns/Makefile b/lib/libldns/Makefile
index 9a436cd..db4b989 100644
--- a/lib/libldns/Makefile
+++ b/lib/libldns/Makefile
@@ -18,7 +18,8 @@ SRCS= buffer.c dane.c dname.c dnssec.c dnssec_sign.c dnssec_verify.c \
SRCS+= b64_ntop.c b64_pton.c
-LIBADD= crypto
+DPADD+= ${LIBCRYPTO}
+LDADD+= -lcrypto
WARNS ?= 3
diff --git a/lib/libldns/Makefile.depend b/lib/libldns/Makefile.depend
new file mode 100644
index 0000000..3bf324e
--- /dev/null
+++ b/lib/libldns/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ secure/lib/libcrypto \
+ secure/lib/libssl \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/liblzma/Makefile b/lib/liblzma/Makefile
index 39b929f..8d614cf 100644
--- a/lib/liblzma/Makefile
+++ b/lib/liblzma/Makefile
@@ -4,7 +4,7 @@ LIB= lzma
LZMADIR= ${.CURDIR}/../../contrib/xz/src/liblzma
.PATH: ${LZMADIR}/../common
-SRCS+= tuklib_physmem.c tuklib_cpucores.c
+SRCS+= tuklib_physmem.c
.PATH: ${LZMADIR}/api/lzma
@@ -21,7 +21,7 @@ LZMAINCS+= base.h \
hardware.h \
index.h \
index_hash.h \
- lzma12.h \
+ lzma.h \
stream_flags.h \
version.h \
vli.h
@@ -36,7 +36,6 @@ SRCS+= common.c \
easy_preset.c \
filter_common.c \
hardware_physmem.c \
- hardware_cputhreads.c \
index.c \
stream_flags_common.c \
vli_size.c \
@@ -69,10 +68,7 @@ SRCS+= common.c \
stream_buffer_decoder.c \
stream_decoder.c \
stream_flags_decoder.c \
- stream_encoder_mt.c \
- vli_decoder.c \
- outqueue.c
-
+ vli_decoder.c
.PATH: ${LZMADIR}/check
SRCS+= check.c \
@@ -121,16 +117,7 @@ SRCS+= simple_coder.c \
arm.c \
armthumb.c \
sparc.c
-
-.PATH: ${LZMADIR}
-
-VERSION_MAJOR!= awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_MAJOR" {print $$3 } ' \
- ${LZMADIR}/api/lzma/version.h
-VERSION_MINOR!= awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_MINOR" {print $$3 } ' \
- ${LZMADIR}/api/lzma/version.h
-VERSION_PATCH!= awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_PATCH" {print $$3 } ' \
- ${LZMADIR}/api/lzma/version.h
-
+
WARNS?= 3
CFLAGS+= -DHAVE_CONFIG_H \
@@ -146,29 +133,8 @@ CFLAGS+= -DHAVE_CONFIG_H \
-I${LZMADIR}/simple \
-I${LZMADIR}/../common
-LIBADD+= pthread
-
VERSION_DEF= ${.CURDIR}/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
CFLAGS+= -DSYMBOL_VERSIONING
-CLEANFILES+= liblzma.pc
-
-.if !defined(LIBRARIES_ONLY)
-all: liblzma.pc
-liblzma.pc: liblzma.pc.in
- @sed -e 's,@prefix@,/usr,g ; \
- s,@exec_prefix@,/usr,g ; \
- s,@libdir@,/usr/lib,g ; \
- s,@includedir@,/usr/include,g ; \
- s,@PACKAGE_URL@,http://tukaani.org/xz/,g ; \
- s,@PACKAGE_VERSION@,${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH},g ; \
- s,@PTHREAD_CFLAGS@,,g ; \
- s,@PTHREAD_LIBS@,,g' ${.ALLSRC} > ${.TARGET}
-
-beforeinstall:
- @${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- liblzma.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
-.endif
-
.include <bsd.lib.mk>
diff --git a/lib/liblzma/Makefile.depend b/lib/liblzma/Makefile.depend
new file mode 100644
index 0000000..4acc32f
--- /dev/null
+++ b/lib/liblzma/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/liblzma/Symbol.map b/lib/liblzma/Symbol.map
index c297625..3638bde 100644
--- a/lib/liblzma/Symbol.map
+++ b/lib/liblzma/Symbol.map
@@ -98,19 +98,9 @@ XZ_5.0 {
lzma_vli_size;
};
-XZ_5.2 {
- lzma_block_uncomp_encode;
- lzma_cputhreads;
- lzma_get_progress;
- lzma_stream_encoder_mt;
- lzma_stream_encoder_mt_memusage;
-};
-
XZprivate_1.0 {
lzma_alloc;
- lzma_alloc_zero;
lzma_alone_decoder_init;
- lzma_block_buffer_bound64;
lzma_block_decoder_init;
lzma_block_encoder_init;
lzma_bufcpy;
@@ -133,7 +123,6 @@ XZprivate_1.0 {
lzma_lz_decoder_uncompressed;
lzma_lz_encoder_init;
lzma_lz_encoder_memusage;
- lzma_lzma2_block_size;
lzma_lzma2_decoder_init;
lzma_lzma2_decoder_memusage;
lzma_lzma2_encoder_init;
@@ -166,16 +155,9 @@ XZprivate_1.0 {
lzma_mf_hc3_skip;
lzma_mf_hc4_find;
lzma_mf_hc4_skip;
- lzma_mt_block_size;
lzma_next_end;
lzma_next_filter_init;
lzma_next_filter_update;
- lzma_outq_end;
- lzma_outq_get_buf;
- lzma_outq_init;
- lzma_outq_is_readable;
- lzma_outq_memusage;
- lzma_outq_read;
lzma_raw_coder_init;
lzma_raw_coder_memusage;
lzma_raw_decoder_init;
@@ -200,7 +182,7 @@ XZprivate_1.0 {
lzma_simple_x86_decoder_init;
lzma_simple_x86_encoder_init;
lzma_stream_decoder_init;
+ lzma_stream_encoder_init;
lzma_strm_init;
- lzma_tuklib_cpucores;
lzma_tuklib_physmem;
};
diff --git a/lib/liblzma/Versions.def b/lib/liblzma/Versions.def
index 6786240..1f65670 100644
--- a/lib/liblzma/Versions.def
+++ b/lib/liblzma/Versions.def
@@ -3,9 +3,7 @@
XZ_5.0 {
};
-XZ_5.2 {
-} XZ_5.0;
XZprivate_1.0 {
-} XZ_5.2;
+} XZ_5.0;
diff --git a/lib/liblzma/config.h b/lib/liblzma/config.h
index 1d0f0bc..9d97247 100644
--- a/lib/liblzma/config.h
+++ b/lib/liblzma/config.h
@@ -1,427 +1,88 @@
-/* $FreeBSD$ */
-/* config.h. Generated from config.h.in by configure. */
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* Define if building universal (internal helper macro) */
-/* #undef AC_APPLE_UNIVERSAL_BUILD */
-
-/* How many MiB of RAM to assume if the real amount cannot be determined. */
+// $FreeBSD$
#define ASSUME_RAM 128
-
-/* Define to 1 if translation of program messages to the user's native
- language is requested. */
-/* FreeBSD - disabled intentionally */
-/* #undef ENABLE_NLS */
-
-/* Define to 1 if bswap_16 is available. */
-/* #undef HAVE_BSWAP_16 */
-
-/* Define to 1 if bswap_32 is available. */
-/* #undef HAVE_BSWAP_32 */
-
-/* Define to 1 if bswap_64 is available. */
-/* #undef HAVE_BSWAP_64 */
-
-/* Define to 1 if you have the <byteswap.h> header file. */
-/* #undef HAVE_BYTESWAP_H */
-
-/* Define to 1 if the system has the type `CC_SHA256_CTX'. */
-/* #undef HAVE_CC_SHA256_CTX */
-
-/* Define to 1 if you have the `CC_SHA256_Init' function. */
-/* #undef HAVE_CC_SHA256_INIT */
-
-/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
- CoreFoundation framework. */
-/* #undef HAVE_CFLOCALECOPYCURRENT */
-
-/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
- the CoreFoundation framework. */
-/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
-
-/* Define to 1 if crc32 integrity check is enabled. */
#define HAVE_CHECK_CRC32 1
-
-/* Define to 1 if crc64 integrity check is enabled. */
#define HAVE_CHECK_CRC64 1
-
-/* Define to 1 if sha256 integrity check is enabled. */
#define HAVE_CHECK_SHA256 1
-
-/* Define to 1 if you have the `clock_gettime' function. */
-#define HAVE_CLOCK_GETTIME 1
-
-/* Define to 1 if you have the <CommonCrypto/CommonDigest.h> header file. */
-/* #undef HAVE_COMMONCRYPTO_COMMONDIGEST_H */
-
-/* Define if the GNU dcgettext() function is already present or preinstalled.
- */
-/* FreeBSD - disabled intentionally */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define to 1 if you have the declaration of `CLOCK_MONOTONIC', and to 0 if
- you don't. */
-#define HAVE_DECL_CLOCK_MONOTONIC 1
-
-/* Define to 1 if you have the declaration of `program_invocation_name', and
- to 0 if you don't. */
#define HAVE_DECL_PROGRAM_INVOCATION_NAME 0
-
-/* Define to 1 if arm decoder is enabled. */
#define HAVE_DECODER_ARM 1
-
-/* Define to 1 if armthumb decoder is enabled. */
#define HAVE_DECODER_ARMTHUMB 1
-
-/* Define to 1 if delta decoder is enabled. */
#define HAVE_DECODER_DELTA 1
-
-/* Define to 1 if ia64 decoder is enabled. */
#define HAVE_DECODER_IA64 1
-
-/* Define to 1 if lzma1 decoder is enabled. */
#define HAVE_DECODER_LZMA1 1
-
-/* Define to 1 if lzma2 decoder is enabled. */
#define HAVE_DECODER_LZMA2 1
-
-/* Define to 1 if powerpc decoder is enabled. */
#define HAVE_DECODER_POWERPC 1
-
-/* Define to 1 if sparc decoder is enabled. */
#define HAVE_DECODER_SPARC 1
-
-/* Define to 1 if x86 decoder is enabled. */
#define HAVE_DECODER_X86 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
-
-/* Define to 1 if arm encoder is enabled. */
#define HAVE_ENCODER_ARM 1
-
-/* Define to 1 if armthumb encoder is enabled. */
#define HAVE_ENCODER_ARMTHUMB 1
-
-/* Define to 1 if delta encoder is enabled. */
#define HAVE_ENCODER_DELTA 1
-
-/* Define to 1 if ia64 encoder is enabled. */
#define HAVE_ENCODER_IA64 1
-
-/* Define to 1 if lzma1 encoder is enabled. */
#define HAVE_ENCODER_LZMA1 1
-
-/* Define to 1 if lzma2 encoder is enabled. */
#define HAVE_ENCODER_LZMA2 1
-
-/* Define to 1 if powerpc encoder is enabled. */
#define HAVE_ENCODER_POWERPC 1
-
-/* Define to 1 if sparc encoder is enabled. */
#define HAVE_ENCODER_SPARC 1
-
-/* Define to 1 if x86 encoder is enabled. */
#define HAVE_ENCODER_X86 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
-
-/* Define to 1 if you have the `futimens' function. */
-#define HAVE_FUTIMENS 1
-
-/* Define to 1 if you have the `futimes' function. */
-/* #undef HAVE_FUTIMES */
-
-/* Define to 1 if you have the `futimesat' function. */
-/* #undef HAVE_FUTIMESAT */
-
-/* Define to 1 if you have the <getopt.h> header file. */
+#define HAVE_FUTIMES 1
#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. */
-/* FreeBSD - disabled intentionally */
-/* #undef HAVE_GETTEXT */
-
-/* Define if you have the iconv() function and it works. */
-#define HAVE_ICONV 1
-
-/* Define to 1 if you have the <immintrin.h> header file. */
-#if defined(__FreeBSD__) && defined(__amd64__)
-#define HAVE_IMMINTRIN_H 1
-#endif
-
-/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
-
-/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
#define HAVE_MBRTOWC 1
-
-/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
-
-/* Define to 1 to enable bt2 match finder. */
#define HAVE_MF_BT2 1
-
-/* Define to 1 to enable bt3 match finder. */
#define HAVE_MF_BT3 1
-
-/* Define to 1 to enable bt4 match finder. */
#define HAVE_MF_BT4 1
-
-/* Define to 1 to enable hc3 match finder. */
#define HAVE_MF_HC3 1
-
-/* Define to 1 to enable hc4 match finder. */
#define HAVE_MF_HC4 1
-
-/* Define to 1 if you have the <minix/sha2.h> header file. */
-/* #undef HAVE_MINIX_SHA2_H */
-
-/* Define to 1 if getopt.h declares extern int optreset. */
#define HAVE_OPTRESET 1
-
-/* Define to 1 if you have the `pipe2' function. */
-#define HAVE_PIPE2 1
-
-/* Define to 1 if you have the `posix_fadvise' function. */
-#define HAVE_POSIX_FADVISE 1
-
-/* Define to 1 if you have the `pthread_condattr_setclock' function. */
-#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
-
-/* Have PTHREAD_PRIO_INHERIT. */
-#define HAVE_PTHREAD_PRIO_INHERIT 1
-
-/* Define to 1 if you have the `SHA256Init' function. */
-/* #undef HAVE_SHA256INIT */
-
-/* Define to 1 if the system has the type `SHA256_CTX'. */
-/* FreeBSD - disabled libmd SHA256 for now */
-/* #undef HAVE_SHA256_CTX */
-
-/* Define to 1 if you have the <sha256.h> header file. */
-/* FreeBSD - disabled libmd SHA256 for now */
-/* #undef HAVE_SHA256_H */
-
-/* Define to 1 if you have the `SHA256_Init' function. */
-/* FreeBSD - disabled libmd SHA256 for now */
-/* #undef HAVE_SHA256_INIT */
-
-/* Define to 1 if the system has the type `SHA2_CTX'. */
-/* #undef HAVE_SHA2_CTX */
-
-/* Define to 1 if you have the <sha2.h> header file. */
-/* #undef HAVE_SHA2_H */
-
-/* Define to 1 if optimizing for size. */
-/* #undef HAVE_SMALL */
-
-/* Define to 1 if stdbool.h conforms to C99. */
+#define HAVE_PTHREAD 1
#define HAVE_STDBOOL_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
-
-/* Define to 1 if `st_atimensec' is a member of `struct stat'. */
-/* #undef HAVE_STRUCT_STAT_ST_ATIMENSEC */
-
-/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
-
-/* Define to 1 if `st_atim.st__tim.tv_nsec' is a member of `struct stat'. */
-/* #undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC */
-
-/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */
-#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
-
-/* Define to 1 if `st_uatime' is a member of `struct stat'. */
-/* #undef HAVE_STRUCT_STAT_ST_UATIME */
-
-/* Define to 1 if you have the <sys/byteorder.h> header file. */
-/* #undef HAVE_SYS_BYTEORDER_H */
-
-/* Define to 1 if you have the <sys/endian.h> header file. */
#define HAVE_SYS_ENDIAN_H 1
-
-/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if the system has the type `uintptr_t'. */
#define HAVE_UINTPTR_T 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
-
-/* Define to 1 if you have the `utime' function. */
-/* #undef HAVE_UTIME */
-
-/* Define to 1 if you have the `utimes' function. */
-/* #undef HAVE_UTIMES */
-
-/* Define to 1 or 0, depending whether the compiler supports simple visibility
- declarations. */
#define HAVE_VISIBILITY 1
-
-/* Define to 1 if you have the `wcwidth' function. */
#define HAVE_WCWIDTH 1
-
-/* Define to 1 if the system has the type `_Bool'. */
#define HAVE__BOOL 1
-
-/* Define to 1 if _mm_movemask_epi8 is available. */
-#if defined(__FreeBSD__) && defined(__amd64__)
-#define HAVE__MM_MOVEMASK_EPI8 1
-#endif
-
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"
-
-/* Define to 1 when using POSIX threads (pthreads). */
-#define MYTHREAD_POSIX 1
-
-/* Define to 1 when using Windows Vista compatible threads. This uses features
- that are not available on Windows XP. */
-/* #undef MYTHREAD_VISTA */
-
-/* Define to 1 when using Windows 95 (and thus XP) compatible threads. This
- avoids use of features that were added in Windows Vista. */
-/* #undef MYTHREAD_WIN95 */
-
-/* Define to 1 to disable debugging code. */
#define NDEBUG 1
-
-/* Name of package */
#define PACKAGE "xz"
-
-/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "lasse.collin@tukaani.org"
-
-/* Define to the full name of this package. */
#define PACKAGE_NAME "XZ Utils"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "XZ Utils 5.2.1"
-
-/* Define to the one symbol short name of this package. */
+#define PACKAGE_STRING "XZ Utils 5.0.3"
#define PACKAGE_TARNAME "xz"
-
-/* Define to the home page for this package. */
#define PACKAGE_URL "http://tukaani.org/xz/"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "5.2.1"
-
-/* Define to necessary symbol if this constant uses a non-standard name on
- your system. */
-/* #undef PTHREAD_CREATE_JOINABLE */
-
-/* The size of `size_t', as computed by sizeof. */
+#define PACKAGE_VERSION "5.0.3"
#define SIZEOF_SIZE_T 8
-
-/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
-
-/* Define to 1 if the number of available CPU cores can be detected with
- cpuset(2). */
-#define TUKLIB_CPUCORES_CPUSET 1
-
-/* Define to 1 if the number of available CPU cores can be detected with
- pstat_getdynamic(). */
-/* #undef TUKLIB_CPUCORES_PSTAT_GETDYNAMIC */
-
-/* Define to 1 if the number of available CPU cores can be detected with
- sysconf(_SC_NPROCESSORS_ONLN) or sysconf(_SC_NPROC_ONLN). */
-/* #undef TUKLIB_CPUCORES_SYSCONF */
-
-/* Define to 1 if the number of available CPU cores can be detected with
- sysctl(). */
-/* #undef TUKLIB_CPUCORES_SYSCTL */
-
-/* Define to 1 if the system supports fast unaligned access to 16-bit and
- 32-bit integers. */
-/* FreeBSD - derive from __NO_STRICT_ALIGNMENT */
-/* #undef TUKLIB_FAST_UNALIGNED_ACCESS */
-
-/* Define to 1 if the amount of physical memory can be detected with
- _system_configuration.physmem. */
-/* #undef TUKLIB_PHYSMEM_AIX */
-
-/* Define to 1 if the amount of physical memory can be detected with
- getinvent_r(). */
-/* #undef TUKLIB_PHYSMEM_GETINVENT_R */
-
-/* Define to 1 if the amount of physical memory can be detected with
- getsysinfo(). */
-/* #undef TUKLIB_PHYSMEM_GETSYSINFO */
-
-/* Define to 1 if the amount of physical memory can be detected with
- pstat_getstatic(). */
-/* #undef TUKLIB_PHYSMEM_PSTAT_GETSTATIC */
-
-/* Define to 1 if the amount of physical memory can be detected with
- sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYS_PAGES). */
+#define TUKLIB_CPUCORES_SYSCTL 1
#define TUKLIB_PHYSMEM_SYSCONF 1
-
-/* Define to 1 if the amount of physical memory can be detected with sysctl().
- */
-/* #undef TUKLIB_PHYSMEM_SYSCTL */
-
-/* Define to 1 if the amount of physical memory can be detected with Linux
- sysinfo(). */
-/* #undef TUKLIB_PHYSMEM_SYSINFO */
-
-/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
-/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
-/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
-/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
-/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
-
-
-/* Version number of package */
-#define VERSION "5.2.1"
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
- significant byte first (like Motorola and SPARC, unlike Intel). */
+#define VERSION "5.0.3"
#if defined(__FreeBSD__)
#include <sys/_types.h>
#if defined(__NO_STRICT_ALIGNMENT)
@@ -431,72 +92,14 @@
#if _BYTE_ORDER == _BIG_ENDIAN
# define WORDS_BIGENDIAN 1
#endif
+#else
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+# endif
#endif
-
-/* Enable large inode numbers on Mac OS X 10.5. */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-/* #undef _FILE_OFFSET_BITS */
-
-/* Define for large files, on AIX-style hosts. */
-/* #undef _LARGE_FILES */
-
-/* Define to 1 if on MINIX. */
-/* #undef _MINIX */
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
- this defined. */
-/* #undef _POSIX_1_SOURCE */
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
- <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
- #define below would cause a syntax error. */
-/* #undef _UINT32_T */
-
-/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
- <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
- #define below would cause a syntax error. */
-/* #undef _UINT64_T */
-
-/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
- <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
- #define below would cause a syntax error. */
-/* #undef _UINT8_T */
-
-/* Define to rpl_ if the getopt replacement functions and variables should be
- used. */
-/* #undef __GETOPT_PREFIX */
-
-/* Define to the type of a signed integer type of width exactly 32 bits if
- such a type exists and the standard includes do not define it. */
-/* #undef int32_t */
-
-/* Define to the type of a signed integer type of width exactly 64 bits if
- such a type exists and the standard includes do not define it. */
-/* #undef int64_t */
-
-/* Define to the type of an unsigned integer type of width exactly 16 bits if
- such a type exists and the standard includes do not define it. */
-/* #undef uint16_t */
-
-/* Define to the type of an unsigned integer type of width exactly 32 bits if
- such a type exists and the standard includes do not define it. */
-/* #undef uint32_t */
-
-/* Define to the type of an unsigned integer type of width exactly 64 bits if
- such a type exists and the standard includes do not define it. */
-/* #undef uint64_t */
-
-/* Define to the type of an unsigned integer type of width exactly 8 bits if
- such a type exists and the standard includes do not define it. */
-/* #undef uint8_t */
-
-/* Define to the type of an unsigned integer type wide enough to hold a
- pointer, if such a type exists, and if the system does not define it. */
-/* #undef uintptr_t */
diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile
index 2add1d3..14f1702 100644
--- a/lib/libmagic/Makefile
+++ b/lib/libmagic/Makefile
@@ -7,7 +7,8 @@ CONTRDIR= ${.CURDIR}/../../contrib/file
LIB= magic
SHLIB_MAJOR= 4
-LIBADD= z
+DPADD= ${LIBZ}
+LDADD= -lz
MAN= libmagic.3 magic.5
SRCS= apprentice.c apptype.c ascmagic.c cdf.c cdf_time.c compress.c \
diff --git a/lib/libmagic/Makefile.depend b/lib/libmagic/Makefile.depend
new file mode 100644
index 0000000..ace658a
--- /dev/null
+++ b/lib/libmagic/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libz \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h
index 47f3347..d80926d 100644
--- a/lib/libmagic/config.h
+++ b/lib/libmagic/config.h
@@ -1,13 +1,5 @@
/* $FreeBSD$ */
-/* Get __FreeBSD_version. */
-#include <osreldate.h>
-
-/* Only specific versions of FreeBSD support xlocale */
-#if __FreeBSD_version >= 1000002 || (__FreeBSD_version < 1000000 && __FreeBSD_version >= 900506)
-#define FREEBSD_XLOCALE_SUPPORT 1
-#endif
-
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
@@ -55,11 +47,6 @@
/* Define to 1 if you have the `fork' function. */
#define HAVE_FORK 1
-/* Define to 1 if you have the `freelocale' function. */
-#ifdef FREEBSD_XLOCALE_SUPPORT
-#define HAVE_FREELOCALE 1
-#endif
-
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#define HAVE_FSEEKO 1
@@ -111,17 +98,9 @@
/* Define to 1 if you have a working `mmap' system call. */
#define HAVE_MMAP 1
-/* Define to 1 if you have the `newlocale' function. */
-#ifdef FREEBSD_XLOCALE_SUPPORT
-#define HAVE_NEWLOCALE 1
-#endif
-
/* Define to 1 if you have the `pread' function. */
#define HAVE_PREAD 1
-/* Define to 1 if you have the `setlocale' function. */
-#define HAVE_SETLOCALE 1
-
/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
@@ -206,11 +185,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
-/* Define to 1 if you have the `uselocale' function. */
-#ifdef FREEBSD_XLOCALE_SUPPORT
-#define HAVE_USELOCALE 1
-#endif
-
/* Define to 1 if you have the `utime' function. */
#define HAVE_UTIME 1
@@ -248,11 +222,6 @@
/* Define to 1 if `vfork' works. */
#define HAVE_WORKING_VFORK 1
-/* Define to 1 if you have the <xlocale.h> header file. */
-#ifdef FREEBSD_XLOCALE_SUPPORT
-#define HAVE_XLOCALE_H 1
-#endif
-
/* Define to 1 if you have the <zlib.h> header file. */
#define HAVE_ZLIB_H 1
@@ -278,7 +247,7 @@
#define PACKAGE_NAME "file"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "file 5.22"
+#define PACKAGE_STRING "file 5.19"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "file"
@@ -287,7 +256,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "5.22"
+#define PACKAGE_VERSION "5.19"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
@@ -318,7 +287,7 @@
/* Version number of package */
-#define VERSION "5.22"
+#define VERSION "5.19"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
diff --git a/lib/libmandoc/Makefile b/lib/libmandoc/Makefile
new file mode 100644
index 0000000..b857b8a
--- /dev/null
+++ b/lib/libmandoc/Makefile
@@ -0,0 +1,20 @@
+# $FreeBSD$
+
+MDOCMLDIR= ${.CURDIR}/../../contrib/mdocml
+.PATH: ${MDOCMLDIR}
+
+LIB= mandoc
+#NO_PIC=
+INTERNALLIB=
+MAN= mandoc.3
+SRCS= arch.c att.c chars.c \
+ compat_fgetln.c compat_getsubopt.c compat_strlcat.c compat_strlcpy.c \
+ eqn.c lib.c man.c man_hash.c man_macro.c man_validate.c mandoc.c \
+ mdoc.c mdoc_argv.c mdoc_hash.c mdoc_macro.c mdoc_validate.c \
+ msec.c read.c roff.c st.c \
+ tbl.c tbl_data.c tbl_layout.c tbl_opts.c vol.c
+
+WARNS?= 3
+CFLAGS+= -DHAVE_CONFIG_H
+
+.include <bsd.lib.mk>
diff --git a/lib/libmandoc/Makefile.depend b/lib/libmandoc/Makefile.depend
new file mode 100644
index 0000000..639d45d
--- /dev/null
+++ b/lib/libmandoc/Makefile.depend
@@ -0,0 +1,14 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile
index 61bea29..727fd86 100644
--- a/lib/libmd/Makefile
+++ b/lib/libmd/Makefile
@@ -42,13 +42,7 @@ CLEANFILES+= md[245]hl.c md[245].ref md[245].3 mddriver \
sha0.ref sha0hl.c sha1.ref sha1hl.c shadriver \
sha256.ref sha256hl.c sha512.ref sha512hl.c
-# Define WEAK_REFS to provide weak aliases for libmd symbols
-#
-# Note that the same sources are also used internally by libcrypt,
-# in which case:
-# * macros are used to rename symbols to libcrypt internal names
-# * no weak aliases are generated
-CFLAGS+= -I${.CURDIR} -DWEAK_REFS
+CFLAGS+= -I${.CURDIR}
.PATH: ${.CURDIR}/${MACHINE_ARCH} ${.CURDIR}/../../sys/crypto/sha2
.if exists(${MACHINE_ARCH}/sha.S)
diff --git a/lib/libmd/Makefile.depend b/lib/libmd/Makefile.depend
new file mode 100644
index 0000000..33e3fb5
--- /dev/null
+++ b/lib/libmd/Makefile.depend
@@ -0,0 +1,42 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+md4hl.So: md4hl.c
+md4hl.o: md4hl.c
+md4hl.po: md4hl.c
+md5hl.So: md5hl.c
+md5hl.o: md5hl.c
+md5hl.po: md5hl.c
+rmd160hl.So: rmd160hl.c
+rmd160hl.o: rmd160hl.c
+rmd160hl.po: rmd160hl.c
+sha0hl.So: sha0hl.c
+sha0hl.o: sha0hl.c
+sha0hl.po: sha0hl.c
+sha1hl.So: sha1hl.c
+sha1hl.o: sha1hl.c
+sha1hl.po: sha1hl.c
+sha256hl.So: sha256hl.c
+sha256hl.o: sha256hl.c
+sha256hl.po: sha256hl.c
+sha512hl.So: sha512hl.c
+sha512hl.o: sha512hl.c
+sha512hl.po: sha512hl.c
+.endif
diff --git a/lib/libmd/md4.h b/lib/libmd/md4.h
index 086a27b..4773513 100644
--- a/lib/libmd/md4.h
+++ b/lib/libmd/md4.h
@@ -35,34 +35,6 @@ typedef struct MD4Context {
#include <sys/cdefs.h>
__BEGIN_DECLS
-
-/* Ensure libmd symbols do not clash with libcrypto */
-
-#ifndef MD4Init
-#define MD4Init _libmd_MD4Init
-#endif
-#ifndef MD4Update
-#define MD4Update _libmd_MD4Update
-#endif
-#ifndef MD4Pad
-#define MD4Pad _libmd_MD4Pad
-#endif
-#ifndef MD4Final
-#define MD4Final _libmd_MD4Final
-#endif
-#ifndef MD4End
-#define MD4End _libmd_MD4End
-#endif
-#ifndef MD4File
-#define MD4File _libmd_MD4File
-#endif
-#ifndef MD4FileChunk
-#define MD4FileChunk _libmd_MD4FileChunk
-#endif
-#ifndef MD4Data
-#define MD4Data _libmd_MD4Data
-#endif
-
void MD4Init(MD4_CTX *);
void MD4Update(MD4_CTX *, const void *, unsigned int);
void MD4Pad(MD4_CTX *);
diff --git a/lib/libmd/md4c.c b/lib/libmd/md4c.c
index de1a7b4a..1211a98 100644
--- a/lib/libmd/md4c.c
+++ b/lib/libmd/md4c.c
@@ -290,18 +290,3 @@ unsigned int len;
output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
}
-
-#ifdef WEAK_REFS
-/* When building libmd, provide weak references. Note: this is not
- activated in the context of compiling these sources for internal
- use in libcrypt.
- */
-#undef MD4Init
-__weak_reference(_libmd_MD4Init, MD4Init);
-#undef MD4Update
-__weak_reference(_libmd_MD4Update, MD4Update);
-#undef MD4Pad
-__weak_reference(_libmd_MD4Pad, MD4Pad);
-#undef MD4Final
-__weak_reference(_libmd_MD4Final, MD4Final);
-#endif
diff --git a/lib/libmd/md5.h b/lib/libmd/md5.h
index 5ab3b14..803a88f 100644
--- a/lib/libmd/md5.h
+++ b/lib/libmd/md5.h
@@ -1,41 +1,4 @@
-/* $FreeBSD$ */
-
#ifndef _MD5_H_
#define _MD5_H_
-
-#ifndef _KERNEL
-
-/* Ensure libmd symbols do not clash with libcrypto */
-
-#ifndef MD5Init
-#define MD5Init _libmd_MD5Init
-#endif
-#ifndef MD5Update
-#define MD5Update _libmd_MD5Update
-#endif
-#ifndef MD5Pad
-#define MD5Pad _libmd_MD5Pad
-#endif
-#ifndef MD5Final
-#define MD5Final _libmd_MD5Final
-#endif
-#ifndef MD5Transform
-#define MD5Transform _libmd_MD5Transform
-#endif
-#ifndef MD5End
-#define MD5End _libmd_MD5End
-#endif
-#ifndef MD5File
-#define MD5File _libmd_MD5File
-#endif
-#ifndef MD5FileChunk
-#define MD5FileChunk _libmd_MD5FileChunk
-#endif
-#ifndef MD5Data
-#define MD5Data _libmd_MD5Data
-#endif
-
-#endif
-
#include <sys/md5.h>
#endif /* _MD5_H_ */
diff --git a/lib/libmd/md5c.c b/lib/libmd/md5c.c
index 6b50464..d097390 100644
--- a/lib/libmd/md5c.c
+++ b/lib/libmd/md5c.c
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
#include <machine/endian.h>
#include <sys/endian.h>
-#include "md5.h"
+#include <sys/md5.h>
static void MD5Transform(u_int32_t [4], const unsigned char [64]);
@@ -335,20 +335,3 @@ MD5Transform (state, block)
/* Zeroize sensitive information. */
memset ((void *)x, 0, sizeof (x));
}
-
-#ifdef WEAK_REFS
-/* When building libmd, provide weak references. Note: this is not
- activated in the context of compiling these sources for internal
- use in libcrypt.
- */
-#undef MD5Init
-__weak_reference(_libmd_MD5Init, MD5Init);
-#undef MD5Update
-__weak_reference(_libmd_MD5Update, MD5Update);
-#undef MD5Pad
-__weak_reference(_libmd_MD5Pad, MD5Pad);
-#undef MD5Final
-__weak_reference(_libmd_MD5Final, MD5Final);
-#undef MD5Transform
-__weak_reference(_libmd_MD5Transform, MD5Transform);
-#endif
diff --git a/lib/libmd/mdXhl.c b/lib/libmd/mdXhl.c
index 62be235..e69e5e5 100644
--- a/lib/libmd/mdXhl.c
+++ b/lib/libmd/mdXhl.c
@@ -74,7 +74,7 @@ MDXFileChunk(const char *filename, char *buf, off_t ofs, off_t len)
i = read(f, buffer, sizeof(buffer));
else
i = read(f, buffer, n);
- if (i <= 0)
+ if (i < 0)
break;
MDXUpdate(&ctx, buffer, i);
n -= i;
@@ -96,18 +96,3 @@ MDXData (const void *data, unsigned int len, char *buf)
MDXUpdate(&ctx,data,len);
return (MDXEnd(&ctx, buf));
}
-
-#ifdef WEAK_REFS
-/* When building libmd, provide weak references. Note: this is not
- activated in the context of compiling these sources for internal
- use in libcrypt.
- */
-#undef MDXEnd
-__weak_reference(_libmd_MDXEnd, MDXEnd);
-#undef MDXFile
-__weak_reference(_libmd_MDXFile, MDXFile);
-#undef MDXFileChunk
-__weak_reference(_libmd_MDXFileChunk, MDXFileChunk);
-#undef MDXData
-__weak_reference(_libmd_MDXData, MDXData);
-#endif
diff --git a/lib/libmd/ripemd.h b/lib/libmd/ripemd.h
index 778808f..2ff35cc 100644
--- a/lib/libmd/ripemd.h
+++ b/lib/libmd/ripemd.h
@@ -81,41 +81,6 @@ typedef struct RIPEMD160state_st {
} RIPEMD160_CTX;
__BEGIN_DECLS
-
-/* Ensure libmd symbols do not clash with libcrypto */
-
-#ifndef RIPEMD160_Init
-#define RIPEMD160_Init _libmd_RIPEMD160_Init
-#endif
-#ifndef RIPEMD160_Update
-#define RIPEMD160_Update _libmd_RIPEMD160_Update
-#endif
-#ifndef RIPEMD160_Final
-#define RIPEMD160_Final _libmd_RIPEMD160_Final
-#endif
-#ifndef RIPEMD160_End
-#define RIPEMD160_End _libmd_RIPEMD160_End
-#endif
-#ifndef RIPEMD160_File
-#define RIPEMD160_File _libmd_RIPEMD160_File
-#endif
-#ifndef RIPEMD160_FileChunk
-#define RIPEMD160_FileChunk _libmd_RIPEMD160_FileChunk
-#endif
-#ifndef RIPEMD160_Data
-#define RIPEMD160_Data _libmd_RIPEMD160_Data
-#endif
-
-#ifndef RIPEMD160_Transform
-#define RIPEMD160_Transform _libmd_RIPEMD160_Transform
-#endif
-#ifndef RMD160_version
-#define RMD160_version _libmd_RMD160_version
-#endif
-#ifndef ripemd160_block
-#define ripemd160_block _libmd_ripemd160_block
-#endif
-
void RIPEMD160_Init(RIPEMD160_CTX *c);
void RIPEMD160_Update(RIPEMD160_CTX *c, const void *data,
size_t len);
diff --git a/lib/libmd/rmd160c.c b/lib/libmd/rmd160c.c
index 5a3b783..e01f1e0 100644
--- a/lib/libmd/rmd160c.c
+++ b/lib/libmd/rmd160c.c
@@ -545,22 +545,3 @@ unsigned long *l;
}
}
#endif
-
-#ifdef WEAK_REFS
-/* When building libmd, provide weak references. Note: this is not
- activated in the context of compiling these sources for internal
- use in libcrypt.
- */
-#undef RIPEMD160_Init
-__weak_reference(_libmd_RIPEMD160_Init, RIPEMD160_Init);
-#undef RIPEMD160_Update
-__weak_reference(_libmd_RIPEMD160_Update, RIPEMD160_Update);
-#undef RIPEMD160_Final
-__weak_reference(_libmd_RIPEMD160_Final, RIPEMD160_Final);
-#undef RIPEMD160_Transform
-__weak_reference(_libmd_RIPEMD160_Transform, RIPEMD160_Transform);
-#undef RMD160_version
-__weak_reference(_libmd_RMD160_version, RMD160_version);
-#undef ripemd160_block
-__weak_reference(_libmd_ripemd160_block, ripemd160_block);
-#endif
diff --git a/lib/libmd/sha.h b/lib/libmd/sha.h
index c608c5b..8a0b7c2 100644
--- a/lib/libmd/sha.h
+++ b/lib/libmd/sha.h
@@ -79,73 +79,6 @@ typedef struct SHAstate_st {
#define SHA1_CTX SHA_CTX
__BEGIN_DECLS
-
-/* Ensure libmd symbols do not clash with libcrypto */
-
-#ifndef SHA_Init
-#define SHA_Init _libmd_SHA_Init
-#endif
-#ifndef SHA_Update
-#define SHA_Update _libmd_SHA_Update
-#endif
-#ifndef SHA_Final
-#define SHA_Final _libmd_SHA_Final
-#endif
-#ifndef SHA_End
-#define SHA_End _libmd_SHA_End
-#endif
-#ifndef SHA_File
-#define SHA_File _libmd_SHA_File
-#endif
-#ifndef SHA_FileChunk
-#define SHA_FileChunk _libmd_SHA_FileChunk
-#endif
-#ifndef SHA_Data
-#define SHA_Data _libmd_SHA_Data
-#endif
-
-#ifndef SHA_Transform
-#define SHA_Transform _libmd_SHA_Transform
-#endif
-#ifndef SHA_version
-#define SHA_version _libmd_SHA_version
-#endif
-#ifndef sha_block
-#define sha_block _libmd_sha_block
-#endif
-
-#ifndef SHA1_Init
-#define SHA1_Init _libmd_SHA1_Init
-#endif
-#ifndef SHA1_Update
-#define SHA1_Update _libmd_SHA1_Update
-#endif
-#ifndef SHA1_Final
-#define SHA1_Final _libmd_SHA1_Final
-#endif
-#ifndef SHA1_End
-#define SHA1_End _libmd_SHA1_End
-#endif
-#ifndef SHA1_File
-#define SHA1_File _libmd_SHA1_File
-#endif
-#ifndef SHA1_FileChunk
-#define SHA1_FileChunk _libmd_SHA1_FileChunk
-#endif
-#ifndef SHA1_Data
-#define SHA1_Data _libmd_SHA1_Data
-#endif
-
-#ifndef SHA1_Transform
-#define SHA1_Transform _libmd_SHA1_Transform
-#endif
-#ifndef SHA1_version
-#define SHA1_version _libmd_SHA1_version
-#endif
-#ifndef sha1_block
-#define sha1_block _libmd_sha1_block
-#endif
-
void SHA_Init(SHA_CTX *c);
void SHA_Update(SHA_CTX *c, const void *data, size_t len);
void SHA_Final(unsigned char *md, SHA_CTX *c);
@@ -153,7 +86,6 @@ char *SHA_End(SHA_CTX *, char *);
char *SHA_File(const char *, char *);
char *SHA_FileChunk(const char *, char *, off_t, off_t);
char *SHA_Data(const void *, unsigned int, char *);
-
void SHA1_Init(SHA_CTX *c);
void SHA1_Update(SHA_CTX *c, const void *data, size_t len);
void SHA1_Final(unsigned char *md, SHA_CTX *c);
diff --git a/lib/libmd/sha1c.c b/lib/libmd/sha1c.c
index 93a4ff3..ba3278a 100644
--- a/lib/libmd/sha1c.c
+++ b/lib/libmd/sha1c.c
@@ -488,33 +488,3 @@ SHA_CTX *c;
/* memset((char *)&c,0,sizeof(c));*/
}
-#ifdef WEAK_REFS
-/* When building libmd, provide weak references. Note: this is not
- activated in the context of compiling these sources for internal
- use in libcrypt.
- */
-#undef SHA_Init
-__weak_reference(_libmd_SHA_Init, SHA_Init);
-#undef SHA_Update
-__weak_reference(_libmd_SHA_Update, SHA_Update);
-#undef SHA_Final
-__weak_reference(_libmd_SHA_Final, SHA_Final);
-#undef SHA_Transform
-__weak_reference(_libmd_SHA_Transform, SHA_Transform);
-#undef SHA_version
-__weak_reference(_libmd_SHA_version, SHA_version);
-#undef sha_block
-__weak_reference(_libmd_sha_block, sha_block);
-#undef SHA1_Init
-__weak_reference(_libmd_SHA1_Init, SHA1_Init);
-#undef SHA1_Update
-__weak_reference(_libmd_SHA1_Update, SHA1_Update);
-#undef SHA1_Final
-__weak_reference(_libmd_SHA1_Final, SHA1_Final);
-#undef SHA1_Transform
-__weak_reference(_libmd_SHA1_Transform, SHA1_Transform);
-#undef SHA1_version
-__weak_reference(_libmd_SHA1_version, SHA1_version);
-#undef sha1_block
-__weak_reference(_libmd_sha1_block, sha1_block);
-#endif
diff --git a/lib/libmd/sha256.h b/lib/libmd/sha256.h
index f55d1d3..1b6a4f4 100644
--- a/lib/libmd/sha256.h
+++ b/lib/libmd/sha256.h
@@ -38,38 +38,6 @@ typedef struct SHA256Context {
} SHA256_CTX;
__BEGIN_DECLS
-
-/* Ensure libmd symbols do not clash with libcrypto */
-
-#ifndef SHA256_Init
-#define SHA256_Init _libmd_SHA256_Init
-#endif
-#ifndef SHA256_Update
-#define SHA256_Update _libmd_SHA256_Update
-#endif
-#ifndef SHA256_Final
-#define SHA256_Final _libmd_SHA256_Final
-#endif
-#ifndef SHA256_End
-#define SHA256_End _libmd_SHA256_End
-#endif
-#ifndef SHA256_File
-#define SHA256_File _libmd_SHA256_File
-#endif
-#ifndef SHA256_FileChunk
-#define SHA256_FileChunk _libmd_SHA256_FileChunk
-#endif
-#ifndef SHA256_Data
-#define SHA256_Data _libmd_SHA256_Data
-#endif
-
-#ifndef SHA256_Transform
-#define SHA256_Transform _libmd_SHA256_Transform
-#endif
-#ifndef SHA256_version
-#define SHA256_version _libmd_SHA256_version
-#endif
-
void SHA256_Init(SHA256_CTX *);
void SHA256_Update(SHA256_CTX *, const void *, size_t);
void SHA256_Final(unsigned char [32], SHA256_CTX *);
diff --git a/lib/libmd/sha256c.c b/lib/libmd/sha256c.c
index 4227b0c..76cec8e 100644
--- a/lib/libmd/sha256c.c
+++ b/lib/libmd/sha256c.c
@@ -295,18 +295,3 @@ SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx)
/* Clear the context state */
memset((void *)ctx, 0, sizeof(*ctx));
}
-
-#ifdef WEAK_REFS
-/* When building libmd, provide weak references. Note: this is not
- activated in the context of compiling these sources for internal
- use in libcrypt.
- */
-#undef SHA256_Init
-__weak_reference(_libmd_SHA256_Init, SHA256_Init);
-#undef SHA256_Update
-__weak_reference(_libmd_SHA256_Update, SHA256_Update);
-#undef SHA256_Final
-__weak_reference(_libmd_SHA256_Final, SHA256_Final);
-#undef SHA256_Transform
-__weak_reference(_libmd_SHA256_Transform, SHA256_Transform);
-#endif
diff --git a/lib/libmd/sha512.h b/lib/libmd/sha512.h
index b034ca5..8998f4c 100644
--- a/lib/libmd/sha512.h
+++ b/lib/libmd/sha512.h
@@ -38,38 +38,6 @@ typedef struct SHA512Context {
} SHA512_CTX;
__BEGIN_DECLS
-
-/* Ensure libmd symbols do not clash with libcrypto */
-
-#ifndef SHA512_Init
-#define SHA512_Init _libmd_SHA512_Init
-#endif
-#ifndef SHA512_Update
-#define SHA512_Update _libmd_SHA512_Update
-#endif
-#ifndef SHA512_Final
-#define SHA512_Final _libmd_SHA512_Final
-#endif
-#ifndef SHA512_End
-#define SHA512_End _libmd_SHA512_End
-#endif
-#ifndef SHA512_File
-#define SHA512_File _libmd_SHA512_File
-#endif
-#ifndef SHA512_FileChunk
-#define SHA512_FileChunk _libmd_SHA512_FileChunk
-#endif
-#ifndef SHA512_Data
-#define SHA512_Data _libmd_SHA512_Data
-#endif
-
-#ifndef SHA512_Transform
-#define SHA512_Transform _libmd_SHA512_Transform
-#endif
-#ifndef SHA512_version
-#define SHA512_version _libmd_SHA512_version
-#endif
-
void SHA512_Init(SHA512_CTX *);
void SHA512_Update(SHA512_CTX *, const void *, size_t);
void SHA512_Final(unsigned char [64], SHA512_CTX *);
diff --git a/lib/libmd/sha512c.c b/lib/libmd/sha512c.c
index e5e52a8..c2a93be 100644
--- a/lib/libmd/sha512c.c
+++ b/lib/libmd/sha512c.c
@@ -318,18 +318,3 @@ SHA512_Final(unsigned char digest[64], SHA512_CTX * ctx)
/* Clear the context state */
memset((void *)ctx, 0, sizeof(*ctx));
}
-
-#ifdef WEAK_REFS
-/* When building libmd, provide weak references. Note: this is not
- activated in the context of compiling these sources for internal
- use in libcrypt.
- */
-#undef SHA512_Init
-__weak_reference(_libmd_SHA512_Init, SHA512_Init);
-#undef SHA512_Update
-__weak_reference(_libmd_SHA512_Update, SHA512_Update);
-#undef SHA512_Final
-__weak_reference(_libmd_SHA512_Final, SHA512_Final);
-#undef SHA512_Transform
-__weak_reference(_libmd_SHA512_Transform, SHA512_Transform);
-#endif
diff --git a/lib/libmd/shadriver.c b/lib/libmd/shadriver.c
index 29a3cf0..adaf684 100644
--- a/lib/libmd/shadriver.c
+++ b/lib/libmd/shadriver.c
@@ -31,13 +31,10 @@ __FBSDID("$FreeBSD$");
#endif
#if SHA == 1
-#undef SHA_Data
#define SHA_Data SHA1_Data
#elif SHA == 256
-#undef SHA_Data
#define SHA_Data SHA256_Data
#elif SHA == 512
-#undef SHA_Data
#define SHA_Data SHA512_Data
#endif
diff --git a/lib/libmemstat/Makefile b/lib/libmemstat/Makefile
index 597dc6d..d261085 100644
--- a/lib/libmemstat/Makefile
+++ b/lib/libmemstat/Makefile
@@ -3,7 +3,8 @@
WARNS?= 3
LIB= memstat
SHLIB_MAJOR= 3
-LIBADD+= kvm
+DPADD= ${LIBKVM}
+LDADD= -lkvm
SRCS+= memstat.c
SRCS+= memstat_all.c
SRCS+= memstat_malloc.c
diff --git a/lib/libmemstat/Makefile.depend b/lib/libmemstat/Makefile.depend
new file mode 100644
index 0000000..46488c9
--- /dev/null
+++ b/lib/libmemstat/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libkvm \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libmilter/Makefile.depend b/lib/libmilter/Makefile.depend
new file mode 100644
index 0000000..e092bec
--- /dev/null
+++ b/lib/libmilter/Makefile.depend
@@ -0,0 +1,58 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libutil \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+comm.So: sm_os.h
+comm.o: sm_os.h
+comm.po: sm_os.h
+engine.So: sm_os.h
+engine.o: sm_os.h
+engine.po: sm_os.h
+errstring.So: sm_os.h
+errstring.o: sm_os.h
+errstring.po: sm_os.h
+handler.So: sm_os.h
+handler.o: sm_os.h
+handler.po: sm_os.h
+listener.So: sm_os.h
+listener.o: sm_os.h
+listener.po: sm_os.h
+main.So: sm_os.h
+main.o: sm_os.h
+main.po: sm_os.h
+monitor.So: sm_os.h
+monitor.o: sm_os.h
+monitor.po: sm_os.h
+signal.So: sm_os.h
+signal.o: sm_os.h
+signal.po: sm_os.h
+sm_gethost.So: sm_os.h
+sm_gethost.o: sm_os.h
+sm_gethost.po: sm_os.h
+smfi.So: sm_os.h
+smfi.o: sm_os.h
+smfi.po: sm_os.h
+strl.So: sm_os.h
+strl.o: sm_os.h
+strl.po: sm_os.h
+worker.So: sm_os.h
+worker.o: sm_os.h
+worker.po: sm_os.h
+.endif
diff --git a/lib/libmp/Makefile b/lib/libmp/Makefile
index 6a73658..5d0e7a7 100644
--- a/lib/libmp/Makefile
+++ b/lib/libmp/Makefile
@@ -4,7 +4,8 @@
LIB= mp
SHLIB_MAJOR= 7
-LIBADD= crypto
+DPADD= ${LIBCRYPTO}
+LDADD= -lcrypto
MAN= libmp.3
INCS= mp.h
SRCS= mpasbn.c
diff --git a/lib/libmp/Makefile.depend b/lib/libmp/Makefile.depend
new file mode 100644
index 0000000..62e4b3c
--- /dev/null
+++ b/lib/libmp/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ secure/lib/libcrypto \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libmp/tests/Makefile b/lib/libmp/tests/Makefile
index e74e806..0f591eb 100644
--- a/lib/libmp/tests/Makefile
+++ b/lib/libmp/tests/Makefile
@@ -4,6 +4,7 @@ TESTSDIR= ${TESTSBASE}/lib/libmp
TAP_TESTS_C+= legacy_test
-LIBADD+= mp
+DPADD+= ${LIBCRYPTO} ${LIBMP}
+LDADD+= -lcrypto -lmp
.include <bsd.test.mk>
diff --git a/lib/libmt/Makefile b/lib/libmt/Makefile
deleted file mode 100644
index 6fe5920..0000000
--- a/lib/libmt/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# $FreeBSD$
-
-LIB= mt
-SHLIBDIR?= /lib
-SRCS= mtlib.c
-INCS= mtlib.h
-
-LIBADD= sbuf bsdxml
-
-MAN= mt.3
-
-.include <bsd.lib.mk>
diff --git a/lib/libmt/mt.3 b/lib/libmt/mt.3
deleted file mode 100644
index eaf0194..0000000
--- a/lib/libmt/mt.3
+++ /dev/null
@@ -1,454 +0,0 @@
-.\"
-.\" Copyright (c) 2013, 2015 Spectra Logic Corporation
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions, and the following disclaimer,
-.\" without modification.
-.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
-.\" substantially similar to the "NO WARRANTY" disclaimer below
-.\" ("Disclaimer") and any redistribution must be conditioned upon
-.\" including a substantially similar Disclaimer requirement for further
-.\" binary redistribution.
-.\"
-.\" NO WARRANTY
-.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
-.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-.\" POSSIBILITY OF SUCH DAMAGES.
-.\"
-.\" Authors: Ken Merry (Spectra Logic Corporation)
-.\"
-.\" $FreeBSD$
-.\"
-.Dd February 13, 2015
-.Dt MT 3
-.Os
-.Sh NAME
-.Nm mt_start_element ,
-.Nm mt_end_element ,
-.Nm mt_char_handler ,
-.Nm mt_status_tree_sbuf ,
-.Nm mt_status_tree_print ,
-.Nm mt_status_entry_free ,
-.Nm mt_status_free ,
-.Nm mt_entry_sbuf ,
-.Nm mt_param_parent_print ,
-.Nm mt_param_entry_print ,
-.Nm mt_protect_print ,
-.Nm mt_param_list ,
-.Nm mt_density_name ,
-.Nm mt_density_bp ,
-.Nm mt_density_num ,
-.Nm mt_get_xml_str ,
-.Nm mt_get_status
-.Nd Magnetic Tape library
-.Sh LIBRARY
-.Lb libmt
-.Sh SYNOPSIS
-.In sys/sbuf.h
-.In bsdxml.h
-.In mtlib.h
-.Ft void
-.Fo mt_start_element
-.Fa "void *user_data"
-.Fa "const char *name"
-.Fa "const char **attr"
-.Fc
-.Ft void
-.Fo mt_end_element
-.Fa "void *user_data"
-.Fa "const char *name"
-.Fc
-.Ft void
-.Fo mt_char_handler
-.Fa "void *user_data"
-.Fa "const XML_Char *str"
-.Fa "int len"
-.Fc
-.Ft void
-.Fo mt_status_tree_sbuf
-.Fa "struct sbuf *sb"
-.Fa "struct mt_status_entry *entry"
-.Fa "int indent"
-.Fa "void (*sbuf_func)(struct sbuf *sb, struct mt_status_entry *entry, void *arg)"
-.Fa "void *arg"
-.Fc
-.Ft void
-.Fo mt_status_tree_print
-.Fa "struct mt_status_entry *entry"
-.Fa "int indent"
-.Fa "void (*print_func)(struct mt_status_entry *entry, void *arg)"
-.Fa "void *arg"
-.Fc
-.Ft "struct mt_status_entry *"
-.Fo mt_entry_find
-.Fa "struct mt_status_entry *entry"
-.Fa "char *name"
-.Fc
-.Ft "struct mt_status_entry *"
-.Fo mt_status_entry_find
-.Fa "struct mt_status_data *status_data"
-.Fa "char *name"
-.Fc
-.Ft void
-.Fo mt_status_entry_free
-.Fa "struct mt_status_entry *entry)"
-.Fc
-.Ft void
-.Fo mt_status_free
-.Fa "struct mt_status_data *status_data"
-.Fc
-.Ft void
-.Fo mt_entry_sbuf
-.Fa "struct sbuf *sb"
-.Fa "struct mt_status_entry *entry"
-.Fa "char *fmt"
-.Fc
-.Ft void
-.Fo mt_param_parent_sbuf
-.Fa "struct sbuf *sb"
-.Fa "struct mt_status_entry *entry"
-.Fa "struct mt_print_params *print_params"
-.Fc
-.Ft void
-.Fo mt_param_parent_print
-.Fa "struct mt_status_entry *entry"
-.Fa "struct mt_print_params *print_params"
-.Fc
-.Ft void
-.Fo mt_param_entry_sbuf
-.Fa "struct sbuf *sb"
-.Fa "struct mt_status_entry *entry"
-.Fa "void *arg"
-.Fc
-.Ft void
-.Fo mt_param_entry_print
-.Fa "struct mt_status_entry *entry"
-.Fa "void *arg"
-.Fc
-.Ft int
-.Fo mt_protect_print
-.Fa "struct mt_status_data *status_data"
-.Fa "int verbose"
-.Fc
-.Ft int
-.Fo mt_param_list
-.Fa "struct mt_status_data *status_data"
-.Fa "char *param_name"
-.Fa "int quiet"
-.Fc
-.Ft "const char *"
-.Fo mt_density_name
-.Fa "int density_num"
-.Fc
-.Ft int
-.Fo mt_density_bp
-.Fa "int density_num"
-.Fa "int bpi"
-.Fc
-.Ft int
-.Fo mt_density_num
-.Fa "const char *density_name"
-.Fc
-.Ft int
-.Fo mt_get_status
-.Fa "char *xml_str"
-.Fa "struct mt_status_data *status_data"
-.Fc
-.Sh DESCRIPTION
-The MT library consists of a number of functions designed to aid in
-interacting with the
-.Xr sa 4
-driver.
-The
-.Xr sa 4
-driver returns some status data as XML-formatted strings, and
-the primary purpose of this library is to make it easier for the
-software developer to parse those strings and extract the status values.
-.Pp
-The
-.Fn mt_start_element ,
-.Fn mt_end_element ,
-and
-.Fn mt_char_handler
-functions are designed to work with the
-.Xr libbbsdxml 3
-library, which is an XML parsing library.
-The user data for the XML parser should be set with
-.Fn XML_SetUserData
-to a zeroed struct
-mt_status_data with the entries list initialized.
-The element handlers for the XML parser should be set to
-.Fn mt_start_element
-and
-.Fn mt_end_element
-with
-.Fn XML_SetElementHandler .
-The character data handler should be set to
-.Fn mt_char_handler
-with the
-.Fn XML_SetCharacterDataHandler
-function.
-The error member of the status_data structure will be set to 0 if parsing
-is successful, and non-zero if parsing failed.
-In the event of a failure, the error_str member will contain an error
-message describing the failure.
-These functions will build a tree of tape driver status data that can be
-searched and printed using the other functions in this library.
-.Pp
-.Fn mt_status_tree_sbuf
-takes the root node of a tree of
-.Xr sa 4
-driver status information, and displays it in an
-.Xr sbuf 9 .
-The
-.Ar sb
-argument is the destination sbuf.
-The
-.Ar entry
-argument is the root of the tree.
-The
-.Ar indent
-argument is the number of characters to indent the output.
-Each recursive call to
-.Fn mt_status_tree_sbuf
-will have the indent level incremented by 2.
-The
-.Ar sbuf_func
-argument is for a user-supplied alternate printing function.
-If it is non-NULL, it will be called instead of the default output printing
-code.
-The
-.Ar arg
-argument is an argument for the
-.Ar sbuf_func
-function.
-.Pp
-The
-.Fn mt_status_tree_print
-function is the same as the
-.Fn mt_status_tree_sbuf
-function, except that the tree is printed to standard out instead of to a
-sbuf.
-.Pp
-The
-.Fn mt_entry_find
-function returns the first entry in the tree starting at
-.Ar entry
-that matches
-.Ar name .
-The supplied node name can be a single level name like "foo", or it can
-specify mulitple node names that must be matched, for instance "foo.bar.baz".
-In the case of a single level name, it will match any node beneath
-.Ar entry
-that matches
-.Ar name .
-In the case of a multi-level name like "foo.bar.baz", it will return the
-first entry named "baz" whose immediate parent is "bar" and where the
-parent of "bar" is named "foo".
-.Pp
-The
-.Fn mt_status_entry_find
-is the same as
-.Fn mt_entry_find ,
-except that it operates on the top level mt_status_data and all
-mt_status_entry nodes below it instead of just an mt_status_entry
-structure.
-.Pp
-The
-.Fn mt_status_entry_free
-function frees the tree of status data underneath
-.Ar entry .
-.Pp
-The
-.Fn mt_status_free
-function frees the tree of status data underneath
-.Ar status_data .
-.Pp
-The
-.Fn mt_entry_sbuf
-function prints
-.Ar entry
-to the supplied sbuf
-.Ar sb ,
-optionally using the
-.Xr printf 3
-format
-.Ar fmt .
-If
-.Ar fmt
-is NULL, then
-.Fn mt_entry_sbuf
-will render integer types in base 10 without special formatting and all
-other types as they were rendered in the XML.
-.Pp
-.Fn mt_param_parent_sbuf
-prints the parents of the given
-.Ar entry
-to the supplied sbuf
-.Ar sb
-subject to the print parameters
-.Ar print_params .
-The result will be formatted with a period between each level, like
-"foo.bar.baz".
-.Pp
-.Fn mt_param_parent_print
-is like
-.Fn mt_param_parent_sbuf
-except that it prints the results to standard output instead of an sbuf.
-.Pp
-.Fn mt_param_entry_sbuf
-prints the
-.Ar entry
-to the given sbuf
-.Ar sb .
-The argument
-.Ar arg
-is a pointer to struct mt_print_params, which allows the caller to control
-the printing output.
-This function is intended to be supplied as an argument to
-.Fn mt_status_tree_sbuf .
-.Pp
-.Fn mt_param_entry_print
-is like
-.Fn mt_param_entry_sbuf
-except that it prints to standard output instead of an sbuf.
-It is intended to be used as an argument to
-.Fn mt_status_tree_print .
-.Pp
-.Fn mt_protect_print
-prints tape drive protection information from the supplied
-.Ar status_data
-beginning at the node name defined as the root node for protection data.
-If the
-.Ar verbose
-argument is non-zero, protection entry descriptions will be printed.
-If it is zero, protection entry descriptions will not be printed.
-.Pp
-.Fn mt_param_list
-prints tape driver parameters information from the supplied
-.Ar status_data .
-If the
-.Ar param_name
-is non-NULL, only the named parameter will be printed.
-If
-.Ar quiet
-is non-zero, parameter descriptions will be omitted in the output.
-.Pp
-.Fn mt_density_name
-Returns a text identifier for the supplied numeric
-.Ar density_num .
-The
-.Ar density_num
-should currently be a value between 0 and 255 inclusive, since that is the
-valid range for
-.Tn SCSI
-density code values.
-See below for notes on the return values.
-.Pp
-.Fn mt_density_bp
-Returns the bits per inch or bits per mm values for a given density entry
-specified by the
-.Ar density_num .
-If the
-.Ar bpi
-argument is non-zero, the bits per inch value is returned.
-Otherwise, the bits per mm value is returned.
-.Pp
-.Fn mt_density_num
-returns a numeric value for a text density description.
-It does a case-insensitive comparison of density names in the density table
-to the supplied density name.
-.Pp
-.Fn mt_get_xml_str
-gets the current XML status / parameter string from the sa(4) driver
-instance referenced by the open file descriptor
-.Ar mtfd .
-The
-.Xr mtio 4
-.Xr ioctl 2
-to be used is supplied as the
-.Ar cmd
-argument.
-Currently the
-.Fn mt_get_xml_str
-function will work with the
-.Dv MTIOCEXTGET
-and
-.Dv MTIOCPARAMGET
-ioctls.
-The supplied
-.Ar xml_str
-will be filled in with a pointer to the complete XML status string.
-Multiple calls to the given
-.Xr ioctl 2
-are made and more space is malloced until all of the XML string is fetched.
-The string returned in the
-.Ar xml_str
-argument should be freed when it is no longer in use.
-.Sh RETURN VALUES
-.Fn mt_entry_find
-returns the first matching entry, or NULL if it fails to find a match.
-.Pp
-.Fn mt_status_entry_find
-returns the first matching entry, or NULL if it fails to find a match.
-.Pp
-.Fn mt_protect_print
-Returns 0 for success, and non-zero for failure.
-.Fn mt_protect_print
-can only fail if it cannot find protection information in the supplied
-status data.
-.Pp
-.Fn mt_param_list
-Returns 0 for success and non-zero for failure.
-.Fn mt_param_list
-can only fail if it cannot find parameter information in the supplied
-status data.
-.Pp
-.Fn mt_density_name
-returns a text description of a numeric density.
-The special density value 0 is decoded as "default".
-The special density value 0x7f is decoded as "same".
-If the density is not known,
-.Fn mt_density_name
-will return "UNKNOWN".
-.Pp
-.Fn mt_density_bp
-returns the bits per inch value for the given density (if the
-.Ar bpi
-field is non-zero), the bits per mm value otherwise, or 0 if the supplied
-.Ar density_num
-is not in the density table or the table entry does not include bpi / bpmm
-values.
-.Pp
-.Fn mt_density_num
-returns a numeric density value between 0 and 255 for the supplied density
-name.
-It returns 0 if the density name is not recognized.
-.Pp
-.Fn mt_get_xml_str
-returns 0 for success, and -1 for failure.
-.Sh SEE ALSO
-.Xr mt 1 ,
-.Xr mtio 4 ,
-.Xr sa 4
-.Sh HISTORY
-The MT library first appeared in
-.Fx 10.1 .
-.Sh AUTHORS
-.An Ken Merry Aq ken@FreeBSD.org
-.Sh BUGS
-The library interface is not complete, and may change in the future.
-Application authors should not rely on the library interface to be
-consistent in the immediate future.
diff --git a/lib/libmt/mtlib.c b/lib/libmt/mtlib.c
deleted file mode 100644
index f6acba2..0000000
--- a/lib/libmt/mtlib.c
+++ /dev/null
@@ -1,773 +0,0 @@
-/*-
- * Copyright (c) 2013, 2014, 2015 Spectra Logic Corporation
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions, and the following disclaimer,
- * without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- * substantially similar to the "NO WARRANTY" disclaimer below
- * ("Disclaimer") and any redistribution must be conditioned upon
- * including a substantially similar Disclaimer requirement for further
- * binary redistribution.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- *
- * Authors: Ken Merry (Spectra Logic Corporation)
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/mtio.h>
-#include <sys/queue.h>
-#include <sys/sbuf.h>
-
-#include <ctype.h>
-#include <err.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdint.h>
-#include <errno.h>
-#include <bsdxml.h>
-#include <mtlib.h>
-
-/*
- * Called at the start of each XML element, and includes the list of
- * attributes for the element.
- */
-void
-mt_start_element(void *user_data, const char *name, const char **attr)
-{
- int i;
- struct mt_status_data *mtinfo;
- struct mt_status_entry *entry;
-
- mtinfo = (struct mt_status_data *)user_data;
-
- if (mtinfo->error != 0)
- return;
-
- mtinfo->level++;
- if ((u_int)mtinfo->level >= (sizeof(mtinfo->cur_sb) /
- sizeof(mtinfo->cur_sb[0]))) {
- mtinfo->error = 1;
- snprintf(mtinfo->error_str, sizeof(mtinfo->error_str),
- "%s: too many nesting levels, %zd max", __func__,
- sizeof(mtinfo->cur_sb) / sizeof(mtinfo->cur_sb[0]));
- return;
- }
-
- mtinfo->cur_sb[mtinfo->level] = sbuf_new_auto();
- if (mtinfo->cur_sb[mtinfo->level] == NULL) {
- mtinfo->error = 1;
- snprintf(mtinfo->error_str, sizeof(mtinfo->error_str),
- "%s: Unable to allocate sbuf", __func__);
- return;
- }
-
- entry = malloc(sizeof(*entry));
- if (entry == NULL) {
- mtinfo->error = 1;
- snprintf(mtinfo->error_str, sizeof(mtinfo->error_str),
- "%s: unable to allocate %zd bytes", __func__,
- sizeof(*entry));
- return;
- }
- bzero(entry, sizeof(*entry));
- STAILQ_INIT(&entry->nv_list);
- STAILQ_INIT(&entry->child_entries);
- entry->entry_name = strdup(name);
- mtinfo->cur_entry[mtinfo->level] = entry;
- if (mtinfo->cur_entry[mtinfo->level - 1] == NULL) {
- STAILQ_INSERT_TAIL(&mtinfo->entries, entry, links);
- } else {
- STAILQ_INSERT_TAIL(
- &mtinfo->cur_entry[mtinfo->level - 1]->child_entries,
- entry, links);
- entry->parent = mtinfo->cur_entry[mtinfo->level - 1];
- }
- for (i = 0; attr[i] != NULL; i+=2) {
- struct mt_status_nv *nv;
- int need_nv;
-
- need_nv = 0;
-
- if (strcmp(attr[i], "size") == 0) {
- entry->size = strtoull(attr[i+1], NULL, 0);
- } else if (strcmp(attr[i], "type") == 0) {
- if (strcmp(attr[i+1], "int") == 0) {
- entry->var_type = MT_TYPE_INT;
- } else if (strcmp(attr[i+1], "uint") == 0) {
- entry->var_type = MT_TYPE_UINT;
- } else if (strcmp(attr[i+1], "str") == 0) {
- entry->var_type = MT_TYPE_STRING;
- } else if (strcmp(attr[i+1], "node") == 0) {
- entry->var_type = MT_TYPE_NODE;
- } else {
- need_nv = 1;
- }
- } else if (strcmp(attr[i], "fmt") == 0) {
- entry->fmt = strdup(attr[i+1]);
- } else if (strcmp(attr[i], "desc") == 0) {
- entry->desc = strdup(attr[i+1]);
- } else {
- need_nv = 1;
- }
- if (need_nv != 0) {
- nv = malloc(sizeof(*nv));
- if (nv == NULL) {
- mtinfo->error = 1;
- snprintf(mtinfo->error_str,
- sizeof(mtinfo->error_str),
- "%s: error allocating %zd bytes",
- __func__, sizeof(*nv));
- }
- bzero(nv, sizeof(*nv));
- nv->name = strdup(attr[i]);
- nv->value = strdup(attr[i+1]);
- STAILQ_INSERT_TAIL(&entry->nv_list, nv, links);
- }
- }
-}
-
-/*
- * Called on XML element close.
- */
-void
-mt_end_element(void *user_data, const char *name)
-{
- struct mt_status_data *mtinfo;
- char *str;
-
- mtinfo = (struct mt_status_data *)user_data;
-
- if (mtinfo->error != 0)
- return;
-
- if (mtinfo->cur_sb[mtinfo->level] == NULL) {
- mtinfo->error = 1;
- snprintf(mtinfo->error_str, sizeof(mtinfo->error_str),
- "%s: no valid sbuf at level %d (name %s)", __func__,
- mtinfo->level, name);
- return;
- }
- sbuf_finish(mtinfo->cur_sb[mtinfo->level]);
- str = strdup(sbuf_data(mtinfo->cur_sb[mtinfo->level]));
- if (str == NULL) {
- mtinfo->error = 1;
- snprintf(mtinfo->error_str, sizeof(mtinfo->error_str),
- "%s can't allocate %zd bytes for string", __func__,
- sbuf_len(mtinfo->cur_sb[mtinfo->level]));
- return;
- }
-
- if (strlen(str) == 0) {
- free(str);
- str = NULL;
- }
- if (str != NULL) {
- struct mt_status_entry *entry;
-
- entry = mtinfo->cur_entry[mtinfo->level];
- switch(entry->var_type) {
- case MT_TYPE_INT:
- entry->value_signed = strtoll(str, NULL, 0);
- break;
- case MT_TYPE_UINT:
- entry->value_unsigned = strtoull(str, NULL, 0);
- break;
- default:
- break;
- }
- }
-
- mtinfo->cur_entry[mtinfo->level]->value = str;
-
- sbuf_delete(mtinfo->cur_sb[mtinfo->level]);
- mtinfo->cur_sb[mtinfo->level] = NULL;
- mtinfo->cur_entry[mtinfo->level] = NULL;
- mtinfo->level--;
-}
-
-/*
- * Called to handle character strings in the current element.
- */
-void
-mt_char_handler(void *user_data, const XML_Char *str, int len)
-{
- struct mt_status_data *mtinfo;
-
- mtinfo = (struct mt_status_data *)user_data;
- if (mtinfo->error != 0)
- return;
-
- sbuf_bcat(mtinfo->cur_sb[mtinfo->level], str, len);
-}
-
-void
-mt_status_tree_sbuf(struct sbuf *sb, struct mt_status_entry *entry, int indent,
- void (*sbuf_func)(struct sbuf *sb, struct mt_status_entry *entry,
- void *arg), void *arg)
-{
- struct mt_status_nv *nv;
- struct mt_status_entry *entry2;
-
- if (sbuf_func != NULL) {
- sbuf_func(sb, entry, arg);
- } else {
- sbuf_printf(sb, "%*sname: %s, value: %s, fmt: %s, size: %zd, "
- "type: %d, desc: %s\n", indent, "", entry->entry_name,
- entry->value, entry->fmt, entry->size, entry->var_type,
- entry->desc);
- STAILQ_FOREACH(nv, &entry->nv_list, links) {
- sbuf_printf(sb, "%*snv: name: %s, value: %s\n",
- indent + 1, "", nv->name, nv->value);
- }
- }
-
- STAILQ_FOREACH(entry2, &entry->child_entries, links)
- mt_status_tree_sbuf(sb, entry2, indent + 2, sbuf_func, arg);
-}
-
-void
-mt_status_tree_print(struct mt_status_entry *entry, int indent,
- void (*print_func)(struct mt_status_entry *entry, void *arg), void *arg)
-{
-
- if (print_func != NULL) {
- struct mt_status_entry *entry2;
-
- print_func(entry, arg);
- STAILQ_FOREACH(entry2, &entry->child_entries, links)
- mt_status_tree_print(entry2, indent + 2, print_func,
- arg);
- } else {
- struct sbuf *sb;
-
- sb = sbuf_new_auto();
- if (sb == NULL)
- return;
- mt_status_tree_sbuf(sb, entry, indent, NULL, NULL);
- sbuf_finish(sb);
-
- printf("%s", sbuf_data(sb));
- sbuf_delete(sb);
- }
-}
-
-/*
- * Given a parameter name in the form "foo" or "foo.bar.baz", traverse the
- * tree looking for the parameter (the first case) or series of parameters
- * (second case).
- */
-struct mt_status_entry *
-mt_entry_find(struct mt_status_entry *entry, char *name)
-{
- struct mt_status_entry *entry2;
- char *tmpname = NULL, *tmpname2 = NULL, *tmpstr = NULL;
-
- tmpname = strdup(name);
- if (tmpname == NULL)
- goto bailout;
-
- /* Save a pointer so we can free this later */
- tmpname2 = tmpname;
-
- tmpstr = strsep(&tmpname, ".");
-
- /*
- * Is this the entry we're looking for? Or do we have further
- * child entries that we need to grab?
- */
- if (strcmp(entry->entry_name, tmpstr) == 0) {
- if (tmpname == NULL) {
- /*
- * There are no further child entries to find. We
- * have a complete match.
- */
- free(tmpname2);
- return (entry);
- } else {
- /*
- * There are more child entries that we need to find.
- * Fall through to the recursive search off of this
- * entry, below. Use tmpname, which will contain
- * everything after the first period.
- */
- name = tmpname;
- }
- }
-
- /*
- * Recursively look for further entries.
- */
- STAILQ_FOREACH(entry2, &entry->child_entries, links) {
- struct mt_status_entry *entry3;
-
- entry3 = mt_entry_find(entry2, name);
- if (entry3 != NULL) {
- free(tmpname2);
- return (entry3);
- }
- }
-
-bailout:
- free(tmpname2);
-
- return (NULL);
-}
-
-struct mt_status_entry *
-mt_status_entry_find(struct mt_status_data *status_data, char *name)
-{
- struct mt_status_entry *entry, *entry2;
-
- STAILQ_FOREACH(entry, &status_data->entries, links) {
- entry2 = mt_entry_find(entry, name);
- if (entry2 != NULL)
- return (entry2);
- }
-
- return (NULL);
-}
-
-void
-mt_status_entry_free(struct mt_status_entry *entry)
-{
- struct mt_status_entry *entry2, *entry3;
- struct mt_status_nv *nv, *nv2;
-
- STAILQ_FOREACH_SAFE(entry2, &entry->child_entries, links, entry3) {
- STAILQ_REMOVE(&entry->child_entries, entry2, mt_status_entry,
- links);
- mt_status_entry_free(entry2);
- }
-
- free(entry->entry_name);
- free(entry->value);
- free(entry->fmt);
- free(entry->desc);
-
- STAILQ_FOREACH_SAFE(nv, &entry->nv_list, links, nv2) {
- STAILQ_REMOVE(&entry->nv_list, nv, mt_status_nv, links);
- free(nv->name);
- free(nv->value);
- free(nv);
- }
- free(entry);
-}
-
-void
-mt_status_free(struct mt_status_data *status_data)
-{
- struct mt_status_entry *entry, *entry2;
-
- STAILQ_FOREACH_SAFE(entry, &status_data->entries, links, entry2) {
- STAILQ_REMOVE(&status_data->entries, entry, mt_status_entry,
- links);
- mt_status_entry_free(entry);
- }
-}
-
-void
-mt_entry_sbuf(struct sbuf *sb, struct mt_status_entry *entry, char *fmt)
-{
- switch(entry->var_type) {
- case MT_TYPE_INT:
- if (fmt != NULL)
- sbuf_printf(sb, fmt, (intmax_t)entry->value_signed);
- else
- sbuf_printf(sb, "%jd",
- (intmax_t)entry->value_signed);
- break;
- case MT_TYPE_UINT:
- if (fmt != NULL)
- sbuf_printf(sb, fmt, (uintmax_t)entry->value_unsigned);
- else
- sbuf_printf(sb, "%ju",
- (uintmax_t)entry->value_unsigned);
- break;
- default:
- if (fmt != NULL)
- sbuf_printf(sb, fmt, entry->value);
- else
- sbuf_printf(sb, "%s", entry->value);
- break;
- }
-}
-
-void
-mt_param_parent_print(struct mt_status_entry *entry,
- struct mt_print_params *print_params)
-{
- if (entry->parent != NULL)
- mt_param_parent_print(entry->parent, print_params);
-
- if (((print_params->flags & MT_PF_INCLUDE_ROOT) == 0)
- && (strcmp(entry->entry_name, print_params->root_name) == 0))
- return;
-
- printf("%s.", entry->entry_name);
-}
-
-void
-mt_param_parent_sbuf(struct sbuf *sb, struct mt_status_entry *entry,
- struct mt_print_params *print_params)
-{
- if (entry->parent != NULL)
- mt_param_parent_sbuf(sb, entry->parent, print_params);
-
- if (((print_params->flags & MT_PF_INCLUDE_ROOT) == 0)
- && (strcmp(entry->entry_name, print_params->root_name) == 0))
- return;
-
- sbuf_printf(sb, "%s.", entry->entry_name);
-}
-
-void
-mt_param_entry_sbuf(struct sbuf *sb, struct mt_status_entry *entry, void *arg)
-{
- struct mt_print_params *print_params;
-
- print_params = (struct mt_print_params *)arg;
-
- /*
- * We don't want to print nodes.
- */
- if (entry->var_type == MT_TYPE_NODE)
- return;
-
- if ((print_params->flags & MT_PF_FULL_PATH)
- && (entry->parent != NULL))
- mt_param_parent_sbuf(sb, entry->parent, print_params);
-
- sbuf_printf(sb, "%s: %s", entry->entry_name, entry->value);
- if ((print_params->flags & MT_PF_VERBOSE)
- && (entry->desc != NULL)
- && (strlen(entry->desc) > 0))
- sbuf_printf(sb, " (%s)", entry->desc);
- sbuf_printf(sb, "\n");
-
-}
-
-void
-mt_param_entry_print(struct mt_status_entry *entry, void *arg)
-{
- struct mt_print_params *print_params;
-
- print_params = (struct mt_print_params *)arg;
-
- /*
- * We don't want to print nodes.
- */
- if (entry->var_type == MT_TYPE_NODE)
- return;
-
- if ((print_params->flags & MT_PF_FULL_PATH)
- && (entry->parent != NULL))
- mt_param_parent_print(entry->parent, print_params);
-
- printf("%s: %s", entry->entry_name, entry->value);
- if ((print_params->flags & MT_PF_VERBOSE)
- && (entry->desc != NULL)
- && (strlen(entry->desc) > 0))
- printf(" (%s)", entry->desc);
- printf("\n");
-}
-
-int
-mt_protect_print(struct mt_status_data *status_data, int verbose)
-{
- struct mt_status_entry *entry;
- const char *prot_name = MT_PROTECTION_NAME;
- struct mt_print_params print_params;
-
- snprintf(print_params.root_name, sizeof(print_params.root_name),
- MT_PARAM_ROOT_NAME);
- print_params.flags = MT_PF_FULL_PATH;
- if (verbose != 0)
- print_params.flags |= MT_PF_VERBOSE;
-
- entry = mt_status_entry_find(status_data, __DECONST(char *,prot_name));
- if (entry == NULL)
- return (1);
- mt_status_tree_print(entry, 0, mt_param_entry_print, &print_params);
-
- return (0);
-}
-
-int
-mt_param_list(struct mt_status_data *status_data, char *param_name, int quiet)
-{
- struct mt_status_entry *entry;
- struct mt_print_params print_params;
- char root_name[20];
-
- snprintf(root_name, sizeof(root_name), "mtparamget");
- strlcpy(print_params.root_name, root_name,
- sizeof(print_params.root_name));
-
- print_params.flags = MT_PF_FULL_PATH;
- if (quiet == 0)
- print_params.flags |= MT_PF_VERBOSE;
-
- if (param_name != NULL) {
- entry = mt_status_entry_find(status_data, param_name);
- if (entry == NULL)
- return (1);
-
- mt_param_entry_print(entry, &print_params);
-
- return (0);
- } else {
- entry = mt_status_entry_find(status_data, root_name);
-
- STAILQ_FOREACH(entry, &status_data->entries, links)
- mt_status_tree_print(entry, 0, mt_param_entry_print,
- &print_params);
- }
-
- return (0);
-}
-
-static struct densities {
- int dens;
- int bpmm;
- int bpi;
- const char *name;
-} dens[] = {
- /*
- * Taken from T10 Project 997D
- * SCSI-3 Stream Device Commands (SSC)
- * Revision 11, 4-Nov-97
- *
- * LTO 1-6 definitions obtained from the eighth edition of the
- * IBM TotalStorage LTO Ultrium Tape Drive SCSI Reference
- * (July 2007) and the second edition of the IBM System Storage LTO
- * Tape Drive SCSI Reference (February 13, 2013).
- *
- * IBM 3592 definitions obtained from second edition of the IBM
- * System Storage Tape Drive 3592 SCSI Reference (May 25, 2012).
- *
- * DAT-72 and DAT-160 bpi values taken from "HP StorageWorks DAT160
- * tape drive white paper", dated June 2007.
- *
- * DAT-160 / SDLT220 density code (0x48) conflict information
- * found here:
- *
- * http://h20564.www2.hp.com/hpsc/doc/public/display?docId=emr_na-c01065117&sp4ts.oid=429311
- * (Document ID c01065117)
- */
- /*Num. bpmm bpi Reference */
- { 0x1, 32, 800, "X3.22-1983" },
- { 0x2, 63, 1600, "X3.39-1986" },
- { 0x3, 246, 6250, "X3.54-1986" },
- { 0x5, 315, 8000, "X3.136-1986" },
- { 0x6, 126, 3200, "X3.157-1987" },
- { 0x7, 252, 6400, "X3.116-1986" },
- { 0x8, 315, 8000, "X3.158-1987" },
- { 0x9, 491, 37871, "X3.180" },
- { 0xA, 262, 6667, "X3B5/86-199" },
- { 0xB, 63, 1600, "X3.56-1986" },
- { 0xC, 500, 12690, "HI-TC1" },
- { 0xD, 999, 25380, "HI-TC2" },
- { 0xF, 394, 10000, "QIC-120" },
- { 0x10, 394, 10000, "QIC-150" },
- { 0x11, 630, 16000, "QIC-320" },
- { 0x12, 2034, 51667, "QIC-1350" },
- { 0x13, 2400, 61000, "X3B5/88-185A" },
- { 0x14, 1703, 43245, "X3.202-1991" },
- { 0x15, 1789, 45434, "ECMA TC17" },
- { 0x16, 394, 10000, "X3.193-1990" },
- { 0x17, 1673, 42500, "X3B5/91-174" },
- { 0x18, 1673, 42500, "X3B5/92-50" },
- { 0x19, 2460, 62500, "DLTapeIII" },
- { 0x1A, 3214, 81633, "DLTapeIV(20GB)" },
- { 0x1B, 3383, 85937, "DLTapeIV(35GB)" },
- { 0x1C, 1654, 42000, "QIC-385M" },
- { 0x1D, 1512, 38400, "QIC-410M" },
- { 0x1E, 1385, 36000, "QIC-1000C" },
- { 0x1F, 2666, 67733, "QIC-2100C" },
- { 0x20, 2666, 67733, "QIC-6GB(M)" },
- { 0x21, 2666, 67733, "QIC-20GB(C)" },
- { 0x22, 1600, 40640, "QIC-2GB(C)" },
- { 0x23, 2666, 67733, "QIC-875M" },
- { 0x24, 2400, 61000, "DDS-2" },
- { 0x25, 3816, 97000, "DDS-3" },
- { 0x26, 3816, 97000, "DDS-4" },
- { 0x27, 3056, 77611, "Mammoth" },
- { 0x28, 1491, 37871, "X3.224" },
- { 0x40, 4880, 123952, "LTO-1" },
- { 0x41, 3868, 98250, "DLTapeIV(40GB)" },
- { 0x42, 7398, 187909, "LTO-2" },
- { 0x44, 9638, 244805, "LTO-3" },
- { 0x46, 12725, 323215, "LTO-4" },
- { 0x47, 6417, 163000, "DAT-72" },
- /*
- * XXX KDM note that 0x48 is also the density code for DAT-160.
- * For some reason they used overlapping density codes.
- */
-#if 0
- { 0x48, 6870, 174500, "DAT-160" },
-#endif
- { 0x48, 5236, 133000, "SDLTapeI(110)" },
- { 0x49, 7598, 193000, "SDLTapeI(160)" },
- { 0x4a, 0, 0, "T10000A" },
- { 0x4b, 0, 0, "T10000B" },
- { 0x4c, 0, 0, "T10000C" },
- { 0x4d, 0, 0, "T10000D" },
- { 0x51, 11800, 299720, "3592A1 (unencrypted)" },
- { 0x52, 11800, 299720, "3592A2 (unencrypted)" },
- { 0x53, 13452, 341681, "3592A3 (unencrypted)" },
- { 0x54, 19686, 500024, "3592A4 (unencrypted)" },
- { 0x55, 20670, 525018, "3592A5 (unencrypted)" },
- { 0x58, 15142, 384607, "LTO-5" },
- { 0x5A, 15142, 384607, "LTO-6" },
- { 0x71, 11800, 299720, "3592A1 (encrypted)" },
- { 0x72, 11800, 299720, "3592A2 (encrypted)" },
- { 0x73, 13452, 341681, "3592A3 (encrypted)" },
- { 0x74, 19686, 500024, "3592A4 (encrypted)" },
- { 0x75, 20670, 525018, "3592A5 (encrypted)" },
- { 0x8c, 1789, 45434, "EXB-8500c" },
- { 0x90, 1703, 43245, "EXB-8200c" },
- { 0, 0, 0, NULL }
-};
-
-const char *
-mt_density_name(int density_num)
-{
- struct densities *sd;
-
- /* densities 0 and 0x7f are handled as special cases */
- if (density_num == 0)
- return ("default");
- if (density_num == 0x7f)
- return ("same");
-
- for (sd = dens; sd->dens != 0; sd++)
- if (sd->dens == density_num)
- break;
- if (sd->dens == 0)
- return ("UNKNOWN");
- return (sd->name);
-}
-
-/*
- * Given a specific density number, return either the bits per inch or bits
- * per millimeter for the given density.
- */
-int
-mt_density_bp(int density_num, int bpi)
-{
- struct densities *sd;
-
- for (sd = dens; sd->dens; sd++)
- if (sd->dens == density_num)
- break;
- if (sd->dens == 0)
- return (0);
- if (bpi)
- return (sd->bpi);
- else
- return (sd->bpmm);
-}
-
-int
-mt_density_num(const char *density_name)
-{
- struct densities *sd;
- size_t l = strlen(density_name);
-
- for (sd = dens; sd->dens; sd++)
- if (strncasecmp(sd->name, density_name, l) == 0)
- break;
- return (sd->dens);
-}
-
-/*
- * Get the current status XML string.
- * Returns 0 on success, -1 on failure (with errno set, and *xml_str == NULL).
- */
-int
-mt_get_xml_str(int mtfd, unsigned long cmd, char **xml_str)
-{
- size_t alloc_len = 32768;
- struct mtextget extget;
- int error;
-
- *xml_str = NULL;
-
- for (;;) {
- bzero(&extget, sizeof(extget));
- *xml_str = malloc(alloc_len);
- if (*xml_str == NULL)
- return (-1);
- extget.status_xml = *xml_str;
- extget.alloc_len = alloc_len;
-
- error = ioctl(mtfd, cmd, (caddr_t)&extget);
- if (error == 0 && extget.status == MT_EXT_GET_OK)
- break;
-
- free(*xml_str);
- *xml_str = NULL;
-
- if (error != 0 || extget.status != MT_EXT_GET_NEED_MORE_SPACE)
- return (-1);
-
- /* The driver needs more space, so double and try again. */
- alloc_len *= 2;
- }
- return (0);
-}
-
-/*
- * Populate a struct mt_status_data from the XML string via mt_get_xml_str().
- *
- * Returns XML_STATUS_OK on success.
- * If XML_STATUS_ERROR is returned, errno may be set to indicate the reason.
- * The caller must check status_data->error.
- */
-int
-mt_get_status(char *xml_str, struct mt_status_data *status_data)
-{
- XML_Parser parser;
- int retval;
-
- bzero(status_data, sizeof(*status_data));
- STAILQ_INIT(&status_data->entries);
-
- parser = XML_ParserCreate(NULL);
- if (parser == NULL) {
- errno = ENOMEM;
- return (XML_STATUS_ERROR);
- }
-
- XML_SetUserData(parser, status_data);
- XML_SetElementHandler(parser, mt_start_element, mt_end_element);
- XML_SetCharacterDataHandler(parser, mt_char_handler);
-
- retval = XML_Parse(parser, xml_str, strlen(xml_str), 1);
- XML_ParserFree(parser);
- return (retval);
-}
diff --git a/lib/libmt/mtlib.h b/lib/libmt/mtlib.h
deleted file mode 100644
index a61a15d..0000000
--- a/lib/libmt/mtlib.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*-
- * Copyright (c) 2013, 2014 Spectra Logic Corporation
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions, and the following disclaimer,
- * without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- * substantially similar to the "NO WARRANTY" disclaimer below
- * ("Disclaimer") and any redistribution must be conditioned upon
- * including a substantially similar Disclaimer requirement for further
- * binary redistribution.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- *
- * Authors: Ken Merry (Spectra Logic Corporation)
- *
- * $FreeBSD$
- */
-
-#ifndef _MTLIB_H
-#define _MTLIB_H
-
-typedef enum {
- MT_TYPE_NONE,
- MT_TYPE_STRING,
- MT_TYPE_INT,
- MT_TYPE_UINT,
- MT_TYPE_NODE
-} mt_variable_type;
-
-struct mt_status_nv {
- char *name;
- char *value;
- STAILQ_ENTRY(mt_status_nv) links;
-};
-
-struct mt_status_entry {
- char *entry_name;
- char *value;
- uint64_t value_unsigned;
- int64_t value_signed;
- char *fmt;
- char *desc;
- size_t size;
- mt_variable_type var_type;
- struct mt_status_entry *parent;
- STAILQ_HEAD(, mt_status_nv) nv_list;
- STAILQ_HEAD(, mt_status_entry) child_entries;
- STAILQ_ENTRY(mt_status_entry) links;
-};
-
-struct mt_status_data {
- int level;
- struct sbuf *cur_sb[32];
- struct mt_status_entry *cur_entry[32];
- int error;
- char error_str[128];
- STAILQ_HEAD(, mt_status_entry) entries;
-};
-
-typedef enum {
- MT_PF_NONE = 0x00,
- MT_PF_VERBOSE = 0x01,
- MT_PF_FULL_PATH = 0x02,
- MT_PF_INCLUDE_ROOT = 0x04
-} mt_print_flags;
-
-struct mt_print_params {
- mt_print_flags flags;
- char root_name[64];
-};
-
-__BEGIN_DECLS
-void mt_start_element(void *user_data, const char *name, const char **attr);
-void mt_end_element(void *user_data, const char *name);
-void mt_char_handler(void *user_data, const XML_Char *str, int len);
-void mt_status_tree_sbuf(struct sbuf *sb, struct mt_status_entry *entry,
- int indent, void (*sbuf_func)(struct sbuf *sb,
- struct mt_status_entry *entry, void *arg), void *arg);
-void mt_status_tree_print(struct mt_status_entry *entry, int indent,
- void (*print_func)(struct mt_status_entry *entry,
- void *arg), void *arg);
-struct mt_status_entry *mt_entry_find(struct mt_status_entry *entry,
- char *name);
-struct mt_status_entry *mt_status_entry_find(struct mt_status_data *status_data,
- char *name);
-void mt_status_entry_free(struct mt_status_entry *entry);
-void mt_status_free(struct mt_status_data *status_data);
-void mt_entry_sbuf(struct sbuf *sb, struct mt_status_entry *entry, char *fmt);
-void mt_param_parent_print(struct mt_status_entry *entry,
- struct mt_print_params *print_params);
-void mt_param_parent_sbuf(struct sbuf *sb, struct mt_status_entry *entry,
- struct mt_print_params *print_params);
-void mt_param_entry_sbuf(struct sbuf *sb, struct mt_status_entry *entry,
- void *arg);
-void mt_param_entry_print(struct mt_status_entry *entry, void *arg);
-int mt_protect_print(struct mt_status_data *status_data, int verbose);
-int mt_param_list(struct mt_status_data *status_data, char *param_name,
- int quiet);
-const char *mt_density_name(int density_num);
-int mt_density_bp(int density_num, int bpi);
-int mt_density_num(const char *density_name);
-int mt_get_xml_str(int mtfd, unsigned long cmd, char **xml_str);
-int mt_get_status(char *xml_str, struct mt_status_data *status_data);
-__END_DECLS
-
-#endif /* _MTLIB_H */
diff --git a/lib/libnetbsd/Makefile.depend b/lib/libnetbsd/Makefile.depend
new file mode 100644
index 0000000..8780851
--- /dev/null
+++ b/lib/libnetbsd/Makefile.depend
@@ -0,0 +1,15 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libnetgraph/Makefile.depend b/lib/libnetgraph/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libnetgraph/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libnetgraph/debug.c b/lib/libnetgraph/debug.c
index f445041..6d0579f 100644
--- a/lib/libnetgraph/debug.c
+++ b/lib/libnetgraph/debug.c
@@ -62,15 +62,12 @@ __FBSDID("$FreeBSD$");
#include <netgraph/ng_atmllc.h>
#include <netgraph/ng_bpf.h>
#include <netgraph/ng_bridge.h>
-#include <netgraph/ng_car.h>
#include <netgraph/ng_cisco.h>
-#include <netgraph/ng_deflate.h>
#include <netgraph/ng_device.h>
#include <netgraph/ng_echo.h>
#include <netgraph/ng_eiface.h>
#include <netgraph/ng_etf.h>
#include <netgraph/ng_ether.h>
-#include <netgraph/ng_ether_echo.h>
#include <netgraph/ng_frame_relay.h>
#include <netgraph/ng_gif.h>
#include <netgraph/ng_gif_demux.h>
@@ -84,20 +81,15 @@ __FBSDID("$FreeBSD$");
#include <netgraph/ng_lmi.h>
#include <netgraph/ng_mppc.h>
#include <netgraph/ng_nat.h>
-#include <netgraph/netflow/ng_netflow.h>
#include <netgraph/ng_one2many.h>
-#include <netgraph/ng_patch.h>
-#include <netgraph/ng_pipe.h>
#include <netgraph/ng_ppp.h>
#include <netgraph/ng_pppoe.h>
#include <netgraph/ng_pptpgre.h>
-#include <netgraph/ng_pred1.h>
#include <netgraph/ng_rfc1490.h>
#include <netgraph/ng_socket.h>
#include <netgraph/ng_source.h>
#include <netgraph/ng_split.h>
#include <netgraph/ng_sppp.h>
-#include <netgraph/ng_tag.h>
#include <netgraph/ng_tcpmss.h>
#include <netgraph/ng_tee.h>
#include <netgraph/ng_tty.h>
@@ -137,15 +129,12 @@ static const struct ng_cookie cookies[] = {
COOKIE(ATMLLC),
COOKIE(BPF),
COOKIE(BRIDGE),
- COOKIE(CAR),
COOKIE(CISCO),
- COOKIE(DEFLATE),
COOKIE(DEVICE),
COOKIE(ECHO),
COOKIE(EIFACE),
COOKIE(ETF),
COOKIE(ETHER),
- COOKIE(ETHER_ECHO),
COOKIE(FRAMERELAY),
COOKIE(GIF),
COOKIE(GIF_DEMUX),
@@ -160,20 +149,15 @@ static const struct ng_cookie cookies[] = {
COOKIE(LMI),
COOKIE(MPPC),
COOKIE(NAT),
- COOKIE(NETFLOW),
COOKIE(ONE2MANY),
- COOKIE(PATCH),
- COOKIE(PIPE),
COOKIE(PPP),
COOKIE(PPPOE),
COOKIE(PPTPGRE),
- COOKIE(PRED1),
COOKIE(RFC1490),
COOKIE(SOCKET),
COOKIE(SOURCE),
COOKIE(SPLIT),
COOKIE(SPPP),
- COOKIE(TAG),
COOKIE(TCPMSS),
COOKIE(TEE),
COOKIE(TTY),
@@ -197,8 +181,9 @@ NgSetDebug(int level)
{
int old = _gNgDebugLevel;
- if (level >= 0)
- _gNgDebugLevel = level;
+ if (level < 0)
+ level = old;
+ _gNgDebugLevel = level;
return (old);
}
@@ -240,10 +225,10 @@ _NgDebugMsg(const struct ng_mesg *msg, const char *path)
/* Display header stuff */
NGLOGX("NG_MESG :");
NGLOGX(" vers %d", msg->header.version);
- NGLOGX(" arglen %u", msg->header.arglen);
- NGLOGX(" flags %x", msg->header.flags);
- NGLOGX(" token %u", msg->header.token);
- NGLOGX(" cookie %s (%u)",
+ NGLOGX(" arglen %d", msg->header.arglen);
+ NGLOGX(" flags %ld", msg->header.flags);
+ NGLOGX(" token %lu", (u_long)msg->header.token);
+ NGLOGX(" cookie %s (%d)",
NgCookie(msg->header.typecookie), msg->header.typecookie);
/* At lower debugging levels, skip ASCII translation */
diff --git a/lib/libngatm/Makefile.depend b/lib/libngatm/Makefile.depend
new file mode 100644
index 0000000..807c0a4
--- /dev/null
+++ b/lib/libngatm/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libnv/Makefile b/lib/libnv/Makefile
index 8b2fc78..e9371bc 100644
--- a/lib/libnv/Makefile
+++ b/lib/libnv/Makefile
@@ -7,13 +7,10 @@ SHLIBDIR?= /lib
LIB= nv
SHLIB_MAJOR= 0
-.PATH: ${.CURDIR}/../../sys/kern ${.CURDIR}/../../sys/sys
-CFLAGS+=-I${.CURDIR}/../../sys -I${.CURDIR}
-
-SRCS= subr_dnvlist.c
+SRCS= dnvlist.c
SRCS+= msgio.c
-SRCS+= subr_nvlist.c
-SRCS+= subr_nvpair.c
+SRCS+= nvlist.c
+SRCS+= nvpair.c
INCS= dnv.h
INCS+= nv.h
@@ -22,66 +19,145 @@ MAN+= nv.3
MLINKS+=nv.3 libnv.3 \
nv.3 nvlist.3
-MLINKS+=nv.3 nvlist_add_binary.3 \
- nv.3 nvlist_add_bool.3 \
- nv.3 nvlist_add_descriptor.3 \
- nv.3 nvlist_add_null.3 \
- nv.3 nvlist_add_number.3 \
- nv.3 nvlist_add_nvlist.3 \
- nv.3 nvlist_add_string.3 \
- nv.3 nvlist_add_stringf.3 \
- nv.3 nvlist_add_stringv.3 \
- nv.3 nvlist_clone.3 \
- nv.3 nvlist_create.3 \
+MLINKS+=nv.3 nvlist_create.3 \
nv.3 nvlist_destroy.3 \
- nv.3 nvlist_dump.3 \
- nv.3 nvlist_empty.3 \
nv.3 nvlist_error.3 \
+ nv.3 nvlist_empty.3 \
+ nv.3 nvlist_clone.3 \
+ nv.3 nvlist_dump.3 \
+ nv.3 nvlist_fdump.3 \
+ nv.3 nvlist_size.3 \
+ nv.3 nvlist_pack.3 \
+ nv.3 nvlist_unpack.3 \
+ nv.3 nvlist_send.3 \
+ nv.3 nvlist_recv.3 \
+ nv.3 nvlist_xfer.3 \
+ nv.3 nvlist_next.3 \
nv.3 nvlist_exists.3 \
- nv.3 nvlist_exists_binary.3 \
- nv.3 nvlist_exists_bool.3 \
- nv.3 nvlist_exists_descriptor.3 \
+ nv.3 nvlist_exists_type.3 \
nv.3 nvlist_exists_null.3 \
+ nv.3 nvlist_exists_bool.3 \
nv.3 nvlist_exists_number.3 \
- nv.3 nvlist_exists_nvlist.3 \
nv.3 nvlist_exists_string.3 \
- nv.3 nvlist_exists_type.3 \
- nv.3 nvlist_fdump.3 \
- nv.3 nvlist_flags.3 \
- nv.3 nvlist_free.3 \
- nv.3 nvlist_free_binary.3 \
- nv.3 nvlist_free_bool.3 \
- nv.3 nvlist_free_descriptor.3 \
- nv.3 nvlist_free_null.3 \
- nv.3 nvlist_free_number.3 \
- nv.3 nvlist_free_nvlist.3 \
- nv.3 nvlist_free_string.3 \
- nv.3 nvlist_free_type.3 \
- nv.3 nvlist_get_binary.3 \
+ nv.3 nvlist_exists_nvlist.3 \
+ nv.3 nvlist_exists_descriptor.3 \
+ nv.3 nvlist_exists_binary.3 \
+ nv.3 nvlist_add_null.3 \
+ nv.3 nvlist_add_bool.3 \
+ nv.3 nvlist_add_number.3 \
+ nv.3 nvlist_add_string.3 \
+ nv.3 nvlist_add_stringf.3 \
+ nv.3 nvlist_add_stringv.3 \
+ nv.3 nvlist_add_nvlist.3 \
+ nv.3 nvlist_add_descriptor.3 \
+ nv.3 nvlist_add_binary.3 \
+ nv.3 nvlist_move_string.3 \
+ nv.3 nvlist_move_nvlist.3 \
+ nv.3 nvlist_move_descriptor.3 \
+ nv.3 nvlist_move_binary.3 \
nv.3 nvlist_get_bool.3 \
- nv.3 nvlist_get_descriptor.3 \
nv.3 nvlist_get_number.3 \
- nv.3 nvlist_get_nvlist.3 \
- nv.3 nvlist_get_parent.3 \
nv.3 nvlist_get_string.3 \
- nv.3 nvlist_move_binary.3 \
- nv.3 nvlist_move_descriptor.3 \
- nv.3 nvlist_move_nvlist.3 \
- nv.3 nvlist_move_string.3 \
- nv.3 nvlist_next.3 \
- nv.3 nvlist_pack.3 \
- nv.3 nvlist_recv.3 \
- nv.3 nvlist_send.3 \
- nv.3 nvlist_set_error.3 \
- nv.3 nvlist_size.3 \
- nv.3 nvlist_take_binary.3 \
+ nv.3 nvlist_get_nvlist.3 \
+ nv.3 nvlist_get_descriptor.3 \
+ nv.3 nvlist_get_binary.3 \
nv.3 nvlist_take_bool.3 \
- nv.3 nvlist_take_descriptor.3 \
nv.3 nvlist_take_number.3 \
- nv.3 nvlist_take_nvlist.3 \
nv.3 nvlist_take_string.3 \
- nv.3 nvlist_unpack.3 \
- nv.3 nvlist_xfer.3
+ nv.3 nvlist_take_nvlist.3 \
+ nv.3 nvlist_take_descriptor.3 \
+ nv.3 nvlist_take_binary.3 \
+ nv.3 nvlist_free.3 \
+ nv.3 nvlist_free_type.3 \
+ nv.3 nvlist_free_null.3 \
+ nv.3 nvlist_free_bool.3 \
+ nv.3 nvlist_free_number.3 \
+ nv.3 nvlist_free_string.3 \
+ nv.3 nvlist_free_nvlist.3 \
+ nv.3 nvlist_free_descriptor.3 \
+ nv.3 nvlist_free_binary.3
+MLINKS+=nv.3 nvlist_existsf.3 \
+ nv.3 nvlist_existsf_type.3 \
+ nv.3 nvlist_existsf_null.3 \
+ nv.3 nvlist_existsf_bool.3 \
+ nv.3 nvlist_existsf_number.3 \
+ nv.3 nvlist_existsf_string.3 \
+ nv.3 nvlist_existsf_nvlist.3 \
+ nv.3 nvlist_existsf_descriptor.3 \
+ nv.3 nvlist_existsf_binary.3 \
+ nv.3 nvlist_addf_null.3 \
+ nv.3 nvlist_addf_bool.3 \
+ nv.3 nvlist_addf_number.3 \
+ nv.3 nvlist_addf_string.3 \
+ nv.3 nvlist_addf_nvlist.3 \
+ nv.3 nvlist_addf_descriptor.3 \
+ nv.3 nvlist_addf_binary.3 \
+ nv.3 nvlist_movef_string.3 \
+ nv.3 nvlist_movef_nvlist.3 \
+ nv.3 nvlist_movef_descriptor.3 \
+ nv.3 nvlist_movef_binary.3 \
+ nv.3 nvlist_getf_bool.3 \
+ nv.3 nvlist_getf_number.3 \
+ nv.3 nvlist_getf_string.3 \
+ nv.3 nvlist_getf_nvlist.3 \
+ nv.3 nvlist_getf_descriptor.3 \
+ nv.3 nvlist_getf_binary.3 \
+ nv.3 nvlist_takef_bool.3 \
+ nv.3 nvlist_takef_number.3 \
+ nv.3 nvlist_takef_string.3 \
+ nv.3 nvlist_takef_nvlist.3 \
+ nv.3 nvlist_takef_descriptor.3 \
+ nv.3 nvlist_takef_binary.3 \
+ nv.3 nvlist_freef.3 \
+ nv.3 nvlist_freef_type.3 \
+ nv.3 nvlist_freef_null.3 \
+ nv.3 nvlist_freef_bool.3 \
+ nv.3 nvlist_freef_number.3 \
+ nv.3 nvlist_freef_string.3 \
+ nv.3 nvlist_freef_nvlist.3 \
+ nv.3 nvlist_freef_descriptor.3 \
+ nv.3 nvlist_freef_binary.3
+MLINKS+=nv.3 nvlist_existsv.3 \
+ nv.3 nvlist_existsv_type.3 \
+ nv.3 nvlist_existsv_null.3 \
+ nv.3 nvlist_existsv_bool.3 \
+ nv.3 nvlist_existsv_number.3 \
+ nv.3 nvlist_existsv_string.3 \
+ nv.3 nvlist_existsv_nvlist.3 \
+ nv.3 nvlist_existsv_descriptor.3 \
+ nv.3 nvlist_existsv_binary.3 \
+ nv.3 nvlist_addv_null.3 \
+ nv.3 nvlist_addv_bool.3 \
+ nv.3 nvlist_addv_number.3 \
+ nv.3 nvlist_addv_string.3 \
+ nv.3 nvlist_addv_nvlist.3 \
+ nv.3 nvlist_addv_descriptor.3 \
+ nv.3 nvlist_addv_binary.3 \
+ nv.3 nvlist_movev_string.3 \
+ nv.3 nvlist_movev_nvlist.3 \
+ nv.3 nvlist_movev_descriptor.3 \
+ nv.3 nvlist_movev_binary.3 \
+ nv.3 nvlist_getv_bool.3 \
+ nv.3 nvlist_getv_number.3 \
+ nv.3 nvlist_getv_string.3 \
+ nv.3 nvlist_getv_nvlist.3 \
+ nv.3 nvlist_getv_descriptor.3 \
+ nv.3 nvlist_getv_binary.3 \
+ nv.3 nvlist_takev_bool.3 \
+ nv.3 nvlist_takev_number.3 \
+ nv.3 nvlist_takev_string.3 \
+ nv.3 nvlist_takev_nvlist.3 \
+ nv.3 nvlist_takev_descriptor.3 \
+ nv.3 nvlist_takev_binary.3 \
+ nv.3 nvlist_freev.3 \
+ nv.3 nvlist_freev_type.3 \
+ nv.3 nvlist_freev_null.3 \
+ nv.3 nvlist_freev_bool.3 \
+ nv.3 nvlist_freev_number.3 \
+ nv.3 nvlist_freev_string.3 \
+ nv.3 nvlist_freev_nvlist.3 \
+ nv.3 nvlist_freev_descriptor.3 \
+ nv.3 nvlist_freev_binary.3
WARNS?= 6
diff --git a/lib/libnv/Makefile.depend b/lib/libnv/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libnv/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libnv/dnv.h b/lib/libnv/dnv.h
new file mode 100644
index 0000000..ac1e57c
--- /dev/null
+++ b/lib/libnv/dnv.h
@@ -0,0 +1,106 @@
+/*-
+ * Copyright (c) 2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Pawel Jakub Dawidek 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 THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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 _DNV_H_
+#define _DNV_H_
+
+#include <sys/cdefs.h>
+
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#ifndef _NVLIST_T_DECLARED
+#define _NVLIST_T_DECLARED
+struct nvlist;
+
+typedef struct nvlist nvlist_t;
+#endif
+
+/*
+ * The dnvlist_get functions returns value associated with the given name.
+ * If it returns a pointer, the pointer represents internal buffer and should
+ * not be freed by the caller.
+ * If no element of the given name and type exists, the function will return
+ * provided default value.
+ */
+
+bool dnvlist_get_bool(const nvlist_t *nvl, const char *name, bool defval);
+uint64_t dnvlist_get_number(const nvlist_t *nvl, const char *name, uint64_t defval);
+const char *dnvlist_get_string(const nvlist_t *nvl, const char *name, const char *defval);
+const nvlist_t *dnvlist_get_nvlist(const nvlist_t *nvl, const char *name, const nvlist_t *defval);
+int dnvlist_get_descriptor(const nvlist_t *nvl, const char *name, int defval);
+const void *dnvlist_get_binary(const nvlist_t *nvl, const char *name, size_t *sizep, const void *defval, size_t defsize);
+
+bool dnvlist_getf_bool(const nvlist_t *nvl, bool defval, const char *namefmt, ...) __printflike(3, 4);
+uint64_t dnvlist_getf_number(const nvlist_t *nvl, uint64_t defval, const char *namefmt, ...) __printflike(3, 4);
+const char *dnvlist_getf_string(const nvlist_t *nvl, const char *defval, const char *namefmt, ...) __printflike(3, 4);
+const nvlist_t *dnvlist_getf_nvlist(const nvlist_t *nvl, const nvlist_t *defval, const char *namefmt, ...) __printflike(3, 4);
+int dnvlist_getf_descriptor(const nvlist_t *nvl, int defval, const char *namefmt, ...) __printflike(3, 4);
+const void *dnvlist_getf_binary(const nvlist_t *nvl, size_t *sizep, const void *defval, size_t defsize, const char *namefmt, ...) __printflike(5, 6);
+
+bool dnvlist_getv_bool(const nvlist_t *nvl, bool defval, const char *namefmt, va_list nameap) __printflike(3, 0);
+uint64_t dnvlist_getv_number(const nvlist_t *nvl, uint64_t defval, const char *namefmt, va_list nameap) __printflike(3, 0);
+const char *dnvlist_getv_string(const nvlist_t *nvl, const char *defval, const char *namefmt, va_list nameap) __printflike(3, 0);
+const nvlist_t *dnvlist_getv_nvlist(const nvlist_t *nvl, const nvlist_t *defval, const char *namefmt, va_list nameap) __printflike(3, 0);
+int dnvlist_getv_descriptor(const nvlist_t *nvl, int defval, const char *namefmt, va_list nameap) __printflike(3, 0);
+const void *dnvlist_getv_binary(const nvlist_t *nvl, size_t *sizep, const void *defval, size_t defsize, const char *namefmt, va_list nameap) __printflike(5, 0);
+
+/*
+ * The dnvlist_take functions returns value associated with the given name and
+ * remove corresponding nvpair.
+ * If it returns a pointer, the caller has to free it.
+ * If no element of the given name and type exists, the function will return
+ * provided default value.
+ */
+
+bool dnvlist_take_bool(nvlist_t *nvl, const char *name, bool defval);
+uint64_t dnvlist_take_number(nvlist_t *nvl, const char *name, uint64_t defval);
+char *dnvlist_take_string(nvlist_t *nvl, const char *name, char *defval);
+nvlist_t *dnvlist_take_nvlist(nvlist_t *nvl, const char *name, nvlist_t *defval);
+int dnvlist_take_descriptor(nvlist_t *nvl, const char *name, int defval);
+void *dnvlist_take_binary(nvlist_t *nvl, const char *name, size_t *sizep, void *defval, size_t defsize);
+
+bool dnvlist_takef_bool(nvlist_t *nvl, bool defval, const char *namefmt, ...) __printflike(3, 4);
+uint64_t dnvlist_takef_number(nvlist_t *nvl, uint64_t defval, const char *namefmt, ...) __printflike(3, 4);
+char *dnvlist_takef_string(nvlist_t *nvl, char *defval, const char *namefmt, ...) __printflike(3, 4);
+nvlist_t *dnvlist_takef_nvlist(nvlist_t *nvl, nvlist_t *defval, const char *namefmt, ...) __printflike(3, 4);
+int dnvlist_takef_descriptor(nvlist_t *nvl, int defval, const char *namefmt, ...) __printflike(3, 4);
+void *dnvlist_takef_binary(nvlist_t *nvl, size_t *sizep, void *defval, size_t defsize, const char *namefmt, ...) __printflike(5, 6);
+
+bool dnvlist_takev_bool(nvlist_t *nvl, bool defval, const char *namefmt, va_list nameap) __printflike(3, 0);
+uint64_t dnvlist_takev_number(nvlist_t *nvl, uint64_t defval, const char *namefmt, va_list nameap) __printflike(3, 0);
+char *dnvlist_takev_string(nvlist_t *nvl, char *defval, const char *namefmt, va_list nameap) __printflike(3, 0);
+nvlist_t *dnvlist_takev_nvlist(nvlist_t *nvl, nvlist_t *defval, const char *namefmt, va_list nameap) __printflike(3, 0);
+int dnvlist_takev_descriptor(nvlist_t *nvl, int defval, const char *namefmt, va_list nameap) __printflike(3, 0);
+void *dnvlist_takev_binary(nvlist_t *nvl, size_t *sizep, void *defval, size_t defsize, const char *namefmt, va_list nameap) __printflike(5, 0);
+
+#endif /* !_DNV_H_ */
diff --git a/lib/libnv/dnvlist.c b/lib/libnv/dnvlist.c
new file mode 100644
index 0000000..b758bbf
--- /dev/null
+++ b/lib/libnv/dnvlist.c
@@ -0,0 +1,252 @@
+/*-
+ * Copyright (c) 2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Pawel Jakub Dawidek 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 THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#include "nv.h"
+#include "nv_impl.h"
+
+#include "dnv.h"
+
+#define DNVLIST_GET(ftype, type) \
+ftype \
+dnvlist_get_##type(const nvlist_t *nvl, const char *name, ftype defval) \
+{ \
+ \
+ return (dnvlist_getf_##type(nvl, defval, "%s", name)); \
+}
+
+DNVLIST_GET(bool, bool)
+DNVLIST_GET(uint64_t, number)
+DNVLIST_GET(const char *, string)
+DNVLIST_GET(const nvlist_t *, nvlist)
+DNVLIST_GET(int, descriptor)
+
+#undef DNVLIST_GET
+
+const void *
+dnvlist_get_binary(const nvlist_t *nvl, const char *name, size_t *sizep,
+ const void *defval, size_t defsize)
+{
+
+ return (dnvlist_getf_binary(nvl, sizep, defval, defsize, "%s", name));
+}
+
+#define DNVLIST_GETF(ftype, type) \
+ftype \
+dnvlist_getf_##type(const nvlist_t *nvl, ftype defval, \
+ const char *namefmt, ...) \
+{ \
+ va_list nameap; \
+ ftype value; \
+ \
+ va_start(nameap, namefmt); \
+ value = dnvlist_getv_##type(nvl, defval, namefmt, nameap); \
+ va_end(nameap); \
+ \
+ return (value); \
+}
+
+DNVLIST_GETF(bool, bool)
+DNVLIST_GETF(uint64_t, number)
+DNVLIST_GETF(const char *, string)
+DNVLIST_GETF(const nvlist_t *, nvlist)
+DNVLIST_GETF(int, descriptor)
+
+#undef DNVLIST_GETF
+
+const void *
+dnvlist_getf_binary(const nvlist_t *nvl, size_t *sizep, const void *defval,
+ size_t defsize, const char *namefmt, ...)
+{
+ va_list nameap;
+ const void *value;
+
+ va_start(nameap, namefmt);
+ value = dnvlist_getv_binary(nvl, sizep, defval, defsize, namefmt,
+ nameap);
+ va_end(nameap);
+
+ return (value);
+}
+
+#define DNVLIST_GETV(ftype, type) \
+ftype \
+dnvlist_getv_##type(const nvlist_t *nvl, ftype defval, \
+ const char *namefmt, va_list nameap) \
+{ \
+ va_list cnameap; \
+ ftype value; \
+ \
+ va_copy(cnameap, nameap); \
+ if (nvlist_existsv_##type(nvl, namefmt, cnameap)) \
+ value = nvlist_getv_##type(nvl, namefmt, nameap); \
+ else \
+ value = defval; \
+ va_end(cnameap); \
+ return (value); \
+}
+
+DNVLIST_GETV(bool, bool)
+DNVLIST_GETV(uint64_t, number)
+DNVLIST_GETV(const char *, string)
+DNVLIST_GETV(const nvlist_t *, nvlist)
+DNVLIST_GETV(int, descriptor)
+
+#undef DNVLIST_GETV
+
+const void *
+dnvlist_getv_binary(const nvlist_t *nvl, size_t *sizep, const void *defval,
+ size_t defsize, const char *namefmt, va_list nameap)
+{
+ va_list cnameap;
+ const void *value;
+
+ va_copy(cnameap, nameap);
+ if (nvlist_existsv_binary(nvl, namefmt, cnameap)) {
+ value = nvlist_getv_binary(nvl, sizep, namefmt, nameap);
+ } else {
+ if (sizep != NULL)
+ *sizep = defsize;
+ value = defval;
+ }
+ va_end(cnameap);
+ return (value);
+}
+
+#define DNVLIST_TAKE(ftype, type) \
+ftype \
+dnvlist_take_##type(nvlist_t *nvl, const char *name, ftype defval) \
+{ \
+ \
+ return (dnvlist_takef_##type(nvl, defval, "%s", name)); \
+}
+
+DNVLIST_TAKE(bool, bool)
+DNVLIST_TAKE(uint64_t, number)
+DNVLIST_TAKE(char *, string)
+DNVLIST_TAKE(nvlist_t *, nvlist)
+DNVLIST_TAKE(int, descriptor)
+
+#undef DNVLIST_TAKE
+
+void *
+dnvlist_take_binary(nvlist_t *nvl, const char *name, size_t *sizep,
+ void *defval, size_t defsize)
+{
+
+ return (dnvlist_takef_binary(nvl, sizep, defval, defsize, "%s", name));
+}
+
+#define DNVLIST_TAKEF(ftype, type) \
+ftype \
+dnvlist_takef_##type(nvlist_t *nvl, ftype defval, \
+ const char *namefmt, ...) \
+{ \
+ va_list nameap; \
+ ftype value; \
+ \
+ va_start(nameap, namefmt); \
+ value = dnvlist_takev_##type(nvl, defval, namefmt, nameap); \
+ va_end(nameap); \
+ \
+ return (value); \
+}
+
+DNVLIST_TAKEF(bool, bool)
+DNVLIST_TAKEF(uint64_t, number)
+DNVLIST_TAKEF(char *, string)
+DNVLIST_TAKEF(nvlist_t *, nvlist)
+DNVLIST_TAKEF(int, descriptor)
+
+#undef DNVLIST_TAKEF
+
+void *
+dnvlist_takef_binary(nvlist_t *nvl, size_t *sizep, void *defval,
+ size_t defsize, const char *namefmt, ...)
+{
+ va_list nameap;
+ void *value;
+
+ va_start(nameap, namefmt);
+ value = dnvlist_takev_binary(nvl, sizep, defval, defsize, namefmt,
+ nameap);
+ va_end(nameap);
+
+ return (value);
+}
+
+#define DNVLIST_TAKEV(ftype, type) \
+ftype \
+dnvlist_takev_##type(nvlist_t *nvl, ftype defval, const char *namefmt, \
+ va_list nameap) \
+{ \
+ va_list cnameap; \
+ ftype value; \
+ \
+ va_copy(cnameap, nameap); \
+ if (nvlist_existsv_##type(nvl, namefmt, cnameap)) \
+ value = nvlist_takev_##type(nvl, namefmt, nameap); \
+ else \
+ value = defval; \
+ va_end(cnameap); \
+ return (value); \
+}
+
+DNVLIST_TAKEV(bool, bool)
+DNVLIST_TAKEV(uint64_t, number)
+DNVLIST_TAKEV(char *, string)
+DNVLIST_TAKEV(nvlist_t *, nvlist)
+DNVLIST_TAKEV(int, descriptor)
+
+#undef DNVLIST_TAKEV
+
+void *
+dnvlist_takev_binary(nvlist_t *nvl, size_t *sizep, void *defval,
+ size_t defsize, const char *namefmt, va_list nameap)
+{
+ va_list cnameap;
+ void *value;
+
+ va_copy(cnameap, nameap);
+ if (nvlist_existsv_binary(nvl, namefmt, cnameap)) {
+ value = nvlist_takev_binary(nvl, sizep, namefmt, nameap);
+ } else {
+ if (sizep != NULL)
+ *sizep = defsize;
+ value = defval;
+ }
+ va_end(cnameap);
+ return (value);
+}
diff --git a/lib/libnv/nv.3 b/lib/libnv/nv.3
index 58033be..29ba744 100644
--- a/lib/libnv/nv.3
+++ b/lib/libnv/nv.3
@@ -28,16 +28,14 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 2, 2015
+.Dd September 25, 2014
.Dt NV 3
.Os
.Sh NAME
.Nm nvlist_create ,
.Nm nvlist_destroy ,
.Nm nvlist_error ,
-.Nm nvlist_set_error ,
.Nm nvlist_empty ,
-.Nm nvlist_flags ,
.Nm nvlist_exists ,
.Nm nvlist_free ,
.Nm nvlist_clone ,
@@ -65,12 +63,8 @@
.Fn nvlist_destroy "nvlist_t *nvl"
.Ft int
.Fn nvlist_error "const nvlist_t *nvl"
-.Ft void
-.Fn nvlist_set_error "nvlist_t *nvl, int error"
.Ft bool
.Fn nvlist_empty "const nvlist_t *nvl"
-.Ft int
-.Fn nvlist_flags "const nvlist_t *nvl"
.\"
.Ft "nvlist_t *"
.Fn nvlist_clone "const nvlist_t *nvl"
@@ -85,14 +79,14 @@
.Ft "void *"
.Fn nvlist_pack "const nvlist_t *nvl" "size_t *sizep"
.Ft "nvlist_t *"
-.Fn nvlist_unpack "const void *buf" "size_t size" "int flags"
+.Fn nvlist_unpack "const void *buf" "size_t size"
.\"
.Ft int
.Fn nvlist_send "int sock" "const nvlist_t *nvl"
.Ft "nvlist_t *"
-.Fn nvlist_recv "int sock" "int flags"
+.Fn nvlist_recv "int sock"
.Ft "nvlist_t *"
-.Fn nvlist_xfer "int sock" "nvlist_t *nvl" "int flags"
+.Fn nvlist_xfer "int sock" "nvlist_t *nvl"
.\"
.Ft "const char *"
.Fn nvlist_next "const nvlist_t *nvl" "int *typep" "void **cookiep"
@@ -157,7 +151,7 @@
.Ft "const void *"
.Fn nvlist_get_binary "const nvlist_t *nvl" "const char *name" "size_t *sizep"
.Ft "const nvlist_t *"
-.Fn nvlist_get_parent "const nvlist_t *nvl" "void **cookiep"
+.Fn nvlist_get_parent "const nvlist_t *nvl"
.\"
.Ft bool
.Fn nvlist_take_bool "nvlist_t *nvl" "const char *name"
@@ -232,8 +226,6 @@ The following flag can be provided:
.Bl -tag -width "NV_FLAG_IGNORE_CASE" -compact -offset indent
.It Dv NV_FLAG_IGNORE_CASE
Perform case-insensitive lookups of provided names.
-.It Dv NV_FLAG_NO_UNIQUE
-Names in the nvlist do not have to be unique.
.El
.Pp
The
@@ -256,17 +248,8 @@ the
error will be returned.
.Pp
The
-.Fn nvlist_set_error
-function sets an nvlist to be in the error state.
-Subsequent calls to
-.Fn nvlist_error
-will return the given error value.
-This function cannot be used to clear the error state from an nvlist.
-This function does nothing if the nvlist is already in the error state.
-.Pp
-The
.Fn nvlist_empty
-function returns
+functions returns
.Dv true
if the given nvlist is empty and
.Dv false
@@ -274,12 +257,6 @@ otherwise.
The nvlist must not be in error state.
.Pp
The
-.Fn nvlist_flags
-function returns flags used to create the nvlist with the
-.Fn nvlist_create
-function.
-.Pp
-The
.Fn nvlist_clone
functions clones the given nvlist.
The clone shares no resources with its origin.
@@ -327,18 +304,6 @@ The nvlist must not be in error state.
The
.Fn nvlist_unpack
function converts the given buffer to the nvlist.
-The
-.Fa flags
-argument defines what type of the top level nvlist is expected to be.
-Flags are set up using the
-.Fn nvlist_create
-function.
-If the nvlist flags do not match the flags passed to
-.Fn nvlist_unpack ,
-the nvlist will not be returned.
-Every nested nvlist list should be checked using
-.Fn nvlist_flags
-function.
The function returns
.Dv NULL
in case of an error.
@@ -357,36 +322,12 @@ The
function receives nvlist over the socket given by the
.Fa sock
argument.
-The
-.Fa flags
-argument defines what type of the top level nvlist is expected to be.
-Flags are set up using the
-.Fn nvlist_create
-function.
-If the nvlist flags do not match the flags passed to
-.Fn nvlist_recv ,
-the nvlist will not be returned.
-Every nested nvlist list should be checked using
-.Fn nvlist_flags
-function.
.Pp
The
.Fn nvlist_xfer
function sends the given nvlist over the socket given by the
.Fa sock
argument and receives nvlist over the same socket.
-The
-.Fa flags
-argument defines what type of the top level nvlist is expected to be.
-Flags are set up using the
-.Fn nvlist_create
-function.
-If the nvlist flags do not match the flags passed to
-.Fn nvlist_xfer ,
-the nvlist will not be returned.
-Every nested nvlist list should be checked using
-.Fn nvlist_flags
-function.
The given nvlist is always destroyed.
.Pp
The
@@ -597,7 +538,7 @@ const char *command;
char *filename;
int fd;
-nvl = nvlist_recv(sock, 0);
+nvl = nvlist_recv(sock);
if (nvl == NULL)
err(1, "nvlist_recv() failed");
@@ -626,7 +567,7 @@ const char *name;
void *cookie;
int type;
-nvl = nvlist_recv(sock, 0);
+nvl = nvlist_recv(sock);
if (nvl == NULL)
err(1, "nvlist_recv() failed");
@@ -647,28 +588,6 @@ while ((name = nvlist_next(nvl, &type, &cookie)) != NULL) {
printf("\\n");
}
.Ed
-.Pp
-Iterating over every nested nvlist:
-.Bd -literal
-nvlist_t *nvl;
-const char *name;
-void *cookie;
-int type;
-
-nvl = nvlist_recv(sock, 0);
-if (nvl == NULL)
- err(1, "nvlist_recv() failed");
-
-cookie = NULL;
-do {
- while ((name = nvlist_next(nvl, &type, &cookie)) != NULL) {
- if (type == NV_TYPE_NVLIST) {
- nvl = nvlist_get_nvlist(nvl, name);
- cookie = NULL;
- }
- }
-} while ((nvl = nvlist_get_parent(nvl, &cookie)) != NULL);
-.Ed
.Sh SEE ALSO
.Xr close 2 ,
.Xr dup 2 ,
diff --git a/lib/libnv/nv.h b/lib/libnv/nv.h
new file mode 100644
index 0000000..1b55be1
--- /dev/null
+++ b/lib/libnv/nv.h
@@ -0,0 +1,275 @@
+/*-
+ * Copyright (c) 2009-2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Pawel Jakub Dawidek 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 THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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 _NV_H_
+#define _NV_H_
+
+#include <sys/cdefs.h>
+
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+
+#ifndef _NVLIST_T_DECLARED
+#define _NVLIST_T_DECLARED
+struct nvlist;
+
+typedef struct nvlist nvlist_t;
+#endif
+
+#define NV_NAME_MAX 2048
+
+#define NV_TYPE_NONE 0
+
+#define NV_TYPE_NULL 1
+#define NV_TYPE_BOOL 2
+#define NV_TYPE_NUMBER 3
+#define NV_TYPE_STRING 4
+#define NV_TYPE_NVLIST 5
+#define NV_TYPE_DESCRIPTOR 6
+#define NV_TYPE_BINARY 7
+
+/*
+ * Perform case-insensitive lookups of provided names.
+ */
+#define NV_FLAG_IGNORE_CASE 0x01
+
+nvlist_t *nvlist_create(int flags);
+void nvlist_destroy(nvlist_t *nvl);
+int nvlist_error(const nvlist_t *nvl);
+bool nvlist_empty(const nvlist_t *nvl);
+
+nvlist_t *nvlist_clone(const nvlist_t *nvl);
+
+void nvlist_dump(const nvlist_t *nvl, int fd);
+void nvlist_fdump(const nvlist_t *nvl, FILE *fp);
+
+size_t nvlist_size(const nvlist_t *nvl);
+void *nvlist_pack(const nvlist_t *nvl, size_t *sizep);
+nvlist_t *nvlist_unpack(const void *buf, size_t size);
+
+int nvlist_send(int sock, const nvlist_t *nvl);
+nvlist_t *nvlist_recv(int sock);
+nvlist_t *nvlist_xfer(int sock, nvlist_t *nvl);
+
+const char *nvlist_next(const nvlist_t *nvl, int *typep, void **cookiep);
+
+const nvlist_t *nvlist_get_parent(const nvlist_t *nvl);
+
+/*
+ * The nvlist_exists functions check if the given name (optionally of the given
+ * type) exists on nvlist.
+ */
+
+bool nvlist_exists(const nvlist_t *nvl, const char *name);
+bool nvlist_exists_type(const nvlist_t *nvl, const char *name, int type);
+
+bool nvlist_exists_null(const nvlist_t *nvl, const char *name);
+bool nvlist_exists_bool(const nvlist_t *nvl, const char *name);
+bool nvlist_exists_number(const nvlist_t *nvl, const char *name);
+bool nvlist_exists_string(const nvlist_t *nvl, const char *name);
+bool nvlist_exists_nvlist(const nvlist_t *nvl, const char *name);
+bool nvlist_exists_descriptor(const nvlist_t *nvl, const char *name);
+bool nvlist_exists_binary(const nvlist_t *nvl, const char *name);
+
+/*
+ * The nvlist_add functions add the given name/value pair.
+ * If a pointer is provided, nvlist_add will internally allocate memory for the
+ * given data (in other words it won't consume provided buffer).
+ */
+
+void nvlist_add_null(nvlist_t *nvl, const char *name);
+void nvlist_add_bool(nvlist_t *nvl, const char *name, bool value);
+void nvlist_add_number(nvlist_t *nvl, const char *name, uint64_t value);
+void nvlist_add_string(nvlist_t *nvl, const char *name, const char *value);
+void nvlist_add_stringf(nvlist_t *nvl, const char *name, const char *valuefmt, ...) __printflike(3, 4);
+void nvlist_add_stringv(nvlist_t *nvl, const char *name, const char *valuefmt, va_list valueap) __printflike(3, 0);
+void nvlist_add_nvlist(nvlist_t *nvl, const char *name, const nvlist_t *value);
+void nvlist_add_descriptor(nvlist_t *nvl, const char *name, int value);
+void nvlist_add_binary(nvlist_t *nvl, const char *name, const void *value, size_t size);
+
+/*
+ * The nvlist_move functions add the given name/value pair.
+ * The functions consumes provided buffer.
+ */
+
+void nvlist_move_string(nvlist_t *nvl, const char *name, char *value);
+void nvlist_move_nvlist(nvlist_t *nvl, const char *name, nvlist_t *value);
+void nvlist_move_descriptor(nvlist_t *nvl, const char *name, int value);
+void nvlist_move_binary(nvlist_t *nvl, const char *name, void *value, size_t size);
+
+/*
+ * The nvlist_get functions returns value associated with the given name.
+ * If it returns a pointer, the pointer represents internal buffer and should
+ * not be freed by the caller.
+ */
+
+bool nvlist_get_bool(const nvlist_t *nvl, const char *name);
+uint64_t nvlist_get_number(const nvlist_t *nvl, const char *name);
+const char *nvlist_get_string(const nvlist_t *nvl, const char *name);
+const nvlist_t *nvlist_get_nvlist(const nvlist_t *nvl, const char *name);
+int nvlist_get_descriptor(const nvlist_t *nvl, const char *name);
+const void *nvlist_get_binary(const nvlist_t *nvl, const char *name, size_t *sizep);
+
+/*
+ * The nvlist_take functions returns value associated with the given name and
+ * remove the given entry from the nvlist.
+ * The caller is responsible for freeing received data.
+ */
+
+bool nvlist_take_bool(nvlist_t *nvl, const char *name);
+uint64_t nvlist_take_number(nvlist_t *nvl, const char *name);
+char *nvlist_take_string(nvlist_t *nvl, const char *name);
+nvlist_t *nvlist_take_nvlist(nvlist_t *nvl, const char *name);
+int nvlist_take_descriptor(nvlist_t *nvl, const char *name);
+void *nvlist_take_binary(nvlist_t *nvl, const char *name, size_t *sizep);
+
+/*
+ * The nvlist_free functions removes the given name/value pair from the nvlist
+ * and frees memory associated with it.
+ */
+
+void nvlist_free(nvlist_t *nvl, const char *name);
+void nvlist_free_type(nvlist_t *nvl, const char *name, int type);
+
+void nvlist_free_null(nvlist_t *nvl, const char *name);
+void nvlist_free_bool(nvlist_t *nvl, const char *name);
+void nvlist_free_number(nvlist_t *nvl, const char *name);
+void nvlist_free_string(nvlist_t *nvl, const char *name);
+void nvlist_free_nvlist(nvlist_t *nvl, const char *name);
+void nvlist_free_descriptor(nvlist_t *nvl, const char *name);
+void nvlist_free_binary(nvlist_t *nvl, const char *name);
+
+/*
+ * Below are the same functions, but which operate on format strings and
+ * variable argument lists.
+ */
+
+bool nvlist_existsf(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+bool nvlist_existsf_type(const nvlist_t *nvl, int type, const char *namefmt, ...) __printflike(3, 4);
+
+bool nvlist_existsf_null(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+bool nvlist_existsf_bool(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+bool nvlist_existsf_number(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+bool nvlist_existsf_string(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+bool nvlist_existsf_nvlist(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+bool nvlist_existsf_descriptor(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+bool nvlist_existsf_binary(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+
+bool nvlist_existsv(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+bool nvlist_existsv_type(const nvlist_t *nvl, int type, const char *namefmt, va_list nameap) __printflike(3, 0);
+
+bool nvlist_existsv_null(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+bool nvlist_existsv_bool(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+bool nvlist_existsv_number(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+bool nvlist_existsv_string(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+bool nvlist_existsv_nvlist(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+bool nvlist_existsv_descriptor(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+bool nvlist_existsv_binary(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+
+void nvlist_addf_null(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+void nvlist_addf_bool(nvlist_t *nvl, bool value, const char *namefmt, ...) __printflike(3, 4);
+void nvlist_addf_number(nvlist_t *nvl, uint64_t value, const char *namefmt, ...) __printflike(3, 4);
+void nvlist_addf_string(nvlist_t *nvl, const char *value, const char *namefmt, ...) __printflike(3, 4);
+void nvlist_addf_nvlist(nvlist_t *nvl, const nvlist_t *value, const char *namefmt, ...) __printflike(3, 4);
+void nvlist_addf_descriptor(nvlist_t *nvl, int value, const char *namefmt, ...) __printflike(3, 4);
+void nvlist_addf_binary(nvlist_t *nvl, const void *value, size_t size, const char *namefmt, ...) __printflike(4, 5);
+
+void nvlist_addv_null(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+void nvlist_addv_bool(nvlist_t *nvl, bool value, const char *namefmt, va_list nameap) __printflike(3, 0);
+void nvlist_addv_number(nvlist_t *nvl, uint64_t value, const char *namefmt, va_list nameap) __printflike(3, 0);
+void nvlist_addv_string(nvlist_t *nvl, const char *value, const char *namefmt, va_list nameap) __printflike(3, 0);
+void nvlist_addv_nvlist(nvlist_t *nvl, const nvlist_t *value, const char *namefmt, va_list nameap) __printflike(3, 0);
+void nvlist_addv_descriptor(nvlist_t *nvl, int value, const char *namefmt, va_list nameap) __printflike(3, 0);
+void nvlist_addv_binary(nvlist_t *nvl, const void *value, size_t size, const char *namefmt, va_list nameap) __printflike(4, 0);
+
+void nvlist_movef_string(nvlist_t *nvl, char *value, const char *namefmt, ...) __printflike(3, 4);
+void nvlist_movef_nvlist(nvlist_t *nvl, nvlist_t *value, const char *namefmt, ...) __printflike(3, 4);
+void nvlist_movef_descriptor(nvlist_t *nvl, int value, const char *namefmt, ...) __printflike(3, 4);
+void nvlist_movef_binary(nvlist_t *nvl, void *value, size_t size, const char *namefmt, ...) __printflike(4, 5);
+
+void nvlist_movev_string(nvlist_t *nvl, char *value, const char *namefmt, va_list nameap) __printflike(3, 0);
+void nvlist_movev_nvlist(nvlist_t *nvl, nvlist_t *value, const char *namefmt, va_list nameap) __printflike(3, 0);
+void nvlist_movev_descriptor(nvlist_t *nvl, int value, const char *namefmt, va_list nameap) __printflike(3, 0);
+void nvlist_movev_binary(nvlist_t *nvl, void *value, size_t size, const char *namefmt, va_list nameap) __printflike(4, 0);
+
+bool nvlist_getf_bool(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+uint64_t nvlist_getf_number(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+const char *nvlist_getf_string(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+const nvlist_t *nvlist_getf_nvlist(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+int nvlist_getf_descriptor(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+const void *nvlist_getf_binary(const nvlist_t *nvl, size_t *sizep, const char *namefmt, ...) __printflike(3, 4);
+
+bool nvlist_getv_bool(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+uint64_t nvlist_getv_number(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+const char *nvlist_getv_string(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+const nvlist_t *nvlist_getv_nvlist(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+int nvlist_getv_descriptor(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+const void *nvlist_getv_binary(const nvlist_t *nvl, size_t *sizep, const char *namefmt, va_list nameap) __printflike(3, 0);
+
+bool nvlist_takef_bool(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+uint64_t nvlist_takef_number(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+char *nvlist_takef_string(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+nvlist_t *nvlist_takef_nvlist(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+int nvlist_takef_descriptor(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+void *nvlist_takef_binary(nvlist_t *nvl, size_t *sizep, const char *namefmt, ...) __printflike(3, 4);
+
+bool nvlist_takev_bool(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+uint64_t nvlist_takev_number(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+char *nvlist_takev_string(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+nvlist_t *nvlist_takev_nvlist(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+int nvlist_takev_descriptor(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+void *nvlist_takev_binary(nvlist_t *nvl, size_t *sizep, const char *namefmt, va_list nameap) __printflike(3, 0);
+
+void nvlist_freef(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+void nvlist_freef_type(nvlist_t *nvl, int type, const char *namefmt, ...) __printflike(3, 4);
+
+void nvlist_freef_null(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+void nvlist_freef_bool(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+void nvlist_freef_number(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+void nvlist_freef_string(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+void nvlist_freef_nvlist(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+void nvlist_freef_descriptor(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+void nvlist_freef_binary(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+
+void nvlist_freev(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+void nvlist_freev_type(nvlist_t *nvl, int type, const char *namefmt, va_list nameap) __printflike(3, 0);
+
+void nvlist_freev_null(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+void nvlist_freev_bool(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+void nvlist_freev_number(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+void nvlist_freev_string(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+void nvlist_freev_nvlist(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+void nvlist_freev_descriptor(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+void nvlist_freev_binary(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+
+#endif /* !_NV_H_ */
diff --git a/lib/libnv/nv_impl.h b/lib/libnv/nv_impl.h
new file mode 100644
index 0000000..3ed45b3
--- /dev/null
+++ b/lib/libnv/nv_impl.h
@@ -0,0 +1,134 @@
+/*-
+ * Copyright (c) 2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Pawel Jakub Dawidek 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 THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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 _NV_IMPL_H_
+#define _NV_IMPL_H_
+
+#ifndef _NVPAIR_T_DECLARED
+#define _NVPAIR_T_DECLARED
+struct nvpair;
+
+typedef struct nvpair nvpair_t;
+#endif
+
+#define NV_TYPE_NVLIST_UP 255
+
+#define NV_TYPE_FIRST NV_TYPE_NULL
+#define NV_TYPE_LAST NV_TYPE_BINARY
+
+#define NV_FLAG_BIG_ENDIAN 0x80
+
+int *nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp);
+size_t nvlist_ndescriptors(const nvlist_t *nvl);
+
+nvpair_t *nvlist_first_nvpair(const nvlist_t *nvl);
+nvpair_t *nvlist_next_nvpair(const nvlist_t *nvl, const nvpair_t *nvp);
+nvpair_t *nvlist_prev_nvpair(const nvlist_t *nvl, const nvpair_t *nvp);
+
+void nvlist_add_nvpair(nvlist_t *nvl, const nvpair_t *nvp);
+
+void nvlist_move_nvpair(nvlist_t *nvl, nvpair_t *nvp);
+
+void nvlist_set_parent(nvlist_t *nvl, nvpair_t *parent);
+
+const nvpair_t *nvlist_get_nvpair(const nvlist_t *nvl, const char *name);
+
+nvpair_t *nvlist_take_nvpair(nvlist_t *nvl, const char *name);
+
+/* Function removes the given nvpair from the nvlist. */
+void nvlist_remove_nvpair(nvlist_t *nvl, nvpair_t *nvp);
+
+void nvlist_free_nvpair(nvlist_t *nvl, nvpair_t *nvp);
+
+int nvpair_type(const nvpair_t *nvp);
+const char *nvpair_name(const nvpair_t *nvp);
+
+nvpair_t *nvpair_clone(const nvpair_t *nvp);
+
+nvpair_t *nvpair_create_null(const char *name);
+nvpair_t *nvpair_create_bool(const char *name, bool value);
+nvpair_t *nvpair_create_number(const char *name, uint64_t value);
+nvpair_t *nvpair_create_string(const char *name, const char *value);
+nvpair_t *nvpair_create_stringf(const char *name, const char *valuefmt, ...) __printflike(2, 3);
+nvpair_t *nvpair_create_stringv(const char *name, const char *valuefmt, va_list valueap) __printflike(2, 0);
+nvpair_t *nvpair_create_nvlist(const char *name, const nvlist_t *value);
+nvpair_t *nvpair_create_descriptor(const char *name, int value);
+nvpair_t *nvpair_create_binary(const char *name, const void *value, size_t size);
+
+nvpair_t *nvpair_move_string(const char *name, char *value);
+nvpair_t *nvpair_move_nvlist(const char *name, nvlist_t *value);
+nvpair_t *nvpair_move_descriptor(const char *name, int value);
+nvpair_t *nvpair_move_binary(const char *name, void *value, size_t size);
+
+bool nvpair_get_bool(const nvpair_t *nvp);
+uint64_t nvpair_get_number(const nvpair_t *nvp);
+const char *nvpair_get_string(const nvpair_t *nvp);
+const nvlist_t *nvpair_get_nvlist(const nvpair_t *nvp);
+int nvpair_get_descriptor(const nvpair_t *nvp);
+const void *nvpair_get_binary(const nvpair_t *nvp, size_t *sizep);
+
+void nvpair_free(nvpair_t *nvp);
+
+const nvpair_t *nvlist_getf_nvpair(const nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+
+const nvpair_t *nvlist_getv_nvpair(const nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+
+nvpair_t *nvlist_takef_nvpair(nvlist_t *nvl, const char *namefmt, ...) __printflike(2, 3);
+
+nvpair_t *nvlist_takev_nvpair(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0);
+
+nvpair_t *nvpair_createf_null(const char *namefmt, ...) __printflike(1, 2);
+nvpair_t *nvpair_createf_bool(bool value, const char *namefmt, ...) __printflike(2, 3);
+nvpair_t *nvpair_createf_number(uint64_t value, const char *namefmt, ...) __printflike(2, 3);
+nvpair_t *nvpair_createf_string(const char *value, const char *namefmt, ...) __printflike(2, 3);
+nvpair_t *nvpair_createf_nvlist(const nvlist_t *value, const char *namefmt, ...) __printflike(2, 3);
+nvpair_t *nvpair_createf_descriptor(int value, const char *namefmt, ...) __printflike(2, 3);
+nvpair_t *nvpair_createf_binary(const void *value, size_t size, const char *namefmt, ...) __printflike(3, 4);
+
+nvpair_t *nvpair_createv_null(const char *namefmt, va_list nameap) __printflike(1, 0);
+nvpair_t *nvpair_createv_bool(bool value, const char *namefmt, va_list nameap) __printflike(2, 0);
+nvpair_t *nvpair_createv_number(uint64_t value, const char *namefmt, va_list nameap) __printflike(2, 0);
+nvpair_t *nvpair_createv_string(const char *value, const char *namefmt, va_list nameap) __printflike(2, 0);
+nvpair_t *nvpair_createv_nvlist(const nvlist_t *value, const char *namefmt, va_list nameap) __printflike(2, 0);
+nvpair_t *nvpair_createv_descriptor(int value, const char *namefmt, va_list nameap) __printflike(2, 0);
+nvpair_t *nvpair_createv_binary(const void *value, size_t size, const char *namefmt, va_list nameap) __printflike(3, 0);
+
+nvpair_t *nvpair_movef_string(char *value, const char *namefmt, ...) __printflike(2, 3);
+nvpair_t *nvpair_movef_nvlist(nvlist_t *value, const char *namefmt, ...) __printflike(2, 3);
+nvpair_t *nvpair_movef_descriptor(int value, const char *namefmt, ...) __printflike(2, 3);
+nvpair_t *nvpair_movef_binary(void *value, size_t size, const char *namefmt, ...) __printflike(3, 4);
+
+nvpair_t *nvpair_movev_string(char *value, const char *namefmt, va_list nameap) __printflike(2, 0);
+nvpair_t *nvpair_movev_nvlist(nvlist_t *value, const char *namefmt, va_list nameap) __printflike(2, 0);
+nvpair_t *nvpair_movev_descriptor(int value, const char *namefmt, va_list nameap) __printflike(2, 0);
+nvpair_t *nvpair_movev_binary(void *value, size_t size, const char *namefmt, va_list nameap) __printflike(3, 0);
+
+#endif /* !_NV_IMPL_H_ */
diff --git a/lib/libnv/nvlist.c b/lib/libnv/nvlist.c
new file mode 100644
index 0000000..b495441
--- /dev/null
+++ b/lib/libnv/nvlist.c
@@ -0,0 +1,1848 @@
+/*-
+ * Copyright (c) 2009-2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Pawel Jakub Dawidek 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 THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/endian.h>
+#include <sys/queue.h>
+#include <sys/socket.h>
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
+#define _WITH_DPRINTF
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef HAVE_PJDLOG
+#include <pjdlog.h>
+#endif
+
+#include "msgio.h"
+#include "nv.h"
+#include "nv_impl.h"
+#include "nvlist_impl.h"
+#include "nvpair_impl.h"
+
+#ifndef HAVE_PJDLOG
+#include <assert.h>
+#define PJDLOG_ASSERT(...) assert(__VA_ARGS__)
+#define PJDLOG_RASSERT(expr, ...) assert(expr)
+#define PJDLOG_ABORT(...) do { \
+ fprintf(stderr, "%s:%u: ", __FILE__, __LINE__); \
+ fprintf(stderr, __VA_ARGS__); \
+ fprintf(stderr, "\n"); \
+ abort(); \
+} while (0)
+#endif
+
+#define NV_FLAG_PRIVATE_MASK (NV_FLAG_BIG_ENDIAN)
+#define NV_FLAG_PUBLIC_MASK (NV_FLAG_IGNORE_CASE)
+#define NV_FLAG_ALL_MASK (NV_FLAG_PRIVATE_MASK | NV_FLAG_PUBLIC_MASK)
+
+#define NVLIST_MAGIC 0x6e766c /* "nvl" */
+struct nvlist {
+ int nvl_magic;
+ int nvl_error;
+ int nvl_flags;
+ nvpair_t *nvl_parent;
+ struct nvl_head nvl_head;
+};
+
+#define NVLIST_ASSERT(nvl) do { \
+ PJDLOG_ASSERT((nvl) != NULL); \
+ PJDLOG_ASSERT((nvl)->nvl_magic == NVLIST_MAGIC); \
+} while (0)
+
+#define NVPAIR_ASSERT(nvp) nvpair_assert(nvp)
+
+#define NVLIST_HEADER_MAGIC 0x6c
+#define NVLIST_HEADER_VERSION 0x00
+struct nvlist_header {
+ uint8_t nvlh_magic;
+ uint8_t nvlh_version;
+ uint8_t nvlh_flags;
+ uint64_t nvlh_descriptors;
+ uint64_t nvlh_size;
+} __packed;
+
+nvlist_t *
+nvlist_create(int flags)
+{
+ nvlist_t *nvl;
+
+ PJDLOG_ASSERT((flags & ~(NV_FLAG_PUBLIC_MASK)) == 0);
+
+ nvl = malloc(sizeof(*nvl));
+ nvl->nvl_error = 0;
+ nvl->nvl_flags = flags;
+ nvl->nvl_parent = NULL;
+ TAILQ_INIT(&nvl->nvl_head);
+ nvl->nvl_magic = NVLIST_MAGIC;
+
+ return (nvl);
+}
+
+void
+nvlist_destroy(nvlist_t *nvl)
+{
+ nvpair_t *nvp;
+ int serrno;
+
+ if (nvl == NULL)
+ return;
+
+ serrno = errno;
+
+ NVLIST_ASSERT(nvl);
+
+ while ((nvp = nvlist_first_nvpair(nvl)) != NULL) {
+ nvlist_remove_nvpair(nvl, nvp);
+ nvpair_free(nvp);
+ }
+ nvl->nvl_magic = 0;
+ free(nvl);
+
+ errno = serrno;
+}
+
+int
+nvlist_error(const nvlist_t *nvl)
+{
+
+ if (nvl == NULL)
+ return (ENOMEM);
+
+ NVLIST_ASSERT(nvl);
+
+ return (nvl->nvl_error);
+}
+
+nvpair_t *
+nvlist_get_nvpair_parent(const nvlist_t *nvl)
+{
+
+ NVLIST_ASSERT(nvl);
+
+ return (nvl->nvl_parent);
+}
+
+const nvlist_t *
+nvlist_get_parent(const nvlist_t *nvl)
+{
+
+ NVLIST_ASSERT(nvl);
+
+ if (nvl->nvl_parent == NULL)
+ return (NULL);
+
+ return (nvpair_nvlist(nvl->nvl_parent));
+}
+
+void
+nvlist_set_parent(nvlist_t *nvl, nvpair_t *parent)
+{
+
+ NVLIST_ASSERT(nvl);
+
+ nvl->nvl_parent = parent;
+}
+
+bool
+nvlist_empty(const nvlist_t *nvl)
+{
+
+ NVLIST_ASSERT(nvl);
+ PJDLOG_ASSERT(nvl->nvl_error == 0);
+
+ return (nvlist_first_nvpair(nvl) == NULL);
+}
+
+static void
+nvlist_report_missing(int type, const char *namefmt, va_list nameap)
+{
+ char *name;
+
+ vasprintf(&name, namefmt, nameap);
+ PJDLOG_ABORT("Element '%s' of type %s doesn't exist.",
+ name != NULL ? name : "N/A", nvpair_type_string(type));
+}
+
+static nvpair_t *
+nvlist_findv(const nvlist_t *nvl, int type, const char *namefmt, va_list nameap)
+{
+ nvpair_t *nvp;
+ char *name;
+
+ NVLIST_ASSERT(nvl);
+ PJDLOG_ASSERT(nvl->nvl_error == 0);
+ PJDLOG_ASSERT(type == NV_TYPE_NONE ||
+ (type >= NV_TYPE_FIRST && type <= NV_TYPE_LAST));
+
+ if (vasprintf(&name, namefmt, nameap) < 0)
+ return (NULL);
+
+ for (nvp = nvlist_first_nvpair(nvl); nvp != NULL;
+ nvp = nvlist_next_nvpair(nvl, nvp)) {
+ if (type != NV_TYPE_NONE && nvpair_type(nvp) != type)
+ continue;
+ if ((nvl->nvl_flags & NV_FLAG_IGNORE_CASE) != 0) {
+ if (strcasecmp(nvpair_name(nvp), name) != 0)
+ continue;
+ } else {
+ if (strcmp(nvpair_name(nvp), name) != 0)
+ continue;
+ }
+ break;
+ }
+
+ free(name);
+
+ if (nvp == NULL)
+ errno = ENOENT;
+
+ return (nvp);
+}
+
+bool
+nvlist_exists_type(const nvlist_t *nvl, const char *name, int type)
+{
+
+ return (nvlist_existsf_type(nvl, type, "%s", name));
+}
+
+bool
+nvlist_existsf_type(const nvlist_t *nvl, int type, const char *namefmt, ...)
+{
+ va_list nameap;
+ bool ret;
+
+ va_start(nameap, namefmt);
+ ret = nvlist_existsv_type(nvl, type, namefmt, nameap);
+ va_end(nameap);
+
+ return (ret);
+}
+
+bool
+nvlist_existsv_type(const nvlist_t *nvl, int type, const char *namefmt,
+ va_list nameap)
+{
+
+ NVLIST_ASSERT(nvl);
+ PJDLOG_ASSERT(nvl->nvl_error == 0);
+ PJDLOG_ASSERT(type == NV_TYPE_NONE ||
+ (type >= NV_TYPE_FIRST && type <= NV_TYPE_LAST));
+
+ return (nvlist_findv(nvl, type, namefmt, nameap) != NULL);
+}
+
+void
+nvlist_free_type(nvlist_t *nvl, const char *name, int type)
+{
+
+ nvlist_freef_type(nvl, type, "%s", name);
+}
+
+void
+nvlist_freef_type(nvlist_t *nvl, int type, const char *namefmt, ...)
+{
+ va_list nameap;
+
+ va_start(nameap, namefmt);
+ nvlist_freev_type(nvl, type, namefmt, nameap);
+ va_end(nameap);
+}
+
+void
+nvlist_freev_type(nvlist_t *nvl, int type, const char *namefmt, va_list nameap)
+{
+ va_list cnameap;
+ nvpair_t *nvp;
+
+ NVLIST_ASSERT(nvl);
+ PJDLOG_ASSERT(nvl->nvl_error == 0);
+ PJDLOG_ASSERT(type == NV_TYPE_NONE ||
+ (type >= NV_TYPE_FIRST && type <= NV_TYPE_LAST));
+
+ va_copy(cnameap, nameap);
+ nvp = nvlist_findv(nvl, type, namefmt, cnameap);
+ va_end(cnameap);
+ if (nvp != NULL)
+ nvlist_free_nvpair(nvl, nvp);
+ else
+ nvlist_report_missing(type, namefmt, nameap);
+}
+
+nvlist_t *
+nvlist_clone(const nvlist_t *nvl)
+{
+ nvlist_t *newnvl;
+ nvpair_t *nvp, *newnvp;
+
+ NVLIST_ASSERT(nvl);
+
+ if (nvl->nvl_error != 0) {
+ errno = nvl->nvl_error;
+ return (NULL);
+ }
+
+ newnvl = nvlist_create(nvl->nvl_flags & NV_FLAG_PUBLIC_MASK);
+ for (nvp = nvlist_first_nvpair(nvl); nvp != NULL;
+ nvp = nvlist_next_nvpair(nvl, nvp)) {
+ newnvp = nvpair_clone(nvp);
+ if (newnvp == NULL)
+ break;
+ nvlist_move_nvpair(newnvl, newnvp);
+ }
+ if (nvp != NULL) {
+ nvlist_destroy(newnvl);
+ return (NULL);
+ }
+ return (newnvl);
+}
+
+static bool
+nvlist_dump_error_check(const nvlist_t *nvl, int fd, int level)
+{
+
+ if (nvlist_error(nvl) != 0) {
+ dprintf(fd, "%*serror: %d\n", level * 4, "",
+ nvlist_error(nvl));
+ return (true);
+ }
+
+ return (false);
+}
+
+/*
+ * Dump content of nvlist.
+ */
+void
+nvlist_dump(const nvlist_t *nvl, int fd)
+{
+ nvpair_t *nvp;
+ int level;
+
+ level = 0;
+ if (nvlist_dump_error_check(nvl, fd, level))
+ return;
+
+ nvp = nvlist_first_nvpair(nvl);
+ while (nvp != NULL) {
+ dprintf(fd, "%*s%s (%s):", level * 4, "", nvpair_name(nvp),
+ nvpair_type_string(nvpair_type(nvp)));
+ switch (nvpair_type(nvp)) {
+ case NV_TYPE_NULL:
+ dprintf(fd, " null\n");
+ break;
+ case NV_TYPE_BOOL:
+ dprintf(fd, " %s\n", nvpair_get_bool(nvp) ?
+ "TRUE" : "FALSE");
+ break;
+ case NV_TYPE_NUMBER:
+ dprintf(fd, " %ju (%jd) (0x%jx)\n",
+ (uintmax_t)nvpair_get_number(nvp),
+ (intmax_t)nvpair_get_number(nvp),
+ (uintmax_t)nvpair_get_number(nvp));
+ break;
+ case NV_TYPE_STRING:
+ dprintf(fd, " [%s]\n", nvpair_get_string(nvp));
+ break;
+ case NV_TYPE_NVLIST:
+ dprintf(fd, "\n");
+ nvl = nvpair_get_nvlist(nvp);
+ if (nvlist_dump_error_check(nvl, fd, level + 1)) {
+ nvl = nvlist_get_parent(nvl);
+ break;
+ }
+ level += 1;
+ nvp = nvlist_first_nvpair(nvl);
+ continue;
+ case NV_TYPE_DESCRIPTOR:
+ dprintf(fd, " %d\n", nvpair_get_descriptor(nvp));
+ break;
+ case NV_TYPE_BINARY:
+ {
+ const unsigned char *binary;
+ unsigned int ii;
+ size_t size;
+
+ binary = nvpair_get_binary(nvp, &size);
+ dprintf(fd, " %zu ", size);
+ for (ii = 0; ii < size; ii++)
+ dprintf(fd, "%02hhx", binary[ii]);
+ dprintf(fd, "\n");
+ break;
+ }
+ default:
+ PJDLOG_ABORT("Unknown type: %d.", nvpair_type(nvp));
+ }
+
+ while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) {
+ nvp = nvlist_get_nvpair_parent(nvl);
+ if (nvp == NULL)
+ return;
+ nvl = nvlist_get_parent(nvl);
+ level --;
+ }
+ }
+}
+
+void
+nvlist_fdump(const nvlist_t *nvl, FILE *fp)
+{
+
+ fflush(fp);
+ nvlist_dump(nvl, fileno(fp));
+}
+
+/*
+ * The function obtains size of the nvlist after nvlist_pack().
+ */
+size_t
+nvlist_size(const nvlist_t *nvl)
+{
+ const nvpair_t *nvp;
+ size_t size;
+
+ NVLIST_ASSERT(nvl);
+ PJDLOG_ASSERT(nvl->nvl_error == 0);
+
+ size = sizeof(struct nvlist_header);
+ nvp = nvlist_first_nvpair(nvl);
+ while (nvp != NULL) {
+ size += nvpair_header_size();
+ size += strlen(nvpair_name(nvp)) + 1;
+ if (nvpair_type(nvp) == NV_TYPE_NVLIST) {
+ size += sizeof(struct nvlist_header);
+ size += nvpair_header_size() + 1;
+ nvl = nvpair_get_nvlist(nvp);
+ PJDLOG_ASSERT(nvl->nvl_error == 0);
+ nvp = nvlist_first_nvpair(nvl);
+ continue;
+ } else {
+ size += nvpair_size(nvp);
+ }
+
+ while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) {
+ nvp = nvlist_get_nvpair_parent(nvl);
+ if (nvp == NULL)
+ goto out;
+ nvl = nvlist_get_parent(nvl);
+ }
+ }
+
+out:
+ return (size);
+}
+
+static int *
+nvlist_xdescriptors(const nvlist_t *nvl, int *descs, int level)
+{
+ const nvpair_t *nvp;
+
+ NVLIST_ASSERT(nvl);
+ PJDLOG_ASSERT(nvl->nvl_error == 0);
+ PJDLOG_ASSERT(level < 3);
+
+ for (nvp = nvlist_first_nvpair(nvl); nvp != NULL;
+ nvp = nvlist_next_nvpair(nvl, nvp)) {
+ switch (nvpair_type(nvp)) {
+ case NV_TYPE_DESCRIPTOR:
+ *descs = nvpair_get_descriptor(nvp);
+ descs++;
+ break;
+ case NV_TYPE_NVLIST:
+ descs = nvlist_xdescriptors(nvpair_get_nvlist(nvp),
+ descs, level + 1);
+ break;
+ }
+ }
+
+ return (descs);
+}
+
+int *
+nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp)
+{
+ size_t nitems;
+ int *fds;
+
+ nitems = nvlist_ndescriptors(nvl);
+ fds = malloc(sizeof(fds[0]) * (nitems + 1));
+ if (fds == NULL)
+ return (NULL);
+ if (nitems > 0)
+ nvlist_xdescriptors(nvl, fds, 0);
+ fds[nitems] = -1;
+ if (nitemsp != NULL)
+ *nitemsp = nitems;
+ return (fds);
+}
+
+static size_t
+nvlist_xndescriptors(const nvlist_t *nvl, int level)
+{
+ const nvpair_t *nvp;
+ size_t ndescs;
+
+ NVLIST_ASSERT(nvl);
+ PJDLOG_ASSERT(nvl->nvl_error == 0);
+ PJDLOG_ASSERT(level < 3);
+
+ ndescs = 0;
+ for (nvp = nvlist_first_nvpair(nvl); nvp != NULL;
+ nvp = nvlist_next_nvpair(nvl, nvp)) {
+ switch (nvpair_type(nvp)) {
+ case NV_TYPE_DESCRIPTOR:
+ ndescs++;
+ break;
+ case NV_TYPE_NVLIST:
+ ndescs += nvlist_xndescriptors(nvpair_get_nvlist(nvp),
+ level + 1);
+ break;
+ }
+ }
+
+ return (ndescs);
+}
+
+size_t
+nvlist_ndescriptors(const nvlist_t *nvl)
+{
+
+ return (nvlist_xndescriptors(nvl, 0));
+}
+
+static unsigned char *
+nvlist_pack_header(const nvlist_t *nvl, unsigned char *ptr, size_t *leftp)
+{
+ struct nvlist_header nvlhdr;
+
+ NVLIST_ASSERT(nvl);
+
+ nvlhdr.nvlh_magic = NVLIST_HEADER_MAGIC;
+ nvlhdr.nvlh_version = NVLIST_HEADER_VERSION;
+ nvlhdr.nvlh_flags = nvl->nvl_flags;
+#if BYTE_ORDER == BIG_ENDIAN
+ nvlhdr.nvlh_flags |= NV_FLAG_BIG_ENDIAN;
+#endif
+ nvlhdr.nvlh_descriptors = nvlist_ndescriptors(nvl);
+ nvlhdr.nvlh_size = *leftp - sizeof(nvlhdr);
+ PJDLOG_ASSERT(*leftp >= sizeof(nvlhdr));
+ memcpy(ptr, &nvlhdr, sizeof(nvlhdr));
+ ptr += sizeof(nvlhdr);
+ *leftp -= sizeof(nvlhdr);
+
+ return (ptr);
+}
+
+void *
+nvlist_xpack(const nvlist_t *nvl, int64_t *fdidxp, size_t *sizep)
+{
+ unsigned char *buf, *ptr;
+ size_t left, size;
+ nvpair_t *nvp;
+
+ NVLIST_ASSERT(nvl);
+
+ if (nvl->nvl_error != 0) {
+ errno = nvl->nvl_error;
+ return (NULL);
+ }
+
+ size = nvlist_size(nvl);
+ buf = malloc(size);
+ if (buf == NULL)
+ return (NULL);
+
+ ptr = buf;
+ left = size;
+
+ ptr = nvlist_pack_header(nvl, ptr, &left);
+
+ nvp = nvlist_first_nvpair(nvl);
+ while (nvp != NULL) {
+ NVPAIR_ASSERT(nvp);
+
+ nvpair_init_datasize(nvp);
+ ptr = nvpair_pack_header(nvp, ptr, &left);
+ if (ptr == NULL) {
+ free(buf);
+ return (NULL);
+ }
+ switch (nvpair_type(nvp)) {
+ case NV_TYPE_NULL:
+ ptr = nvpair_pack_null(nvp, ptr, &left);
+ break;
+ case NV_TYPE_BOOL:
+ ptr = nvpair_pack_bool(nvp, ptr, &left);
+ break;
+ case NV_TYPE_NUMBER:
+ ptr = nvpair_pack_number(nvp, ptr, &left);
+ break;
+ case NV_TYPE_STRING:
+ ptr = nvpair_pack_string(nvp, ptr, &left);
+ break;
+ case NV_TYPE_NVLIST:
+ nvl = nvpair_get_nvlist(nvp);
+ nvp = nvlist_first_nvpair(nvl);
+ ptr = nvlist_pack_header(nvl, ptr, &left);
+ continue;
+ case NV_TYPE_DESCRIPTOR:
+ ptr = nvpair_pack_descriptor(nvp, ptr, fdidxp, &left);
+ break;
+ case NV_TYPE_BINARY:
+ ptr = nvpair_pack_binary(nvp, ptr, &left);
+ break;
+ default:
+ PJDLOG_ABORT("Invalid type (%d).", nvpair_type(nvp));
+ }
+ if (ptr == NULL) {
+ free(buf);
+ return (NULL);
+ }
+ while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) {
+ nvp = nvlist_get_nvpair_parent(nvl);
+ if (nvp == NULL)
+ goto out;
+ ptr = nvpair_pack_nvlist_up(ptr, &left);
+ if (ptr == NULL)
+ goto out;
+ nvl = nvlist_get_parent(nvl);
+ }
+ }
+
+out:
+ if (sizep != NULL)
+ *sizep = size;
+ return (buf);
+}
+
+void *
+nvlist_pack(const nvlist_t *nvl, size_t *sizep)
+{
+
+ NVLIST_ASSERT(nvl);
+
+ if (nvl->nvl_error != 0) {
+ errno = nvl->nvl_error;
+ return (NULL);
+ }
+
+ if (nvlist_ndescriptors(nvl) > 0) {
+ errno = EOPNOTSUPP;
+ return (NULL);
+ }
+
+ return (nvlist_xpack(nvl, NULL, sizep));
+}
+
+static bool
+nvlist_check_header(struct nvlist_header *nvlhdrp)
+{
+
+ if (nvlhdrp->nvlh_magic != NVLIST_HEADER_MAGIC) {
+ errno = EINVAL;
+ return (false);
+ }
+ if ((nvlhdrp->nvlh_flags & ~NV_FLAG_ALL_MASK) != 0) {
+ errno = EINVAL;
+ return (false);
+ }
+#if BYTE_ORDER == BIG_ENDIAN
+ if ((nvlhdrp->nvlh_flags & NV_FLAG_BIG_ENDIAN) == 0) {
+ nvlhdrp->nvlh_size = le64toh(nvlhdrp->nvlh_size);
+ nvlhdrp->nvlh_descriptors = le64toh(nvlhdrp->nvlh_descriptors);
+ }
+#else
+ if ((nvlhdrp->nvlh_flags & NV_FLAG_BIG_ENDIAN) != 0) {
+ nvlhdrp->nvlh_size = be64toh(nvlhdrp->nvlh_size);
+ nvlhdrp->nvlh_descriptors = be64toh(nvlhdrp->nvlh_descriptors);
+ }
+#endif
+ return (true);
+}
+
+const unsigned char *
+nvlist_unpack_header(nvlist_t *nvl, const unsigned char *ptr, size_t nfds,
+ bool *isbep, size_t *leftp)
+{
+ struct nvlist_header nvlhdr;
+
+ if (*leftp < sizeof(nvlhdr))
+ goto failed;
+
+ memcpy(&nvlhdr, ptr, sizeof(nvlhdr));
+
+ if (!nvlist_check_header(&nvlhdr))
+ goto failed;
+
+ if (nvlhdr.nvlh_size != *leftp - sizeof(nvlhdr))
+ goto failed;
+
+ /*
+ * nvlh_descriptors might be smaller than nfds in embedded nvlists.
+ */
+ if (nvlhdr.nvlh_descriptors > nfds)
+ goto failed;
+
+ if ((nvlhdr.nvlh_flags & ~NV_FLAG_ALL_MASK) != 0)
+ goto failed;
+
+ nvl->nvl_flags = (nvlhdr.nvlh_flags & NV_FLAG_PUBLIC_MASK);
+
+ ptr += sizeof(nvlhdr);
+ if (isbep != NULL)
+ *isbep = (((int)nvlhdr.nvlh_flags & NV_FLAG_BIG_ENDIAN) != 0);
+ *leftp -= sizeof(nvlhdr);
+
+ return (ptr);
+failed:
+ errno = EINVAL;
+ return (NULL);
+}
+
+nvlist_t *
+nvlist_xunpack(const void *buf, size_t size, const int *fds, size_t nfds)
+{
+ const unsigned char *ptr;
+ nvlist_t *nvl, *retnvl, *tmpnvl;
+ nvpair_t *nvp;
+ size_t left;
+ bool isbe;
+
+ left = size;
+ ptr = buf;
+
+ tmpnvl = NULL;
+ nvl = retnvl = nvlist_create(0);
+ if (nvl == NULL)
+ goto failed;
+
+ ptr = nvlist_unpack_header(nvl, ptr, nfds, &isbe, &left);
+ if (ptr == NULL)
+ goto failed;
+
+ while (left > 0) {
+ ptr = nvpair_unpack(isbe, ptr, &left, &nvp);
+ if (ptr == NULL)
+ goto failed;
+ switch (nvpair_type(nvp)) {
+ case NV_TYPE_NULL:
+ ptr = nvpair_unpack_null(isbe, nvp, ptr, &left);
+ break;
+ case NV_TYPE_BOOL:
+ ptr = nvpair_unpack_bool(isbe, nvp, ptr, &left);
+ break;
+ case NV_TYPE_NUMBER:
+ ptr = nvpair_unpack_number(isbe, nvp, ptr, &left);
+ break;
+ case NV_TYPE_STRING:
+ ptr = nvpair_unpack_string(isbe, nvp, ptr, &left);
+ break;
+ case NV_TYPE_NVLIST:
+ ptr = nvpair_unpack_nvlist(isbe, nvp, ptr, &left, nfds,
+ &tmpnvl);
+ nvlist_set_parent(tmpnvl, nvp);
+ break;
+ case NV_TYPE_DESCRIPTOR:
+ ptr = nvpair_unpack_descriptor(isbe, nvp, ptr, &left,
+ fds, nfds);
+ break;
+ case NV_TYPE_BINARY:
+ ptr = nvpair_unpack_binary(isbe, nvp, ptr, &left);
+ break;
+ case NV_TYPE_NVLIST_UP:
+ if (nvl->nvl_parent == NULL)
+ goto failed;
+ nvl = nvpair_nvlist(nvl->nvl_parent);
+ continue;
+ default:
+ PJDLOG_ABORT("Invalid type (%d).", nvpair_type(nvp));
+ }
+ if (ptr == NULL)
+ goto failed;
+ nvlist_move_nvpair(nvl, nvp);
+ if (tmpnvl != NULL) {
+ nvl = tmpnvl;
+ tmpnvl = NULL;
+ }
+ }
+
+ return (retnvl);
+failed:
+ nvlist_destroy(retnvl);
+ return (NULL);
+}
+
+nvlist_t *
+nvlist_unpack(const void *buf, size_t size)
+{
+
+ return (nvlist_xunpack(buf, size, NULL, 0));
+}
+
+int
+nvlist_send(int sock, const nvlist_t *nvl)
+{
+ size_t datasize, nfds;
+ int *fds;
+ void *data;
+ int64_t fdidx;
+ int serrno, ret;
+
+ if (nvlist_error(nvl) != 0) {
+ errno = nvlist_error(nvl);
+ return (-1);
+ }
+
+ fds = nvlist_descriptors(nvl, &nfds);
+ if (fds == NULL)
+ return (-1);
+
+ ret = -1;
+ data = NULL;
+ fdidx = 0;
+
+ data = nvlist_xpack(nvl, &fdidx, &datasize);
+ if (data == NULL)
+ goto out;
+
+ if (buf_send(sock, data, datasize) == -1)
+ goto out;
+
+ if (nfds > 0) {
+ if (fd_send(sock, fds, nfds) == -1)
+ goto out;
+ }
+
+ ret = 0;
+out:
+ serrno = errno;
+ free(fds);
+ free(data);
+ errno = serrno;
+ return (ret);
+}
+
+nvlist_t *
+nvlist_recv(int sock)
+{
+ struct nvlist_header nvlhdr;
+ nvlist_t *nvl, *ret;
+ unsigned char *buf;
+ size_t nfds, size, i;
+ int serrno, *fds;
+
+ if (buf_recv(sock, &nvlhdr, sizeof(nvlhdr)) == -1)
+ return (NULL);
+
+ if (!nvlist_check_header(&nvlhdr))
+ return (NULL);
+
+ nfds = (size_t)nvlhdr.nvlh_descriptors;
+ size = sizeof(nvlhdr) + (size_t)nvlhdr.nvlh_size;
+
+ buf = malloc(size);
+ if (buf == NULL)
+ return (NULL);
+
+ memcpy(buf, &nvlhdr, sizeof(nvlhdr));
+
+ ret = NULL;
+ fds = NULL;
+
+ if (buf_recv(sock, buf + sizeof(nvlhdr), size - sizeof(nvlhdr)) == -1)
+ goto out;
+
+ if (nfds > 0) {
+ fds = malloc(nfds * sizeof(fds[0]));
+ if (fds == NULL)
+ goto out;
+ if (fd_recv(sock, fds, nfds) == -1)
+ goto out;
+ }
+
+ nvl = nvlist_xunpack(buf, size, fds, nfds);
+ if (nvl == NULL) {
+ for (i = 0; i < nfds; i++)
+ close(fds[i]);
+ goto out;
+ }
+
+ ret = nvl;
+out:
+ serrno = errno;
+ free(buf);
+ free(fds);
+ errno = serrno;
+
+ return (ret);
+}
+
+nvlist_t *
+nvlist_xfer(int sock, nvlist_t *nvl)
+{
+
+ if (nvlist_send(sock, nvl) < 0) {
+ nvlist_destroy(nvl);
+ return (NULL);
+ }
+ nvlist_destroy(nvl);
+ return (nvlist_recv(sock));
+}
+
+nvpair_t *
+nvlist_first_nvpair(const nvlist_t *nvl)
+{
+
+ NVLIST_ASSERT(nvl);
+
+ return (TAILQ_FIRST(&nvl->nvl_head));
+}
+
+nvpair_t *
+nvlist_next_nvpair(const nvlist_t *nvl, const nvpair_t *nvp)
+{
+ nvpair_t *retnvp;
+
+ NVLIST_ASSERT(nvl);
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvpair_nvlist(nvp) == nvl);
+
+ retnvp = nvpair_next(nvp);
+ PJDLOG_ASSERT(retnvp == NULL || nvpair_nvlist(retnvp) == nvl);
+
+ return (retnvp);
+
+}
+
+nvpair_t *
+nvlist_prev_nvpair(const nvlist_t *nvl, const nvpair_t *nvp)
+{
+ nvpair_t *retnvp;
+
+ NVLIST_ASSERT(nvl);
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvpair_nvlist(nvp) == nvl);
+
+ retnvp = nvpair_prev(nvp);
+ PJDLOG_ASSERT(nvpair_nvlist(retnvp) == nvl);
+
+ return (retnvp);
+}
+
+const char *
+nvlist_next(const nvlist_t *nvl, int *typep, void **cookiep)
+{
+ nvpair_t *nvp;
+
+ NVLIST_ASSERT(nvl);
+ PJDLOG_ASSERT(cookiep != NULL);
+
+ if (*cookiep == NULL)
+ nvp = nvlist_first_nvpair(nvl);
+ else
+ nvp = nvlist_next_nvpair(nvl, *cookiep);
+ if (nvp == NULL)
+ return (NULL);
+ if (typep != NULL)
+ *typep = nvpair_type(nvp);
+ *cookiep = nvp;
+ return (nvpair_name(nvp));
+}
+
+bool
+nvlist_exists(const nvlist_t *nvl, const char *name)
+{
+
+ return (nvlist_existsf(nvl, "%s", name));
+}
+
+#define NVLIST_EXISTS(type) \
+bool \
+nvlist_exists_##type(const nvlist_t *nvl, const char *name) \
+{ \
+ \
+ return (nvlist_existsf_##type(nvl, "%s", name)); \
+}
+
+NVLIST_EXISTS(null)
+NVLIST_EXISTS(bool)
+NVLIST_EXISTS(number)
+NVLIST_EXISTS(string)
+NVLIST_EXISTS(nvlist)
+NVLIST_EXISTS(descriptor)
+NVLIST_EXISTS(binary)
+
+#undef NVLIST_EXISTS
+
+bool
+nvlist_existsf(const nvlist_t *nvl, const char *namefmt, ...)
+{
+ va_list nameap;
+ bool ret;
+
+ va_start(nameap, namefmt);
+ ret = nvlist_existsv(nvl, namefmt, nameap);
+ va_end(nameap);
+ return (ret);
+}
+
+#define NVLIST_EXISTSF(type) \
+bool \
+nvlist_existsf_##type(const nvlist_t *nvl, const char *namefmt, ...) \
+{ \
+ va_list nameap; \
+ bool ret; \
+ \
+ va_start(nameap, namefmt); \
+ ret = nvlist_existsv_##type(nvl, namefmt, nameap); \
+ va_end(nameap); \
+ return (ret); \
+}
+
+NVLIST_EXISTSF(null)
+NVLIST_EXISTSF(bool)
+NVLIST_EXISTSF(number)
+NVLIST_EXISTSF(string)
+NVLIST_EXISTSF(nvlist)
+NVLIST_EXISTSF(descriptor)
+NVLIST_EXISTSF(binary)
+
+#undef NVLIST_EXISTSF
+
+bool
+nvlist_existsv(const nvlist_t *nvl, const char *namefmt, va_list nameap)
+{
+
+ return (nvlist_findv(nvl, NV_TYPE_NONE, namefmt, nameap) != NULL);
+}
+
+#define NVLIST_EXISTSV(type, TYPE) \
+bool \
+nvlist_existsv_##type(const nvlist_t *nvl, const char *namefmt, \
+ va_list nameap) \
+{ \
+ \
+ return (nvlist_findv(nvl, NV_TYPE_##TYPE, namefmt, nameap) != \
+ NULL); \
+}
+
+NVLIST_EXISTSV(null, NULL)
+NVLIST_EXISTSV(bool, BOOL)
+NVLIST_EXISTSV(number, NUMBER)
+NVLIST_EXISTSV(string, STRING)
+NVLIST_EXISTSV(nvlist, NVLIST)
+NVLIST_EXISTSV(descriptor, DESCRIPTOR)
+NVLIST_EXISTSV(binary, BINARY)
+
+#undef NVLIST_EXISTSV
+
+void
+nvlist_add_nvpair(nvlist_t *nvl, const nvpair_t *nvp)
+{
+ nvpair_t *newnvp;
+
+ NVPAIR_ASSERT(nvp);
+
+ if (nvlist_error(nvl) != 0) {
+ errno = nvlist_error(nvl);
+ return;
+ }
+ if (nvlist_exists(nvl, nvpair_name(nvp))) {
+ nvl->nvl_error = errno = EEXIST;
+ return;
+ }
+
+ newnvp = nvpair_clone(nvp);
+ if (newnvp == NULL) {
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ return;
+ }
+
+ nvpair_insert(&nvl->nvl_head, newnvp, nvl);
+}
+
+void
+nvlist_add_null(nvlist_t *nvl, const char *name)
+{
+
+ nvlist_addf_null(nvl, "%s", name);
+}
+
+void
+nvlist_add_bool(nvlist_t *nvl, const char *name, bool value)
+{
+
+ nvlist_addf_bool(nvl, value, "%s", name);
+}
+
+void
+nvlist_add_number(nvlist_t *nvl, const char *name, uint64_t value)
+{
+
+ nvlist_addf_number(nvl, value, "%s", name);
+}
+
+void
+nvlist_add_string(nvlist_t *nvl, const char *name, const char *value)
+{
+
+ nvlist_addf_string(nvl, value, "%s", name);
+}
+
+void
+nvlist_add_stringf(nvlist_t *nvl, const char *name, const char *valuefmt, ...)
+{
+ va_list valueap;
+
+ va_start(valueap, valuefmt);
+ nvlist_add_stringv(nvl, name, valuefmt, valueap);
+ va_end(valueap);
+}
+
+void
+nvlist_add_stringv(nvlist_t *nvl, const char *name, const char *valuefmt,
+ va_list valueap)
+{
+ nvpair_t *nvp;
+
+ if (nvlist_error(nvl) != 0) {
+ errno = nvlist_error(nvl);
+ return;
+ }
+
+ nvp = nvpair_create_stringv(name, valuefmt, valueap);
+ if (nvp == NULL)
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ else
+ nvlist_move_nvpair(nvl, nvp);
+}
+
+void
+nvlist_add_nvlist(nvlist_t *nvl, const char *name, const nvlist_t *value)
+{
+
+ nvlist_addf_nvlist(nvl, value, "%s", name);
+}
+
+void
+nvlist_add_descriptor(nvlist_t *nvl, const char *name, int value)
+{
+
+ nvlist_addf_descriptor(nvl, value, "%s", name);
+}
+
+void
+nvlist_add_binary(nvlist_t *nvl, const char *name, const void *value,
+ size_t size)
+{
+
+ nvlist_addf_binary(nvl, value, size, "%s", name);
+}
+
+void
+nvlist_addf_null(nvlist_t *nvl, const char *namefmt, ...)
+{
+ va_list nameap;
+
+ va_start(nameap, namefmt);
+ nvlist_addv_null(nvl, namefmt, nameap);
+ va_end(nameap);
+}
+
+void
+nvlist_addf_bool(nvlist_t *nvl, bool value, const char *namefmt, ...)
+{
+ va_list nameap;
+
+ va_start(nameap, namefmt);
+ nvlist_addv_bool(nvl, value, namefmt, nameap);
+ va_end(nameap);
+}
+
+void
+nvlist_addf_number(nvlist_t *nvl, uint64_t value, const char *namefmt, ...)
+{
+ va_list nameap;
+
+ va_start(nameap, namefmt);
+ nvlist_addv_number(nvl, value, namefmt, nameap);
+ va_end(nameap);
+}
+
+void
+nvlist_addf_string(nvlist_t *nvl, const char *value, const char *namefmt, ...)
+{
+ va_list nameap;
+
+ va_start(nameap, namefmt);
+ nvlist_addv_string(nvl, value, namefmt, nameap);
+ va_end(nameap);
+}
+
+void
+nvlist_addf_nvlist(nvlist_t *nvl, const nvlist_t *value, const char *namefmt,
+ ...)
+{
+ va_list nameap;
+
+ va_start(nameap, namefmt);
+ nvlist_addv_nvlist(nvl, value, namefmt, nameap);
+ va_end(nameap);
+}
+
+void
+nvlist_addf_descriptor(nvlist_t *nvl, int value, const char *namefmt, ...)
+{
+ va_list nameap;
+
+ va_start(nameap, namefmt);
+ nvlist_addv_descriptor(nvl, value, namefmt, nameap);
+ va_end(nameap);
+}
+
+void
+nvlist_addf_binary(nvlist_t *nvl, const void *value, size_t size,
+ const char *namefmt, ...)
+{
+ va_list nameap;
+
+ va_start(nameap, namefmt);
+ nvlist_addv_binary(nvl, value, size, namefmt, nameap);
+ va_end(nameap);
+}
+
+void
+nvlist_addv_null(nvlist_t *nvl, const char *namefmt, va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (nvlist_error(nvl) != 0) {
+ errno = nvlist_error(nvl);
+ return;
+ }
+
+ nvp = nvpair_createv_null(namefmt, nameap);
+ if (nvp == NULL)
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ else
+ nvlist_move_nvpair(nvl, nvp);
+}
+
+void
+nvlist_addv_bool(nvlist_t *nvl, bool value, const char *namefmt, va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (nvlist_error(nvl) != 0) {
+ errno = nvlist_error(nvl);
+ return;
+ }
+
+ nvp = nvpair_createv_bool(value, namefmt, nameap);
+ if (nvp == NULL)
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ else
+ nvlist_move_nvpair(nvl, nvp);
+}
+
+void
+nvlist_addv_number(nvlist_t *nvl, uint64_t value, const char *namefmt,
+ va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (nvlist_error(nvl) != 0) {
+ errno = nvlist_error(nvl);
+ return;
+ }
+
+ nvp = nvpair_createv_number(value, namefmt, nameap);
+ if (nvp == NULL)
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ else
+ nvlist_move_nvpair(nvl, nvp);
+}
+
+void
+nvlist_addv_string(nvlist_t *nvl, const char *value, const char *namefmt,
+ va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (nvlist_error(nvl) != 0) {
+ errno = nvlist_error(nvl);
+ return;
+ }
+
+ nvp = nvpair_createv_string(value, namefmt, nameap);
+ if (nvp == NULL)
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ else
+ nvlist_move_nvpair(nvl, nvp);
+}
+
+void
+nvlist_addv_nvlist(nvlist_t *nvl, const nvlist_t *value, const char *namefmt,
+ va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (nvlist_error(nvl) != 0) {
+ errno = nvlist_error(nvl);
+ return;
+ }
+
+ nvp = nvpair_createv_nvlist(value, namefmt, nameap);
+ if (nvp == NULL)
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ else
+ nvlist_move_nvpair(nvl, nvp);
+}
+
+void
+nvlist_addv_descriptor(nvlist_t *nvl, int value, const char *namefmt,
+ va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (nvlist_error(nvl) != 0) {
+ errno = nvlist_error(nvl);
+ return;
+ }
+
+ nvp = nvpair_createv_descriptor(value, namefmt, nameap);
+ if (nvp == NULL)
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ else
+ nvlist_move_nvpair(nvl, nvp);
+}
+
+void
+nvlist_addv_binary(nvlist_t *nvl, const void *value, size_t size,
+ const char *namefmt, va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (nvlist_error(nvl) != 0) {
+ errno = nvlist_error(nvl);
+ return;
+ }
+
+ nvp = nvpair_createv_binary(value, size, namefmt, nameap);
+ if (nvp == NULL)
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ else
+ nvlist_move_nvpair(nvl, nvp);
+}
+
+void
+nvlist_move_nvpair(nvlist_t *nvl, nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvpair_nvlist(nvp) == NULL);
+
+ if (nvlist_error(nvl) != 0) {
+ nvpair_free(nvp);
+ errno = nvlist_error(nvl);
+ return;
+ }
+ if (nvlist_exists(nvl, nvpair_name(nvp))) {
+ nvpair_free(nvp);
+ nvl->nvl_error = errno = EEXIST;
+ return;
+ }
+
+ nvpair_insert(&nvl->nvl_head, nvp, nvl);
+}
+
+#define NVLIST_MOVE(vtype, type) \
+void \
+nvlist_move_##type(nvlist_t *nvl, const char *name, vtype value) \
+{ \
+ \
+ nvlist_movef_##type(nvl, value, "%s", name); \
+}
+
+NVLIST_MOVE(char *, string)
+NVLIST_MOVE(nvlist_t *, nvlist)
+NVLIST_MOVE(int, descriptor)
+
+#undef NVLIST_MOVE
+
+void
+nvlist_move_binary(nvlist_t *nvl, const char *name, void *value, size_t size)
+{
+
+ nvlist_movef_binary(nvl, value, size, "%s", name);
+}
+
+#define NVLIST_MOVEF(vtype, type) \
+void \
+nvlist_movef_##type(nvlist_t *nvl, vtype value, const char *namefmt, \
+ ...) \
+{ \
+ va_list nameap; \
+ \
+ va_start(nameap, namefmt); \
+ nvlist_movev_##type(nvl, value, namefmt, nameap); \
+ va_end(nameap); \
+}
+
+NVLIST_MOVEF(char *, string)
+NVLIST_MOVEF(nvlist_t *, nvlist)
+NVLIST_MOVEF(int, descriptor)
+
+#undef NVLIST_MOVEF
+
+void
+nvlist_movef_binary(nvlist_t *nvl, void *value, size_t size,
+ const char *namefmt, ...)
+{
+ va_list nameap;
+
+ va_start(nameap, namefmt);
+ nvlist_movev_binary(nvl, value, size, namefmt, nameap);
+ va_end(nameap);
+}
+
+void
+nvlist_movev_string(nvlist_t *nvl, char *value, const char *namefmt,
+ va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (nvlist_error(nvl) != 0) {
+ free(value);
+ errno = nvlist_error(nvl);
+ return;
+ }
+
+ nvp = nvpair_movev_string(value, namefmt, nameap);
+ if (nvp == NULL)
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ else
+ nvlist_move_nvpair(nvl, nvp);
+}
+
+void
+nvlist_movev_nvlist(nvlist_t *nvl, nvlist_t *value, const char *namefmt,
+ va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (nvlist_error(nvl) != 0) {
+ if (value != NULL && nvlist_get_nvpair_parent(value) != NULL)
+ nvlist_destroy(value);
+ errno = nvlist_error(nvl);
+ return;
+ }
+
+ nvp = nvpair_movev_nvlist(value, namefmt, nameap);
+ if (nvp == NULL)
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ else
+ nvlist_move_nvpair(nvl, nvp);
+}
+
+void
+nvlist_movev_descriptor(nvlist_t *nvl, int value, const char *namefmt,
+ va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (nvlist_error(nvl) != 0) {
+ close(value);
+ errno = nvlist_error(nvl);
+ return;
+ }
+
+ nvp = nvpair_movev_descriptor(value, namefmt, nameap);
+ if (nvp == NULL)
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ else
+ nvlist_move_nvpair(nvl, nvp);
+}
+
+void
+nvlist_movev_binary(nvlist_t *nvl, void *value, size_t size,
+ const char *namefmt, va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (nvlist_error(nvl) != 0) {
+ free(value);
+ errno = nvlist_error(nvl);
+ return;
+ }
+
+ nvp = nvpair_movev_binary(value, size, namefmt, nameap);
+ if (nvp == NULL)
+ nvl->nvl_error = errno = (errno != 0 ? errno : ENOMEM);
+ else
+ nvlist_move_nvpair(nvl, nvp);
+}
+
+#define NVLIST_GET(ftype, type) \
+ftype \
+nvlist_get_##type(const nvlist_t *nvl, const char *name) \
+{ \
+ \
+ return (nvlist_getf_##type(nvl, "%s", name)); \
+}
+
+NVLIST_GET(const nvpair_t *, nvpair)
+NVLIST_GET(bool, bool)
+NVLIST_GET(uint64_t, number)
+NVLIST_GET(const char *, string)
+NVLIST_GET(const nvlist_t *, nvlist)
+NVLIST_GET(int, descriptor)
+
+#undef NVLIST_GET
+
+const void *
+nvlist_get_binary(const nvlist_t *nvl, const char *name, size_t *sizep)
+{
+
+ return (nvlist_getf_binary(nvl, sizep, "%s", name));
+}
+
+#define NVLIST_GETF(ftype, type) \
+ftype \
+nvlist_getf_##type(const nvlist_t *nvl, const char *namefmt, ...) \
+{ \
+ va_list nameap; \
+ ftype value; \
+ \
+ va_start(nameap, namefmt); \
+ value = nvlist_getv_##type(nvl, namefmt, nameap); \
+ va_end(nameap); \
+ \
+ return (value); \
+}
+
+NVLIST_GETF(const nvpair_t *, nvpair)
+NVLIST_GETF(bool, bool)
+NVLIST_GETF(uint64_t, number)
+NVLIST_GETF(const char *, string)
+NVLIST_GETF(const nvlist_t *, nvlist)
+NVLIST_GETF(int, descriptor)
+
+#undef NVLIST_GETF
+
+const void *
+nvlist_getf_binary(const nvlist_t *nvl, size_t *sizep, const char *namefmt, ...)
+{
+ va_list nameap;
+ const void *value;
+
+ va_start(nameap, namefmt);
+ value = nvlist_getv_binary(nvl, sizep, namefmt, nameap);
+ va_end(nameap);
+
+ return (value);
+}
+
+const nvpair_t *
+nvlist_getv_nvpair(const nvlist_t *nvl, const char *namefmt, va_list nameap)
+{
+
+ return (nvlist_findv(nvl, NV_TYPE_NONE, namefmt, nameap));
+}
+
+#define NVLIST_GETV(ftype, type, TYPE) \
+ftype \
+nvlist_getv_##type(const nvlist_t *nvl, const char *namefmt, \
+ va_list nameap) \
+{ \
+ va_list cnameap; \
+ const nvpair_t *nvp; \
+ \
+ va_copy(cnameap, nameap); \
+ nvp = nvlist_findv(nvl, NV_TYPE_##TYPE, namefmt, cnameap); \
+ va_end(cnameap); \
+ if (nvp == NULL) \
+ nvlist_report_missing(NV_TYPE_##TYPE, namefmt, nameap); \
+ return (nvpair_get_##type(nvp)); \
+}
+
+NVLIST_GETV(bool, bool, BOOL)
+NVLIST_GETV(uint64_t, number, NUMBER)
+NVLIST_GETV(const char *, string, STRING)
+NVLIST_GETV(const nvlist_t *, nvlist, NVLIST)
+NVLIST_GETV(int, descriptor, DESCRIPTOR)
+
+#undef NVLIST_GETV
+
+const void *
+nvlist_getv_binary(const nvlist_t *nvl, size_t *sizep, const char *namefmt,
+ va_list nameap)
+{
+ va_list cnameap;
+ const nvpair_t *nvp;
+
+ va_copy(cnameap, nameap);
+ nvp = nvlist_findv(nvl, NV_TYPE_BINARY, namefmt, cnameap);
+ va_end(cnameap);
+ if (nvp == NULL)
+ nvlist_report_missing(NV_TYPE_BINARY, namefmt, nameap);
+
+ return (nvpair_get_binary(nvp, sizep));
+}
+
+#define NVLIST_TAKE(ftype, type) \
+ftype \
+nvlist_take_##type(nvlist_t *nvl, const char *name) \
+{ \
+ \
+ return (nvlist_takef_##type(nvl, "%s", name)); \
+}
+
+NVLIST_TAKE(nvpair_t *, nvpair)
+NVLIST_TAKE(bool, bool)
+NVLIST_TAKE(uint64_t, number)
+NVLIST_TAKE(char *, string)
+NVLIST_TAKE(nvlist_t *, nvlist)
+NVLIST_TAKE(int, descriptor)
+
+#undef NVLIST_TAKE
+
+void *
+nvlist_take_binary(nvlist_t *nvl, const char *name, size_t *sizep)
+{
+
+ return (nvlist_takef_binary(nvl, sizep, "%s", name));
+}
+
+#define NVLIST_TAKEF(ftype, type) \
+ftype \
+nvlist_takef_##type(nvlist_t *nvl, const char *namefmt, ...) \
+{ \
+ va_list nameap; \
+ ftype value; \
+ \
+ va_start(nameap, namefmt); \
+ value = nvlist_takev_##type(nvl, namefmt, nameap); \
+ va_end(nameap); \
+ \
+ return (value); \
+}
+
+NVLIST_TAKEF(nvpair_t *, nvpair)
+NVLIST_TAKEF(bool, bool)
+NVLIST_TAKEF(uint64_t, number)
+NVLIST_TAKEF(char *, string)
+NVLIST_TAKEF(nvlist_t *, nvlist)
+NVLIST_TAKEF(int, descriptor)
+
+#undef NVLIST_TAKEF
+
+void *
+nvlist_takef_binary(nvlist_t *nvl, size_t *sizep, const char *namefmt, ...)
+{
+ va_list nameap;
+ void *value;
+
+ va_start(nameap, namefmt);
+ value = nvlist_takev_binary(nvl, sizep, namefmt, nameap);
+ va_end(nameap);
+
+ return (value);
+}
+
+nvpair_t *
+nvlist_takev_nvpair(nvlist_t *nvl, const char *namefmt, va_list nameap)
+{
+ nvpair_t *nvp;
+
+ nvp = nvlist_findv(nvl, NV_TYPE_NONE, namefmt, nameap);
+ if (nvp != NULL)
+ nvlist_remove_nvpair(nvl, nvp);
+ return (nvp);
+}
+
+#define NVLIST_TAKEV(ftype, type, TYPE) \
+ftype \
+nvlist_takev_##type(nvlist_t *nvl, const char *namefmt, va_list nameap) \
+{ \
+ va_list cnameap; \
+ nvpair_t *nvp; \
+ ftype value; \
+ \
+ va_copy(cnameap, nameap); \
+ nvp = nvlist_findv(nvl, NV_TYPE_##TYPE, namefmt, cnameap); \
+ va_end(cnameap); \
+ if (nvp == NULL) \
+ nvlist_report_missing(NV_TYPE_##TYPE, namefmt, nameap); \
+ value = (ftype)(intptr_t)nvpair_get_##type(nvp); \
+ nvlist_remove_nvpair(nvl, nvp); \
+ nvpair_free_structure(nvp); \
+ return (value); \
+}
+
+NVLIST_TAKEV(bool, bool, BOOL)
+NVLIST_TAKEV(uint64_t, number, NUMBER)
+NVLIST_TAKEV(char *, string, STRING)
+NVLIST_TAKEV(nvlist_t *, nvlist, NVLIST)
+NVLIST_TAKEV(int, descriptor, DESCRIPTOR)
+
+#undef NVLIST_TAKEV
+
+void *
+nvlist_takev_binary(nvlist_t *nvl, size_t *sizep, const char *namefmt,
+ va_list nameap)
+{
+ va_list cnameap;
+ nvpair_t *nvp;
+ void *value;
+
+ va_copy(cnameap, nameap);
+ nvp = nvlist_findv(nvl, NV_TYPE_BINARY, namefmt, cnameap);
+ va_end(cnameap);
+ if (nvp == NULL)
+ nvlist_report_missing(NV_TYPE_BINARY, namefmt, nameap);
+
+ value = (void *)(intptr_t)nvpair_get_binary(nvp, sizep);
+ nvlist_remove_nvpair(nvl, nvp);
+ nvpair_free_structure(nvp);
+ return (value);
+}
+
+void
+nvlist_remove_nvpair(nvlist_t *nvl, nvpair_t *nvp)
+{
+
+ NVLIST_ASSERT(nvl);
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvpair_nvlist(nvp) == nvl);
+
+ nvpair_remove(&nvl->nvl_head, nvp, nvl);
+}
+
+void
+nvlist_free(nvlist_t *nvl, const char *name)
+{
+
+ nvlist_freef(nvl, "%s", name);
+}
+
+#define NVLIST_FREE(type) \
+void \
+nvlist_free_##type(nvlist_t *nvl, const char *name) \
+{ \
+ \
+ nvlist_freef_##type(nvl, "%s", name); \
+}
+
+NVLIST_FREE(null)
+NVLIST_FREE(bool)
+NVLIST_FREE(number)
+NVLIST_FREE(string)
+NVLIST_FREE(nvlist)
+NVLIST_FREE(descriptor)
+NVLIST_FREE(binary)
+
+#undef NVLIST_FREE
+
+void
+nvlist_freef(nvlist_t *nvl, const char *namefmt, ...)
+{
+ va_list nameap;
+
+ va_start(nameap, namefmt);
+ nvlist_freev(nvl, namefmt, nameap);
+ va_end(nameap);
+}
+
+#define NVLIST_FREEF(type) \
+void \
+nvlist_freef_##type(nvlist_t *nvl, const char *namefmt, ...) \
+{ \
+ va_list nameap; \
+ \
+ va_start(nameap, namefmt); \
+ nvlist_freev_##type(nvl, namefmt, nameap); \
+ va_end(nameap); \
+}
+
+NVLIST_FREEF(null)
+NVLIST_FREEF(bool)
+NVLIST_FREEF(number)
+NVLIST_FREEF(string)
+NVLIST_FREEF(nvlist)
+NVLIST_FREEF(descriptor)
+NVLIST_FREEF(binary)
+
+#undef NVLIST_FREEF
+
+void
+nvlist_freev(nvlist_t *nvl, const char *namefmt, va_list nameap)
+{
+
+ nvlist_freev_type(nvl, NV_TYPE_NONE, namefmt, nameap);
+}
+
+#define NVLIST_FREEV(type, TYPE) \
+void \
+nvlist_freev_##type(nvlist_t *nvl, const char *namefmt, va_list nameap) \
+{ \
+ \
+ nvlist_freev_type(nvl, NV_TYPE_##TYPE, namefmt, nameap); \
+}
+
+NVLIST_FREEV(null, NULL)
+NVLIST_FREEV(bool, BOOL)
+NVLIST_FREEV(number, NUMBER)
+NVLIST_FREEV(string, STRING)
+NVLIST_FREEV(nvlist, NVLIST)
+NVLIST_FREEV(descriptor, DESCRIPTOR)
+NVLIST_FREEV(binary, BINARY)
+#undef NVLIST_FREEV
+
+void
+nvlist_free_nvpair(nvlist_t *nvl, nvpair_t *nvp)
+{
+
+ NVLIST_ASSERT(nvl);
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvpair_nvlist(nvp) == nvl);
+
+ nvlist_remove_nvpair(nvl, nvp);
+ nvpair_free(nvp);
+}
diff --git a/lib/libdevctl/devctl.h b/lib/libnv/nvlist_impl.h
index f773b11..ef32dea 100644
--- a/lib/libdevctl/devctl.h
+++ b/lib/libnv/nvlist_impl.h
@@ -1,7 +1,10 @@
/*-
- * Copyright (c) 2014 John Baldwin <jhb@FreeBSD.org>
+ * Copyright (c) 2013 The FreeBSD Foundation
* All rights reserved.
*
+ * This software was developed by Pawel Jakub Dawidek 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:
@@ -11,10 +14,10 @@
* 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
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED 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
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -26,17 +29,19 @@
* $FreeBSD$
*/
-#ifndef __DEVCTL_H__
-#define __DEVCTL_H__
+#ifndef _NVLIST_IMPL_H_
+#define _NVLIST_IMPL_H_
+
+#include <stdint.h>
+
+#include "nv.h"
-#include <stdbool.h>
+void *nvlist_xpack(const nvlist_t *nvl, int64_t *fdidxp, size_t *sizep);
+nvlist_t *nvlist_xunpack(const void *buf, size_t size, const int *fds,
+ size_t nfds);
-int devctl_attach(const char *device);
-int devctl_detach(const char *device, bool force);
-int devctl_enable(const char *device);
-int devctl_disable(const char *device, bool force_detach);
-int devctl_suspend(const char *device);
-int devctl_resume(const char *device);
-int devctl_set_driver(const char *device, const char *driver, bool force);
+nvpair_t *nvlist_get_nvpair_parent(const nvlist_t *nvl);
+const unsigned char *nvlist_unpack_header(nvlist_t *nvl,
+ const unsigned char *ptr, size_t nfds, bool *isbep, size_t *leftp);
-#endif /* !__DEVCTL_H__ */
+#endif /* !_NVLIST_IMPL_H_ */
diff --git a/lib/libnv/nvpair.c b/lib/libnv/nvpair.c
new file mode 100644
index 0000000..4f0bd72
--- /dev/null
+++ b/lib/libnv/nvpair.c
@@ -0,0 +1,1282 @@
+/*-
+ * Copyright (c) 2009-2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Pawel Jakub Dawidek 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 THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/endian.h>
+#include <sys/queue.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef HAVE_PJDLOG
+#include <pjdlog.h>
+#endif
+
+#include "common_impl.h"
+#include "nv.h"
+#include "nv_impl.h"
+#include "nvlist_impl.h"
+#include "nvpair_impl.h"
+
+#ifndef HAVE_PJDLOG
+#include <assert.h>
+#define PJDLOG_ASSERT(...) assert(__VA_ARGS__)
+#define PJDLOG_RASSERT(expr, ...) assert(expr)
+#define PJDLOG_ABORT(...) abort()
+#endif
+
+#define NVPAIR_MAGIC 0x6e7670 /* "nvp" */
+struct nvpair {
+ int nvp_magic;
+ char *nvp_name;
+ int nvp_type;
+ uint64_t nvp_data;
+ size_t nvp_datasize;
+ nvlist_t *nvp_list;
+ TAILQ_ENTRY(nvpair) nvp_next;
+};
+
+#define NVPAIR_ASSERT(nvp) do { \
+ PJDLOG_ASSERT((nvp) != NULL); \
+ PJDLOG_ASSERT((nvp)->nvp_magic == NVPAIR_MAGIC); \
+} while (0)
+
+struct nvpair_header {
+ uint8_t nvph_type;
+ uint16_t nvph_namesize;
+ uint64_t nvph_datasize;
+} __packed;
+
+
+void
+nvpair_assert(const nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+}
+
+nvlist_t *
+nvpair_nvlist(const nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+
+ return (nvp->nvp_list);
+}
+
+nvpair_t *
+nvpair_next(const nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_list != NULL);
+
+ return (TAILQ_NEXT(nvp, nvp_next));
+}
+
+nvpair_t *
+nvpair_prev(const nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_list != NULL);
+
+ return (TAILQ_PREV(nvp, nvl_head, nvp_next));
+}
+
+void
+nvpair_insert(struct nvl_head *head, nvpair_t *nvp, nvlist_t *nvl)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_list == NULL);
+ PJDLOG_ASSERT(!nvlist_exists(nvl, nvpair_name(nvp)));
+
+ TAILQ_INSERT_TAIL(head, nvp, nvp_next);
+ nvp->nvp_list = nvl;
+}
+
+static void
+nvpair_remove_nvlist(nvpair_t *nvp)
+{
+ nvlist_t *nvl;
+
+ /* XXX: DECONST is bad, mkay? */
+ nvl = __DECONST(nvlist_t *, nvpair_get_nvlist(nvp));
+ PJDLOG_ASSERT(nvl != NULL);
+ nvlist_set_parent(nvl, NULL);
+}
+
+void
+nvpair_remove(struct nvl_head *head, nvpair_t *nvp, const nvlist_t *nvl)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_list == nvl);
+
+ if (nvpair_type(nvp) == NV_TYPE_NVLIST)
+ nvpair_remove_nvlist(nvp);
+
+ TAILQ_REMOVE(head, nvp, nvp_next);
+ nvp->nvp_list = NULL;
+}
+
+nvpair_t *
+nvpair_clone(const nvpair_t *nvp)
+{
+ nvpair_t *newnvp;
+ const char *name;
+ const void *data;
+ size_t datasize;
+
+ NVPAIR_ASSERT(nvp);
+
+ name = nvpair_name(nvp);
+
+ switch (nvpair_type(nvp)) {
+ case NV_TYPE_NULL:
+ newnvp = nvpair_create_null(name);
+ break;
+ case NV_TYPE_BOOL:
+ newnvp = nvpair_create_bool(name, nvpair_get_bool(nvp));
+ break;
+ case NV_TYPE_NUMBER:
+ newnvp = nvpair_create_number(name, nvpair_get_number(nvp));
+ break;
+ case NV_TYPE_STRING:
+ newnvp = nvpair_create_string(name, nvpair_get_string(nvp));
+ break;
+ case NV_TYPE_NVLIST:
+ newnvp = nvpair_create_nvlist(name, nvpair_get_nvlist(nvp));
+ break;
+ case NV_TYPE_DESCRIPTOR:
+ newnvp = nvpair_create_descriptor(name,
+ nvpair_get_descriptor(nvp));
+ break;
+ case NV_TYPE_BINARY:
+ data = nvpair_get_binary(nvp, &datasize);
+ newnvp = nvpair_create_binary(name, data, datasize);
+ break;
+ default:
+ PJDLOG_ABORT("Unknown type: %d.", nvpair_type(nvp));
+ }
+
+ return (newnvp);
+}
+
+size_t
+nvpair_header_size(void)
+{
+
+ return (sizeof(struct nvpair_header));
+}
+
+size_t
+nvpair_size(const nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+
+ return (nvp->nvp_datasize);
+}
+
+unsigned char *
+nvpair_pack_header(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp)
+{
+ struct nvpair_header nvphdr;
+ size_t namesize;
+
+ NVPAIR_ASSERT(nvp);
+
+ nvphdr.nvph_type = nvp->nvp_type;
+ namesize = strlen(nvp->nvp_name) + 1;
+ PJDLOG_ASSERT(namesize > 0 && namesize <= UINT16_MAX);
+ nvphdr.nvph_namesize = namesize;
+ nvphdr.nvph_datasize = nvp->nvp_datasize;
+ PJDLOG_ASSERT(*leftp >= sizeof(nvphdr));
+ memcpy(ptr, &nvphdr, sizeof(nvphdr));
+ ptr += sizeof(nvphdr);
+ *leftp -= sizeof(nvphdr);
+
+ PJDLOG_ASSERT(*leftp >= namesize);
+ memcpy(ptr, nvp->nvp_name, namesize);
+ ptr += namesize;
+ *leftp -= namesize;
+
+ return (ptr);
+}
+
+unsigned char *
+nvpair_pack_null(const nvpair_t *nvp, unsigned char *ptr,
+ size_t *leftp __unused)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_NULL);
+
+ return (ptr);
+}
+
+unsigned char *
+nvpair_pack_bool(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp)
+{
+ uint8_t value;
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_BOOL);
+
+ value = (uint8_t)nvp->nvp_data;
+
+ PJDLOG_ASSERT(*leftp >= sizeof(value));
+ memcpy(ptr, &value, sizeof(value));
+ ptr += sizeof(value);
+ *leftp -= sizeof(value);
+
+ return (ptr);
+}
+
+unsigned char *
+nvpair_pack_number(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp)
+{
+ uint64_t value;
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_NUMBER);
+
+ value = (uint64_t)nvp->nvp_data;
+
+ PJDLOG_ASSERT(*leftp >= sizeof(value));
+ memcpy(ptr, &value, sizeof(value));
+ ptr += sizeof(value);
+ *leftp -= sizeof(value);
+
+ return (ptr);
+}
+
+unsigned char *
+nvpair_pack_string(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_STRING);
+
+ PJDLOG_ASSERT(*leftp >= nvp->nvp_datasize);
+ memcpy(ptr, (const void *)(intptr_t)nvp->nvp_data, nvp->nvp_datasize);
+ ptr += nvp->nvp_datasize;
+ *leftp -= nvp->nvp_datasize;
+
+ return (ptr);
+}
+
+unsigned char *
+nvpair_pack_nvlist_up(unsigned char *ptr, size_t *leftp)
+{
+ struct nvpair_header nvphdr;
+ size_t namesize;
+ const char *name = "";
+
+ namesize = 1;
+ nvphdr.nvph_type = NV_TYPE_NVLIST_UP;
+ nvphdr.nvph_namesize = namesize;
+ nvphdr.nvph_datasize = 0;
+ PJDLOG_ASSERT(*leftp >= sizeof(nvphdr));
+ memcpy(ptr, &nvphdr, sizeof(nvphdr));
+ ptr += sizeof(nvphdr);
+ *leftp -= sizeof(nvphdr);
+
+ PJDLOG_ASSERT(*leftp >= namesize);
+ memcpy(ptr, name, namesize);
+ ptr += namesize;
+ *leftp -= namesize;
+
+ return (ptr);
+}
+
+unsigned char *
+nvpair_pack_descriptor(const nvpair_t *nvp, unsigned char *ptr, int64_t *fdidxp,
+ size_t *leftp)
+{
+ int64_t value;
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_DESCRIPTOR);
+
+ value = (int64_t)nvp->nvp_data;
+ if (value != -1) {
+ /*
+ * If there is a real descriptor here, we change its number
+ * to position in the array of descriptors send via control
+ * message.
+ */
+ PJDLOG_ASSERT(fdidxp != NULL);
+
+ value = *fdidxp;
+ (*fdidxp)++;
+ }
+
+ PJDLOG_ASSERT(*leftp >= sizeof(value));
+ memcpy(ptr, &value, sizeof(value));
+ ptr += sizeof(value);
+ *leftp -= sizeof(value);
+
+ return (ptr);
+}
+
+unsigned char *
+nvpair_pack_binary(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_BINARY);
+
+ PJDLOG_ASSERT(*leftp >= nvp->nvp_datasize);
+ memcpy(ptr, (const void *)(intptr_t)nvp->nvp_data, nvp->nvp_datasize);
+ ptr += nvp->nvp_datasize;
+ *leftp -= nvp->nvp_datasize;
+
+ return (ptr);
+}
+
+void
+nvpair_init_datasize(nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+
+ if (nvp->nvp_type == NV_TYPE_NVLIST) {
+ if (nvp->nvp_data == 0) {
+ nvp->nvp_datasize = 0;
+ } else {
+ nvp->nvp_datasize =
+ nvlist_size((const nvlist_t *)(intptr_t)nvp->nvp_data);
+ }
+ }
+}
+
+const unsigned char *
+nvpair_unpack_header(bool isbe, nvpair_t *nvp, const unsigned char *ptr,
+ size_t *leftp)
+{
+ struct nvpair_header nvphdr;
+
+ if (*leftp < sizeof(nvphdr))
+ goto failed;
+
+ memcpy(&nvphdr, ptr, sizeof(nvphdr));
+ ptr += sizeof(nvphdr);
+ *leftp -= sizeof(nvphdr);
+
+#if NV_TYPE_FIRST > 0
+ if (nvphdr.nvph_type < NV_TYPE_FIRST)
+ goto failed;
+#endif
+ if (nvphdr.nvph_type > NV_TYPE_LAST &&
+ nvphdr.nvph_type != NV_TYPE_NVLIST_UP) {
+ goto failed;
+ }
+
+#if BYTE_ORDER == BIG_ENDIAN
+ if (!isbe) {
+ nvphdr.nvph_namesize = le16toh(nvphdr.nvph_namesize);
+ nvphdr.nvph_datasize = le64toh(nvphdr.nvph_datasize);
+ }
+#else
+ if (isbe) {
+ nvphdr.nvph_namesize = be16toh(nvphdr.nvph_namesize);
+ nvphdr.nvph_datasize = be64toh(nvphdr.nvph_datasize);
+ }
+#endif
+
+ if (nvphdr.nvph_namesize > NV_NAME_MAX)
+ goto failed;
+ if (*leftp < nvphdr.nvph_namesize)
+ goto failed;
+ if (nvphdr.nvph_namesize < 1)
+ goto failed;
+ if (strnlen((const char *)ptr, nvphdr.nvph_namesize) !=
+ (size_t)(nvphdr.nvph_namesize - 1)) {
+ goto failed;
+ }
+
+ memcpy(nvp->nvp_name, ptr, nvphdr.nvph_namesize);
+ ptr += nvphdr.nvph_namesize;
+ *leftp -= nvphdr.nvph_namesize;
+
+ if (*leftp < nvphdr.nvph_datasize)
+ goto failed;
+
+ nvp->nvp_type = nvphdr.nvph_type;
+ nvp->nvp_data = 0;
+ nvp->nvp_datasize = nvphdr.nvph_datasize;
+
+ return (ptr);
+failed:
+ errno = EINVAL;
+ return (NULL);
+}
+
+const unsigned char *
+nvpair_unpack_null(bool isbe __unused, nvpair_t *nvp, const unsigned char *ptr,
+ size_t *leftp __unused)
+{
+
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_NULL);
+
+ if (nvp->nvp_datasize != 0) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ return (ptr);
+}
+
+const unsigned char *
+nvpair_unpack_bool(bool isbe __unused, nvpair_t *nvp, const unsigned char *ptr,
+ size_t *leftp)
+{
+ uint8_t value;
+
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_BOOL);
+
+ if (nvp->nvp_datasize != sizeof(value)) {
+ errno = EINVAL;
+ return (NULL);
+ }
+ if (*leftp < sizeof(value)) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ memcpy(&value, ptr, sizeof(value));
+ ptr += sizeof(value);
+ *leftp -= sizeof(value);
+
+ if (value != 0 && value != 1) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ nvp->nvp_data = (uint64_t)value;
+
+ return (ptr);
+}
+
+const unsigned char *
+nvpair_unpack_number(bool isbe, nvpair_t *nvp, const unsigned char *ptr,
+ size_t *leftp)
+{
+
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_NUMBER);
+
+ if (nvp->nvp_datasize != sizeof(uint64_t)) {
+ errno = EINVAL;
+ return (NULL);
+ }
+ if (*leftp < sizeof(uint64_t)) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ if (isbe)
+ nvp->nvp_data = be64dec(ptr);
+ else
+ nvp->nvp_data = le64dec(ptr);
+ ptr += sizeof(uint64_t);
+ *leftp -= sizeof(uint64_t);
+
+ return (ptr);
+}
+
+const unsigned char *
+nvpair_unpack_string(bool isbe __unused, nvpair_t *nvp,
+ const unsigned char *ptr, size_t *leftp)
+{
+
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_STRING);
+
+ if (*leftp < nvp->nvp_datasize || nvp->nvp_datasize == 0) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ if (strnlen((const char *)ptr, nvp->nvp_datasize) !=
+ nvp->nvp_datasize - 1) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ nvp->nvp_data = (uint64_t)(uintptr_t)strdup((const char *)ptr);
+ if (nvp->nvp_data == 0)
+ return (NULL);
+
+ ptr += nvp->nvp_datasize;
+ *leftp -= nvp->nvp_datasize;
+
+ return (ptr);
+}
+
+const unsigned char *
+nvpair_unpack_nvlist(bool isbe __unused, nvpair_t *nvp,
+ const unsigned char *ptr, size_t *leftp, size_t nfds, nvlist_t **child)
+{
+ nvlist_t *value;
+
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_NVLIST);
+
+ if (*leftp < nvp->nvp_datasize || nvp->nvp_datasize == 0) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ value = nvlist_create(0);
+ if (value == NULL)
+ return (NULL);
+
+ ptr = nvlist_unpack_header(value, ptr, nfds, NULL, leftp);
+ if (ptr == NULL)
+ return (NULL);
+
+ nvp->nvp_data = (uint64_t)(uintptr_t)value;
+ *child = value;
+
+ return (ptr);
+}
+
+const unsigned char *
+nvpair_unpack_descriptor(bool isbe, nvpair_t *nvp, const unsigned char *ptr,
+ size_t *leftp, const int *fds, size_t nfds)
+{
+ int64_t idx;
+
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_DESCRIPTOR);
+
+ if (nvp->nvp_datasize != sizeof(idx)) {
+ errno = EINVAL;
+ return (NULL);
+ }
+ if (*leftp < sizeof(idx)) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ if (isbe)
+ idx = be64dec(ptr);
+ else
+ idx = le64dec(ptr);
+
+ if (idx < 0) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ if ((size_t)idx >= nfds) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ nvp->nvp_data = (uint64_t)fds[idx];
+
+ ptr += sizeof(idx);
+ *leftp -= sizeof(idx);
+
+ return (ptr);
+}
+
+const unsigned char *
+nvpair_unpack_binary(bool isbe __unused, nvpair_t *nvp,
+ const unsigned char *ptr, size_t *leftp)
+{
+ void *value;
+
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_BINARY);
+
+ if (*leftp < nvp->nvp_datasize || nvp->nvp_datasize == 0) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ value = malloc(nvp->nvp_datasize);
+ if (value == NULL)
+ return (NULL);
+
+ memcpy(value, ptr, nvp->nvp_datasize);
+ ptr += nvp->nvp_datasize;
+ *leftp -= nvp->nvp_datasize;
+
+ nvp->nvp_data = (uint64_t)(uintptr_t)value;
+
+ return (ptr);
+}
+
+const unsigned char *
+nvpair_unpack(bool isbe, const unsigned char *ptr, size_t *leftp,
+ nvpair_t **nvpp)
+{
+ nvpair_t *nvp, *tmp;
+
+ nvp = calloc(1, sizeof(*nvp) + NV_NAME_MAX);
+ if (nvp == NULL)
+ return (NULL);
+ nvp->nvp_name = (char *)(nvp + 1);
+
+ ptr = nvpair_unpack_header(isbe, nvp, ptr, leftp);
+ if (ptr == NULL)
+ goto failed;
+ tmp = realloc(nvp, sizeof(*nvp) + strlen(nvp->nvp_name) + 1);
+ if (tmp == NULL)
+ goto failed;
+ nvp = tmp;
+
+ /* Update nvp_name after realloc(). */
+ nvp->nvp_name = (char *)(nvp + 1);
+ nvp->nvp_data = 0x00;
+ nvp->nvp_magic = NVPAIR_MAGIC;
+ *nvpp = nvp;
+ return (ptr);
+failed:
+ free(nvp);
+ return (NULL);
+}
+
+int
+nvpair_type(const nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+
+ return (nvp->nvp_type);
+}
+
+const char *
+nvpair_name(const nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+
+ return (nvp->nvp_name);
+}
+
+static nvpair_t *
+nvpair_allocv(int type, uint64_t data, size_t datasize, const char *namefmt,
+ va_list nameap)
+{
+ nvpair_t *nvp;
+ char *name;
+ int namelen;
+
+ PJDLOG_ASSERT(type >= NV_TYPE_FIRST && type <= NV_TYPE_LAST);
+
+ namelen = vasprintf(&name, namefmt, nameap);
+ if (namelen < 0)
+ return (NULL);
+
+ PJDLOG_ASSERT(namelen > 0);
+ if (namelen >= NV_NAME_MAX) {
+ free(name);
+ errno = ENAMETOOLONG;
+ return (NULL);
+ }
+
+ nvp = calloc(1, sizeof(*nvp) + namelen + 1);
+ if (nvp != NULL) {
+ nvp->nvp_name = (char *)(nvp + 1);
+ memcpy(nvp->nvp_name, name, namelen + 1);
+ nvp->nvp_type = type;
+ nvp->nvp_data = data;
+ nvp->nvp_datasize = datasize;
+ nvp->nvp_magic = NVPAIR_MAGIC;
+ }
+ free(name);
+
+ return (nvp);
+};
+
+nvpair_t *
+nvpair_create_null(const char *name)
+{
+
+ return (nvpair_createf_null("%s", name));
+}
+
+nvpair_t *
+nvpair_create_bool(const char *name, bool value)
+{
+
+ return (nvpair_createf_bool(value, "%s", name));
+}
+
+nvpair_t *
+nvpair_create_number(const char *name, uint64_t value)
+{
+
+ return (nvpair_createf_number(value, "%s", name));
+}
+
+nvpair_t *
+nvpair_create_string(const char *name, const char *value)
+{
+
+ return (nvpair_createf_string(value, "%s", name));
+}
+
+nvpair_t *
+nvpair_create_stringf(const char *name, const char *valuefmt, ...)
+{
+ va_list valueap;
+ nvpair_t *nvp;
+
+ va_start(valueap, valuefmt);
+ nvp = nvpair_create_stringv(name, valuefmt, valueap);
+ va_end(valueap);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_create_stringv(const char *name, const char *valuefmt, va_list valueap)
+{
+ nvpair_t *nvp;
+ char *str;
+ int len;
+
+ len = vasprintf(&str, valuefmt, valueap);
+ if (len < 0)
+ return (NULL);
+ nvp = nvpair_create_string(name, str);
+ if (nvp == NULL)
+ free(str);
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_create_nvlist(const char *name, const nvlist_t *value)
+{
+
+ return (nvpair_createf_nvlist(value, "%s", name));
+}
+
+nvpair_t *
+nvpair_create_descriptor(const char *name, int value)
+{
+
+ return (nvpair_createf_descriptor(value, "%s", name));
+}
+
+nvpair_t *
+nvpair_create_binary(const char *name, const void *value, size_t size)
+{
+
+ return (nvpair_createf_binary(value, size, "%s", name));
+}
+
+nvpair_t *
+nvpair_createf_null(const char *namefmt, ...)
+{
+ va_list nameap;
+ nvpair_t *nvp;
+
+ va_start(nameap, namefmt);
+ nvp = nvpair_createv_null(namefmt, nameap);
+ va_end(nameap);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_createf_bool(bool value, const char *namefmt, ...)
+{
+ va_list nameap;
+ nvpair_t *nvp;
+
+ va_start(nameap, namefmt);
+ nvp = nvpair_createv_bool(value, namefmt, nameap);
+ va_end(nameap);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_createf_number(uint64_t value, const char *namefmt, ...)
+{
+ va_list nameap;
+ nvpair_t *nvp;
+
+ va_start(nameap, namefmt);
+ nvp = nvpair_createv_number(value, namefmt, nameap);
+ va_end(nameap);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_createf_string(const char *value, const char *namefmt, ...)
+{
+ va_list nameap;
+ nvpair_t *nvp;
+
+ va_start(nameap, namefmt);
+ nvp = nvpair_createv_string(value, namefmt, nameap);
+ va_end(nameap);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_createf_nvlist(const nvlist_t *value, const char *namefmt, ...)
+{
+ va_list nameap;
+ nvpair_t *nvp;
+
+ va_start(nameap, namefmt);
+ nvp = nvpair_createv_nvlist(value, namefmt, nameap);
+ va_end(nameap);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_createf_descriptor(int value, const char *namefmt, ...)
+{
+ va_list nameap;
+ nvpair_t *nvp;
+
+ va_start(nameap, namefmt);
+ nvp = nvpair_createv_descriptor(value, namefmt, nameap);
+ va_end(nameap);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_createf_binary(const void *value, size_t size, const char *namefmt, ...)
+{
+ va_list nameap;
+ nvpair_t *nvp;
+
+ va_start(nameap, namefmt);
+ nvp = nvpair_createv_binary(value, size, namefmt, nameap);
+ va_end(nameap);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_createv_null(const char *namefmt, va_list nameap)
+{
+
+ return (nvpair_allocv(NV_TYPE_NULL, 0, 0, namefmt, nameap));
+}
+
+nvpair_t *
+nvpair_createv_bool(bool value, const char *namefmt, va_list nameap)
+{
+
+ return (nvpair_allocv(NV_TYPE_BOOL, value ? 1 : 0, sizeof(uint8_t),
+ namefmt, nameap));
+}
+
+nvpair_t *
+nvpair_createv_number(uint64_t value, const char *namefmt, va_list nameap)
+{
+
+ return (nvpair_allocv(NV_TYPE_NUMBER, value, sizeof(value), namefmt,
+ nameap));
+}
+
+nvpair_t *
+nvpair_createv_string(const char *value, const char *namefmt, va_list nameap)
+{
+ nvpair_t *nvp;
+ size_t size;
+ char *data;
+
+ if (value == NULL) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ data = strdup(value);
+ if (data == NULL)
+ return (NULL);
+ size = strlen(value) + 1;
+
+ nvp = nvpair_allocv(NV_TYPE_STRING, (uint64_t)(uintptr_t)data, size,
+ namefmt, nameap);
+ if (nvp == NULL)
+ free(data);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_createv_nvlist(const nvlist_t *value, const char *namefmt,
+ va_list nameap)
+{
+ nvlist_t *nvl;
+ nvpair_t *nvp;
+
+ if (value == NULL) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ nvl = nvlist_clone(value);
+ if (nvl == NULL)
+ return (NULL);
+
+ nvp = nvpair_allocv(NV_TYPE_NVLIST, (uint64_t)(uintptr_t)nvl, 0,
+ namefmt, nameap);
+ if (nvp == NULL)
+ nvlist_destroy(nvl);
+ else
+ nvlist_set_parent(nvl, nvp);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_createv_descriptor(int value, const char *namefmt, va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (value < 0 || !fd_is_valid(value)) {
+ errno = EBADF;
+ return (NULL);
+ }
+
+ value = fcntl(value, F_DUPFD_CLOEXEC, 0);
+ if (value < 0)
+ return (NULL);
+
+ nvp = nvpair_allocv(NV_TYPE_DESCRIPTOR, (uint64_t)value,
+ sizeof(int64_t), namefmt, nameap);
+ if (nvp == NULL)
+ close(value);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_createv_binary(const void *value, size_t size, const char *namefmt,
+ va_list nameap)
+{
+ nvpair_t *nvp;
+ void *data;
+
+ if (value == NULL || size == 0) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ data = malloc(size);
+ if (data == NULL)
+ return (NULL);
+ memcpy(data, value, size);
+
+ nvp = nvpair_allocv(NV_TYPE_BINARY, (uint64_t)(uintptr_t)data, size,
+ namefmt, nameap);
+ if (nvp == NULL)
+ free(data);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_move_string(const char *name, char *value)
+{
+
+ return (nvpair_movef_string(value, "%s", name));
+}
+
+nvpair_t *
+nvpair_move_nvlist(const char *name, nvlist_t *value)
+{
+
+ return (nvpair_movef_nvlist(value, "%s", name));
+}
+
+nvpair_t *
+nvpair_move_descriptor(const char *name, int value)
+{
+
+ return (nvpair_movef_descriptor(value, "%s", name));
+}
+
+nvpair_t *
+nvpair_move_binary(const char *name, void *value, size_t size)
+{
+
+ return (nvpair_movef_binary(value, size, "%s", name));
+}
+
+nvpair_t *
+nvpair_movef_string(char *value, const char *namefmt, ...)
+{
+ va_list nameap;
+ nvpair_t *nvp;
+
+ va_start(nameap, namefmt);
+ nvp = nvpair_movev_string(value, namefmt, nameap);
+ va_end(nameap);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_movef_nvlist(nvlist_t *value, const char *namefmt, ...)
+{
+ va_list nameap;
+ nvpair_t *nvp;
+
+ va_start(nameap, namefmt);
+ nvp = nvpair_movev_nvlist(value, namefmt, nameap);
+ va_end(nameap);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_movef_descriptor(int value, const char *namefmt, ...)
+{
+ va_list nameap;
+ nvpair_t *nvp;
+
+ va_start(nameap, namefmt);
+ nvp = nvpair_movev_descriptor(value, namefmt, nameap);
+ va_end(nameap);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_movef_binary(void *value, size_t size, const char *namefmt, ...)
+{
+ va_list nameap;
+ nvpair_t *nvp;
+
+ va_start(nameap, namefmt);
+ nvp = nvpair_movev_binary(value, size, namefmt, nameap);
+ va_end(nameap);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_movev_string(char *value, const char *namefmt, va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (value == NULL) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ nvp = nvpair_allocv(NV_TYPE_STRING, (uint64_t)(uintptr_t)value,
+ strlen(value) + 1, namefmt, nameap);
+ if (nvp == NULL)
+ free(value);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_movev_nvlist(nvlist_t *value, const char *namefmt, va_list nameap)
+{
+ nvpair_t *nvp;
+
+ if (value == NULL || nvlist_get_nvpair_parent(value) != NULL) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ nvp = nvpair_allocv(NV_TYPE_NVLIST, (uint64_t)(uintptr_t)value, 0,
+ namefmt, nameap);
+ if (nvp == NULL)
+ nvlist_destroy(value);
+ else
+ nvlist_set_parent(value, nvp);
+
+ return (nvp);
+}
+
+nvpair_t *
+nvpair_movev_descriptor(int value, const char *namefmt, va_list nameap)
+{
+
+ if (value < 0 || !fd_is_valid(value)) {
+ errno = EBADF;
+ return (NULL);
+ }
+
+ return (nvpair_allocv(NV_TYPE_DESCRIPTOR, (uint64_t)value,
+ sizeof(int64_t), namefmt, nameap));
+}
+
+nvpair_t *
+nvpair_movev_binary(void *value, size_t size, const char *namefmt,
+ va_list nameap)
+{
+
+ if (value == NULL || size == 0) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ return (nvpair_allocv(NV_TYPE_BINARY, (uint64_t)(uintptr_t)value, size,
+ namefmt, nameap));
+}
+
+bool
+nvpair_get_bool(const nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+
+ return (nvp->nvp_data == 1);
+}
+
+uint64_t
+nvpair_get_number(const nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+
+ return (nvp->nvp_data);
+}
+
+const char *
+nvpair_get_string(const nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_STRING);
+
+ return ((const char *)(intptr_t)nvp->nvp_data);
+}
+
+const nvlist_t *
+nvpair_get_nvlist(const nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_NVLIST);
+
+ return ((const nvlist_t *)(intptr_t)nvp->nvp_data);
+}
+
+int
+nvpair_get_descriptor(const nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_DESCRIPTOR);
+
+ return ((int)nvp->nvp_data);
+}
+
+const void *
+nvpair_get_binary(const nvpair_t *nvp, size_t *sizep)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_BINARY);
+
+ if (sizep != NULL)
+ *sizep = nvp->nvp_datasize;
+ return ((const void *)(intptr_t)nvp->nvp_data);
+}
+
+void
+nvpair_free(nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_list == NULL);
+
+ nvp->nvp_magic = 0;
+ switch (nvp->nvp_type) {
+ case NV_TYPE_DESCRIPTOR:
+ close((int)nvp->nvp_data);
+ break;
+ case NV_TYPE_NVLIST:
+ nvlist_destroy((nvlist_t *)(intptr_t)nvp->nvp_data);
+ break;
+ case NV_TYPE_STRING:
+ free((char *)(intptr_t)nvp->nvp_data);
+ break;
+ case NV_TYPE_BINARY:
+ free((void *)(intptr_t)nvp->nvp_data);
+ break;
+ }
+ free(nvp);
+}
+
+void
+nvpair_free_structure(nvpair_t *nvp)
+{
+
+ NVPAIR_ASSERT(nvp);
+ PJDLOG_ASSERT(nvp->nvp_list == NULL);
+
+ nvp->nvp_magic = 0;
+ free(nvp);
+}
+
+const char *
+nvpair_type_string(int type)
+{
+
+ switch (type) {
+ case NV_TYPE_NULL:
+ return ("NULL");
+ case NV_TYPE_BOOL:
+ return ("BOOL");
+ case NV_TYPE_NUMBER:
+ return ("NUMBER");
+ case NV_TYPE_STRING:
+ return ("STRING");
+ case NV_TYPE_NVLIST:
+ return ("NVLIST");
+ case NV_TYPE_DESCRIPTOR:
+ return ("DESCRIPTOR");
+ case NV_TYPE_BINARY:
+ return ("BINARY");
+ default:
+ return ("<UNKNOWN>");
+ }
+}
diff --git a/lib/libnv/nvpair_impl.h b/lib/libnv/nvpair_impl.h
new file mode 100644
index 0000000..a72000b
--- /dev/null
+++ b/lib/libnv/nvpair_impl.h
@@ -0,0 +1,92 @@
+/*-
+ * Copyright (c) 2009-2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Pawel Jakub Dawidek 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 THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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 _NVPAIR_IMPL_H_
+#define _NVPAIR_IMPL_H_
+
+#include <sys/queue.h>
+
+#include <stdint.h>
+
+#include "nv.h"
+
+TAILQ_HEAD(nvl_head, nvpair);
+
+void nvpair_assert(const nvpair_t *nvp);
+nvlist_t *nvpair_nvlist(const nvpair_t *nvp);
+nvpair_t *nvpair_next(const nvpair_t *nvp);
+nvpair_t *nvpair_prev(const nvpair_t *nvp);
+void nvpair_insert(struct nvl_head *head, nvpair_t *nvp, nvlist_t *nvl);
+void nvpair_remove(struct nvl_head *head, nvpair_t *nvp, const nvlist_t *nvl);
+size_t nvpair_header_size(void);
+size_t nvpair_size(const nvpair_t *nvp);
+const unsigned char *nvpair_unpack(bool isbe, const unsigned char *ptr,
+ size_t *leftp, nvpair_t **nvpp);
+void nvpair_free_structure(nvpair_t *nvp);
+void nvpair_init_datasize(nvpair_t *nvp);
+const char *nvpair_type_string(int type);
+
+/* Pack functions. */
+unsigned char *nvpair_pack_header(const nvpair_t *nvp, unsigned char *ptr,
+ size_t *leftp);
+unsigned char *nvpair_pack_null(const nvpair_t *nvp, unsigned char *ptr,
+ size_t *leftp);
+unsigned char *nvpair_pack_bool(const nvpair_t *nvp, unsigned char *ptr,
+ size_t *leftp);
+unsigned char *nvpair_pack_number(const nvpair_t *nvp, unsigned char *ptr,
+ size_t *leftp);
+unsigned char *nvpair_pack_string(const nvpair_t *nvp, unsigned char *ptr,
+ size_t *leftp);
+unsigned char *nvpair_pack_descriptor(const nvpair_t *nvp, unsigned char *ptr,
+ int64_t *fdidxp, size_t *leftp);
+unsigned char *nvpair_pack_binary(const nvpair_t *nvp, unsigned char *ptr,
+ size_t *leftp);
+unsigned char *nvpair_pack_nvlist_up(unsigned char *ptr, size_t *leftp);
+
+/* Unpack data functions. */
+const unsigned char *nvpair_unpack_header(bool isbe, nvpair_t *nvp,
+ const unsigned char *ptr, size_t *leftp);
+const unsigned char *nvpair_unpack_null(bool isbe, nvpair_t *nvp,
+ const unsigned char *ptr, size_t *leftp);
+const unsigned char *nvpair_unpack_bool(bool isbe, nvpair_t *nvp,
+ const unsigned char *ptr, size_t *leftp);
+const unsigned char *nvpair_unpack_number(bool isbe, nvpair_t *nvp,
+ const unsigned char *ptr, size_t *leftp);
+const unsigned char *nvpair_unpack_string(bool isbe, nvpair_t *nvp,
+ const unsigned char *ptr, size_t *leftp);
+const unsigned char *nvpair_unpack_nvlist(bool isbe, nvpair_t *nvp,
+ const unsigned char *ptr, size_t *leftp, size_t nvlist, nvlist_t **child);
+const unsigned char *nvpair_unpack_descriptor(bool isbe, nvpair_t *nvp,
+ const unsigned char *ptr, size_t *leftp, const int *fds, size_t nfds);
+const unsigned char *nvpair_unpack_binary(bool isbe, nvpair_t *nvp,
+ const unsigned char *ptr, size_t *leftp);
+
+#endif /* !_NVPAIR_IMPL_H_ */
diff --git a/lib/libnv/tests/Makefile b/lib/libnv/tests/Makefile
index 7fc8d91..df10549 100644
--- a/lib/libnv/tests/Makefile
+++ b/lib/libnv/tests/Makefile
@@ -2,10 +2,6 @@
TESTSDIR= ${TESTSBASE}/lib/libnv
-ATF_TESTS_CXX= \
- dnv_tests \
- nv_tests \
-
TAP_TESTS_C+= nvlist_add_test
TAP_TESTS_C+= nvlist_exists_test
TAP_TESTS_C+= nvlist_free_test
@@ -13,8 +9,9 @@ TAP_TESTS_C+= nvlist_get_test
TAP_TESTS_C+= nvlist_move_test
TAP_TESTS_C+= nvlist_send_recv_test
-LIBADD+= nv
+DPADD+= ${LIBNV}
+LDADD+= -lnv
-WARNS?= 3
+WARNS?= 6
.include <bsd.test.mk>
diff --git a/lib/libnv/tests/dnv_tests.cc b/lib/libnv/tests/dnv_tests.cc
deleted file mode 100644
index 2f92d9d..0000000
--- a/lib/libnv/tests/dnv_tests.cc
+++ /dev/null
@@ -1,567 +0,0 @@
-/*-
- * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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 <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <atf-c++.hpp>
-#include <dnv.h>
-#include <nv.h>
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_bool__present);
-ATF_TEST_CASE_BODY(dnvlist_get_bool__present)
-{
- nvlist_t *nvl;
- const char *key;
- bool value;
-
- nvl = nvlist_create(0);
-
- key = "name";
- value = true;
- nvlist_add_bool(nvl, key, value);
-
- ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, key, false), value);
- ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, "name", false), value);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_bool__default_value);
-ATF_TEST_CASE_BODY(dnvlist_get_bool__default_value)
-{
- nvlist_t *nvl;
- const char *key;
-
- key = "123";
- nvl = nvlist_create(0);
-
- ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, key, false), false);
- ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, "123", true), true);
-
- nvlist_add_bool(nvl, key, true);
-
- ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, "otherkey", true), true);
- ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, "12c", false), false);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_number__present);
-ATF_TEST_CASE_BODY(dnvlist_get_number__present)
-{
- nvlist_t *nvl;
- const char *key;
- uint64_t value;
-
- nvl = nvlist_create(0);
-
- key = "key";
- value = 48952;
- nvlist_add_number(nvl, key, value);
-
- ATF_REQUIRE_EQ(dnvlist_get_number(nvl, key, 19), value);
- ATF_REQUIRE_EQ(dnvlist_get_number(nvl, "key", 65), value);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_number__default_value);
-ATF_TEST_CASE_BODY(dnvlist_get_number__default_value)
-{
- nvlist_t *nvl;
- const char *key;
-
- key = "123";
- nvl = nvlist_create(0);
-
- ATF_REQUIRE_EQ(dnvlist_get_number(nvl, key, 5), 5);
- ATF_REQUIRE_EQ(dnvlist_get_number(nvl, "1234", 5), 5);
-
- nvlist_add_number(nvl, key, 24841);
-
- ATF_REQUIRE_EQ(dnvlist_get_number(nvl, "1234", 5641), 5641);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_string__present);
-ATF_TEST_CASE_BODY(dnvlist_get_string__present)
-{
- nvlist_t *nvl;
- const char *key;
- const char *value, *actual_value;
-
- nvl = nvlist_create(0);
-
- key = "string";
- value = "fjdojfdi";
- nvlist_add_string(nvl, key, value);
-
- ATF_REQUIRE_EQ(strcmp(dnvlist_get_string(nvl, key, "g"), value), 0);
-
- actual_value = dnvlist_get_string(nvl, key, "rs");
- ATF_REQUIRE_EQ(strcmp(actual_value, value), 0);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_string__default_value);
-ATF_TEST_CASE_BODY(dnvlist_get_string__default_value)
-{
- nvlist_t *nvl;
- const char *key;
- const char *actual_value;
-
- key = "123";
- nvl = nvlist_create(0);
-
- ATF_REQUIRE_EQ(strcmp(dnvlist_get_string(nvl, key, "bar"), "bar"), 0);
-
- actual_value = dnvlist_get_string(nvl, key, "d");
- ATF_REQUIRE_EQ(strcmp(actual_value, "d"), 0);
-
- nvlist_add_string(nvl, key, "cxhweh");
-
- ATF_REQUIRE_EQ(strcmp(dnvlist_get_string(nvl, "hthth", "fd"), "fd"), 0);
- actual_value = dnvlist_get_string(nvl, "5", "5");
- ATF_REQUIRE_EQ(strcmp("5", "5"), 0);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_nvlist__present);
-ATF_TEST_CASE_BODY(dnvlist_get_nvlist__present)
-{
- nvlist_t *nvl;
- const char *key;
- nvlist_t *value;
- const nvlist_t *actual_value;
-
- nvl = nvlist_create(0);
-
- key = "nvlist";
- value = nvlist_create(0);
- nvlist_move_nvlist(nvl, key, value);
-
- actual_value = dnvlist_get_nvlist(nvl, key, NULL);
- ATF_REQUIRE(actual_value != NULL);
- ATF_REQUIRE(nvlist_empty(actual_value));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_nvlist__default_value);
-ATF_TEST_CASE_BODY(dnvlist_get_nvlist__default_value)
-{
- nvlist_t *nvl;
- const char *key;
- nvlist_t *dummy;
-
- key = "123";
- nvl = nvlist_create(0);
- dummy = nvlist_create(0);
-
- ATF_REQUIRE_EQ(dnvlist_get_nvlist(nvl, key, dummy), dummy);
-
- nvlist_move_nvlist(nvl, key, nvlist_create(0));
- ATF_REQUIRE_EQ(dnvlist_get_nvlist(nvl, "456", dummy), dummy);
- ATF_REQUIRE_EQ(dnvlist_get_nvlist(nvl, "gh", dummy), dummy);
-
- nvlist_destroy(nvl);
-}
-
-static void
-set_const_binary_value(const void *&value, size_t &size, const char *str)
-{
-
- value = str;
- size = strlen(str) + 1; /* +1 to include '\0' */
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_binary__present);
-ATF_TEST_CASE_BODY(dnvlist_get_binary__present)
-{
- nvlist_t *nvl;
- const char *k;
- const void *value, *actual_value;
- size_t value_size, actual_size;
-
- nvl = nvlist_create(0);
-
- k = "binary";
- set_const_binary_value(value, value_size, "fjdojfdi");
- nvlist_add_binary(nvl, k, value, value_size);
-
- actual_value = dnvlist_get_binary(nvl, k, &actual_size, "g", 1);
- ATF_REQUIRE_EQ(value_size, actual_size);
- ATF_REQUIRE_EQ(memcmp(actual_value, value, actual_size), 0);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_binary__default_value);
-ATF_TEST_CASE_BODY(dnvlist_get_binary__default_value)
-{
- nvlist_t *nvl;
- const char *key;
- const void *default_value, *actual_value;
- size_t default_size, actual_size;
-
- key = "123";
- nvl = nvlist_create(0);
-
- set_const_binary_value(default_value, default_size, "bar");
- actual_value = dnvlist_get_binary(nvl, key, &actual_size, default_value,
- default_size);
- ATF_REQUIRE_EQ(default_size, actual_size);
- ATF_REQUIRE_EQ(memcmp(actual_value, default_value, actual_size), 0);
-
- set_const_binary_value(default_value, default_size, "atf");
- actual_value = dnvlist_get_binary(nvl, key, &actual_size, default_value,
- default_size);
- ATF_REQUIRE_EQ(default_size, actual_size);
- ATF_REQUIRE_EQ(memcmp(actual_value, default_value, actual_size), 0);
-
- nvlist_add_binary(nvl, key, "test", 4);
-
- set_const_binary_value(default_value, default_size, "bthrg");
- actual_value = dnvlist_get_binary(nvl, "k", &actual_size, default_value,
- default_size);
- ATF_REQUIRE_EQ(default_size, actual_size);
- ATF_REQUIRE_EQ(memcmp(actual_value, default_value, actual_size), 0);
-
- set_const_binary_value(default_value, default_size,
- "rrhgrythtyrtgbrhgrtdsvdfbtjlkul");
- actual_value = dnvlist_get_binary(nvl, "s", &actual_size, default_value,
- default_size);
- ATF_REQUIRE_EQ(default_size, actual_size);
- ATF_REQUIRE_EQ(memcmp(actual_value, default_value, actual_size), 0);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_bool__present);
-ATF_TEST_CASE_BODY(dnvlist_take_bool__present)
-{
- nvlist_t *nvl;
- const char *key;
- bool value;
-
- nvl = nvlist_create(0);
-
- key = "name";
- value = true;
- nvlist_add_bool(nvl, key, value);
-
- ATF_REQUIRE_EQ(dnvlist_take_bool(nvl, key, false), value);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_bool__empty);
-ATF_TEST_CASE_BODY(dnvlist_take_bool__empty)
-{
- nvlist_t *nvl;
-
- nvl = nvlist_create(0);
-
- ATF_REQUIRE_EQ(dnvlist_take_bool(nvl, "123", false), false);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_bool__default_value);
-ATF_TEST_CASE_BODY(dnvlist_take_bool__default_value)
-{
- nvlist_t *nvl;
-
- nvl = nvlist_create(0);
- nvlist_add_bool(nvl, "key", true);
-
- ATF_REQUIRE_EQ(dnvlist_take_bool(nvl, "otherkey", true), true);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_number__present);
-ATF_TEST_CASE_BODY(dnvlist_take_number__present)
-{
- nvlist_t *nvl;
- const char *key;
- uint64_t value;
-
- nvl = nvlist_create(0);
-
- key = "name";
- value = 194154;
- nvlist_add_number(nvl, key, value);
-
- ATF_REQUIRE_EQ(dnvlist_take_number(nvl, key, 2), value);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_number__empty);
-ATF_TEST_CASE_BODY(dnvlist_take_number__empty)
-{
- nvlist_t *nvl;
-
- nvl = nvlist_create(0);
-
- ATF_REQUIRE_EQ(dnvlist_take_number(nvl, "123", 126484), 126484);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_number__default_value);
-ATF_TEST_CASE_BODY(dnvlist_take_number__default_value)
-{
- nvlist_t *nvl;
-
- nvl = nvlist_create(0);
- nvlist_add_number(nvl, "key", 12);
-
- ATF_REQUIRE_EQ(dnvlist_take_number(nvl, "otherkey", 13), 13);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_string__present);
-ATF_TEST_CASE_BODY(dnvlist_take_string__present)
-{
- nvlist_t *nvl;
- const char *key;
- const char *value;
- char *default_val, *actual_val;
-
- nvl = nvlist_create(0);
-
- key = "name";
- value = "wrowm";
- default_val = strdup("default");
- nvlist_add_string(nvl, key, value);
-
- actual_val = dnvlist_take_string(nvl, key, default_val);
- ATF_REQUIRE_EQ(strcmp(actual_val, value), 0);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- free(actual_val);
- free(default_val);
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_string__empty);
-ATF_TEST_CASE_BODY(dnvlist_take_string__empty)
-{
- nvlist_t *nvl;
- char *default_val, *actual_val;
-
- nvl = nvlist_create(0);
- default_val = strdup("");
-
- actual_val = dnvlist_take_string(nvl, "123", default_val);
- ATF_REQUIRE_EQ(strcmp(actual_val, default_val), 0);
-
- free(actual_val);
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_string__default_value);
-ATF_TEST_CASE_BODY(dnvlist_take_string__default_value)
-{
- nvlist_t *nvl;
- char *default_val, *actual_val;
-
- nvl = nvlist_create(0);
- nvlist_add_string(nvl, "key", "foobar");
- default_val = strdup("other");
-
- actual_val = dnvlist_take_string(nvl, "otherkey", default_val);
- ATF_REQUIRE_EQ(strcmp(actual_val, default_val), 0);
-
- free(actual_val);
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_nvlist__present);
-ATF_TEST_CASE_BODY(dnvlist_take_nvlist__present)
-{
- nvlist_t *nvl;
- const char *key;
- nvlist_t *value, *default_val, *actual_val;
-
- nvl = nvlist_create(0);
-
- key = "name";
- value = nvlist_create(0);
- default_val = nvlist_create(0);
- nvlist_move_nvlist(nvl, key, value);
-
- actual_val = dnvlist_take_nvlist(nvl, key, default_val);
- ATF_REQUIRE_EQ(actual_val, value);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- free(actual_val);
- free(default_val);
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_nvlist__empty);
-ATF_TEST_CASE_BODY(dnvlist_take_nvlist__empty)
-{
- nvlist_t *nvl, *actual_val;
-
- nvl = nvlist_create(0);
-
- actual_val = dnvlist_take_nvlist(nvl, "123", NULL);
- ATF_REQUIRE_EQ(actual_val, static_cast<nvlist_t *>(NULL));
-
- free(actual_val);
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_nvlist__default_value);
-ATF_TEST_CASE_BODY(dnvlist_take_nvlist__default_value)
-{
- nvlist_t *nvl;
- nvlist_t *default_val, *actual_val;
-
- nvl = nvlist_create(0);
- nvlist_move_nvlist(nvl, "key", nvlist_create(0));
- default_val = nvlist_create(0);
-
- actual_val = dnvlist_take_nvlist(nvl, "otherkey", default_val);
- ATF_REQUIRE_EQ(actual_val, default_val);
-
- free(actual_val);
- nvlist_destroy(nvl);
-}
-
-static void
-set_binary_value(void *&value, size_t &size, const char *str)
-{
-
- value = strdup(str);
- size = strlen(str) + 1; /* +1 to include '\0' */
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_binary__present);
-ATF_TEST_CASE_BODY(dnvlist_take_binary__present)
-{
- nvlist_t *nvl;
- const char *key;
- void *value, *default_val, *actual_val;
- size_t value_size, default_size, actual_size;
-
- nvl = nvlist_create(0);
-
- key = "name";
- set_binary_value(value, value_size, "fkdojvmo908");
- set_binary_value(default_val, default_size, "16546");
- nvlist_add_binary(nvl, key, value, value_size);
-
- actual_val = dnvlist_take_binary(nvl, key, &actual_size, default_val,
- default_size);
- ATF_REQUIRE_EQ(value_size, actual_size);
- ATF_REQUIRE_EQ(memcmp(actual_val, value, value_size), 0);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- free(actual_val);
- free(default_val);
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_binary__empty);
-ATF_TEST_CASE_BODY(dnvlist_take_binary__empty)
-{
- nvlist_t *nvl;
- void *default_val, *actual_val;
- size_t default_size, actual_size;
-
- nvl = nvlist_create(0);
- set_binary_value(default_val, default_size, "\xa8\x89\x49\xff\xe2\x08");
-
- actual_val = dnvlist_take_binary(nvl, "123", &actual_size, default_val,
- default_size);
- ATF_REQUIRE_EQ(default_size, actual_size);
- ATF_REQUIRE_EQ(memcmp(actual_val, default_val, actual_size), 0);
-
- free(actual_val);
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_binary__default_value);
-ATF_TEST_CASE_BODY(dnvlist_take_binary__default_value)
-{
- nvlist_t *nvl;
- void *default_val, *actual_val;
- size_t default_size, actual_size;
-
- nvl = nvlist_create(0);
- nvlist_add_binary(nvl, "key", "foobar", 6);
- set_binary_value(default_val, default_size, "vbhag");
-
- actual_val = dnvlist_take_binary(nvl, "otherkey", &actual_size,
- default_val, default_size);
- ATF_REQUIRE_EQ(default_size, actual_size);
- ATF_REQUIRE_EQ(memcmp(actual_val, default_val, default_size), 0);
-
- free(actual_val);
- nvlist_destroy(nvl);
-}
-
-ATF_INIT_TEST_CASES(tp)
-{
- ATF_ADD_TEST_CASE(tp, dnvlist_get_bool__present);
- ATF_ADD_TEST_CASE(tp, dnvlist_get_bool__default_value);
- ATF_ADD_TEST_CASE(tp, dnvlist_get_number__present);
- ATF_ADD_TEST_CASE(tp, dnvlist_get_number__default_value);
- ATF_ADD_TEST_CASE(tp, dnvlist_get_string__present);
- ATF_ADD_TEST_CASE(tp, dnvlist_get_string__default_value);
- ATF_ADD_TEST_CASE(tp, dnvlist_get_nvlist__present);
- ATF_ADD_TEST_CASE(tp, dnvlist_get_nvlist__default_value);
- ATF_ADD_TEST_CASE(tp, dnvlist_get_binary__present);
- ATF_ADD_TEST_CASE(tp, dnvlist_get_binary__default_value);
-
- ATF_ADD_TEST_CASE(tp, dnvlist_take_bool__present);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_bool__empty);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_bool__default_value);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_number__present);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_number__empty);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_number__default_value);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_string__present);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_string__empty);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_string__default_value);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_nvlist__present);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_nvlist__empty);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_nvlist__default_value);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_binary__present);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_binary__empty);
- ATF_ADD_TEST_CASE(tp, dnvlist_take_binary__default_value);
-}
diff --git a/lib/libnv/tests/nv_tests.cc b/lib/libnv/tests/nv_tests.cc
deleted file mode 100644
index d779190..0000000
--- a/lib/libnv/tests/nv_tests.cc
+++ /dev/null
@@ -1,1275 +0,0 @@
-/*-
- * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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 <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <atf-c++.hpp>
-#include <nv.h>
-
-#include <errno.h>
-#include <limits>
-#include <set>
-#include <sstream>
-#include <string>
-
-/*
- * Test that a newly created nvlist has no errors, and is empty.
- */
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_create__is_empty);
-ATF_TEST_CASE_BODY(nvlist_create__is_empty)
-{
- nvlist_t *nvl;
- int type;
- void *it;
-
- nvl = nvlist_create(0);
-
- ATF_REQUIRE(nvl != NULL);
-
- ATF_REQUIRE_EQ(nvlist_error(nvl), 0);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- it = NULL;
- ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), static_cast<const char *>(NULL));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_null__single_insert);
-ATF_TEST_CASE_BODY(nvlist_add_null__single_insert)
-{
- nvlist_t *nvl;
- void *it;
- const char *key;
- int type;
-
- key = "key";
- nvl = nvlist_create(0);
-
- ATF_REQUIRE(nvl != NULL);
- ATF_REQUIRE(!nvlist_exists(nvl, key));
-
- nvlist_add_null(nvl, key);
-
- ATF_REQUIRE(!nvlist_empty(nvl));
- ATF_REQUIRE(nvlist_exists(nvl, key));
- ATF_REQUIRE(nvlist_exists_null(nvl, key));
- ATF_REQUIRE(nvlist_exists_null(nvl, "key"));
-
- /* Iterate over the nvlist; ensure that it has only our one key. */
- it = NULL;
- ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0);
- ATF_REQUIRE_EQ(type, NV_TYPE_NULL);
- ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast<const char *>(NULL));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_bool__single_insert);
-ATF_TEST_CASE_BODY(nvlist_add_bool__single_insert)
-{
- nvlist_t *nvl;
- void *it;
- const char *key;
- int type;
-
- key = "name";
- nvl = nvlist_create(0);
-
- ATF_REQUIRE(nvl != NULL);
- ATF_REQUIRE(!nvlist_exists(nvl, key));
-
- nvlist_add_bool(nvl, key, true);
-
- ATF_REQUIRE(!nvlist_empty(nvl));
- ATF_REQUIRE(nvlist_exists(nvl, key));
- ATF_REQUIRE(nvlist_exists(nvl, "name"));
- ATF_REQUIRE(nvlist_exists_bool(nvl, key));
- ATF_REQUIRE(nvlist_exists_bool(nvl, "name"));
- ATF_REQUIRE_EQ(nvlist_get_bool(nvl, key), true);
-
- /* Iterate over the nvlist; ensure that it has only our one key. */
- it = NULL;
- ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0);
- ATF_REQUIRE_EQ(type, NV_TYPE_BOOL);
- ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast<const char *>(NULL));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_number__single_insert);
-ATF_TEST_CASE_BODY(nvlist_add_number__single_insert)
-{
- nvlist_t *nvl;
- void *it;
- const char *key;
- uint64_t value;
- int type;
-
- key = "foo123";
- value = 71965;
- nvl = nvlist_create(0);
-
- ATF_REQUIRE(nvl != NULL);
- ATF_REQUIRE(!nvlist_exists(nvl, key));
-
- nvlist_add_number(nvl, key, value);
-
- ATF_REQUIRE(!nvlist_empty(nvl));
- ATF_REQUIRE(nvlist_exists(nvl, key));
- ATF_REQUIRE(nvlist_exists(nvl, "foo123"));
- ATF_REQUIRE(nvlist_exists_number(nvl, key));
- ATF_REQUIRE_EQ(nvlist_get_number(nvl, key), value);
-
- /* Iterate over the nvlist; ensure that it has only our one key. */
- it = NULL;
- ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0);
- ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER);
- ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast<const char *>(NULL));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_string__single_insert);
-ATF_TEST_CASE_BODY(nvlist_add_string__single_insert)
-{
- nvlist_t *nvl;
- void *it;
- const char *key;
- const char *value;
- int type;
-
- key = "test";
- value = "fgjdkgjdk";
- nvl = nvlist_create(0);
-
- ATF_REQUIRE(nvl != NULL);
- ATF_REQUIRE(!nvlist_exists(nvl, key));
-
- nvlist_add_string(nvl, key, value);
-
- ATF_REQUIRE(!nvlist_empty(nvl));
- ATF_REQUIRE(nvlist_exists(nvl, key));
- ATF_REQUIRE(nvlist_exists(nvl, "test"));
- ATF_REQUIRE(nvlist_exists_string(nvl, key));
- ATF_REQUIRE(nvlist_exists_string(nvl, "test"));
- ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, key), value), 0);
-
- /* nvlist_add_* is required to clone the value, so check for that. */
- ATF_REQUIRE(nvlist_get_string(nvl, key) != value);
-
- /* Iterate over the nvlist; ensure that it has only our one key. */
- it = NULL;
- ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0);
- ATF_REQUIRE_EQ(type, NV_TYPE_STRING);
- ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast<const char *>(NULL));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_nvlist__single_insert);
-ATF_TEST_CASE_BODY(nvlist_add_nvlist__single_insert)
-{
- nvlist_t *nvl;
- void *it;
- const char *key, *subkey;
- nvlist_t *sublist;
- const nvlist_t *value;
- int type;
-
- key = "test";
- subkey = "subkey";
- sublist = nvlist_create(0);
- nvl = nvlist_create(0);
-
- ATF_REQUIRE(nvl != NULL);
- ATF_REQUIRE(!nvlist_exists(nvl, key));
-
- nvlist_add_null(sublist, subkey);
- nvlist_add_nvlist(nvl, key, sublist);
-
- ATF_REQUIRE(!nvlist_empty(nvl));
- ATF_REQUIRE(nvlist_exists(nvl, key));
- ATF_REQUIRE(nvlist_exists(nvl, "test"));
- ATF_REQUIRE(nvlist_exists_nvlist(nvl, key));
- ATF_REQUIRE(nvlist_exists_nvlist(nvl, "test"));
-
- value = nvlist_get_nvlist(nvl, key);
- ATF_REQUIRE(nvlist_exists_null(value, subkey));
-
- /* nvlist_add_* is required to clone the value, so check for that. */
- ATF_REQUIRE(sublist != value);
-
- /* Iterate over the nvlist; ensure that it has only our one key. */
- it = NULL;
- ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0);
- ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST);
- ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast<const char *>(NULL));
-
- nvlist_destroy(sublist);
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_nvlist__child_with_error);
-ATF_TEST_CASE_BODY(nvlist_add_nvlist__child_with_error)
-{
- nvlist_t *nvl, *parent;
-
- nvl = nvlist_create(0);
- parent = nvlist_create(0);
-
- nvlist_set_error(nvl, EBADF);
- nvlist_add_nvlist(parent, "test", nvl);
- ATF_REQUIRE_EQ(nvlist_error(parent), EBADF);
-
- nvlist_destroy(nvl);
- nvlist_destroy(parent);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_binary__single_insert);
-ATF_TEST_CASE_BODY(nvlist_add_binary__single_insert)
-{
- nvlist_t *nvl;
- void *it;
- const char *key;
- void *value;
- const void *ret_value;
- size_t value_size, ret_size;
- int type;
-
- key = "binary";
- value_size = 13;
- value = malloc(value_size);
- memset(value, 0xa5, value_size);
- nvl = nvlist_create(0);
-
- ATF_REQUIRE(nvl != NULL);
- ATF_REQUIRE(!nvlist_exists(nvl, key));
-
- nvlist_add_binary(nvl, key, value, value_size);
-
- ATF_REQUIRE(!nvlist_empty(nvl));
- ATF_REQUIRE(nvlist_exists(nvl, key));
- ATF_REQUIRE(nvlist_exists(nvl, "binary"));
- ATF_REQUIRE(nvlist_exists_binary(nvl, key));
- ATF_REQUIRE(nvlist_exists_binary(nvl, "binary"));
-
- ret_value = nvlist_get_binary(nvl, key, &ret_size);
- ATF_REQUIRE_EQ(value_size, ret_size);
- ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0);
-
- /* nvlist_add_* is required to clone the value, so check for that. */
- ATF_REQUIRE(value != ret_value);
-
- /* Iterate over the nvlist; ensure that it has only our one key. */
- it = NULL;
- ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0);
- ATF_REQUIRE_EQ(type, NV_TYPE_BINARY);
- ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast<const char *>(NULL));
-
- nvlist_destroy(nvl);
- free(value);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__empty_nvlist);
-ATF_TEST_CASE_BODY(nvlist_clone__empty_nvlist)
-{
- nvlist_t *nvl, *clone;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- clone = nvlist_clone(nvl);
- ATF_REQUIRE(clone != NULL);
- ATF_REQUIRE(clone != nvl);
- ATF_REQUIRE(nvlist_empty(clone));
-
- nvlist_destroy(clone);
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__nonempty_nvlist);
-ATF_TEST_CASE_BODY(nvlist_clone__nonempty_nvlist)
-{
- nvlist_t *nvl, *clone;
- const char *key;
- void *it;
- uint64_t value;
- int type;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- key = "testkey";
- value = 684874;
- nvlist_add_number(nvl, key, value);
-
- clone = nvlist_clone(nvl);
- ATF_REQUIRE(clone != NULL);
- ATF_REQUIRE(clone != nvl);
- ATF_REQUIRE(nvlist_exists_number(clone, key));
- ATF_REQUIRE_EQ(nvlist_get_number(clone, key), value);
-
- /* Iterate over the nvlist; ensure that it has only our one key. */
- it = NULL;
- ATF_REQUIRE_EQ(strcmp(nvlist_next(clone, &type, &it), key), 0);
- ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER);
- ATF_REQUIRE_EQ(nvlist_next(clone, &type, &it), static_cast<const char *>(NULL));
-
- nvlist_destroy(clone);
- nvlist_destroy(nvl);
-}
-
-static const char * const test_subnvlist_key = "nvlist";
-
-static const char * const test_string_key = "string";
-static const char * const test_string_val = "59525";
-
-static nvlist_t*
-create_test_nvlist(void)
-{
- nvlist_t *nvl, *sublist;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- sublist = nvlist_create(0);
- ATF_REQUIRE(sublist != NULL);
-
- nvlist_add_string(sublist, test_string_key, test_string_val);
- nvlist_move_nvlist(nvl, test_subnvlist_key, sublist);
-
- return (nvl);
-}
-
-static void
-verify_test_nvlist(const nvlist_t *nvl)
-{
- void *it;
- const nvlist_t *value;
- int type;
-
- ATF_REQUIRE(nvlist_exists_nvlist(nvl, test_subnvlist_key));
-
- value = nvlist_get_nvlist(nvl, test_subnvlist_key);
-
- ATF_REQUIRE(nvlist_exists_string(value, test_string_key));
- ATF_REQUIRE_EQ(strcmp(nvlist_get_string(value, test_string_key), test_string_val), 0);
- ATF_REQUIRE(nvlist_get_string(value, test_string_key) != test_string_val);
-
- /* Iterate over both nvlists; ensure that each has only the one key. */
- it = NULL;
- ATF_REQUIRE_EQ(strcmp(nvlist_next(value, &type, &it),
- test_string_key), 0);
- ATF_REQUIRE_EQ(type, NV_TYPE_STRING);
- ATF_REQUIRE_EQ(nvlist_next(value, &type, &it), static_cast<const char *>(NULL));
-
- it = NULL;
- ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it),
- test_subnvlist_key), 0);
- ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST);
- ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), static_cast<const char *>(NULL));
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__nested_nvlist);
-ATF_TEST_CASE_BODY(nvlist_clone__nested_nvlist)
-{
- nvlist_t *nvl, *clone;
-
- nvl = create_test_nvlist();
- clone = nvlist_clone(nvl);
-
- ATF_REQUIRE(clone != NULL);
- ATF_REQUIRE(clone != nvl);
- verify_test_nvlist(clone);
-
- nvlist_destroy(clone);
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__error_nvlist);
-ATF_TEST_CASE_BODY(nvlist_clone__error_nvlist)
-{
- nvlist_t *nvl, *clone;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- nvlist_set_error(nvl, ENOMEM);
-
- clone = nvlist_clone(nvl);
- ATF_REQUIRE(clone == NULL);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_pack__empty_nvlist);
-ATF_TEST_CASE_BODY(nvlist_pack__empty_nvlist)
-{
- nvlist_t *nvl, *unpacked;
- void *packed;
- size_t packed_size;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- packed = nvlist_pack(nvl, &packed_size);
- ATF_REQUIRE(packed != NULL);
-
- unpacked = nvlist_unpack(packed, packed_size, 0);
- ATF_REQUIRE(unpacked != NULL);
- ATF_REQUIRE(unpacked != nvl);
- ATF_REQUIRE(nvlist_empty(unpacked));
-
- nvlist_destroy(unpacked);
- nvlist_destroy(nvl);
- free(packed);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_unpack__flags_nvlist);
-ATF_TEST_CASE_BODY(nvlist_unpack__flags_nvlist)
-{
- nvlist_t *nvl, *unpacked;
- void *packed;
- size_t packed_size;
-
- nvl = nvlist_create(NV_FLAG_NO_UNIQUE);
- ATF_REQUIRE(nvl != NULL);
-
- nvlist_add_bool(nvl, "name", true);
- ATF_REQUIRE(!nvlist_empty(nvl));
- ATF_REQUIRE(nvlist_exists_bool(nvl, "name"));
-
- packed = nvlist_pack(nvl, &packed_size);
- ATF_REQUIRE(packed != NULL);
-
- unpacked = nvlist_unpack(packed, packed_size, 0);
- ATF_REQUIRE(unpacked == NULL);
-
- unpacked = nvlist_unpack(packed, packed_size, NV_FLAG_IGNORE_CASE);
- ATF_REQUIRE(unpacked == NULL);
-
- unpacked = nvlist_unpack(packed, packed_size, NV_FLAG_NO_UNIQUE);
- ATF_REQUIRE(unpacked != NULL);
- ATF_REQUIRE(unpacked != nvl);
- ATF_REQUIRE(!nvlist_empty(unpacked));
- ATF_REQUIRE(nvlist_exists_bool(unpacked, "name"));
-
- nvlist_destroy(unpacked);
- nvlist_destroy(nvl);
- free(packed);
-}
-
-static void
-verify_null(const nvlist_t *nvl, int type)
-{
-
- ATF_REQUIRE_EQ(type, NV_TYPE_NULL);
-}
-
-static void
-verify_number(const nvlist_t *nvl, const char *name, int type, uint64_t value)
-{
-
- ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER);
- ATF_REQUIRE_EQ(nvlist_get_number(nvl, name), value);
-}
-
-static void
-verify_string(const nvlist_t *nvl, const char *name, int type,
- const char * value)
-{
-
- ATF_REQUIRE_EQ(type, NV_TYPE_STRING);
- ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, name), value), 0);
-}
-
-static void
-verify_nvlist(const nvlist_t *nvl, const char *name, int type)
-{
-
- ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST);
- verify_test_nvlist(nvlist_get_nvlist(nvl, name));
-}
-
-static void
-verify_binary(const nvlist_t *nvl, const char *name, int type,
- const void * value, size_t size)
-{
- const void *actual_value;
- size_t actual_size;
-
- ATF_REQUIRE_EQ(type, NV_TYPE_BINARY);
- actual_value = nvlist_get_binary(nvl, name, &actual_size);
- ATF_REQUIRE_EQ(size, actual_size);
- ATF_REQUIRE_EQ(memcmp(value, actual_value, size), 0);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_pack__multiple_values);
-ATF_TEST_CASE_BODY(nvlist_pack__multiple_values)
-{
- std::ostringstream msg;
- std::set<std::string> keys_seen;
- nvlist_t *nvl, *unpacked, *nvvalue;
- const char *nullkey, *numkey, *strkey, *nvkey, *binkey, *name;
- int numvalue;
- const char * strvalue;
- void *binvalue, *packed, *it;
- size_t binsize, packed_size;
- int type;
-
- nvl = nvlist_create(0);
-
- nullkey = "null";
- nvlist_add_null(nvl, nullkey);
-
- numkey = "number";
- numvalue = 939853984;
- nvlist_add_number(nvl, numkey, numvalue);
-
- strkey = "string";
- strvalue = "jfieutijf";
- nvlist_add_string(nvl, strkey, strvalue);
-
- nvkey = "nvlist";
- nvvalue = create_test_nvlist();
- nvlist_move_nvlist(nvl, nvkey, nvvalue);
-
- binkey = "binary";
- binsize = 4;
- binvalue = malloc(binsize);
- memset(binvalue, 'b', binsize);
- nvlist_move_binary(nvl, binkey, binvalue, binsize);
-
- packed = nvlist_pack(nvl, &packed_size);
- ATF_REQUIRE(packed != NULL);
-
- unpacked = nvlist_unpack(packed, packed_size, 0);
- ATF_REQUIRE(unpacked != 0);
-
- it = NULL;
- while ((name = nvlist_next(unpacked, &type, &it)) != NULL) {
- /* Ensure that we see every key only once. */
- ATF_REQUIRE_EQ(keys_seen.count(name), 0);
-
- if (strcmp(name, nullkey) == 0)
- verify_null(unpacked, type);
- else if (strcmp(name, numkey) == 0)
- verify_number(unpacked, name, type, numvalue);
- else if (strcmp(name, strkey) == 0)
- verify_string(unpacked, name, type, strvalue);
- else if (strcmp(name, nvkey) == 0)
- verify_nvlist(unpacked, name, type);
- else if (strcmp(name, binkey) == 0)
- verify_binary(unpacked, name, type, binvalue, binsize);
- else {
- msg << "Unexpected key :'" << name << "'";
- ATF_FAIL(msg.str().c_str());
- }
-
- keys_seen.insert(name);
- }
-
- /* Ensure that we saw every key. */
- ATF_REQUIRE_EQ(keys_seen.size(), 5);
-
- nvlist_destroy(nvl);
- nvlist_destroy(unpacked);
- free(packed);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_pack__error_nvlist);
-ATF_TEST_CASE_BODY(nvlist_pack__error_nvlist)
-{
- nvlist_t *nvl;
- void *packed;
- size_t size;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- nvlist_set_error(nvl, ENOMEM);
-
- packed = nvlist_pack(nvl, &size);
- ATF_REQUIRE(packed == NULL);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_unpack__duplicate_key);
-ATF_TEST_CASE_BODY(nvlist_unpack__duplicate_key)
-{
- nvlist_t *nvl, *unpacked;
- const char *key1, *key2;
- void *packed, *keypos;
- size_t size, keylen;
-
- nvl = nvlist_create(0);
-
- key1 = "key1";
- keylen = strlen(key1);
- nvlist_add_number(nvl, key1, 5);
-
- key2 = "key2";
- ATF_REQUIRE_EQ(keylen, strlen(key2));
- nvlist_add_number(nvl, key2, 10);
-
- packed = nvlist_pack(nvl, &size);
-
- /*
- * Mangle the packed nvlist by replacing key1 with key2, creating a
- * packed nvlist with a duplicate key.
- */
- keypos = memmem(packed, size, key1, keylen);
- ATF_REQUIRE(keypos != NULL);
- memcpy(keypos, key2, keylen);
-
- unpacked = nvlist_unpack(packed, size, 0);
- ATF_REQUIRE(nvlist_error(unpacked) != 0);
-
- free(packed);
- nvlist_destroy(nvl);
- nvlist_destroy(unpacked);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_string__single_insert);
-ATF_TEST_CASE_BODY(nvlist_move_string__single_insert)
-{
- nvlist_t *nvl;
- const char *key;
- char *value;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- key = "testkey";
- value = strdup("testval");
- ATF_REQUIRE(value != NULL);
-
- nvlist_move_string(nvl, key, value);
- ATF_REQUIRE_EQ(nvlist_get_string(nvl, key), value);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_nvlist__null_child);
-ATF_TEST_CASE_BODY(nvlist_move_nvlist__null_child)
-{
- nvlist_t *parent;
-
- parent = nvlist_create(0);
-
- nvlist_move_nvlist(parent, "test", NULL);
-
- ATF_REQUIRE(nvlist_error(parent) != 0);
-
- nvlist_destroy(parent);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_nvlist__child_with_error);
-ATF_TEST_CASE_BODY(nvlist_move_nvlist__child_with_error)
-{
- nvlist_t *nvl, *parent;
-
- nvl = nvlist_create(0);
- parent = nvlist_create(0);
-
- nvlist_set_error(nvl, EBADF);
- nvlist_move_nvlist(parent, "test", nvl);
- ATF_REQUIRE_EQ(nvlist_error(parent), EBADF);
-
- nvlist_destroy(parent);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_nvlist__single_insert);
-ATF_TEST_CASE_BODY(nvlist_move_nvlist__single_insert)
-{
- nvlist_t *nvl;
- const char *key;
- nvlist_t *value;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- key = "testkey";
- value = nvlist_create(0);
- ATF_REQUIRE(value != NULL);
-
- nvlist_move_nvlist(nvl, key, value);
- ATF_REQUIRE_EQ(nvlist_get_nvlist(nvl, key), value);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_binary__single_insert);
-ATF_TEST_CASE_BODY(nvlist_move_binary__single_insert)
-{
- nvlist_t *nvl;
- const char *key;
- void *value;
- size_t size, actual_size;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- key = "testkey";
- size = 73;
- value = malloc(size);
- ATF_REQUIRE(value != NULL);
-
- nvlist_move_binary(nvl, key, value, size);
- ATF_REQUIRE_EQ(nvlist_get_binary(nvl, key, &actual_size), value);
- ATF_REQUIRE_EQ(size, actual_size);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_bool__single_remove);
-ATF_TEST_CASE_BODY(nvlist_take_bool__single_remove)
-{
- nvlist_t *nvl;
- const char *testkey;
- bool testval;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- testkey = "boolkey";
- testval = false;
- nvlist_add_bool(nvl, testkey, testval);
-
- ATF_REQUIRE_EQ(nvlist_take_bool(nvl, testkey), testval);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_bool__other_keys_unchanged);
-ATF_TEST_CASE_BODY(nvlist_take_bool__other_keys_unchanged)
-{
- nvlist_t *nvl;
- const char *testkey, *otherkey1, *otherkey2;
- bool testval, otherval1;
- nvlist_t *otherval2;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- testkey = "boolkey";
- testval = true;
- nvlist_add_bool(nvl, testkey, testval);
-
- otherkey1 = "key1";
- otherval1 = false;
- nvlist_add_bool(nvl, otherkey1, otherval1);
-
- otherkey2 = "key2";
- otherval2 = create_test_nvlist();
- nvlist_move_nvlist(nvl, otherkey2, otherval2);
-
- ATF_REQUIRE_EQ(nvlist_take_bool(nvl, testkey), testval);
-
- ATF_REQUIRE(nvlist_exists_bool(nvl, otherkey1));
- ATF_REQUIRE_EQ(nvlist_get_bool(nvl, otherkey1), otherval1);
-
- ATF_REQUIRE(nvlist_exists_nvlist(nvl, otherkey2));
- verify_test_nvlist(nvlist_get_nvlist(nvl, otherkey2));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_number__single_remove);
-ATF_TEST_CASE_BODY(nvlist_take_number__single_remove)
-{
- nvlist_t *nvl;
- const char *testkey;
- uint64_t testval;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- testkey = "numkey";
- testval = std::numeric_limits<uint64_t>::max();
- nvlist_add_number(nvl, testkey, testval);
-
- ATF_REQUIRE_EQ(nvlist_take_number(nvl, testkey), testval);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_number__other_keys_unchanged);
-ATF_TEST_CASE_BODY(nvlist_take_number__other_keys_unchanged)
-{
- nvlist_t *nvl;
- const char *testkey, *otherkey1, *otherkey2;
- uint64_t testval, otherval1;
- const char *otherval2;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- otherkey1 = "key1";
- otherval1 = 5;
- nvlist_add_number(nvl, otherkey1, otherval1);
-
- testkey = "numkey";
- testval = 1654;
- nvlist_add_number(nvl, testkey, testval);
-
- otherkey2 = "key2";
- otherval2 = "string";
- nvlist_add_string(nvl, otherkey2, otherval2);
-
- ATF_REQUIRE_EQ(nvlist_take_number(nvl, testkey), testval);
-
- ATF_REQUIRE(nvlist_exists_number(nvl, otherkey1));
- ATF_REQUIRE_EQ(nvlist_get_number(nvl, otherkey1), otherval1);
-
- ATF_REQUIRE(nvlist_exists_string(nvl, otherkey2));
- ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, otherkey2), otherval2), 0);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_string__single_remove);
-ATF_TEST_CASE_BODY(nvlist_take_string__single_remove)
-{
- nvlist_t *nvl;
- const char *testkey;
- const char *testval;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- testkey = "numkey";
- testval = "nvlist";
- nvlist_add_string(nvl, testkey, testval);
-
- ATF_REQUIRE_EQ(strcmp(nvlist_take_string(nvl, testkey), testval), 0);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_string__other_keys_unchanged);
-ATF_TEST_CASE_BODY(nvlist_take_string__other_keys_unchanged)
-{
- nvlist_t *nvl;
- const char *testkey, *otherkey1, *otherkey2;
- const char *testval, *otherval1;
- bool otherval2;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- otherkey1 = "key1";
- otherval1 = "fjdifjdk";
- nvlist_add_string(nvl, otherkey1, otherval1);
-
- otherkey2 = "key2";
- otherval2 = true;
- nvlist_add_bool(nvl, otherkey2, otherval2);
-
- testkey = "strkey";
- testval = "1654";
- nvlist_add_string(nvl, testkey, testval);
-
- ATF_REQUIRE_EQ(strcmp(nvlist_take_string(nvl, testkey), testval), 0);
-
- ATF_REQUIRE(nvlist_exists_string(nvl, otherkey1));
- ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, otherkey1), otherval1), 0);
-
- ATF_REQUIRE(nvlist_exists_bool(nvl, otherkey2));
- ATF_REQUIRE_EQ(nvlist_get_bool(nvl, otherkey2), otherval2);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_nvlist__single_remove);
-ATF_TEST_CASE_BODY(nvlist_take_nvlist__single_remove)
-{
- nvlist_t *nvl;
- const char *testkey;
- nvlist_t *testval;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- testkey = "numkey";
- testval = create_test_nvlist();
- nvlist_move_nvlist(nvl, testkey, testval);
-
- verify_test_nvlist(nvlist_take_nvlist(nvl, testkey));
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_nvlist__other_keys_unchanged);
-ATF_TEST_CASE_BODY(nvlist_take_nvlist__other_keys_unchanged)
-{
- nvlist_t *nvl;
- const char *testkey, *otherkey1, *otherkey2;
- nvlist_t *testval, *otherval1;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- testkey = "strkey";
- testval = create_test_nvlist();
- nvlist_move_nvlist(nvl, testkey, testval);
-
- otherkey1 = "key1";
- otherval1 = nvlist_create(0);
- nvlist_move_nvlist(nvl, otherkey1, otherval1);
-
- otherkey2 = "key2";
- nvlist_add_null(nvl, otherkey2);
-
- verify_test_nvlist(nvlist_take_nvlist(nvl, testkey));
-
- ATF_REQUIRE(nvlist_exists_nvlist(nvl, otherkey1));
- ATF_REQUIRE(nvlist_empty(nvlist_get_nvlist(nvl, otherkey1)));
-
- ATF_REQUIRE(nvlist_exists_null(nvl, otherkey2));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_binary__single_remove);
-ATF_TEST_CASE_BODY(nvlist_take_binary__single_remove)
-{
- nvlist_t *nvl;
- const char *testkey;
- void *testval;
- const void *actual_val;
- size_t testsize, actual_size;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- testkey = "numkey";
- testsize = 457;
- testval = malloc(testsize);
- memset(testval, '5', testsize);
- nvlist_move_binary(nvl, testkey, testval, testsize);
-
- actual_val = nvlist_take_binary(nvl, testkey, &actual_size);
- ATF_REQUIRE_EQ(testsize, actual_size);
- ATF_REQUIRE_EQ(memcmp(actual_val, testval, testsize), 0);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_binary__other_keys_unchanged);
-ATF_TEST_CASE_BODY(nvlist_take_binary__other_keys_unchanged)
-{
- nvlist_t *nvl;
- const char *testkey, *otherkey1, *otherkey2;
- const void *actual_value;
- char testval[] = "gjiertj";
- char otherval1[] = "fdreg";
- size_t testsize, othersize, actual_size;
- bool otherval2;
-
- nvl = nvlist_create(0);
- ATF_REQUIRE(nvl != NULL);
-
- otherkey1 = "key1";
- othersize = sizeof(otherval1);
- nvlist_add_binary(nvl, otherkey1, otherval1, othersize);
-
- otherkey2 = "key2";
- otherval2 = true;
- nvlist_add_bool(nvl, otherkey2, otherval2);
-
- testkey = "strkey";
- testsize = sizeof(testval);
- nvlist_add_binary(nvl, testkey, testval, testsize);
-
- actual_value = nvlist_take_binary(nvl, testkey, &actual_size);
- ATF_REQUIRE_EQ(testsize, actual_size);
- ATF_REQUIRE_EQ(memcmp(actual_value, testval, testsize), 0);
-
- ATF_REQUIRE(nvlist_exists_binary(nvl, otherkey1));
- actual_value = nvlist_get_binary(nvl, otherkey1, &actual_size);
- ATF_REQUIRE_EQ(othersize, actual_size);
- ATF_REQUIRE_EQ(memcmp(actual_value, otherval1, othersize), 0);
-
- ATF_REQUIRE(nvlist_exists_bool(nvl, otherkey2));
- ATF_REQUIRE_EQ(nvlist_get_bool(nvl, otherkey2), otherval2);
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_null);
-ATF_TEST_CASE_BODY(nvlist_free__single_null)
-{
- nvlist_t *nvl;
- const char *key;
-
- nvl = nvlist_create(0);
- key = "test";
- nvlist_add_null(nvl, key);
-
- nvlist_free(nvl, key);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_bool);
-ATF_TEST_CASE_BODY(nvlist_free__single_bool)
-{
- nvlist_t *nvl;
- const char *key;
-
- nvl = nvlist_create(0);
- key = "test";
- nvlist_add_bool(nvl, key, true);
-
- nvlist_free(nvl, key);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_number);
-ATF_TEST_CASE_BODY(nvlist_free__single_number)
-{
- nvlist_t *nvl;
- const char *key;
-
- nvl = nvlist_create(0);
- key = "test";
- nvlist_add_number(nvl, key, 584);
-
- nvlist_free(nvl, key);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_string);
-ATF_TEST_CASE_BODY(nvlist_free__single_string)
-{
- nvlist_t *nvl;
- const char *key;
-
- nvl = nvlist_create(0);
- key = "test";
- nvlist_add_string(nvl, key, "gjkfkjd");
-
- nvlist_free(nvl, key);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_nvlist);
-ATF_TEST_CASE_BODY(nvlist_free__single_nvlist)
-{
- nvlist_t *nvl;
- const char *key;
-
- nvl = nvlist_create(0);
- key = "test";
- nvlist_add_nvlist(nvl, key, nvlist_create(0));
-
- nvlist_free(nvl, key);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_binary);
-ATF_TEST_CASE_BODY(nvlist_free__single_binary)
-{
- nvlist_t *nvl;
- const char *key;
-
- nvl = nvlist_create(0);
- key = "test";
- nvlist_add_binary(nvl, key, "jgjgfd", 6);
-
- nvlist_free(nvl, key);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free_null__single_null);
-ATF_TEST_CASE_BODY(nvlist_free_null__single_null)
-{
- nvlist_t *nvl;
- const char *key;
-
- nvl = nvlist_create(0);
- key = "test";
- nvlist_add_null(nvl, key);
-
- nvlist_free_null(nvl, key);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free_bool__single_bool);
-ATF_TEST_CASE_BODY(nvlist_free_bool__single_bool)
-{
- nvlist_t *nvl;
- const char *key;
-
- nvl = nvlist_create(0);
- key = "test";
- nvlist_add_bool(nvl, key, true);
-
- nvlist_free_bool(nvl, key);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free_number__single_number);
-ATF_TEST_CASE_BODY(nvlist_free_number__single_number)
-{
- nvlist_t *nvl;
- const char *key;
-
- nvl = nvlist_create(0);
- key = "test";
- nvlist_add_number(nvl, key, 584);
-
- nvlist_free_number(nvl, key);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free_string__single_string);
-ATF_TEST_CASE_BODY(nvlist_free_string__single_string)
-{
- nvlist_t *nvl;
- const char *key;
-
- nvl = nvlist_create(0);
- key = "test";
- nvlist_add_string(nvl, key, "gjkfkjd");
-
- nvlist_free_string(nvl, key);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free_nvlist__single_nvlist);
-ATF_TEST_CASE_BODY(nvlist_free_nvlist__single_nvlist)
-{
- nvlist_t *nvl;
- const char *key;
-
- nvl = nvlist_create(0);
- key = "test";
- nvlist_add_nvlist(nvl, key, nvlist_create(0));
-
- nvlist_free_nvlist(nvl, key);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free_binary__single_binary);
-ATF_TEST_CASE_BODY(nvlist_free_binary__single_binary)
-{
- nvlist_t *nvl;
- const char *key;
-
- nvl = nvlist_create(0);
- key = "test";
- nvlist_add_binary(nvl, key, "jgjgfd", 6);
-
- nvlist_free_binary(nvl, key);
- ATF_REQUIRE(nvlist_empty(nvl));
-
- nvlist_destroy(nvl);
-}
-
-ATF_INIT_TEST_CASES(tp)
-{
- ATF_ADD_TEST_CASE(tp, nvlist_create__is_empty);
- ATF_ADD_TEST_CASE(tp, nvlist_add_null__single_insert);
- ATF_ADD_TEST_CASE(tp, nvlist_add_bool__single_insert);
- ATF_ADD_TEST_CASE(tp, nvlist_add_number__single_insert);
- ATF_ADD_TEST_CASE(tp, nvlist_add_string__single_insert);
- ATF_ADD_TEST_CASE(tp, nvlist_add_nvlist__single_insert);
- ATF_ADD_TEST_CASE(tp, nvlist_add_nvlist__child_with_error);
- ATF_ADD_TEST_CASE(tp, nvlist_add_binary__single_insert);
-
- ATF_ADD_TEST_CASE(tp, nvlist_clone__empty_nvlist);
- ATF_ADD_TEST_CASE(tp, nvlist_clone__nonempty_nvlist);
- ATF_ADD_TEST_CASE(tp, nvlist_clone__nested_nvlist);
- ATF_ADD_TEST_CASE(tp, nvlist_clone__error_nvlist);
-
- ATF_ADD_TEST_CASE(tp, nvlist_pack__empty_nvlist);
- ATF_ADD_TEST_CASE(tp, nvlist_pack__multiple_values);
- ATF_ADD_TEST_CASE(tp, nvlist_pack__error_nvlist);
- ATF_ADD_TEST_CASE(tp, nvlist_unpack__duplicate_key);
- ATF_ADD_TEST_CASE(tp, nvlist_unpack__flags_nvlist);
-
- ATF_ADD_TEST_CASE(tp, nvlist_move_string__single_insert);
- ATF_ADD_TEST_CASE(tp, nvlist_move_nvlist__single_insert);
- ATF_ADD_TEST_CASE(tp, nvlist_move_nvlist__null_child);
- ATF_ADD_TEST_CASE(tp, nvlist_move_nvlist__child_with_error);
- ATF_ADD_TEST_CASE(tp, nvlist_move_binary__single_insert);
-
- ATF_ADD_TEST_CASE(tp, nvlist_take_bool__single_remove);
- ATF_ADD_TEST_CASE(tp, nvlist_take_bool__other_keys_unchanged);
- ATF_ADD_TEST_CASE(tp, nvlist_take_number__single_remove);
- ATF_ADD_TEST_CASE(tp, nvlist_take_number__other_keys_unchanged);
- ATF_ADD_TEST_CASE(tp, nvlist_take_string__single_remove);
- ATF_ADD_TEST_CASE(tp, nvlist_take_string__other_keys_unchanged);
- ATF_ADD_TEST_CASE(tp, nvlist_take_nvlist__single_remove);
- ATF_ADD_TEST_CASE(tp, nvlist_take_nvlist__other_keys_unchanged);
- ATF_ADD_TEST_CASE(tp, nvlist_take_binary__single_remove);
- ATF_ADD_TEST_CASE(tp, nvlist_take_binary__other_keys_unchanged);
-
- ATF_ADD_TEST_CASE(tp, nvlist_free__single_null);
- ATF_ADD_TEST_CASE(tp, nvlist_free__single_bool);
- ATF_ADD_TEST_CASE(tp, nvlist_free__single_number);
- ATF_ADD_TEST_CASE(tp, nvlist_free__single_string);
- ATF_ADD_TEST_CASE(tp, nvlist_free__single_nvlist);
- ATF_ADD_TEST_CASE(tp, nvlist_free__single_binary);
-
- ATF_ADD_TEST_CASE(tp, nvlist_free_null__single_null);
- ATF_ADD_TEST_CASE(tp, nvlist_free_bool__single_bool);
- ATF_ADD_TEST_CASE(tp, nvlist_free_number__single_number);
- ATF_ADD_TEST_CASE(tp, nvlist_free_string__single_string);
- ATF_ADD_TEST_CASE(tp, nvlist_free_nvlist__single_nvlist);
- ATF_ADD_TEST_CASE(tp, nvlist_free_binary__single_binary);
-}
diff --git a/lib/libnv/tests/nvlist_send_recv_test.c b/lib/libnv/tests/nvlist_send_recv_test.c
index 50222fb..c751bf7 100644
--- a/lib/libnv/tests/nvlist_send_recv_test.c
+++ b/lib/libnv/tests/nvlist_send_recv_test.c
@@ -58,10 +58,8 @@ static void
child(int sock)
{
nvlist_t *nvl;
- nvlist_t *empty;
nvl = nvlist_create(0);
- empty = nvlist_create(0);
nvlist_add_bool(nvl, "nvlist/bool/true", true);
nvlist_add_bool(nvl, "nvlist/bool/false", false);
@@ -77,7 +75,6 @@ child(int sock)
nvlist_add_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO", STDERR_FILENO);
nvlist_add_binary(nvl, "nvlist/binary/x", "x", 1);
nvlist_add_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz"));
- nvlist_move_nvlist(nvl, "nvlist/nvlist/empty", empty);
nvlist_add_nvlist(nvl, "nvlist/nvlist", nvl);
nvlist_send(sock, nvl);
@@ -89,13 +86,13 @@ static void
parent(int sock)
{
nvlist_t *nvl;
- const nvlist_t *cnvl, *empty;
+ const nvlist_t *cnvl;
const char *name, *cname;
void *cookie, *ccookie;
int type, ctype;
size_t size;
- nvl = nvlist_recv(sock, 0);
+ nvl = nvlist_recv(sock);
CHECK(nvlist_error(nvl) == 0);
if (nvlist_error(nvl) != 0)
err(1, "nvlist_recv() failed");
@@ -193,13 +190,6 @@ parent(int sock)
name = nvlist_next(nvl, &type, &cookie);
CHECK(name != NULL);
CHECK(type == NV_TYPE_NVLIST);
- CHECK(strcmp(name, "nvlist/nvlist/empty") == 0);
- cnvl = nvlist_get_nvlist(nvl, name);
- CHECK(nvlist_empty(cnvl));
-
- name = nvlist_next(nvl, &type, &cookie);
- CHECK(name != NULL);
- CHECK(type == NV_TYPE_NVLIST);
CHECK(strcmp(name, "nvlist/nvlist") == 0);
cnvl = nvlist_get_nvlist(nvl, name);
@@ -294,13 +284,6 @@ parent(int sock)
CHECK(size == sizeof("abcdefghijklmnopqrstuvwxyz"));
cname = nvlist_next(cnvl, &ctype, &ccookie);
- CHECK(cname != NULL);
- CHECK(ctype == NV_TYPE_NVLIST);
- CHECK(strcmp(cname, "nvlist/nvlist/empty") == 0);
- empty = nvlist_get_nvlist(cnvl, cname);
- CHECK(nvlist_empty(empty));
-
- cname = nvlist_next(cnvl, &ctype, &ccookie);
CHECK(cname == NULL);
name = nvlist_next(nvl, &type, &cookie);
@@ -313,7 +296,7 @@ main(void)
int status, socks[2];
pid_t pid;
- printf("1..134\n");
+ printf("1..126\n");
fflush(stdout);
if (socketpair(PF_UNIX, SOCK_STREAM, 0, socks) < 0)
diff --git a/lib/libohash/Makefile.depend b/lib/libohash/Makefile.depend
new file mode 100644
index 0000000..639d45d
--- /dev/null
+++ b/lib/libohash/Makefile.depend
@@ -0,0 +1,14 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libopie/Makefile b/lib/libopie/Makefile
index e66e67a..e47e16d 100644
--- a/lib/libopie/Makefile
+++ b/lib/libopie/Makefile
@@ -27,7 +27,8 @@ CFLAGS+= -DINSECURE_OVERRIDE -DPATH_ACCESS_FILE=${ACCESSFILE}
WARNS?= 0
-LIBADD= md
+DPADD= ${LIBMD}
+LDADD= -lmd
MAN= ${OPIE_DIST}/opie.4 ${OPIE_DIST}/opiekeys.5 ${OPIE_DIST}/opieaccess.5
diff --git a/lib/libopie/Makefile.depend b/lib/libopie/Makefile.depend
new file mode 100644
index 0000000..9c2e453
--- /dev/null
+++ b/lib/libopie/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libmd \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/Makefile b/lib/libpam/Makefile
index 088e8a0..5c3a2ae 100644
--- a/lib/libpam/Makefile
+++ b/lib/libpam/Makefile
@@ -26,6 +26,6 @@
# The modules must be built first, because they are built into the
# static version of libpam.
-SUBDIR+= modules libpam
+SUBDIR+= modules libpam static_modules
.include <bsd.subdir.mk>
diff --git a/lib/libpam/libpam/Makefile b/lib/libpam/libpam/Makefile
index a681a82..c8f13c4 100644
--- a/lib/libpam/libpam/Makefile
+++ b/lib/libpam/libpam/Makefile
@@ -172,33 +172,12 @@ HEADERS= security/openpam.h \
ADD_HEADERS= security/pam_mod_misc.h
-#
-# Static modules
-#
-# We build static versions of all modules and of openpam_static.o,
-# then link them all together into openpam_static_modules.o. None of
-# the modules export any symbols, but they store structures with
-# pointers to their service functions in a linker set which the code
-# in openpam_static.c traverses to locate the individual modules.
-#
-MODULE_DIR= ../modules
-.include "${.CURDIR}/${MODULE_DIR}/modules.inc"
-STATIC_MODULES= ${MODULES:C/.*/${MODULE_DIR}\/&\/lib&.a/}
-STATICOBJS+= openpam_static_modules.o
-CLEANFILES+= openpam_static.o \
- openpam_static_modules.o
-
-openpam_static_modules.o: openpam_static.o ${STATIC_MODULES}
- ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC}
-
-# We can't put openpam_static.c in SRCS, but we still want to scan it
-# for dependencies.
-DPSRCS= openpam_static.c
-
# Headers
INCS= ${HEADERS} ${ADD_HEADERS}
INCSDIR= ${INCLUDEDIR}/security
+.include <src.opts.mk>
+
.if ${MK_TESTS} != "no"
SUBDIR+= tests
.endif
diff --git a/lib/libpam/libpam/Makefile.depend b/lib/libpam/libpam/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libpam/libpam/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/libpam/tests/Makefile b/lib/libpam/libpam/tests/Makefile
index 4532ace..2ad64e2 100644
--- a/lib/libpam/libpam/tests/Makefile
+++ b/lib/libpam/libpam/tests/Makefile
@@ -13,6 +13,7 @@ SRCS.${test} = ${test}.c ${COMMONSRC}
CFLAGS +=-I${OPENPAM}/include -I${OPENPAM}/lib/libpam -I${OPENPAM}/t
WARNS ?= 6
-LIBADD = pam
+DPADD = ${LIBPAM}
+LDADD = ${MINUSLPAM}
.include <bsd.test.mk>
diff --git a/lib/libpam/modules/Makefile.inc b/lib/libpam/modules/Makefile.inc
index 2da5a7b..085ab58 100644
--- a/lib/libpam/modules/Makefile.inc
+++ b/lib/libpam/modules/Makefile.inc
@@ -14,7 +14,8 @@ CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam
NO_PIC=
.else
SHLIB_NAME?= ${LIB}.so.${SHLIB_MAJOR}
-LIBADD+= pam
+DPADD+= ${LIBPAM}
+LDADD+= -lpam
.endif
.include "../Makefile.inc"
diff --git a/lib/libpam/modules/modules.inc b/lib/libpam/modules/modules.inc
index 02debf7..66fc63c 100644
--- a/lib/libpam/modules/modules.inc
+++ b/lib/libpam/modules/modules.inc
@@ -21,9 +21,7 @@ MODULES += pam_opie
MODULES += pam_opieaccess
MODULES += pam_passwdqc
MODULES += pam_permit
-.if ${MK_RADIUS_SUPPORT} != "no"
MODULES += pam_radius
-.endif
MODULES += pam_rhosts
MODULES += pam_rootok
MODULES += pam_securetty
diff --git a/lib/libpam/modules/pam_chroot/Makefile.depend b/lib/libpam/modules/pam_chroot/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libpam/modules/pam_chroot/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_deny/Makefile.depend b/lib/libpam/modules/pam_deny/Makefile.depend
new file mode 100644
index 0000000..7cedd5f
--- /dev/null
+++ b/lib/libpam/modules/pam_deny/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_echo/Makefile.depend b/lib/libpam/modules/pam_echo/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libpam/modules/pam_echo/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_exec/Makefile.depend b/lib/libpam/modules/pam_exec/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libpam/modules/pam_exec/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_ftpusers/Makefile.depend b/lib/libpam/modules/pam_ftpusers/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libpam/modules/pam_ftpusers/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_group/Makefile.depend b/lib/libpam/modules/pam_group/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libpam/modules/pam_group/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_guest/Makefile.depend b/lib/libpam/modules/pam_guest/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libpam/modules/pam_guest/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_guest/pam_guest.8 b/lib/libpam/modules/pam_guest/pam_guest.8
index 0b858d6..0bd1755 100644
--- a/lib/libpam/modules/pam_guest/pam_guest.8
+++ b/lib/libpam/modules/pam_guest/pam_guest.8
@@ -82,8 +82,8 @@ password.
Requires the guest user to type in the guest account name as password.
.El
.Sh SEE ALSO
-.Xr pam_get_item 3 ,
.Xr pam_getenv 3 ,
+.Xr pam_get_item 3 ,
.Xr pam.conf 5 ,
.Xr pam 8
.Sh AUTHORS
diff --git a/lib/libpam/modules/pam_krb5/Makefile b/lib/libpam/modules/pam_krb5/Makefile
index 97fd490..85f3421 100644
--- a/lib/libpam/modules/pam_krb5/Makefile
+++ b/lib/libpam/modules/pam_krb5/Makefile
@@ -32,6 +32,7 @@ CFLAGS+=-D_FREEFALL_CONFIG
WARNS?= 3
.endif
-LIBADD+= krb5
+DPADD= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO}
+LDADD= -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypt -lcrypto
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_krb5/Makefile.depend b/lib/libpam/modules/pam_krb5/Makefile.depend
new file mode 100644
index 0000000..f6e886e
--- /dev/null
+++ b/lib/libpam/modules/pam_krb5/Makefile.depend
@@ -0,0 +1,28 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ kerberos5/lib/libasn1 \
+ kerberos5/lib/libhx509 \
+ kerberos5/lib/libkrb5 \
+ kerberos5/lib/libroken \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcom_err \
+ lib/libcompiler_rt \
+ lib/libcrypt \
+ lib/libpam/libpam \
+ secure/lib/libcrypto \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_ksu/Makefile b/lib/libpam/modules/pam_ksu/Makefile
index 26f3f85..9aa6a7e 100644
--- a/lib/libpam/modules/pam_ksu/Makefile
+++ b/lib/libpam/modules/pam_ksu/Makefile
@@ -28,6 +28,7 @@ LIB= pam_ksu
SRCS= pam_ksu.c
MAN= pam_ksu.8
-LIBADD+= krb5
+DPADD= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO}
+LDADD= -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypt -lcrypto
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_ksu/Makefile.depend b/lib/libpam/modules/pam_ksu/Makefile.depend
new file mode 100644
index 0000000..f6e886e
--- /dev/null
+++ b/lib/libpam/modules/pam_ksu/Makefile.depend
@@ -0,0 +1,28 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ kerberos5/lib/libasn1 \
+ kerberos5/lib/libhx509 \
+ kerberos5/lib/libkrb5 \
+ kerberos5/lib/libroken \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcom_err \
+ lib/libcompiler_rt \
+ lib/libcrypt \
+ lib/libpam/libpam \
+ secure/lib/libcrypto \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_lastlog/Makefile.depend b/lib/libpam/modules/pam_lastlog/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libpam/modules/pam_lastlog/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_login_access/Makefile.depend b/lib/libpam/modules/pam_login_access/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libpam/modules/pam_login_access/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_nologin/Makefile b/lib/libpam/modules/pam_nologin/Makefile
index 746e9e8..ba5a7d4 100644
--- a/lib/libpam/modules/pam_nologin/Makefile
+++ b/lib/libpam/modules/pam_nologin/Makefile
@@ -28,6 +28,7 @@ LIB= pam_nologin
SRCS= pam_nologin.c
MAN= pam_nologin.8
-LIBADD+= util
+DPADD= ${LIBUTIL}
+LDADD= -lutil
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_nologin/Makefile.depend b/lib/libpam/modules/pam_nologin/Makefile.depend
new file mode 100644
index 0000000..0e5a167
--- /dev/null
+++ b/lib/libpam/modules/pam_nologin/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libpam/libpam \
+ lib/libutil \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_opie/Makefile b/lib/libpam/modules/pam_opie/Makefile
index c2074bf..fbc1278 100644
--- a/lib/libpam/modules/pam_opie/Makefile
+++ b/lib/libpam/modules/pam_opie/Makefile
@@ -29,6 +29,7 @@ LIB= pam_opie
SRCS= pam_opie.c
MAN= pam_opie.8
-LIBADD+= opie
+DPADD= ${LIBOPIE}
+LDADD= -lopie
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_opie/Makefile.depend b/lib/libpam/modules/pam_opie/Makefile.depend
new file mode 100644
index 0000000..1e75b4a
--- /dev/null
+++ b/lib/libpam/modules/pam_opie/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libopie \
+ lib/libpam/libpam \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_opieaccess/Makefile b/lib/libpam/modules/pam_opieaccess/Makefile
index 2e764cd..1554a88 100644
--- a/lib/libpam/modules/pam_opieaccess/Makefile
+++ b/lib/libpam/modules/pam_opieaccess/Makefile
@@ -4,6 +4,7 @@ LIB= pam_opieaccess
SRCS= ${LIB}.c
MAN= pam_opieaccess.8
-LIBADD+= opie
+DPADD= ${LIBOPIE}
+LDADD= -lopie
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_opieaccess/Makefile.depend b/lib/libpam/modules/pam_opieaccess/Makefile.depend
new file mode 100644
index 0000000..7316349
--- /dev/null
+++ b/lib/libpam/modules/pam_opieaccess/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libopie \
+ lib/libpam/libpam \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_passwdqc/Makefile b/lib/libpam/modules/pam_passwdqc/Makefile
index cd23642..c9cc30e 100644
--- a/lib/libpam/modules/pam_passwdqc/Makefile
+++ b/lib/libpam/modules/pam_passwdqc/Makefile
@@ -10,7 +10,8 @@ MAN= pam_passwdqc.8
WARNS?= 2
CFLAGS+= -I${SRCDIR}
-LIBADD+= crypt
+DPADD= ${LIBCRYPT}
+LDADD= -lcrypt
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_passwdqc/Makefile.depend b/lib/libpam/modules/pam_passwdqc/Makefile.depend
new file mode 100644
index 0000000..7cce822
--- /dev/null
+++ b/lib/libpam/modules/pam_passwdqc/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libcrypt \
+ lib/libpam/libpam \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_permit/Makefile.depend b/lib/libpam/modules/pam_permit/Makefile.depend
new file mode 100644
index 0000000..7cedd5f
--- /dev/null
+++ b/lib/libpam/modules/pam_permit/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_radius/Makefile b/lib/libpam/modules/pam_radius/Makefile
index a9a93e2..2fac833 100644
--- a/lib/libpam/modules/pam_radius/Makefile
+++ b/lib/libpam/modules/pam_radius/Makefile
@@ -29,6 +29,7 @@ SRCS= pam_radius.c
MAN= pam_radius.8
WARNS?= 3
-LIBADD+= radius
+DPADD= ${LIBRADIUS}
+LDADD= -lradius
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_radius/Makefile.depend b/lib/libpam/modules/pam_radius/Makefile.depend
new file mode 100644
index 0000000..8daba2c
--- /dev/null
+++ b/lib/libpam/modules/pam_radius/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libpam/libpam \
+ lib/libradius \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_radius/pam_radius.c b/lib/libpam/modules/pam_radius/pam_radius.c
index dcfde30..c5d4dd4 100644
--- a/lib/libpam/modules/pam_radius/pam_radius.c
+++ b/lib/libpam/modules/pam_radius/pam_radius.c
@@ -62,11 +62,11 @@ __FBSDID("$FreeBSD$");
#define PASSWORD_PROMPT "RADIUS Password:"
static int build_access_request(struct rad_handle *, const char *,
- const char *, const char *, const char *, const char *,
- const void *, size_t);
+ const char *, const char *, const char *, const void *,
+ size_t);
static int do_accept(pam_handle_t *, struct rad_handle *);
static int do_challenge(pam_handle_t *, struct rad_handle *,
- const char *, const char *, const char *, const char *);
+ const char *, const char *, const char *);
/*
* Construct an access request, but don't send it. Returns 0 on success,
@@ -75,7 +75,7 @@ static int do_challenge(pam_handle_t *, struct rad_handle *,
static int
build_access_request(struct rad_handle *radh, const char *user,
const char *pass, const char *nas_id, const char *nas_ipaddr,
- const char *rhost, const void *state, size_t state_len)
+ const void *state, size_t state_len)
{
int error;
char host[MAXHOSTNAMELEN];
@@ -121,13 +121,8 @@ build_access_request(struct rad_handle *radh, const char *user,
}
}
}
- if (rhost != NULL &&
- rad_put_string(radh, RAD_CALLING_STATION_ID, rhost) == -1) {
- syslog(LOG_CRIT, "rad_put_string: %s", rad_strerror(radh));
- return (-1);
- }
- if (state != NULL &&
- rad_put_attr(radh, RAD_STATE, state, state_len) == -1) {
+ if (state != NULL && rad_put_attr(radh, RAD_STATE, state,
+ state_len) == -1) {
syslog(LOG_CRIT, "rad_put_attr: %s", rad_strerror(radh));
return (-1);
}
@@ -167,7 +162,7 @@ do_accept(pam_handle_t *pamh, struct rad_handle *radh)
static int
do_challenge(pam_handle_t *pamh, struct rad_handle *radh, const char *user,
- const char *nas_id, const char *nas_ipaddr, const char *rhost)
+ const char *nas_id, const char *nas_ipaddr)
{
int retval;
int attrtype;
@@ -235,7 +230,7 @@ do_challenge(pam_handle_t *pamh, struct rad_handle *radh, const char *user,
conv->appdata_ptr)) != PAM_SUCCESS)
return (retval);
if (build_access_request(radh, user, resp[num_msgs-1].resp, nas_id,
- nas_ipaddr, rhost, state, statelen) == -1)
+ nas_ipaddr, state, statelen) == -1)
return (PAM_SERVICE_ERR);
memset(resp[num_msgs-1].resp, 0, strlen(resp[num_msgs-1].resp));
free(resp[num_msgs-1].resp);
@@ -251,7 +246,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
{
struct rad_handle *radh;
const char *user, *pass;
- const void *rhost, *tmpuser;
+ const void *tmpuser;
const char *conf_file, *template_user, *nas_id, *nas_ipaddr;
int retval;
int e;
@@ -260,7 +255,6 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
template_user = openpam_get_option(pamh, PAM_OPT_TEMPLATE_USER);
nas_id = openpam_get_option(pamh, PAM_OPT_NAS_ID);
nas_ipaddr = openpam_get_option(pamh, PAM_OPT_NAS_IPADDR);
- pam_get_item(pamh, PAM_RHOST, &rhost);
retval = pam_get_user(pamh, &user, NULL);
if (retval != PAM_SUCCESS)
@@ -290,8 +284,8 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
PAM_LOG("Radius config file read");
- if (build_access_request(radh, user, pass, nas_id, nas_ipaddr, rhost,
- NULL, 0) == -1) {
+ if (build_access_request(radh, user, pass, nas_id, nas_ipaddr, NULL,
+ 0) == -1) {
rad_close(radh);
return (PAM_SERVICE_ERR);
}
@@ -336,7 +330,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
case RAD_ACCESS_CHALLENGE:
retval = do_challenge(pamh, radh, user, nas_id,
- nas_ipaddr, rhost);
+ nas_ipaddr);
if (retval != PAM_SUCCESS) {
rad_close(radh);
return (retval);
diff --git a/lib/libpam/modules/pam_rhosts/Makefile.depend b/lib/libpam/modules/pam_rhosts/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libpam/modules/pam_rhosts/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_rootok/Makefile.depend b/lib/libpam/modules/pam_rootok/Makefile.depend
new file mode 100644
index 0000000..7cedd5f
--- /dev/null
+++ b/lib/libpam/modules/pam_rootok/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_securetty/Makefile.depend b/lib/libpam/modules/pam_securetty/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libpam/modules/pam_securetty/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_self/Makefile.depend b/lib/libpam/modules/pam_self/Makefile.depend
new file mode 100644
index 0000000..7cedd5f
--- /dev/null
+++ b/lib/libpam/modules/pam_self/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_ssh/Makefile b/lib/libpam/modules/pam_ssh/Makefile
index b5ca478..5643f32 100644
--- a/lib/libpam/modules/pam_ssh/Makefile
+++ b/lib/libpam/modules/pam_ssh/Makefile
@@ -13,7 +13,9 @@ SRCS+= roaming_dummy.c
WARNS?= 3
CFLAGS+= -I${SSHDIR} -include ssh_namespace.h
-LIBADD= ssh
+DPADD= ${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT}
+LDADD= ${LDSSH} -lcrypto -lcrypt
+USEPRIVATELIB= ssh
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_ssh/Makefile.depend b/lib/libpam/modules/pam_ssh/Makefile.depend
new file mode 100644
index 0000000..e46aac4
--- /dev/null
+++ b/lib/libpam/modules/pam_ssh/Makefile.depend
@@ -0,0 +1,26 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libcrypt \
+ lib/libpam/libpam \
+ lib/libutil \
+ secure/lib/libcrypto \
+ secure/lib/libssh \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_tacplus/Makefile b/lib/libpam/modules/pam_tacplus/Makefile
index 5d2a3f3..053812a 100644
--- a/lib/libpam/modules/pam_tacplus/Makefile
+++ b/lib/libpam/modules/pam_tacplus/Makefile
@@ -28,6 +28,7 @@ LIB= pam_tacplus
SRCS= pam_tacplus.c
MAN= pam_tacplus.8
-LIBADD+= tacplus
+DPADD= ${LIBTACPLUS}
+LDADD= -ltacplus
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_tacplus/Makefile.depend b/lib/libpam/modules/pam_tacplus/Makefile.depend
new file mode 100644
index 0000000..c3edc9b
--- /dev/null
+++ b/lib/libpam/modules/pam_tacplus/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libpam/libpam \
+ lib/libtacplus \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/modules/pam_unix/Makefile b/lib/libpam/modules/pam_unix/Makefile
index 5330ae4..ea9e639 100644
--- a/lib/libpam/modules/pam_unix/Makefile
+++ b/lib/libpam/modules/pam_unix/Makefile
@@ -41,11 +41,13 @@ LIB= pam_unix
SRCS= pam_unix.c
MAN= pam_unix.8
-LIBADD+= util crypt
+DPADD+= ${LIBUTIL} ${LIBCRYPT}
+LDADD+= -lutil -lcrypt
.if ${MK_NIS} != "no"
CFLAGS+= -DYP
-LIBADD+= ypclnt
+DPADD+= ${LIBYPCLNT}
+LDADD+= -lypclnt
.endif
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_unix/Makefile.depend b/lib/libpam/modules/pam_unix/Makefile.depend
new file mode 100644
index 0000000..47a9e7e
--- /dev/null
+++ b/lib/libpam/modules/pam_unix/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libcrypt \
+ lib/libpam/libpam \
+ lib/libutil \
+ lib/libypclnt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpam/static_modules/Makefile b/lib/libpam/static_modules/Makefile
new file mode 100644
index 0000000..07a6c69
--- /dev/null
+++ b/lib/libpam/static_modules/Makefile
@@ -0,0 +1,72 @@
+#-
+# Copyright (c) 1998, 2013 Juniper Networks, Inc.
+# All rights reserved.
+# Copyright (c) 2002 Networks Associates Technology, Inc.
+# All rights reserved.
+#
+# Portions of this software was developed for the FreeBSD Project by
+# ThinkSec AS and NAI Labs, the Security Research Division of Network
+# Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
+# ("CBOSS"), as part of the DARPA CHATS research program.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must 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$
+
+OPENPAM= ${.CURDIR:H:H:H}/contrib/openpam
+.PATH: ${OPENPAM}/lib
+.PATH: ${OPENPAM}/lib/libpam
+
+all:
+
+SRCS = openpam_static.c
+
+NO_PROFILE=
+NO_MAN=
+
+#
+# Static modules
+#
+# We build static versions of all modules and of openpam_static.o,
+# then link them all together into openpam_static_modules.o. None of
+# the modules export any symbols, but they store structures with
+# pointers to their service functions in a linker set which the code
+# in openpam_static.c traverses to locate the individual modules.
+#
+MODULE_DIR= ../modules
+.include "${.CURDIR}/${MODULE_DIR}/modules.inc"
+STATIC_MODULES= ${MODULES:C/.*/${MODULE_DIR}\/&\/lib&.a/}
+STATICOBJS+= openpam_static_modules.o
+CLEANFILES+= openpam_static.o \
+ openpam_static_modules.o
+
+openpam_static_modules.o: openpam_static.o ${STATIC_MODULES}
+ ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC}
+
+.include <bsd.prog.mk>
+
+.if empty(_SKIP_BUILD)
+all: ${STATICOBJS}
+.endif
diff --git a/lib/libpam/static_modules/Makefile.depend b/lib/libpam/static_modules/Makefile.depend
new file mode 100644
index 0000000..fc4eb35
--- /dev/null
+++ b/lib/libpam/static_modules/Makefile.depend
@@ -0,0 +1,41 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DEP_MACHINE := ${.PARSEFILE:E}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libpam/libpam \
+ lib/libpam/modules/pam_chroot \
+ lib/libpam/modules/pam_deny \
+ lib/libpam/modules/pam_echo \
+ lib/libpam/modules/pam_exec \
+ lib/libpam/modules/pam_ftpusers \
+ lib/libpam/modules/pam_group \
+ lib/libpam/modules/pam_guest \
+ lib/libpam/modules/pam_krb5 \
+ lib/libpam/modules/pam_ksu \
+ lib/libpam/modules/pam_lastlog \
+ lib/libpam/modules/pam_login_access \
+ lib/libpam/modules/pam_nologin \
+ lib/libpam/modules/pam_opie \
+ lib/libpam/modules/pam_opieaccess \
+ lib/libpam/modules/pam_passwdqc \
+ lib/libpam/modules/pam_permit \
+ lib/libpam/modules/pam_radius \
+ lib/libpam/modules/pam_rhosts \
+ lib/libpam/modules/pam_rootok \
+ lib/libpam/modules/pam_securetty \
+ lib/libpam/modules/pam_self \
+ lib/libpam/modules/pam_ssh \
+ lib/libpam/modules/pam_tacplus \
+ lib/libpam/modules/pam_unix \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpcap/Makefile b/lib/libpcap/Makefile
index c36b3ef..11d7f73 100644
--- a/lib/libpcap/Makefile
+++ b/lib/libpcap/Makefile
@@ -40,7 +40,6 @@ MAN= pcap.3 \
pcap_findalldevs.3 \
pcap_freecode.3 \
pcap_get_selectable_fd.3 \
- pcap_get_tstamp_precision.3 \
pcap_geterr.3 \
pcap_inject.3 \
pcap_is_swapped.3 \
@@ -58,12 +57,10 @@ MAN= pcap.3 \
pcap_open_offline.3 \
pcap_set_buffer_size.3 \
pcap_set_datalink.3 \
- pcap_set_immediate_mode.3 \
pcap_set_promisc.3 \
pcap_set_rfmon.3 \
pcap_set_snaplen.3 \
pcap_set_timeout.3 \
- pcap_set_tstamp_precision.3 \
pcap_set_tstamp_type.3 \
pcap_setdirection.3 \
pcap_setfilter.3 \
diff --git a/lib/libpcap/Makefile.depend b/lib/libpcap/Makefile.depend
new file mode 100644
index 0000000..c3f153b
--- /dev/null
+++ b/lib/libpcap/Makefile.depend
@@ -0,0 +1,36 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+grammar.So: grammar.c
+grammar.o: grammar.c
+grammar.po: grammar.c
+pcap.So: version.h
+pcap.o: version.h
+pcap.po: version.h
+scanner.So: scanner.c
+scanner.So: tokdefs.h
+scanner.o: scanner.c
+scanner.o: tokdefs.h
+scanner.po: scanner.c
+scanner.po: tokdefs.h
+version.So: version.c
+version.o: version.c
+version.po: version.c
+.endif
diff --git a/lib/libpcap/config.h b/lib/libpcap/config.h
index 4033b27..60cb448 100644
--- a/lib/libpcap/config.h
+++ b/lib/libpcap/config.h
@@ -227,13 +227,13 @@
/* #undef LINUX_USB_MON_DEV */
/* if we need a pcap_parse wrapper around yyparse */
-#define NEED_YYPARSE_WRAPPER 1
+#define NEED_YYPARSE_WRAPPER
/* Define to 1 if netinet/ether.h declares `ether_hostton' */
/* #undef NETINET_ETHER_H_DECLARES_ETHER_HOSTTON */
/* Define to 1 if netinet/if_ether.h declares `ether_hostton' */
-#define NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON /**/
+#define NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON
/* do not use protochain */
/* #undef NO_PROTOCHAIN */
@@ -250,9 +250,6 @@
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
-/* Define to the home page for this package. */
-#define PACKAGE_URL ""
-
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
@@ -262,18 +259,12 @@
/* target host supports Bluetooth sniffing */
/* #undef PCAP_SUPPORT_BT */
-/* target host supports Bluetooth Monitor */
-/* #undef PCAP_SUPPORT_BT_MONITOR */
-
/* target host supports CAN sniffing */
/* #undef PCAP_SUPPORT_CAN */
/* target host supports canusb */
/* #undef PCAP_SUPPORT_CANUSB */
-/* support D-Bus sniffing */
-/* #undef PCAP_SUPPORT_DBUS */
-
/* target host supports netfilter sniffing */
/* #undef PCAP_SUPPORT_NETFILTER */
@@ -295,14 +286,12 @@
/* Enable parser debugging */
/* #undef YYDEBUG */
-/* Enable large inode numbers on Mac OS X 10.5. */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
+/* needed on HP-UX */
+/* #undef _HPUX_SOURCE */
+
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
/* #undef _LARGEFILE_SOURCE */
@@ -312,9 +301,6 @@
/* define on AIX to get certain functions */
/* #undef _SUN */
-/* define if your compiler allows __attribute__((format)) without a warning */
-#define __ATTRIBUTE___FORMAT_OK 1
-
/* to handle Ultrix compilers that don't support const in prototypes */
/* #undef const */
diff --git a/lib/libpjdlog/Makefile b/lib/libpjdlog/Makefile
index e44f53b..a80b629 100644
--- a/lib/libpjdlog/Makefile
+++ b/lib/libpjdlog/Makefile
@@ -13,7 +13,8 @@ SHLIB_MAJOR= 0
CFLAGS+=-I${.CURDIR}
-LIBADD= util
+DPADD= ${LIBUTIL}
+LDADD= -lutil
WARNS?= 6
diff --git a/lib/libpmc/Makefile.depend b/lib/libpmc/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libpmc/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c
index d9d7902..5282bb2 100644
--- a/lib/libpmc/libpmc.c
+++ b/lib/libpmc/libpmc.c
@@ -74,18 +74,10 @@ static int p6_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
static int tsc_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
struct pmc_op_pmcallocate *_pmc_config);
#endif
-#if defined(__arm__)
#if defined(__XSCALE__)
static int xscale_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
struct pmc_op_pmcallocate *_pmc_config);
#endif
-static int armv7_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
- struct pmc_op_pmcallocate *_pmc_config);
-#endif
-#if defined(__aarch64__)
-static int arm64_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
- struct pmc_op_pmcallocate *_pmc_config);
-#endif
#if defined(__mips__)
static int mips_allocate_pmc(enum pmc_event _pe, char* ctrspec,
struct pmc_op_pmcallocate *_pmc_config);
@@ -161,15 +153,11 @@ PMC_CLASSDEP_TABLE(p4, P4);
PMC_CLASSDEP_TABLE(p5, P5);
PMC_CLASSDEP_TABLE(p6, P6);
PMC_CLASSDEP_TABLE(xscale, XSCALE);
-PMC_CLASSDEP_TABLE(armv7, ARMV7);
-PMC_CLASSDEP_TABLE(armv8, ARMV8);
PMC_CLASSDEP_TABLE(mips24k, MIPS24K);
-PMC_CLASSDEP_TABLE(mips74k, MIPS74K);
PMC_CLASSDEP_TABLE(octeon, OCTEON);
PMC_CLASSDEP_TABLE(ucf, UCF);
PMC_CLASSDEP_TABLE(ppc7450, PPC7450);
PMC_CLASSDEP_TABLE(ppc970, PPC970);
-PMC_CLASSDEP_TABLE(e500, E500);
static struct pmc_event_descr soft_event_table[PMC_EV_DYN_COUNT];
@@ -212,12 +200,6 @@ static const struct pmc_event_descr haswell_event_table[] =
__PMC_EV_ALIAS_HASWELL()
};
-static const struct pmc_event_descr haswell_xeon_event_table[] =
-{
- __PMC_EV_ALIAS_HASWELL_XEON()
-};
-
-
static const struct pmc_event_descr ivybridge_event_table[] =
{
__PMC_EV_ALIAS_IVYBRIDGE()
@@ -268,16 +250,6 @@ static const struct pmc_event_descr westmereuc_event_table[] =
__PMC_EV_ALIAS_WESTMEREUC()
};
-static const struct pmc_event_descr cortex_a53_event_table[] =
-{
- __PMC_EV_ALIAS_ARMV8_CORTEX_A53()
-};
-
-static const struct pmc_event_descr cortex_a57_event_table[] =
-{
- __PMC_EV_ALIAS_ARMV8_CORTEX_A57()
-};
-
/*
* PMC_MDEP_TABLE(NAME, PRIMARYCLASS, ADDITIONAL_CLASSES...)
*
@@ -295,7 +267,6 @@ PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC);
PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
PMC_MDEP_TABLE(nehalem_ex, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC);
PMC_MDEP_TABLE(haswell, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
-PMC_MDEP_TABLE(haswell_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC);
PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC);
PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
@@ -308,15 +279,10 @@ PMC_MDEP_TABLE(p4, P4, PMC_CLASS_SOFT, PMC_CLASS_TSC);
PMC_MDEP_TABLE(p5, P5, PMC_CLASS_SOFT, PMC_CLASS_TSC);
PMC_MDEP_TABLE(p6, P6, PMC_CLASS_SOFT, PMC_CLASS_TSC);
PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS_SOFT, PMC_CLASS_XSCALE);
-PMC_MDEP_TABLE(armv7, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7);
-PMC_MDEP_TABLE(cortex_a53, ARMV8, PMC_CLASS_SOFT, PMC_CLASS_ARMV8);
-PMC_MDEP_TABLE(cortex_a57, ARMV8, PMC_CLASS_SOFT, PMC_CLASS_ARMV8);
PMC_MDEP_TABLE(mips24k, MIPS24K, PMC_CLASS_SOFT, PMC_CLASS_MIPS24K);
-PMC_MDEP_TABLE(mips74k, MIPS74K, PMC_CLASS_SOFT, PMC_CLASS_MIPS74K);
PMC_MDEP_TABLE(octeon, OCTEON, PMC_CLASS_SOFT, PMC_CLASS_OCTEON);
-PMC_MDEP_TABLE(ppc7450, PPC7450, PMC_CLASS_SOFT, PMC_CLASS_PPC7450, PMC_CLASS_TSC);
-PMC_MDEP_TABLE(ppc970, PPC970, PMC_CLASS_SOFT, PMC_CLASS_PPC970, PMC_CLASS_TSC);
-PMC_MDEP_TABLE(e500, E500, PMC_CLASS_SOFT, PMC_CLASS_E500, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(ppc7450, PPC7450, PMC_CLASS_SOFT, PMC_CLASS_PPC7450);
+PMC_MDEP_TABLE(ppc970, PPC970, PMC_CLASS_SOFT, PMC_CLASS_PPC970);
PMC_MDEP_TABLE(generic, SOFT, PMC_CLASS_SOFT);
static const struct pmc_event_descr tsc_event_table[] =
@@ -346,7 +312,6 @@ PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap);
PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap);
PMC_CLASS_TABLE_DESC(nehalem_ex, IAP, nehalem_ex, iap);
PMC_CLASS_TABLE_DESC(haswell, IAP, haswell, iap);
-PMC_CLASS_TABLE_DESC(haswell_xeon, IAP, haswell_xeon, iap);
PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap);
PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap);
PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap);
@@ -373,25 +338,16 @@ PMC_CLASS_TABLE_DESC(p6, P6, p6, p6);
#if defined(__i386__) || defined(__amd64__)
PMC_CLASS_TABLE_DESC(tsc, TSC, tsc, tsc);
#endif
-#if defined(__arm__)
#if defined(__XSCALE__)
PMC_CLASS_TABLE_DESC(xscale, XSCALE, xscale, xscale);
#endif
-PMC_CLASS_TABLE_DESC(armv7, ARMV7, armv7, armv7);
-#endif
-#if defined(__aarch64__)
-PMC_CLASS_TABLE_DESC(cortex_a53, ARMV8, cortex_a53, arm64);
-PMC_CLASS_TABLE_DESC(cortex_a57, ARMV8, cortex_a57, arm64);
-#endif
#if defined(__mips__)
PMC_CLASS_TABLE_DESC(mips24k, MIPS24K, mips24k, mips);
-PMC_CLASS_TABLE_DESC(mips74k, MIPS74K, mips74k, mips);
PMC_CLASS_TABLE_DESC(octeon, OCTEON, octeon, mips);
#endif /* __mips__ */
#if defined(__powerpc__)
PMC_CLASS_TABLE_DESC(ppc7450, PPC7450, ppc7450, powerpc);
PMC_CLASS_TABLE_DESC(ppc970, PPC970, ppc970, powerpc);
-PMC_CLASS_TABLE_DESC(e500, E500, e500, powerpc);
#endif
static struct pmc_class_descr soft_class_table_descr =
@@ -423,14 +379,9 @@ static const char * pmc_capability_names[] = {
__PMC_CAPS()
};
-struct pmc_class_map {
- enum pmc_class pm_class;
- const char *pm_name;
-};
-
-static const struct pmc_class_map pmc_class_names[] = {
+static const char * pmc_class_names[] = {
#undef __PMC_CLASS
-#define __PMC_CLASS(S,V,D) { .pm_class = PMC_CLASS_##S, .pm_name = #S } ,
+#define __PMC_CLASS(C) #C ,
__PMC_CLASSES()
};
@@ -675,8 +626,6 @@ static struct pmc_event_alias core2_aliases_without_iaf[] = {
#define nehalem_ex_aliases_without_iaf core2_aliases_without_iaf
#define haswell_aliases core2_aliases
#define haswell_aliases_without_iaf core2_aliases_without_iaf
-#define haswell_xeon_aliases core2_aliases
-#define haswell_xeon_aliases_without_iaf core2_aliases_without_iaf
#define ivybridge_aliases core2_aliases
#define ivybridge_aliases_without_iaf core2_aliases_without_iaf
#define ivybridge_xeon_aliases core2_aliases
@@ -947,8 +896,7 @@ iap_allocate_pmc(enum pmc_event pe, char *ctrspec,
n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, &rsp);
} else
return (-1);
- } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_HASWELL ||
- cpu_info.pm_cputype == PMC_CPU_INTEL_HASWELL_XEON) {
+ } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_HASWELL) {
if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) {
n = pmc_parse_mask(iap_rsp_mask_haswell, p, &rsp);
} else
@@ -2412,7 +2360,6 @@ soft_allocate_pmc(enum pmc_event pe, char *ctrspec,
return (0);
}
-#if defined(__arm__)
#if defined(__XSCALE__)
static struct pmc_event_alias xscale_aliases[] = {
@@ -2436,45 +2383,6 @@ xscale_allocate_pmc(enum pmc_event pe, char *ctrspec __unused,
}
#endif
-static struct pmc_event_alias armv7_aliases[] = {
- EV_ALIAS("dc-misses", "L1_DCACHE_REFILL"),
- EV_ALIAS("ic-misses", "L1_ICACHE_REFILL"),
- EV_ALIAS("instructions", "INSTR_EXECUTED"),
- EV_ALIAS(NULL, NULL)
-};
-static int
-armv7_allocate_pmc(enum pmc_event pe, char *ctrspec __unused,
- struct pmc_op_pmcallocate *pmc_config __unused)
-{
- switch (pe) {
- default:
- break;
- }
-
- return (0);
-}
-#endif
-
-#if defined(__aarch64__)
-static struct pmc_event_alias cortex_a53_aliases[] = {
- EV_ALIAS(NULL, NULL)
-};
-static struct pmc_event_alias cortex_a57_aliases[] = {
- EV_ALIAS(NULL, NULL)
-};
-static int
-arm64_allocate_pmc(enum pmc_event pe, char *ctrspec __unused,
- struct pmc_op_pmcallocate *pmc_config __unused)
-{
- switch (pe) {
- default:
- break;
- }
-
- return (0);
-}
-#endif
-
#if defined(__mips__)
static struct pmc_event_alias mips24k_aliases[] = {
@@ -2484,13 +2392,6 @@ static struct pmc_event_alias mips24k_aliases[] = {
EV_ALIAS(NULL, NULL)
};
-static struct pmc_event_alias mips74k_aliases[] = {
- EV_ALIAS("instructions", "INSTR_EXECUTED"),
- EV_ALIAS("branches", "BRANCH_INSNS"),
- EV_ALIAS("branch-mispredicts", "MISPREDICTED_BRANCH_INSNS"),
- EV_ALIAS(NULL, NULL)
-};
-
static struct pmc_event_alias octeon_aliases[] = {
EV_ALIAS("instructions", "RET"),
EV_ALIAS("branches", "BR"),
@@ -2543,12 +2444,6 @@ static struct pmc_event_alias ppc970_aliases[] = {
EV_ALIAS(NULL, NULL)
};
-static struct pmc_event_alias e500_aliases[] = {
- EV_ALIAS("instructions", "INSTR_COMPLETED"),
- EV_ALIAS("cycles", "CYCLES"),
- EV_ALIAS(NULL, NULL)
-};
-
#define POWERPC_KW_OS "os"
#define POWERPC_KW_USR "usr"
#define POWERPC_KW_ANYTHREAD "anythread"
@@ -2893,10 +2788,6 @@ pmc_event_names_of_class(enum pmc_class cl, const char ***eventnames,
ev = haswell_event_table;
count = PMC_EVENT_TABLE_SIZE(haswell);
break;
- case PMC_CPU_INTEL_HASWELL_XEON:
- ev = haswell_xeon_event_table;
- count = PMC_EVENT_TABLE_SIZE(haswell_xeon);
- break;
case PMC_CPU_INTEL_IVYBRIDGE:
ev = ivybridge_event_table;
count = PMC_EVENT_TABLE_SIZE(ivybridge);
@@ -2980,31 +2871,10 @@ pmc_event_names_of_class(enum pmc_class cl, const char ***eventnames,
ev = xscale_event_table;
count = PMC_EVENT_TABLE_SIZE(xscale);
break;
- case PMC_CLASS_ARMV7:
- ev = armv7_event_table;
- count = PMC_EVENT_TABLE_SIZE(armv7);
- break;
- case PMC_CLASS_ARMV8:
- switch (cpu_info.pm_cputype) {
- default:
- case PMC_CPU_ARMV8_CORTEX_A53:
- ev = cortex_a53_event_table;
- count = PMC_EVENT_TABLE_SIZE(cortex_a53);
- break;
- case PMC_CPU_ARMV8_CORTEX_A57:
- ev = cortex_a57_event_table;
- count = PMC_EVENT_TABLE_SIZE(cortex_a57);
- break;
- }
- break;
case PMC_CLASS_MIPS24K:
ev = mips24k_event_table;
count = PMC_EVENT_TABLE_SIZE(mips24k);
break;
- case PMC_CLASS_MIPS74K:
- ev = mips74k_event_table;
- count = PMC_EVENT_TABLE_SIZE(mips74k);
- break;
case PMC_CLASS_OCTEON:
ev = octeon_event_table;
count = PMC_EVENT_TABLE_SIZE(octeon);
@@ -3017,10 +2887,6 @@ pmc_event_names_of_class(enum pmc_class cl, const char ***eventnames,
ev = ppc970_event_table;
count = PMC_EVENT_TABLE_SIZE(ppc970);
break;
- case PMC_CLASS_E500:
- ev = e500_event_table;
- count = PMC_EVENT_TABLE_SIZE(e500);
- break;
case PMC_CLASS_SOFT:
ev = soft_event_table;
count = soft_event_info.pm_nevent;
@@ -3249,9 +3115,6 @@ pmc_init(void)
pmc_class_table[n++] = &haswelluc_class_table_descr;
PMC_MDEP_INIT_INTEL_V2(haswell);
break;
- case PMC_CPU_INTEL_HASWELL_XEON:
- PMC_MDEP_INIT_INTEL_V2(haswell_xeon);
- break;
case PMC_CPU_INTEL_IVYBRIDGE:
PMC_MDEP_INIT_INTEL_V2(ivybridge);
break;
@@ -3282,37 +3145,17 @@ pmc_init(void)
case PMC_CPU_GENERIC:
PMC_MDEP_INIT(generic);
break;
-#if defined(__arm__)
#if defined(__XSCALE__)
case PMC_CPU_INTEL_XSCALE:
PMC_MDEP_INIT(xscale);
pmc_class_table[n] = &xscale_class_table_descr;
break;
#endif
- case PMC_CPU_ARMV7:
- PMC_MDEP_INIT(armv7);
- pmc_class_table[n] = &armv7_class_table_descr;
- break;
-#endif
-#if defined(__aarch64__)
- case PMC_CPU_ARMV8_CORTEX_A53:
- PMC_MDEP_INIT(cortex_a53);
- pmc_class_table[n] = &cortex_a53_class_table_descr;
- break;
- case PMC_CPU_ARMV8_CORTEX_A57:
- PMC_MDEP_INIT(cortex_a57);
- pmc_class_table[n] = &cortex_a57_class_table_descr;
- break;
-#endif
#if defined(__mips__)
case PMC_CPU_MIPS_24K:
PMC_MDEP_INIT(mips24k);
pmc_class_table[n] = &mips24k_class_table_descr;
break;
- case PMC_CPU_MIPS_74K:
- PMC_MDEP_INIT(mips74k);
- pmc_class_table[n] = &mips74k_class_table_descr;
- break;
case PMC_CPU_MIPS_OCTEON:
PMC_MDEP_INIT(octeon);
pmc_class_table[n] = &octeon_class_table_descr;
@@ -3327,10 +3170,6 @@ pmc_init(void)
PMC_MDEP_INIT(ppc970);
pmc_class_table[n] = &ppc970_class_table_descr;
break;
- case PMC_CPU_PPC_E500:
- PMC_MDEP_INIT(e500);
- pmc_class_table[n] = &e500_class_table_descr;
- break;
#endif
default:
/*
@@ -3367,11 +3206,9 @@ pmc_name_of_capability(enum pmc_caps cap)
const char *
pmc_name_of_class(enum pmc_class pc)
{
- size_t n;
-
- for (n = 0; n < PMC_TABLE_SIZE(pmc_class_names); n++)
- if (pc == pmc_class_names[n].pm_class)
- return (pmc_class_names[n].pm_name);
+ if ((int) pc >= PMC_CLASS_FIRST &&
+ pc <= PMC_CLASS_LAST)
+ return (pmc_class_names[pc]);
errno = EINVAL;
return (NULL);
@@ -3443,11 +3280,6 @@ _pmc_name_of_event(enum pmc_event pe, enum pmc_cputype cpu)
ev = haswell_event_table;
evfence = haswell_event_table + PMC_EVENT_TABLE_SIZE(haswell);
break;
- case PMC_CPU_INTEL_HASWELL_XEON:
- ev = haswell_xeon_event_table;
- evfence = haswell_xeon_event_table + PMC_EVENT_TABLE_SIZE(haswell_xeon);
- break;
-
case PMC_CPU_INTEL_IVYBRIDGE:
ev = ivybridge_event_table;
evfence = ivybridge_event_table + PMC_EVENT_TABLE_SIZE(ivybridge);
@@ -3514,28 +3346,9 @@ _pmc_name_of_event(enum pmc_event pe, enum pmc_cputype cpu)
} else if (pe >= PMC_EV_XSCALE_FIRST && pe <= PMC_EV_XSCALE_LAST) {
ev = xscale_event_table;
evfence = xscale_event_table + PMC_EVENT_TABLE_SIZE(xscale);
- } else if (pe >= PMC_EV_ARMV7_FIRST && pe <= PMC_EV_ARMV7_LAST) {
- ev = armv7_event_table;
- evfence = armv7_event_table + PMC_EVENT_TABLE_SIZE(armv7);
- } else if (pe >= PMC_EV_ARMV8_FIRST && pe <= PMC_EV_ARMV8_LAST) {
- switch (cpu) {
- case PMC_CPU_ARMV8_CORTEX_A53:
- ev = cortex_a53_event_table;
- evfence = cortex_a53_event_table + PMC_EVENT_TABLE_SIZE(cortex_a53);
- break;
- case PMC_CPU_ARMV8_CORTEX_A57:
- ev = cortex_a57_event_table;
- evfence = cortex_a57_event_table + PMC_EVENT_TABLE_SIZE(cortex_a57);
- break;
- default: /* Unknown CPU type. */
- break;
- }
} else if (pe >= PMC_EV_MIPS24K_FIRST && pe <= PMC_EV_MIPS24K_LAST) {
ev = mips24k_event_table;
evfence = mips24k_event_table + PMC_EVENT_TABLE_SIZE(mips24k);
- } else if (pe >= PMC_EV_MIPS74K_FIRST && pe <= PMC_EV_MIPS74K_LAST) {
- ev = mips74k_event_table;
- evfence = mips74k_event_table + PMC_EVENT_TABLE_SIZE(mips74k);
} else if (pe >= PMC_EV_OCTEON_FIRST && pe <= PMC_EV_OCTEON_LAST) {
ev = octeon_event_table;
evfence = octeon_event_table + PMC_EVENT_TABLE_SIZE(octeon);
@@ -3545,9 +3358,6 @@ _pmc_name_of_event(enum pmc_event pe, enum pmc_cputype cpu)
} else if (pe >= PMC_EV_PPC970_FIRST && pe <= PMC_EV_PPC970_LAST) {
ev = ppc970_event_table;
evfence = ppc970_event_table + PMC_EVENT_TABLE_SIZE(ppc970);
- } else if (pe >= PMC_EV_E500_FIRST && pe <= PMC_EV_E500_LAST) {
- ev = e500_event_table;
- evfence = e500_event_table + PMC_EVENT_TABLE_SIZE(e500);
} else if (pe == PMC_EV_TSC_TSC) {
ev = tsc_event_table;
evfence = tsc_event_table + PMC_EVENT_TABLE_SIZE(tsc);
diff --git a/lib/libpmc/pmc.3 b/lib/libpmc/pmc.3
index f51285e..8e6db48 100644
--- a/lib/libpmc/pmc.3
+++ b/lib/libpmc/pmc.3
@@ -527,7 +527,6 @@ API is
.Xr pmc.core2 3 ,
.Xr pmc.haswell 3 ,
.Xr pmc.haswelluc 3 ,
-.Xr pmc.haswellxeon 3 ,
.Xr pmc.iaf 3 ,
.Xr pmc.ivybridge 3 ,
.Xr pmc.ivybridgexeon 3 ,
diff --git a/lib/libpmc/pmc.corei7.3 b/lib/libpmc/pmc.corei7.3
index ec31054..90d19df 100644
--- a/lib/libpmc/pmc.corei7.3
+++ b/lib/libpmc/pmc.corei7.3
@@ -1549,18 +1549,18 @@ Counts number of segment register loads.
.Xr pmc 3 ,
.Xr pmc.atom 3 ,
.Xr pmc.core 3 ,
-.Xr pmc.corei7uc 3 ,
.Xr pmc.iaf 3 ,
+.Xr pmc.ucf 3 ,
.Xr pmc.k7 3 ,
.Xr pmc.k8 3 ,
.Xr pmc.p4 3 ,
.Xr pmc.p5 3 ,
.Xr pmc.p6 3 ,
-.Xr pmc.soft 3 ,
-.Xr pmc.tsc 3 ,
-.Xr pmc.ucf 3 ,
+.Xr pmc.corei7uc 3 ,
.Xr pmc.westmere 3 ,
.Xr pmc.westmereuc 3 ,
+.Xr pmc.soft 3 ,
+.Xr pmc.tsc 3 ,
.Xr pmc_cpuinfo 3 ,
.Xr pmclog 3 ,
.Xr hwpmc 4
diff --git a/lib/libpmc/pmc.corei7uc.3 b/lib/libpmc/pmc.corei7uc.3
index 3bcda1c..5b99113 100644
--- a/lib/libpmc/pmc.corei7uc.3
+++ b/lib/libpmc/pmc.corei7uc.3
@@ -853,18 +853,18 @@ refreshed or needs to go into a power down mode.
.Xr pmc 3 ,
.Xr pmc.atom 3 ,
.Xr pmc.core 3 ,
-.Xr pmc.corei7 3 ,
.Xr pmc.iaf 3 ,
+.Xr pmc.ucf 3 ,
.Xr pmc.k7 3 ,
.Xr pmc.k8 3 ,
.Xr pmc.p4 3 ,
.Xr pmc.p5 3 ,
.Xr pmc.p6 3 ,
-.Xr pmc.soft 3 ,
-.Xr pmc.tsc 3 ,
-.Xr pmc.ucf 3 ,
+.Xr pmc.corei7 3 ,
.Xr pmc.westmere 3 ,
.Xr pmc.westmereuc 3 ,
+.Xr pmc.soft 3 ,
+.Xr pmc.tsc 3 ,
.Xr pmc_cpuinfo 3 ,
.Xr pmclog 3 ,
.Xr hwpmc 4
diff --git a/lib/libpmc/pmc.haswell.3 b/lib/libpmc/pmc.haswell.3
index a85f760..ace9c2a 100644
--- a/lib/libpmc/pmc.haswell.3
+++ b/lib/libpmc/pmc.haswell.3
@@ -529,60 +529,73 @@ instruction.
.It Li ILD_STALL.IQ_FULL
.Pq Event 87H , Umask 04H
Stall cycles due to IQ is full.
-.It Li BR_INST_EXEC.NONTAKEN_COND
-.Pq Event 88H , Umask 41H
-Count conditional near branch instructions that were executed (but not
-necessarily retired) and not taken.
-.It Li BR_INST_EXEC.TAKEN_COND
-.Pq Event 88H , Umask 81H
-Count conditional near branch instructions that were executed (but not
-necessarily retired) and taken.
+.It Li BR_INST_EXEC.COND
+.Pq Event 88H , Umask 01H
+Qualify conditional near branch instructions
+executed, but not necessarily retired.
.It Li BR_INST_EXEC.DIRECT_JMP
-.Pq Event 88H , Umask 82H
-Count all unconditional near branch instructions excluding calls and
-indirect branches.
+.Pq Event 88H , Umask 02H
+Qualify all unconditional near branch instructions
+excluding calls and indirect branches.
.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET
-.Pq Event 88H , Umask 84H
-Count executed indirect near branch instructions that are not calls nor
-returns.
+.Pq Event 88H , Umask 04H
+Qualify executed indirect near branch instructions
+that are not calls nor returns.
.It Li BR_INST_EXEC.RETURN_NEAR
-.Pq Event 88H , Umask 88H
-Count indirect near branches that have a return mnemonic.
+.Pq Event 88H , Umask 08H
+Qualify indirect near branches that have a return
+mnemonic.
.It Li BR_INST_EXEC.DIRECT_NEAR_CALL
-.Pq Event 88H , Umask 90H
-Count unconditional near call branch instructions, excluding non call
-branch, executed.
+.Pq Event 88H , Umask 10H
+Qualify unconditional near call branch instructions,
+excluding non call branch, executed.
.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL
-.Pq Event 88H , Umask A0H
-Count indirect near calls, including both register and memory indirect,
-executed.
+.Pq Event 88H , Umask 20H
+Qualify indirect near calls, including both register and
+memory indirect, executed.
+.It Li BR_INST_EXEC.NONTAKEN
+.Pq Event 88H , Umask 40H
+Qualify non-taken near branches executed.
+.It Li BR_INST_EXEC.TAKEN
+.Pq Event 88H , Umask 80H
+Qualify taken near branches executed. Must combine
+with 01H,02H, 04H, 08H, 10H, 20H.
.It Li BR_INST_EXEC.ALL_BRANCHES
.Pq Event 88H , Umask FFH
-Counts all near executed branches (not necessarily retired).
-.It Li BR_MISP_EXEC.NONTAKEN_COND
-.Pq Event 89H , Umask 41H
-Count conditional near branch instructions mispredicted as nontaken.
-.It Li BR_MISP_EXEC.TAKEN_COND
-.Pq Event 89H , Umask 81H
-Count conditional near branch instructions mispredicted as taken.
+Counts all near executed branches (not necessarily
+retired).
+.It Li BR_MISP_EXEC.COND
+.Pq Event 89H , Umask 01H
+Qualify conditional near branch instructions
+mispredicted.
.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET
-.Pq Event 89H , Umask 84H
-Count mispredicted indirect near branch instructions that are not calls
-nor returns.
+.Pq Event 89H , Umask 04H
+Qualify mispredicted indirect near branch
+instructions that are not calls nor returns.
.It Li BR_MISP_EXEC.RETURN_NEAR
-.Pq Event 89H , Umask 88H
-Count mispredicted indirect near branches that have a return mnemonic.
+.Pq Event 89H , Umask 08H
+Qualify mispredicted indirect near branches that
+have a return mnemonic.
.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL
-.Pq Event 89H , Umask 90H
-Count mispredicted unconditional near call branch instructions, excluding
-non call branch, executed.
+.Pq Event 89H , Umask 10H
+Qualify mispredicted unconditional near call branch
+instructions, excluding non call branch, executed.
.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL
-.Pq Event 89H , Umask A0H
-Count mispredicted indirect near calls, including both register and memory
-indirect, executed.
+.Pq Event 89H , Umask 20H
+Qualify mispredicted indirect near calls, including
+both register and memory indirect, executed.
+.It Li BR_MISP_EXEC.NONTAKEN
+.Pq Event 89H , Umask 40H
+Qualify mispredicted non-taken near branches
+executed.
+.It Li BR_MISP_EXEC.TAKEN
+.Pq Event 89H , Umask 80H
+Qualify mispredicted taken near branches executed.
+Must combine with 01H,02H, 04H, 08H, 10H, 20H.
.It Li BR_MISP_EXEC.ALL_BRANCHES
.Pq Event 89H , Umask FFH
-Counts all mispredicted near executed branches (not necessarily retired).
+Counts all near executed branches (not necessarily
+retired).
.It Li IDQ_UOPS_NOT_DELIVERED.CORE
.Pq Event 9CH , Umask 01H
Count number of non-delivered uops to RAT per
@@ -808,24 +821,30 @@ Count cases of saving new LBR records by hardware.
Randomly sampled loads whose latency is above a
user defined threshold. A small fraction of the overall
loads are sampled due to randomization.
-.It Li MEM_UOPS_RETIRED.STLB_MISS_LOADS
-.Pq Event D0H , Umask 11H
-Count retired load uops that missed the STLB.
-.It Li MEM_UOPS_RETIRED.STLB_MISS_STORES
-.Pq Event D0H , Umask 12H
-Count retired store uops that missed the STLB.
-.It Li MEM_UOPS_RETIRED.SPLIT_LOADS
-.Pq Event D0H , Umask 41H
-Count retired load uops that were split across a cache line.
-.It Li MEM_UOPS_RETIRED.SPLIT_STORES
-.Pq Event D0H , Umask 42H
-Count retired store uops that were split across a cache line.
-.It Li MEM_UOPS_RETIRED.ALL_LOADS
-.Pq Event D0H , Umask 81H
-Count all retired load uops.
-.It Li MEM_UOPS_RETIRED.ALL_STORES
-.Pq Event D0H , Umask 82H
-Count all retired store uops.
+.It Li MEM_UOP_RETIRED.LOADS
+.Pq Event D0H , Umask 01H
+Qualify retired memory uops that are loads. Combine Supports PEBS and
+with umask 10H, 20H, 40H, 80H.
+.It Li MEM_UOP_RETIRED.STORES
+.Pq Event D0H , Umask 02H
+Qualify retired memory uops that are stores.
+Combine with umask 10H, 20H, 40H, 80H.
+.It Li MEM_UOP_RETIRED.STLB_MISS
+.Pq Event D0H , Umask 10H
+Qualify retired memory uops with STLB miss. Must
+combine with umask 01H, 02H, to produce counts.
+.It Li MEM_UOP_RETIRED.LOCK
+.Pq Event D0H , Umask 20H
+Qualify retired memory uops with lock. Must combine Supports PEBS and
+with umask 01H, 02H, to produce counts.
+.It Li MEM_UOP_RETIRED.SPLIT
+.Pq Event D0H , Umask 40H
+Qualify retired memory uops with line split. Must
+combine with umask 01H, 02H, to produce counts.
+.It Li MEM_UOP_RETIRED.ALL
+.Pq Event D0H , Umask 80H
+Qualify any retired memory uops. Must combine with Supports PEBS and
+umask 01H, 02H, to produce counts.
.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT
.Pq Event D1H , Umask 01H
Retired load uops with L1 cache hits as data sources.
@@ -917,25 +936,25 @@ Dirty L2 cache lines evicted by demand.
.Xr pmc 3 ,
.Xr pmc.atom 3 ,
.Xr pmc.core 3 ,
-.Xr pmc.corei7 3 ,
-.Xr pmc.corei7uc 3 ,
-.Xr pmc.haswelluc 3 ,
.Xr pmc.iaf 3 ,
-.Xr pmc.ivybridge 3 ,
-.Xr pmc.ivybridgexeon 3 ,
+.Xr pmc.ucf 3 ,
.Xr pmc.k7 3 ,
.Xr pmc.k8 3 ,
.Xr pmc.p4 3 ,
.Xr pmc.p5 3 ,
.Xr pmc.p6 3 ,
+.Xr pmc.corei7 3 ,
+.Xr pmc.corei7uc 3 ,
+.Xr pmc.haswelluc 3 ,
+.Xr pmc.ivybridge 3 ,
+.Xr pmc.ivybridgexeon 3 ,
.Xr pmc.sandybridge 3 ,
.Xr pmc.sandybridgeuc 3 ,
.Xr pmc.sandybridgexeon 3 ,
-.Xr pmc.soft 3 ,
-.Xr pmc.tsc 3 ,
-.Xr pmc.ucf 3 ,
.Xr pmc.westmere 3 ,
.Xr pmc.westmereuc 3 ,
+.Xr pmc.soft 3 ,
+.Xr pmc.tsc 3 ,
.Xr pmc_cpuinfo 3 ,
.Xr pmclog 3 ,
.Xr hwpmc 4
diff --git a/lib/libpmc/pmc.haswellxeon.3 b/lib/libpmc/pmc.haswellxeon.3
deleted file mode 100644
index 7519030..0000000
--- a/lib/libpmc/pmc.haswellxeon.3
+++ /dev/null
@@ -1,956 +0,0 @@
-.\"
-.\" Copyright (c) 2013 Hiren Panchasara <hiren.panchasara@gmail.com>
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must 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 November 21, 2014
-.Dt PMC.HASWELLXEON 3
-.Os
-.Sh NAME
-.Nm pmc.haswellxeon
-.Nd measurement events for
-.Tn Intel
-.Tn Haswell Xeon
-family CPUs
-.Sh LIBRARY
-.Lb libpmc
-.Sh SYNOPSIS
-.In pmc.h
-.Sh DESCRIPTION
-.Tn Intel
-.Tn "Haswell"
-CPUs contain PMCs conforming to version 2 of the
-.Tn Intel
-performance measurement architecture.
-These CPUs may contain up to two classes of PMCs:
-.Bl -tag -width "Li PMC_CLASS_IAP"
-.It Li PMC_CLASS_IAF
-Fixed-function counters that count only one hardware event per counter.
-.It Li PMC_CLASS_IAP
-Programmable counters that may be configured to count one of a defined
-set of hardware events.
-.El
-.Pp
-The number of PMCs available in each class and their widths need to be
-determined at run time by calling
-.Xr pmc_cpuinfo 3 .
-.Pp
-Intel Haswell Xeon PMCs are documented in
-.Rs
-.%B "Intel(R) 64 and IA-32 Architectures Software Developer's Manual"
-.%T "Combined Volumes: 1, 2A, 2B, 2C, 3A, 3B and 3C"
-.%N "Order Number: 325462-052US"
-.%D September 2014
-.%Q "Intel Corporation"
-.Re
-.Ss HASWELL FIXED FUNCTION PMCS
-These PMCs and their supported events are documented in
-.Xr pmc.iaf 3 .
-.Ss HASWELL PROGRAMMABLE PMCS
-The programmable PMCs support the following capabilities:
-.Bl -column "PMC_CAP_INTERRUPT" "Support"
-.It Em Capability Ta Em Support
-.It PMC_CAP_CASCADE Ta \&No
-.It PMC_CAP_EDGE Ta Yes
-.It PMC_CAP_INTERRUPT Ta Yes
-.It PMC_CAP_INVERT Ta Yes
-.It PMC_CAP_READ Ta Yes
-.It PMC_CAP_PRECISE Ta \&No
-.It PMC_CAP_SYSTEM Ta Yes
-.It PMC_CAP_TAGGING Ta \&No
-.It PMC_CAP_THRESHOLD Ta Yes
-.It PMC_CAP_USER Ta Yes
-.It PMC_CAP_WRITE Ta Yes
-.El
-.Ss Event Qualifiers
-Event specifiers for these PMCs support the following common
-qualifiers:
-.Bl -tag -width indent
-.It Li rsp= Ns Ar value
-Configure the Off-core Response bits.
-.Bl -tag -width indent
-.It Li DMND_DATA_RD
-Counts the number of demand and DCU prefetch data reads of full
-and partial cachelines as well as demand data page table entry
-cacheline reads. Does not count L2 data read prefetches or
-instruction fetches.
-.It Li REQ_DMND_RFO
-Counts the number of demand and DCU prefetch reads for ownership (RFO)
-requests generated by a write to data cacheline. Does not count L2 RFO
-prefetches.
-.It Li REQ_DMND_IFETCH
-Counts the number of demand and DCU prefetch instruction cacheline reads.
-Does not count L2 code read prefetches.
-.It Li REQ_WB
-Counts the number of writeback (modified to exclusive) transactions.
-.It Li REQ_PF_DATA_RD
-Counts the number of data cacheline reads generated by L2 prefetchers.
-.It Li REQ_PF_RFO
-Counts the number of RFO requests generated by L2 prefetchers.
-.It Li REQ_PF_IFETCH
-Counts the number of code reads generated by L2 prefetchers.
-.It Li REQ_PF_LLC_DATA_RD
-L2 prefetcher to L3 for loads.
-.It Li REQ_PF_LLC_RFO
-RFO requests generated by L2 prefetcher
-.It Li REQ_PF_LLC_IFETCH
-L2 prefetcher to L3 for instruction fetches.
-.It Li REQ_BUS_LOCKS
-Bus lock and split lock requests.
-.It Li REQ_STRM_ST
-Streaming store requests.
-.It Li REQ_OTHER
-Any other request that crosses IDI, including I/O.
-.It Li RES_ANY
-Catch all value for any response types.
-.It Li RES_SUPPLIER_NO_SUPP
-No Supplier Information available.
-.It Li RES_SUPPLIER_LLC_HITM
-M-state initial lookup stat in L3.
-.It Li RES_SUPPLIER_LLC_HITE
-E-state.
-.It Li RES_SUPPLIER_LLC_HITS
-S-state.
-.It Li RES_SUPPLIER_LLC_HITF
-F-state.
-.It Li RES_SUPPLIER_LOCAL
-Local DRAM Controller.
-.It Li RES_SNOOP_SNP_NONE
-No details on snoop-related information.
-.It Li RES_SNOOP_SNP_NO_NEEDED
-No snoop was needed to satisfy the request.
-.It Li RES_SNOOP_SNP_MISS
-A snoop was needed and it missed all snooped caches:
--For LLC Hit, ReslHitl was returned by all cores
--For LLC Miss, Rspl was returned by all sockets and data was returned from
-DRAM.
-.It Li RES_SNOOP_HIT_NO_FWD
-A snoop was needed and it hits in at least one snooped cache. Hit denotes a
-cache-line was valid before snoop effect. This includes:
--Snoop Hit w/ Invalidation (LLC Hit, RFO)
--Snoop Hit, Left Shared (LLC Hit/Miss, IFetch/Data_RD)
--Snoop Hit w/ Invalidation and No Forward (LLC Miss, RFO Hit S)
-In the LLC Miss case, data is returned from DRAM.
-.It Li RES_SNOOP_HIT_FWD
-A snoop was needed and data was forwarded from a remote socket.
-This includes:
--Snoop Forward Clean, Left Shared (LLC Hit/Miss, IFetch/Data_RD/RFT).
-.It Li RES_SNOOP_HITM
-A snoop was needed and it HitM-ed in local or remote cache. HitM denotes a
-cache-line was in modified state before effect as a results of snoop. This
-includes:
--Snoop HitM w/ WB (LLC miss, IFetch/Data_RD)
--Snoop Forward Modified w/ Invalidation (LLC Hit/Miss, RFO)
--Snoop MtoS (LLC Hit, IFetch/Data_RD).
-.It Li RES_NON_DRAM
-Target was non-DRAM system address. This includes MMIO transactions.
-.El
-.It Li cmask= Ns Ar value
-Configure the PMC to increment only if the number of configured
-events measured in a cycle is greater than or equal to
-.Ar value .
-.It Li edge
-Configure the PMC to count the number of de-asserted to asserted
-transitions of the conditions expressed by the other qualifiers.
-If specified, the counter will increment only once whenever a
-condition becomes true, irrespective of the number of clocks during
-which the condition remains true.
-.It Li inv
-Invert the sense of comparison when the
-.Dq Li cmask
-qualifier is present, making the counter increment when the number of
-events per cycle is less than the value specified by the
-.Dq Li cmask
-qualifier.
-.It Li os
-Configure the PMC to count events happening at processor privilege
-level 0.
-.It Li usr
-Configure the PMC to count events occurring at privilege levels 1, 2
-or 3.
-.El
-.Pp
-If neither of the
-.Dq Li os
-or
-.Dq Li usr
-qualifiers are specified, the default is to enable both.
-.Ss Event Specifiers (Programmable PMCs)
-Haswell programmable PMCs support the following events:
-.Bl -tag -width indent
-.It Li LD_BLOCKS.STORE_FORWARD
-.Pq Event 03H , Umask 02H
-Loads blocked by overlapping with store buffer that
-cannot be forwarded.
-.It Li MISALIGN_MEM_REF.LOADS
-.Pq Event 05H , Umask 01H
-Speculative cache-line split load uops dispatched to
-L1D.
-.It Li MISALIGN_MEM_REF.STORES
-.Pq Event 05H , Umask 02H
-Speculative cache-line split Store-address uops
-dispatched to L1D.
-.It Li LD_BLOCKS_PARTIAL.ADDRESS_ALIAS
-.Pq Event 07H , Umask 01H
-False dependencies in MOB due to partial compare
-on address.
-.It Li DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK
-.Pq Event 08H , Umask 01H
-Misses in all TLB levels that cause a page walk of any
-page size.
-.It Li DTLB_LOAD_MISSES.WALK_COMPLETED_4K
-.Pq Event 08H , Umask 02H
-Completed page walks due to demand load misses
-that caused 4K page walks in any TLB levels.
-.It Li DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4K
-.Pq Event 08H , Umask 02H
-Completed page walks due to demand load misses
-that caused 2M/4M page walks in any TLB levels.
-.It Li DTLB_LOAD_MISSES.WALK_COMPLETED
-.Pq Event 08H , Umask 0EH
-Completed page walks in any TLB of any page size
-due to demand load misses
-.It Li DTLB_LOAD_MISSES.WALK_DURATION
-.Pq Event 08H , Umask 10H
-Cycle PMH is busy with a walk.
-.It Li DTLB_LOAD_MISSES.STLB_HIT_4K
-.Pq Event 08H , Umask 20H
-Load misses that missed DTLB but hit STLB (4K).
-.It Li DTLB_LOAD_MISSES.STLB_HIT_2M
-.Pq Event 08H , Umask 40H
-Load misses that missed DTLB but hit STLB (2M).
-.It Li DTLB_LOAD_MISSES.STLB_HIT
-.Pq Event 08H , Umask 60H
-Number of cache load STLB hits. No page walk.
-.It Li DTLB_LOAD_MISSES.PDE_CACHE_MISS
-.Pq Event 08H , Umask 80H
-DTLB demand load misses with low part of linear-to-
-physical address translation missed
-.It Li INT_MISC.RECOVERY_CYCLES
-.Pq Event 0DH , Umask 03H
-Cycles waiting to recover after Machine Clears
-except JEClear. Set Cmask= 1.
-.It Li UOPS_ISSUED.ANY
-.Pq Event 0EH , Umask 01H
-ncrements each cycle the # of Uops issued by the
-RAT to RS.
-Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles
-of this core.
-.It Li UOPS_ISSUED.FLAGS_MERGE
-.Pq Event 0EH , Umask 10H
-Number of flags-merge uops allocated. Such uops
-adds delay.
-.It Li UOPS_ISSUED.SLOW_LEA
-.Pq Event 0EH , Umask 20H
-Number of slow LEA or similar uops allocated. Such
-uop has 3 sources (e.g. 2 sources + immediate)
-regardless if as a result of LEA instruction or not.
-.It Li UOPS_ISSUED.SiNGLE_MUL
-.Pq Event 0EH , Umask 40H
-Number of multiply packed/scalar single precision
-uops allocated.
-.It Li L2_RQSTS.DEMAND_DATA_RD_MISS
-.Pq Event 24H , Umask 21H
-Demand Data Read requests that missed L2, no
-rejects.
-.It Li L2_RQSTS.DEMAND_DATA_RD_HIT
-.Pq Event 24H , Umask 41H
-Demand Data Read requests that hit L2 cache.
-.It Li L2_RQSTS.ALL_DEMAND_DATA_RD
-.Pq Event 24H , Umask E1H
-Counts any demand and L1 HW prefetch data load
-requests to L2.
-.It Li L2_RQSTS.RFO_HIT
-.Pq Event 24H , Umask 42H
-Counts the number of store RFO requests that hit
-the L2 cache.
-.It Li L2_RQSTS.RFO_MISS
-.Pq Event 24H , Umask 22H
-Counts the number of store RFO requests that miss
-the L2 cache.
-.It Li L2_RQSTS.ALL_RFO
-.Pq Event 24H , Umask E2H
-Counts all L2 store RFO requests.
-.It Li L2_RQSTS.CODE_RD_HIT
-.Pq Event 24H , Umask 44H
-Number of instruction fetches that hit the L2 cache.
-.It Li L2_RQSTS.CODE_RD_MISS
-.Pq Event 24H , Umask 24H
-Number of instruction fetches that missed the L2
-cache.
-.It Li L2_RQSTS.ALL_DEMAND_MISS
-.Pq Event 24H , Umask 27H
-Demand requests that miss L2 cache.
-.It Li L2_RQSTS.ALL_DEMAND_REFERENCES
-.Pq Event 24H , Umask E7H
-Demand requests to L2 cache.
-.It Li L2_RQSTS.ALL_CODE_RD
-.Pq Event 24H , Umask E4H
-Counts all L2 code requests.
-.It Li L2_RQSTS.L2_PF_HIT
-.Pq Event 24H , Umask 50H
-Counts all L2 HW prefetcher requests that hit L2.
-.It Li L2_RQSTS.L2_PF_MISS
-.Pq Event 24H , Umask 30H
-Counts all L2 HW prefetcher requests that missed
-L2.
-.It Li L2_RQSTS.ALL_PF
-.Pq Event 24H , Umask F8H
-Counts all L2 HW prefetcher requests.
-.It Li L2_RQSTS.MISS
-.Pq Event 24H , Umask 3FH
-All requests that missed L2.
-.It Li L2_RQSTS.REFERENCES
-.Pq Event 24H , Umask FFH
-All requests to L2 cache.
-.It Li L2_DEMAND_RQSTS.WB_HIT
-.Pq Event 27H , Umask 50H
-Not rejected writebacks that hit L2 cache
-.It Li LONGEST_LAT_CACHE.REFERENCE
-.Pq Event 2EH , Umask 4FH
-This event counts requests originating from the core
-that reference a cache line in the last level cache.
-.It Li LONGEST_LAT_CACHE.MISS
-.Pq Event 2EH , Umask 41H
-This event counts each cache miss condition for
-references to the last level cache.
-.It Li CPU_CLK_UNHALTED.THREAD_P
-.Pq Event 3CH , Umask 00H
-Counts the number of thread cycles while the thread
-is not in a halt state. The thread enters the halt state
-when it is running the HLT instruction. The core
-frequency may change from time to time due to
-power or thermal throttling.
-.It Li CPU_CLK_THREAD_UNHALTED.REF_XCLK
-.Pq Event 3CH , Umask 01H
-Increments at the frequency of XCLK (100 MHz)
-when not halted.
-.It Li L1D_PEND_MISS.PENDING
-.Pq Event 48H , Umask 01H
-Increments the number of outstanding L1D misses
-every cycle. Set Cmaks = 1 and Edge =1 to count
-occurrences.
-.It Li DTLB_STORE_MISSES.MISS_CAUSES_A_WALK
-.Pq Event 49H , Umask 01H
-Miss in all TLB levels causes an page walk of any
-page size (4K/2M/4M/1G).
-.It Li DTLB_STORE_MISSES.WALK_COMPLETED_4K
-.Pq Event 49H , Umask 02H
-Completed page walks due to store misses in one or
-more TLB levels of 4K page structure.
-.It Li DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M
-.Pq Event 49H , Umask 04H
-Completed page walks due to store misses in one or
-more TLB levels of 2M/4M page structure.
-.It Li DTLB_STORE_MISSES.WALK_COMPLETED
-.Pq Event 49H , Umask 0EH
-Completed page walks due to store miss in any TLB
-levels of any page size (4K/2M/4M/1G).
-.It Li DTLB_STORE_MISSES.WALK_DURATION
-.Pq Event 49H , Umask 10H
-Cycles PMH is busy with this walk.
-.It Li DTLB_STORE_MISSES.STLB_HIT_4K
-.Pq Event 49H , Umask 20H
-Store misses that missed DTLB but hit STLB (4K).
-.It Li DTLB_STORE_MISSES.STLB_HIT_2M
-.Pq Event 49H , Umask 40H
-Store misses that missed DTLB but hit STLB (2M).
-.It Li DTLB_STORE_MISSES.STLB_HIT
-.Pq Event 49H , Umask 60H
-Store operations that miss the first TLB level but hit
-the second and do not cause page walks.
-.It Li DTLB_STORE_MISSES.PDE_CACHE_MISS
-.Pq Event 49H , Umask 80H
-DTLB store misses with low part of linear-to-physical
-address translation missed.
-.It Li LOAD_HIT_PRE.SW_PF
-.Pq Event 4CH , Umask 01H
-Non-SW-prefetch load dispatches that hit fill buffer
-allocated for S/W prefetch.
-.It Li LOAD_HIT_PRE.HW_PF
-.Pq Event 4CH , Umask 02H
-Non-SW-prefetch load dispatches that hit fill buffer
-allocated for H/W prefetch.
-.It Li L1D.REPLACEMENT
-.Pq Event 51H , Umask 01H
-Counts the number of lines brought into the L1 data
-cache.
-.It Li MOVE_ELIMINATION.INT_NOT_ELIMINATED
-.Pq Event 58H , Umask 04H
-Number of integer Move Elimination candidate uops
-that were not eliminated.
-.It Li MOVE_ELIMINATION.SMID_NOT_ELIMINATED
-.Pq Event 58H , Umask 08H
-Number of SIMD Move Elimination candidate uops
-that were not eliminated.
-.It Li MOVE_ELIMINATION.INT_ELIMINATED
-.Pq Event 58H , Umask 01H
-Unhalted core cycles when the thread is in ring 0.
-.It Li MOVE_ELIMINATION.SMID_ELIMINATED
-.Pq Event 58H , Umask 02H
-Number of SIMD Move Elimination candidate uops
-that were eliminated.
-.It Li CPL_CYCLES.RING0
-.Pq Event 5CH , Umask 02H
-Unhalted core cycles when the thread is in ring 0.
-.It Li CPL_CYCLES.RING123
-.Pq Event 5CH , Umask 01H
-Unhalted core cycles when the thread is not in ring 0.
-.It Li RS_EVENTS.EMPTY_CYCLES
-.Pq Event 5EH , Umask 01H
-Cycles the RS is empty for the thread.
-.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD
-.Pq Event 60H , Umask 01H
-Offcore outstanding Demand Data Read transactions
-in SQ to uncore. Set Cmask=1 to count cycles.
-.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CORE_RD
-.Pq Event 60H , Umask 02H
-Offcore outstanding Demand code Read transactions
-in SQ to uncore. Set Cmask=1 to count cycles.
-.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO
-.Pq Event 60H , Umask 04H
-Offcore outstanding RFO store transactions in SQ to
-uncore. Set Cmask=1 to count cycles.
-.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD
-.Pq Event 60H , Umask 08H
-Offcore outstanding cacheable data read
-transactions in SQ to uncore. Set Cmask=1 to count
-cycles.
-.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION
-.Pq Event 63H , Umask 01H
-Cycles in which the L1D and L2 are locked, due to a
-UC lock or split lock.
-.It Li LOCK_CYCLES.CACHE_LOCK_DURATION
-.Pq Event 63H , Umask 02H
-Cycles in which the L1D is locked.
-.It Li IDQ.EMPTY
-.Pq Event 79H , Umask 02H
-Counts cycles the IDQ is empty.
-.It Li IDQ.MITE_UOPS
-.Pq Event 79H , Umask 04H
-Increment each cycle # of uops delivered to IDQ from
-MITE path.
-Set Cmask = 1 to count cycles.
-.It Li IDQ.DSB_UOPS
-.Pq Event 79H , Umask 08H
-Increment each cycle. # of uops delivered to IDQ
-from DSB path.
-Set Cmask = 1 to count cycles.
-.It Li IDQ.MS_DSB_UOPS
-.Pq Event 79H , Umask 10H
-Increment each cycle # of uops delivered to IDQ
-when MS_busy by DSB. Set Cmask = 1 to count
-cycles. Add Edge=1 to count # of delivery.
-.It Li IDQ.MS_MITE_UOPS
-.Pq Event 79H , Umask 20H
-ncrement each cycle # of uops delivered to IDQ
-when MS_busy by MITE. Set Cmask = 1 to count
-cycles.
-.It Li IDQ.MS_UOPS
-.Pq Event 79H , Umask 30H
-Increment each cycle # of uops delivered to IDQ from
-MS by either DSB or MITE. Set Cmask = 1 to count
-cycles.
-.It Li IDQ.ALL_DSB_CYCLES_ANY_UOPS
-.Pq Event 79H , Umask 18H
-Counts cycles DSB is delivered at least one uops. Set
-Cmask = 1.
-.It Li IDQ.ALL_DSB_CYCLES_4_UOPS
-.Pq Event 79H , Umask 18H
-Counts cycles DSB is delivered four uops. Set Cmask
-=4.
-.It Li IDQ.ALL_MITE_CYCLES_ANY_UOPS
-.Pq Event 79H , Umask 24H
-Counts cycles MITE is delivered at least one uops. Set
-Cmask = 1.
-.It Li IDQ.ALL_MITE_CYCLES_4_UOPS
-.Pq Event 79H , Umask 24H
-Counts cycles MITE is delivered four uops. Set Cmask
-=4.
-.It Li IDQ.MITE_ALL_UOPS
-.Pq Event 79H , Umask 3CH
-# of uops delivered to IDQ from any path.
-.It Li ICACHE.MISSES
-.Pq Event 80H , Umask 02H
-Number of Instruction Cache, Streaming Buffer and
-Victim Cache Misses. Includes UC accesses.
-.It Li ITLB_MISSES.MISS_CAUSES_A_WALK
-.Pq Event 85H , Umask 01H
-Misses in ITLB that causes a page walk of any page
-size.
-.It Li ITLB_MISSES.WALK_COMPLETED_4K
-.Pq Event 85H , Umask 02H
-Completed page walks due to misses in ITLB 4K page
-entries.
-.It Li TLB_MISSES.WALK_COMPLETED_2M_4M
-.Pq Event 85H , Umask 04H
-Completed page walks due to misses in ITLB 2M/4M
-page entries.
-.It Li ITLB_MISSES.WALK_COMPLETED
-.Pq Event 85H , Umask 0EH
-Completed page walks in ITLB of any page size.
-.It Li ITLB_MISSES.WALK_DURATION
-.Pq Event 85H , Umask 10H
-Cycle PMH is busy with a walk.
-.It Li ITLB_MISSES.STLB_HIT_4K
-.Pq Event 85H , Umask 20H
-ITLB misses that hit STLB (4K).
-.It Li ITLB_MISSES.STLB_HIT_2M
-.Pq Event 85H , Umask 40H
-ITLB misses that hit STLB (2K).
-.It Li ITLB_MISSES.STLB_HIT
-.Pq Event 85H , Umask 60H
-TLB misses that hit STLB. No page walk.
-.It Li ILD_STALL.LCP
-.Pq Event 87H , Umask 01H
-Stalls caused by changing prefix length of the
-instruction.
-.It Li ILD_STALL.IQ_FULL
-.Pq Event 87H , Umask 04H
-Stall cycles due to IQ is full.
-.It Li BR_INST_EXEC.NONTAKEN_COND
-.Pq Event 88H , Umask 41H
-Count conditional near branch instructions that were executed (but not
-necessarily retired) and not taken.
-.It Li BR_INST_EXEC.TAKEN_COND
-.Pq Event 88H , Umask 81H
-Count conditional near branch instructions that were executed (but not
-necessarily retired) and taken.
-.It Li BR_INST_EXEC.DIRECT_JMP
-.Pq Event 88H , Umask 82H
-Count all unconditional near branch instructions excluding calls and
-indirect branches.
-.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET
-.Pq Event 88H , Umask 84H
-Count executed indirect near branch instructions that are not calls nor
-returns.
-.It Li BR_INST_EXEC.RETURN_NEAR
-.Pq Event 88H , Umask 88H
-Count indirect near branches that have a return mnemonic.
-.It Li BR_INST_EXEC.DIRECT_NEAR_CALL
-.Pq Event 88H , Umask 90H
-Count unconditional near call branch instructions, excluding non call
-branch, executed.
-.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL
-.Pq Event 88H , Umask A0H
-Count indirect near calls, including both register and memory indirect,
-executed.
-.It Li BR_INST_EXEC.ALL_BRANCHES
-.Pq Event 88H , Umask FFH
-Counts all near executed branches (not necessarily retired).
-.It Li BR_MISP_EXEC.NONTAKEN_COND
-.Pq Event 89H , Umask 41H
-Count conditional near branch instructions mispredicted as nontaken.
-.It Li BR_MISP_EXEC.TAKEN_COND
-.Pq Event 89H , Umask 81H
-Count conditional near branch instructions mispredicted as taken.
-.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET
-.Pq Event 89H , Umask 84H
-Count mispredicted indirect near branch instructions that are not calls
-nor returns.
-.It Li BR_MISP_EXEC.RETURN_NEAR
-.Pq Event 89H , Umask 88H
-Count mispredicted indirect near branches that have a return mnemonic.
-.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL
-.Pq Event 89H , Umask 90H
-Count mispredicted unconditional near call branch instructions, excluding
-non call branch, executed.
-.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL
-.Pq Event 89H , Umask A0H
-Count mispredicted indirect near calls, including both register and memory
-indirect, executed.
-.It Li BR_MISP_EXEC.ALL_BRANCHES
-.Pq Event 89H , Umask FFH
-Counts all mispredicted near executed branches (not necessarily retired).
-.It Li IDQ_UOPS_NOT_DELIVERED.CORE
-.Pq Event 9CH , Umask 01H
-Count number of non-delivered uops to RAT per
-thread.
-.It Li UOPS_EXECUTED_PORT.PORT_0
-.Pq Event A1H , Umask 01H
-Cycles which a Uop is dispatched on port 0 in this
-thread.
-.It Li UOPS_EXECUTED_PORT.PORT_1
-.Pq Event A1H , Umask 02H
-Cycles which a Uop is dispatched on port 1 in this
-thread.
-.It Li UOPS_EXECUTED_PORT.PORT_2
-.Pq Event A1H , Umask 04H
-Cycles which a Uop is dispatched on port 2 in this
-thread.
-.It Li UOPS_EXECUTED_PORT.PORT_3
-.Pq Event A1H , Umask 08H
-Cycles which a Uop is dispatched on port 3 in this
-thread.
-.It Li UOPS_EXECUTED_PORT.PORT_4
-.Pq Event A1H , Umask 10H
-Cycles which a Uop is dispatched on port 4 in this
-thread.
-.It Li UOPS_EXECUTED_PORT.PORT_5
-.Pq Event A1H , Umask 20H
-Cycles which a Uop is dispatched on port 5 in this
-thread.
-.It Li UOPS_EXECUTED_PORT.PORT_6
-.Pq Event A1H , Umask 40H
-Cycles which a Uop is dispatched on port 6 in this
-thread.
-.It Li UOPS_EXECUTED_PORT.PORT_7
-.Pq Event A1H , Umask 80H
-Cycles which a Uop is dispatched on port 7 in this
-thread.
-.It Li RESOURCE_STALLS.ANY
-.Pq Event A2H , Umask 01H
-Cycles Allocation is stalled due to Resource Related
-reason.
-.It Li RESOURCE_STALLS.RS
-.Pq Event A2H , Umask 04H
-Cycles stalled due to no eligible RS entry available.
-.It Li RESOURCE_STALLS.SB
-.Pq Event A2H , Umask 08H
-Cycles stalled due to no store buffers available (not
-including draining form sync).
-.It Li RESOURCE_STALLS.ROB
-.Pq Event A2H , Umask 10H
-Cycles stalled due to re-order buffer full.
-.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING
-.Pq Event A3H , Umask 01H
-Cycles with pending L2 miss loads. Set Cmask=2 to
-count cycle.
-.It Li CYCLE_ACTIVITY.CYCLES_LDM_PENDING
-.Pq Event A3H , Umask 02H
-Cycles with pending memory loads. Set Cmask=2 to
-count cycle.
-.It Li CYCLE_ACTIVITY.STALLS_L2_PENDING
-.Pq Event A3H , Umask 05H
-Number of loads missed L2.
-.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING
-.Pq Event A3H , Umask 08H
-Cycles with pending L1 cache miss loads. Set
-Cmask=8 to count cycle.
-.It Li ITLB.ITLB_FLUSH
-.Pq Event AEH , Umask 01H
-Counts the number of ITLB flushes, includes
-4k/2M/4M pages.
-.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD
-.Pq Event B0H , Umask 01H
-Demand data read requests sent to uncore.
-.It Li OFFCORE_REQUESTS.DEMAND_CODE_RD
-.Pq Event B0H , Umask 02H
-Demand code read requests sent to uncore.
-.It Li OFFCORE_REQUESTS.DEMAND_RFO
-.Pq Event B0H , Umask 04H
-Demand RFO read requests sent to uncore, including
-regular RFOs, locks, ItoM.
-.It Li OFFCORE_REQUESTS.ALL_DATA_RD
-.Pq Event B0H , Umask 08H
-Data read requests sent to uncore (demand and
-prefetch).
-.It Li UOPS_EXECUTED.CORE
-.Pq Event B1H , Umask 02H
-Counts total number of uops to be executed per-core
-each cycle.
-.It Li OFF_CORE_RESPONSE_0
-.Pq Event B7H , Umask 01H
-Requires MSR 01A6H
-.It Li OFF_CORE_RESPONSE_1
-.Pq Event BBH , Umask 01H
-Requires MSR 01A7H
-.It Li PAGE_WALKER_LOADS.DTLB_L1
-.Pq Event BCH , Umask 11H
-Number of DTLB page walker loads that hit in the
-L1+FB.
-.It Li PAGE_WALKER_LOADS.ITLB_L1
-.Pq Event BCH , Umask 21H
-Number of ITLB page walker loads that hit in the
-L1+FB.
-.It Li PAGE_WALKER_LOADS.DTLB_L2
-.Pq Event BCH , Umask 12H
-Number of DTLB page walker loads that hit in the L2.
-.It Li PAGE_WALKER_LOADS.ITLB_L2
-.Pq Event BCH , Umask 22H
-Number of ITLB page walker loads that hit in the L2.
-.It Li PAGE_WALKER_LOADS.DTLB_L3
-.Pq Event BCH , Umask 14H
-Number of DTLB page walker loads that hit in the L3.
-.It Li PAGE_WALKER_LOADS.ITLB_L3
-.Pq Event BCH , Umask 24H
-Number of ITLB page walker loads that hit in the L3.
-.It Li PAGE_WALKER_LOADS.DTLB_MEMORY
-.Pq Event BCH , Umask 18H
-Number of DTLB page walker loads from memory.
-.It Li PAGE_WALKER_LOADS.ITLB_MEMORY
-.Pq Event BCH , Umask 28H
-Number of ITLB page walker loads from memory.
-.It Li TLB_FLUSH.DTLB_THREAD
-.Pq Event BDH , Umask 01H
-DTLB flush attempts of the thread-specific entries.
-.It Li TLB_FLUSH.STLB_ANY
-.Pq Event BDH , Umask 20H
-Count number of STLB flush attempts.
-.It Li INST_RETIRED.ANY_P
-.Pq Event C0H , Umask 00H
-Number of instructions at retirement.
-.It Li INST_RETIRED.ALL
-.Pq Event C0H , Umask 01H
-Precise instruction retired event with HW to reduce
-effect of PEBS shadow in IP distribution.
-.It Li OTHER_ASSISTS.AVX_TO_SSE
-.Pq Event C1H , Umask 08H
-Number of transitions from AVX-256 to legacy SSE
-when penalty applicable.
-.It Li OTHER_ASSISTS.SSE_TO_AVX
-.Pq Event C1H , Umask 10H
-Number of transitions from SSE to AVX-256 when
-penalty applicable.
-.It Li OTHER_ASSISTS.ANY_WB_ASSIST
-.Pq Event C1H , Umask 40H
-Number of microcode assists invoked by HW upon
-uop writeback.
-.It Li UOPS_RETIRED.ALL
-.Pq Event C2H , Umask 01H
-Counts the number of micro-ops retired, Use
-cmask=1 and invert to count active cycles or stalled
-cycles.
-.It Li UOPS_RETIRED.RETIRE_SLOTS
-.Pq Event C2H , Umask 02H
-Counts the number of retirement slots used each
-cycle.
-.It Li MACHINE_CLEARS.MEMORY_ORDERING
-.Pq Event C3H , Umask 02H
-Counts the number of machine clears due to memory
-order conflicts.
-.It Li MACHINE_CLEARS.SMC
-.Pq Event C3H , Umask 04H
-Number of self-modifying-code machine clears
-detected.
-.It Li MACHINE_CLEARS.MASKMOV
-.Pq Event C3H , Umask 20H
-Counts the number of executed AVX masked load
-operations that refer to an illegal address range with
-the mask bits set to 0.
-.It Li BR_INST_RETIRED.ALL_BRANCHES
-.Pq Event C4H , Umask 00H
-Branch instructions at retirement.
-.It Li BR_INST_RETIRED.CONDITIONAL
-.Pq Event C4H , Umask 01H
-Counts the number of conditional branch instructions Supports PEBS
-retired.
-.It Li BR_INST_RETIRED.NEAR_CALL
-.Pq Event C4H , Umask 02H
-Direct and indirect near call instructions retired.
-.It Li BR_INST_RETIRED.ALL_BRANCHES
-.Pq Event C4H , Umask 04H
-Counts the number of branch instructions retired.
-.It Li BR_INST_RETIRED.NEAR_RETURN
-.Pq Event C4H , Umask 08H
-Counts the number of near return instructions
-retired.
-.It Li BR_INST_RETIRED.NOT_TAKEN
-.Pq Event C4H , Umask 10H
-Counts the number of not taken branch instructions
-retired.
- It Li BR_INST_RETIRED.NEAR_TAKEN
-.Pq Event C4H , Umask 20H
-Number of near taken branches retired.
-.It Li BR_INST_RETIRED.FAR_BRANCH
-.Pq Event C4H , Umask 40H
-Number of far branches retired.
-.It Li BR_MISP_RETIRED.ALL_BRANCHES
-.Pq Event C5H , Umask 00H
-Mispredicted branch instructions at retirement
-.It Li BR_MISP_RETIRED.CONDITIONAL
-.Pq Event C5H , Umask 01H
-Mispredicted conditional branch instructions retired.
-.It Li BR_MISP_RETIRED.CONDITIONAL
-.Pq Event C5H , Umask 04H
-Mispredicted macro branch instructions retired.
-.It Li FP_ASSIST.X87_OUTPUT
-.Pq Event CAH , Umask 02H
-Number of X87 FP assists due to Output values.
-.It Li FP_ASSIST.X87_INPUT
-.Pq Event CAH , Umask 04H
-Number of X87 FP assists due to input values.
-.It Li FP_ASSIST.SIMD_OUTPUT
-.Pq Event CAH , Umask 08H
-Number of SIMD FP assists due to Output values.
-.It Li FP_ASSIST.SIMD_INPUT
-.Pq Event CAH , Umask 10H
-Number of SIMD FP assists due to input values.
-.It Li FP_ASSIST.ANY
-.Pq Event CAH , Umask 1EH
-Cycles with any input/output SSE* or FP assists.
-.It Li ROB_MISC_EVENTS.LBR_INSERTS
-.Pq Event CCH , Umask 20H
-Count cases of saving new LBR records by hardware.
-.It Li MEM_TRANS_RETIRED.LOAD_LATENCY
-.Pq Event CDH , Umask 01H
-Randomly sampled loads whose latency is above a
-user defined threshold. A small fraction of the overall
-loads are sampled due to randomization.
-.It Li MEM_UOPS_RETIRED.STLB_MISS_LOADS
-.Pq Event D0H , Umask 11H
-Count retired load uops that missed the STLB.
-.It Li MEM_UOPS_RETIRED.STLB_MISS_STORES
-.Pq Event D0H , Umask 12H
-Count retired store uops that missed the STLB.
-.It Li MEM_UOPS_RETIRED.SPLIT_LOADS
-.Pq Event D0H , Umask 41H
-Count retired load uops that were split across a cache line.
-.It Li MEM_UOPS_RETIRED.SPLIT_STORES
-.Pq Event D0H , Umask 42H
-Count retired store uops that were split across a cache line.
-.It Li MEM_UOPS_RETIRED.ALL_LOADS
-.Pq Event D0H , Umask 81H
-Count all retired load uops.
-.It Li MEM_UOPS_RETIRED.ALL_STORES
-.Pq Event D0H , Umask 82H
-Count all retired store uops.
-.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT
-.Pq Event D1H , Umask 01H
-Retired load uops with L1 cache hits as data sources.
-.It Li MEM_LOAD_UOPS_RETIRED.L2_HIT
-.Pq Event D1H , Umask 02H
-Retired load uops with L2 cache hits as data sources.
-.It Li MEM_LOAD_UOPS_RETIRED.LLC_HIT
-.Pq Event D1H , Umask 04H
-Retired load uops with LLC cache hits as data
-sources.
-.It Li MEM_LOAD_UOPS_RETIRED.L2_MISS
-.Pq Event D1H , Umask 10H
-Retired load uops missed L2. Unknown data source
-excluded.
-.It Li MEM_LOAD_UOPS_RETIRED.HIT_LFB
-.Pq Event D1H , Umask 40H
-Retired load uops which data sources were load uops
-missed L1 but hit FB due to preceding miss to the
-same cache line with data not ready.
-.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS
-.Pq Event D2H , Umask 01H
-Retired load uops which data sources were LLC hit
-and cross-core snoop missed in on-pkg core cache.
-.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT
-.Pq Event D2H , Umask 02H
-Retired load uops which data sources were LLC and
-cross-core snoop hits in on-pkg core cache.
-.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM
-.Pq Event D2H , Umask 04H
-Retired load uops which data sources were HitM
-responses from shared LLC.
-.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE
-.Pq Event D2H , Umask 08H
-Retired load uops which data sources were hits in
-LLC without snoops required.
-.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM
-.Pq Event D3H , Umask 01H
-Retired load uops which data sources missed LLC but
-serviced from local dram.
-.It Li BACLEARS.ANY
-.Pq Event E6H , Umask 1FH
-Number of front end re-steers due to BPU
-misprediction.
-.It Li L2_TRANS.DEMAND_DATA_RD
-.Pq Event F0H , Umask 01H
-Demand Data Read requests that access L2 cache.
-.It Li L2_TRANS.RFO
-.Pq Event F0H , Umask 02H
-RFO requests that access L2 cache.
-.It Li L2_TRANS.CODE_RD
-.Pq Event F0H , Umask 04H
-L2 cache accesses when fetching instructions.
-.It Li L2_TRANS.ALL_PF
-.Pq Event F0H , Umask 08H
-Any MLC or LLC HW prefetch accessing L2, including
-rejects.
-.It Li L2_TRANS.L1D_WB
-.Pq Event F0H , Umask 10H
-L1D writebacks that access L2 cache.
-.It Li L2_TRANS.L2_FILL
-.Pq Event F0H , Umask 20H
-L2 fill requests that access L2 cache.
-.It Li L2_TRANS.L2_WB
-.Pq Event F0H , Umask 40H
-L2 writebacks that access L2 cache.
-.It Li L2_TRANS.ALL_REQUESTS
-.Pq Event F0H , Umask 80H
-Transactions accessing L2 pipe.
-.It Li L2_LINES_IN.I
-.Pq Event F1H , Umask 01H
-L2 cache lines in I state filling L2.
-.It Li L2_LINES_IN.S
-.Pq Event F1H , Umask 02H
-L2 cache lines in S state filling L2.
-.It Li L2_LINES_IN.E
-.Pq Event F1H , Umask 04H
-L2 cache lines in E state filling L2.
-.It Li L2_LINES_IN.ALL
-.Pq Event F1H , Umask 07H
-L2 cache lines filling L2.
-.It Li L2_LINES_OUT.DEMAND_CLEAN
-.Pq Event F2H , Umask 05H
-Clean L2 cache lines evicted by demand.
-.It Li L2_LINES_OUT.DEMAND_DIRTY
-.Pq Event F2H , Umask 06H
-Dirty L2 cache lines evicted by demand.
-.El
-.Sh SEE ALSO
-.Xr pmc 3 ,
-.Xr pmc.atom 3 ,
-.Xr pmc.core 3 ,
-.Xr pmc.iaf 3 ,
-.Xr pmc.ucf 3 ,
-.Xr pmc.k7 3 ,
-.Xr pmc.k8 3 ,
-.Xr pmc.p4 3 ,
-.Xr pmc.p5 3 ,
-.Xr pmc.p6 3 ,
-.Xr pmc.corei7 3 ,
-.Xr pmc.corei7uc 3 ,
-.Xr pmc.haswell 3 ,
-.Xr pmc.haswelluc 3 ,
-.Xr pmc.ivybridge 3 ,
-.Xr pmc.ivybridgexeon 3 ,
-.Xr pmc.sandybridge 3 ,
-.Xr pmc.sandybridgeuc 3 ,
-.Xr pmc.sandybridgexeon 3 ,
-.Xr pmc.westmere 3 ,
-.Xr pmc.westmereuc 3 ,
-.Xr pmc.soft 3 ,
-.Xr pmc.tsc 3 ,
-.Xr pmc_cpuinfo 3 ,
-.Xr pmclog 3 ,
-.Xr hwpmc 4
-.Sh HISTORY
-Support for the Haswell Xeon microarchitecture first appeared in
-.Fx 10.2 .
-.Sh AUTHORS
-The
-.Lb libpmc
-library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
-The support for the Haswell Xeon
-microarchitecture was written by
-.An "Randall Stewart"
-.Aq rrs@FreeBSD.org .
diff --git a/lib/libpmc/pmc.ivybridge.3 b/lib/libpmc/pmc.ivybridge.3
index b693b30..b8ad8e0 100644
--- a/lib/libpmc/pmc.ivybridge.3
+++ b/lib/libpmc/pmc.ivybridge.3
@@ -449,60 +449,80 @@ Stalls caused by changing prefix length of the instruction.
.It Li ILD_STALL.IQ_FULL
.Pq Event 87H , Umask 04H
Stall cycles due to IQ is full.
-.It Li BR_INST_EXEC.NONTAKEN_COND
-.Pq Event 88H , Umask 41H
-Count conditional near branch instructions that were executed (but not
-necessarily retired) and not taken.
-.It Li BR_INST_EXEC.TAKEN_COND
-.Pq Event 88H , Umask 81H
-Count conditional near branch instructions that were executed (but not
-necessarily retired) and taken.
+.It Li BR_INST_EXEC.COND
+.Pq Event 88H , Umask 01H
+Qualify conditional near branch instructions executed, but not necessarily
+retired.
+Must combine with umask 40H, 80H.
.It Li BR_INST_EXEC.DIRECT_JMP
-.Pq Event 88H , Umask 82H
-Count all unconditional near branch instructions excluding calls and
+.Pq Event 88H , Umask 02H
+Qualify all unconditional near branch instructions excluding calls and
indirect branches.
+Must combine with umask 80H.
.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET
-.Pq Event 88H , Umask 84H
-Count executed indirect near branch instructions that are not calls nor
+.Pq Event 88H , Umask 04H
+Qualify executed indirect near branch instructions that are not calls nor
returns.
+Must combine with umask 80H.
.It Li BR_INST_EXEC.RETURN_NEAR
-.Pq Event 88H , Umask 88H
-Count indirect near branches that have a return mnemonic.
+.Pq Event 88H , Umask 08H
+Qualify indirect near branches that have a return mnemonic.
+Must combine with umask 80H.
.It Li BR_INST_EXEC.DIRECT_NEAR_CALL
-.Pq Event 88H , Umask 90H
-Count unconditional near call branch instructions, excluding non call
+.Pq Event 88H , Umask 10H
+Qualify unconditional near call branch instructions, excluding non call
branch, executed.
+Must combine with umask 80H.
.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL
-.Pq Event 88H , Umask A0H
-Count indirect near calls, including both register and memory indirect,
+.Pq Event 88H , Umask 20H
+Qualify indirect near calls, including both register and memory indirect,
executed.
+Must combine with umask 80H.
+.It Li BR_INST_EXEC.NONTAKEN
+.Pq Event 88H , Umask 40H
+Qualify non-taken near branches executed.
+Applicable to umask 01H only.
+.It Li BR_INST_EXEC.TAKEN
+.Pq Event 88H , Umask 80H
+Qualify taken near branches executed. Must combine with 01H,02H, 04H, 08H,
+10H, 20H.
.It Li BR_INST_EXEC.ALL_BRANCHES
.Pq Event 88H , Umask FFH
Counts all near executed branches (not necessarily retired).
-.It Li BR_MISP_EXEC.NONTAKEN_COND
-.Pq Event 89H , Umask 41H
-Count conditional near branch instructions mispredicted as nontaken.
-.It Li BR_MISP_EXEC.TAKEN_COND
-.Pq Event 89H , Umask 81H
-Count conditional near branch instructions mispredicted as taken.
+.It Li BR_MISP_EXEC.COND
+.Pq Event 89H , Umask 01H
+Qualify conditional near branch instructions mispredicted.
+Must combine with umask 40H, 80H.
.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET
-.Pq Event 89H , Umask 84H
-Count mispredicted indirect near branch instructions that are not calls
+.Pq Event 89H , Umask 04H
+Qualify mispredicted indirect near branch instructions that are not calls
nor returns.
+Must combine with umask 80H.
.It Li BR_MISP_EXEC.RETURN_NEAR
-.Pq Event 89H , Umask 88H
-Count mispredicted indirect near branches that have a return mnemonic.
+.Pq Event 89H , Umask 08H
+Qualify mispredicted indirect near branches that have a return mnemonic.
+Must combine with umask 80H.
.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL
-.Pq Event 89H , Umask 90H
-Count mispredicted unconditional near call branch instructions, excluding
+.Pq Event 89H , Umask 10H
+Qualify mispredicted unconditional near call branch instructions, excluding
non call branch, executed.
+Must combine with umask 80H.
.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL
-.Pq Event 89H , Umask A0H
-Count mispredicted indirect near calls, including both register and memory
+.Pq Event 89H , Umask 20H
+Qualify mispredicted indirect near calls, including both register and memory
indirect, executed.
+Must combine with umask 80H.
+.It Li BR_MISP_EXEC.NONTAKEN
+.Pq Event 89H , Umask 40H
+Qualify mispredicted non-taken near branches executed.
+Applicable to umask 01H only.
+.It Li BR_MISP_EXEC.TAKEN
+.Pq Event 89H , Umask 80H
+Qualify mispredicted taken near branches executed. Must combine with
+01H,02H, 04H, 08H, 10H, 20H.
.It Li BR_MISP_EXEC.ALL_BRANCHES
.Pq Event 89H , Umask FFH
-Counts all mispredicted near executed branches (not necessarily retired).
+Counts all near executed branches (not necessarily retired).
.It Li IDQ_UOPS_NOT_DELIVERED.CORE
.Pq Event 9CH , Umask 01H
Count number of non-delivered uops to RAT per thread.
@@ -706,24 +726,31 @@ Specify threshold in MSR 0x3F6.
.Pq Event CDH , Umask 02H
Sample stores and collect precise store operation via PEBS record.
PMC3 only.
-.It Li MEM_UOPS_RETIRED.STLB_MISS_LOADS
-.Pq Event D0H , Umask 11H
-Count retired load uops that missed the STLB.
-.It Li MEM_UOPS_RETIRED.STLB_MISS_STORES
-.Pq Event D0H , Umask 12H
-Count retired store uops that missed the STLB.
-.It Li MEM_UOPS_RETIRED.SPLIT_LOADS
-.Pq Event D0H , Umask 41H
-Count retired load uops that were split across a cache line.
-.It Li MEM_UOPS_RETIRED.SPLIT_STORES
-.Pq Event D0H , Umask 42H
-Count retired store uops that were split across a cache line.
-.It Li MEM_UOPS_RETIRED.ALL_LOADS
-.Pq Event D0H , Umask 81H
-Count all retired load uops.
-.It Li MEM_UOPS_RETIRED.ALL_STORES
-.Pq Event D0H , Umask 82H
-Count all retired store uops.
+.It Li MEM_UOP_RETIRED.LOADS
+.Pq Event D0H , Umask 01H
+Qualify retired memory uops that are loads. Combine with umask 10H, 20H,
+40H, 80H.
+Supports PEBS.
+.It Li MEM_UOP_RETIRED.STORES
+.Pq Event D0H , Umask 02H
+Qualify retired memory uops that are stores. Combine with umask 10H, 20H,
+40H, 80H.
+.It Li MEM_UOP_RETIRED.STLB_MISS
+.Pq Event D0H , Umask 10H
+Qualify retired memory uops with STLB miss. Must combine with umask 01H,
+02H, to produce counts.
+.It Li MEM_UOP_RETIRED.LOCK
+.Pq Event D0H , Umask 20H
+Qualify retired memory uops with lock. Must combine with umask 01H, 02H, to
+produce counts.
+.It Li MEM_UOP_RETIRED.SPLIT
+.Pq Event D0H , Umask 40H
+Qualify retired memory uops with line split. Must combine with umask 01H,
+02H, to produce counts.
+.It Li MEM_UOP_RETIRED.ALL
+.Pq Event D0H , Umask 80H
+Qualify any retired memory uops. Must combine with umask 01H, 02H, to
+produce counts.
.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT
.Pq Event D1H , Umask 01H
Retired load uops with L1 cache hits as data sources.
@@ -817,23 +844,23 @@ Dirty L2 cache lines evicted by the MLC prefetcher.
.Xr pmc 3 ,
.Xr pmc.atom 3 ,
.Xr pmc.core 3 ,
-.Xr pmc.corei7 3 ,
-.Xr pmc.corei7uc 3 ,
.Xr pmc.iaf 3 ,
-.Xr pmc.ivybridgexeon 3 ,
+.Xr pmc.ucf 3 ,
.Xr pmc.k7 3 ,
.Xr pmc.k8 3 ,
.Xr pmc.p4 3 ,
.Xr pmc.p5 3 ,
.Xr pmc.p6 3 ,
+.Xr pmc.corei7 3 ,
+.Xr pmc.corei7uc 3 ,
+.Xr pmc.ivybridgexeon 3 ,
.Xr pmc.sandybridge 3 ,
.Xr pmc.sandybridgeuc 3 ,
.Xr pmc.sandybridgexeon 3 ,
-.Xr pmc.soft 3 ,
-.Xr pmc.tsc 3 ,
-.Xr pmc.ucf 3 ,
.Xr pmc.westmere 3 ,
.Xr pmc.westmereuc 3 ,
+.Xr pmc.soft 3 ,
+.Xr pmc.tsc 3 ,
.Xr pmc_cpuinfo 3 ,
.Xr pmclog 3 ,
.Xr hwpmc 4
diff --git a/lib/libpmc/pmc.ivybridgexeon.3 b/lib/libpmc/pmc.ivybridgexeon.3
index 2ee5b78..3a5b709 100644
--- a/lib/libpmc/pmc.ivybridgexeon.3
+++ b/lib/libpmc/pmc.ivybridgexeon.3
@@ -449,60 +449,80 @@ Stalls caused by changing prefix length of the instruction.
.It Li ILD_STALL.IQ_FULL
.Pq Event 87H , Umask 04H
Stall cycles due to IQ is full.
-.It Li BR_INST_EXEC.NONTAKEN_COND
-.Pq Event 88H , Umask 41H
-Count conditional near branch instructions that were executed (but not
-necessarily retired) and not taken.
-.It Li BR_INST_EXEC.TAKEN_COND
-.Pq Event 88H , Umask 81H
-Count conditional near branch instructions that were executed (but not
-necessarily retired) and taken.
+.It Li BR_INST_EXEC.COND
+.Pq Event 88H , Umask 01H
+Qualify conditional near branch instructions executed, but not necessarily
+retired.
+Must combine with umask 40H, 80H.
.It Li BR_INST_EXEC.DIRECT_JMP
-.Pq Event 88H , Umask 82H
-Count all unconditional near branch instructions excluding calls and
+.Pq Event 88H , Umask 02H
+Qualify all unconditional near branch instructions excluding calls and
indirect branches.
+Must combine with umask 80H.
.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET
-.Pq Event 88H , Umask 84H
-Count executed indirect near branch instructions that are not calls nor
+.Pq Event 88H , Umask 04H
+Qualify executed indirect near branch instructions that are not calls nor
returns.
+Must combine with umask 80H.
.It Li BR_INST_EXEC.RETURN_NEAR
-.Pq Event 88H , Umask 88H
-Count indirect near branches that have a return mnemonic.
+.Pq Event 88H , Umask 08H
+Qualify indirect near branches that have a return mnemonic.
+Must combine with umask 80H.
.It Li BR_INST_EXEC.DIRECT_NEAR_CALL
-.Pq Event 88H , Umask 90H
-Count unconditional near call branch instructions, excluding non call
+.Pq Event 88H , Umask 10H
+Qualify unconditional near call branch instructions, excluding non call
branch, executed.
+Must combine with umask 80H.
.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL
-.Pq Event 88H , Umask A0H
-Count indirect near calls, including both register and memory indirect,
+.Pq Event 88H , Umask 20H
+Qualify indirect near calls, including both register and memory indirect,
executed.
+Must combine with umask 80H.
+.It Li BR_INST_EXEC.NONTAKEN
+.Pq Event 88H , Umask 40H
+Qualify non-taken near branches executed.
+Applicable to umask 01H only.
+.It Li BR_INST_EXEC.TAKEN
+.Pq Event 88H , Umask 80H
+Qualify taken near branches executed. Must combine with 01H,02H, 04H, 08H,
+10H, 20H.
.It Li BR_INST_EXEC.ALL_BRANCHES
.Pq Event 88H , Umask FFH
Counts all near executed branches (not necessarily retired).
-.It Li BR_MISP_EXEC.NONTAKEN_COND
-.Pq Event 89H , Umask 41H
-Count conditional near branch instructions mispredicted as nontaken.
-.It Li BR_MISP_EXEC.TAKEN_COND
-.Pq Event 89H , Umask 81H
-Count conditional near branch instructions mispredicted as taken.
+.It Li BR_MISP_EXEC.COND
+.Pq Event 89H , Umask 01H
+Qualify conditional near branch instructions mispredicted.
+Must combine with umask 40H, 80H.
.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET
-.Pq Event 89H , Umask 84H
-Count mispredicted indirect near branch instructions that are not calls
+.Pq Event 89H , Umask 04H
+Qualify mispredicted indirect near branch instructions that are not calls
nor returns.
+Must combine with umask 80H.
.It Li BR_MISP_EXEC.RETURN_NEAR
-.Pq Event 89H , Umask 88H
-Count mispredicted indirect near branches that have a return mnemonic.
+.Pq Event 89H , Umask 08H
+Qualify mispredicted indirect near branches that have a return mnemonic.
+Must combine with umask 80H.
.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL
-.Pq Event 89H , Umask 90H
-Count mispredicted unconditional near call branch instructions, excluding
+.Pq Event 89H , Umask 10H
+Qualify mispredicted unconditional near call branch instructions, excluding
non call branch, executed.
+Must combine with umask 80H.
.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL
-.Pq Event 89H , Umask A0H
-Count mispredicted indirect near calls, including both register and memory
+.Pq Event 89H , Umask 20H
+Qualify mispredicted indirect near calls, including both register and memory
indirect, executed.
+Must combine with umask 80H.
+.It Li BR_MISP_EXEC.NONTAKEN
+.Pq Event 89H , Umask 40H
+Qualify mispredicted non-taken near branches executed.
+Applicable to umask 01H only.
+.It Li BR_MISP_EXEC.TAKEN
+.Pq Event 89H , Umask 80H
+Qualify mispredicted taken near branches executed. Must combine with
+01H,02H, 04H, 08H, 10H, 20H.
.It Li BR_MISP_EXEC.ALL_BRANCHES
.Pq Event 89H , Umask FFH
-Counts all mispredicted near executed branches (not necessarily retired).
+Counts all near executed branches (not necessarily retired).
.It Li IDQ_UOPS_NOT_DELIVERED.CORE
.Pq Event 9CH , Umask 01H
Count number of non-delivered uops to RAT per thread.
@@ -718,24 +738,31 @@ Specify threshold in MSR 0x3F6.
.Pq Event CDH , Umask 02H
Sample stores and collect precise store operation via PEBS record.
PMC3 only.
-.It Li MEM_UOPS_RETIRED.STLB_MISS_LOADS
-.Pq Event D0H , Umask 11H
-Count retired load uops that missed the STLB.
-.It Li MEM_UOPS_RETIRED.STLB_MISS_STORES
-.Pq Event D0H , Umask 12H
-Count retired store uops that missed the STLB.
-.It Li MEM_UOPS_RETIRED.SPLIT_LOADS
-.Pq Event D0H , Umask 41H
-Count retired load uops that were split across a cache line.
-.It Li MEM_UOPS_RETIRED.SPLIT_STORES
-.Pq Event D0H , Umask 42H
-Count retired store uops that were split across a cache line.
-.It Li MEM_UOPS_RETIRED.ALL_LOADS
-.Pq Event D0H , Umask 81H
-Count all retired load uops.
-.It Li MEM_UOPS_RETIRED.ALL_STORES
-.Pq Event D0H , Umask 82H
-Count all retired store uops.
+.It Li MEM_UOP_RETIRED.LOADS
+.Pq Event D0H , Umask 01H
+Qualify retired memory uops that are loads. Combine with umask 10H, 20H,
+40H, 80H.
+Supports PEBS.
+.It Li MEM_UOP_RETIRED.STORES
+.Pq Event D0H , Umask 02H
+Qualify retired memory uops that are stores. Combine with umask 10H, 20H,
+40H, 80H.
+.It Li MEM_UOP_RETIRED.STLB_MISS
+.Pq Event D0H , Umask 10H
+Qualify retired memory uops with STLB miss. Must combine with umask 01H,
+02H, to produce counts.
+.It Li MEM_UOP_RETIRED.LOCK
+.Pq Event D0H , Umask 20H
+Qualify retired memory uops with lock. Must combine with umask 01H, 02H, to
+produce counts.
+.It Li MEM_UOP_RETIRED.SPLIT
+.Pq Event D0H , Umask 40H
+Qualify retired memory uops with line split. Must combine with umask 01H,
+02H, to produce counts.
+.It Li MEM_UOP_RETIRED.ALL
+.Pq Event D0H , Umask 80H
+Qualify any retired memory uops. Must combine with umask 01H, 02H, to
+produce counts.
.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT
.Pq Event D1H , Umask 01H
Retired load uops with L1 cache hits as data sources.
@@ -847,23 +874,23 @@ Dirty L2 cache lines filling the L2.
.Xr pmc 3 ,
.Xr pmc.atom 3 ,
.Xr pmc.core 3 ,
-.Xr pmc.corei7 3 ,
-.Xr pmc.corei7uc 3 ,
.Xr pmc.iaf 3 ,
-.Xr pmc.ivybridge 3 ,
+.Xr pmc.ucf 3 ,
.Xr pmc.k7 3 ,
.Xr pmc.k8 3 ,
.Xr pmc.p4 3 ,
.Xr pmc.p5 3 ,
.Xr pmc.p6 3 ,
+.Xr pmc.corei7 3 ,
+.Xr pmc.corei7uc 3 ,
+.Xr pmc.ivybridge 3 ,
.Xr pmc.sandybridge 3 ,
.Xr pmc.sandybridgeuc 3 ,
.Xr pmc.sandybridgexeon 3 ,
-.Xr pmc.soft 3 ,
-.Xr pmc.tsc 3 ,
-.Xr pmc.ucf 3 ,
.Xr pmc.westmere 3 ,
.Xr pmc.westmereuc 3 ,
+.Xr pmc.soft 3 ,
+.Xr pmc.tsc 3 ,
.Xr pmc_cpuinfo 3 ,
.Xr pmclog 3 ,
.Xr hwpmc 4
diff --git a/lib/libpmc/pmc.sandybridge.3 b/lib/libpmc/pmc.sandybridge.3
index 0e219ae..0b8f6b2 100644
--- a/lib/libpmc/pmc.sandybridge.3
+++ b/lib/libpmc/pmc.sandybridge.3
@@ -497,60 +497,80 @@ Stalls caused by changing prefix length of the instruction.
.It Li ILD_STALL.IQ_FULL
.Pq Event 87H, Umask 04H
Stall cycles due to IQ is full.
-.It Li BR_INST_EXEC.NONTAKEN_COND
-.Pq Event 88H , Umask 41H
-Count conditional near branch instructions that were executed (but not
-necessarily retired) and not taken.
-.It Li BR_INST_EXEC.TAKEN_COND
-.Pq Event 88H , Umask 81H
-Count conditional near branch instructions that were executed (but not
-necessarily retired) and taken.
+.It Li BR_INST_EXEC.COND
+.Pq Event 88H, Umask 01H
+Qualify conditional near branch instructions executed, but not necessarily
+retired.
+Must combine with umask 40H, 80H
.It Li BR_INST_EXEC.DIRECT_JMP
-.Pq Event 88H , Umask 82H
-Count all unconditional near branch instructions excluding calls and
-indirect branches.
+.Pq Event 88H, Umask 02H
+Qualify all unconditional near branch instructions excluding calls and indirect
+branches.
+Must combine with umask 80H
.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET
-.Pq Event 88H , Umask 84H
-Count executed indirect near branch instructions that are not calls nor
+.Pq Event 88H, Umask 04H
+Qualify executed indirect near branch instructions that are not calls nor
returns.
+Must combine with umask 80H
.It Li BR_INST_EXEC.RETURN_NEAR
-.Pq Event 88H , Umask 88H
-Count indirect near branches that have a return mnemonic.
+.Pq Event 88H, Umask 08H
+Qualify indirect near branches that have a return mnemonic.
+Must combine with umask 80H
.It Li BR_INST_EXEC.DIRECT_NEAR_CALL
-.Pq Event 88H , Umask 90H
-Count unconditional near call branch instructions, excluding non call
-branch, executed.
+.Pq Event 88H, Umask 10H
+Qualify unconditional near call branch instructions, excluding non call branch,
+executed.
+Must combine with umask 80H
.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL
-.Pq Event 88H , Umask A0H
-Count indirect near calls, including both register and memory indirect,
+.Pq Event 88H, Umask 20H
+Qualify indirect near calls, including both register and memory indirect,
executed.
-.It Li BR_INST_EXEC.ALL_BRANCHES
-.Pq Event 88H , Umask FFH
+Must combine with umask 80H
+.It Li BR_INST_EXEC.NONTAKEN
+.Pq Event 88H, Umask 40H
+Qualify non-taken near branches executed.
+Applicable to umask 01H only
+.It Li BR_INST_EXEC.TAKEN
+.Pq Event 88H, Umask 80H
+Qualify taken near branches executed.
+Must combine with 01H,02H, 04H, 08H, 10H, 20H
+.It Li BR_INST_EXE.ALL_BRANCHES
+.Pq Event 88H, Umask FFH
Counts all near executed branches (not necessarily retired).
-.It Li BR_MISP_EXEC.NONTAKEN_COND
-.Pq Event 89H , Umask 41H
-Count conditional near branch instructions mispredicted as nontaken.
-.It Li BR_MISP_EXEC.TAKEN_COND
-.Pq Event 89H , Umask 81H
-Count conditional near branch instructions mispredicted as taken.
+.It Li BR_MISP_EXEC.COND
+.Pq Event 89H, Umask 01H
+Qualify conditional near branch instructions mispredicted.
+Must combine with umask 40H, 80H
.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET
-.Pq Event 89H , Umask 84H
-Count mispredicted indirect near branch instructions that are not calls
-nor returns.
+.Pq Event 89H, Umask 04H
+Qualify mispredicted indirect near branch instructions that are not calls nor
+returns.
+Must combine with umask 80H
.It Li BR_MISP_EXEC.RETURN_NEAR
-.Pq Event 89H , Umask 88H
-Count mispredicted indirect near branches that have a return mnemonic.
+.Pq Event 89H, Umask 08H
+Qualify mispredicted indirect near branches that have a return mnemonic.
+Must combine with umask 80H
.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL
-.Pq Event 89H , Umask 90H
-Count mispredicted unconditional near call branch instructions, excluding
-non call branch, executed.
+.Pq Event 89H, Umask 10H
+Qualify mispredicted unconditional near call branch instructions, excluding non
+call branch, executed.
+Must combine with umask 80H
.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL
-.Pq Event 89H , Umask A0H
-Count mispredicted indirect near calls, including both register and memory
+.Pq Event 89H, Umask 20H
+Qualify mispredicted indirect near calls, including both register and memory
indirect, executed.
+Must combine with umask 80H
+.It Li BR_MISP_EXEC.NONTAKEN
+.Pq Event 89H, Umask 40H
+Qualify mispredicted non-taken near branches executed.
+Applicable to umask 01H only
+.It Li BR_MISP_EXEC.TAKEN
+.Pq Event 89H, Umask 80H
+Qualify mispredicted taken near branches executed.
+Must combine with 01H,02H, 04H, 08H, 10H, 20H
.It Li BR_MISP_EXEC.ALL_BRANCHES
-.Pq Event 89H , Umask FFH
-Counts all mispredicted near executed branches (not necessarily retired).
+.Pq Event 89H, Umask FFH
+Counts all near executed branches (not necessarily retired).
.It Li IDQ_UOPS_NOT_DELIVERED.CORE
.Pq Event 9CH, Umask 01H
Count number of non-delivered uops to RAT per thread.
diff --git a/lib/libpmc/pmc.sandybridgexeon.3 b/lib/libpmc/pmc.sandybridgexeon.3
index b334c16..9a80f78 100644
--- a/lib/libpmc/pmc.sandybridgexeon.3
+++ b/lib/libpmc/pmc.sandybridgexeon.3
@@ -543,60 +543,73 @@ instruction.
.It Li ILD_STALL.IQ_FULL
.Pq Event 87H , Umask 04H
Stall cycles due to IQ is full.
-.It Li BR_INST_EXEC.NONTAKEN_COND
-.Pq Event 88H , Umask 41H
-Count conditional near branch instructions that were executed (but not
-necessarily retired) and not taken.
-.It Li BR_INST_EXEC.TAKEN_COND
-.Pq Event 88H , Umask 81H
-Count conditional near branch instructions that were executed (but not
-necessarily retired) and taken.
+.It Li BR_INST_EXEC.COND
+.Pq Event 88H , Umask 01H
+Qualify conditional near branch instructions
+executed, but not necessarily retired.
.It Li BR_INST_EXEC.DIRECT_JMP
-.Pq Event 88H , Umask 82H
-Count all unconditional near branch instructions excluding calls and
-indirect branches.
+.Pq Event 88H , Umask 02H
+Qualify all unconditional near branch instructions
+excluding calls and indirect branches.
.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET
-.Pq Event 88H , Umask 84H
-Count executed indirect near branch instructions that are not calls nor
-returns.
+.Pq Event 88H , Umask 04H
+Qualify executed indirect near branch instructions
+that are not calls nor returns.
.It Li BR_INST_EXEC.RETURN_NEAR
-.Pq Event 88H , Umask 88H
-Count indirect near branches that have a return mnemonic.
+.Pq Event 88H , Umask 08H
+Qualify indirect near branches that have a return
+mnemonic.
.It Li BR_INST_EXEC.DIRECT_NEAR_CALL
-.Pq Event 88H , Umask 90H
-Count unconditional near call branch instructions, excluding non call
-branch, executed.
+.Pq Event 88H , Umask 10H
+Qualify unconditional near call branch instructions,
+excluding non call branch, executed.
.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL
-.Pq Event 88H , Umask A0H
-Count indirect near calls, including both register and memory indirect,
-executed.
-.It Li BR_INST_EXEC.ALL_BRANCHES
+.Pq Event 88H , Umask 20H
+Qualify indirect near calls, including both register
+and memory indirect, executed.
+.It Li BR_INST_EXEC.NONTAKEN
+.Pq Event 88H , Umask 40H
+Qualify non-taken near branches executed.
+.It Li BR_INST_EXEC.TAKEN
+.Pq Event 88H , Umask 80H
+Qualify taken near branches executed. Must
+combine with 01H,02H, 04H, 08H, 10H, 20H.
+.It Li BR_INST_EXE.ALL_BRANCHES
.Pq Event 88H , Umask FFH
-Counts all near executed branches (not necessarily retired).
-.It Li BR_MISP_EXEC.NONTAKEN_COND
-.Pq Event 89H , Umask 41H
-Count conditional near branch instructions mispredicted as nontaken.
-.It Li BR_MISP_EXEC.TAKEN_COND
-.Pq Event 89H , Umask 81H
-Count conditional near branch instructions mispredicted as taken.
+Counts all near executed branches (not necessarily
+retired).
+.It Li BR_MISP_EXEC.COND
+.Pq Event 89H , Umask 01H
+Qualify conditional near branch instructions
+mispredicted.
.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET
-.Pq Event 89H , Umask 84H
-Count mispredicted indirect near branch instructions that are not calls
-nor returns.
+.Pq Event 89H , Umask 04H
+Qualify mispredicted indirect near branch
+instructions that are not calls nor returns.
.It Li BR_MISP_EXEC.RETURN_NEAR
-.Pq Event 89H , Umask 88H
-Count mispredicted indirect near branches that have a return mnemonic.
+.Pq Event 89H , Umask 08H
+Qualify mispredicted indirect near branches that
+have a return mnemonic.
.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL
-.Pq Event 89H , Umask 90H
-Count mispredicted unconditional near call branch instructions, excluding
-non call branch, executed.
+.Pq Event 89H , Umask 10H
+Qualify mispredicted unconditional near call branch
+instructions, excluding non call branch, executed.
.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL
-.Pq Event 89H , Umask A0H
-Count mispredicted indirect near calls, including both register and memory
-indirect, executed.
+.Pq Event 89H , Umask 20H
+Qualify mispredicted indirect near calls, including
+both register and memory indirect, executed.
+.It Li BR_MISP_EXEC.NONTAKEN
+.Pq Event 89H , Umask 40H
+Qualify mispredicted non-taken near branches
+executed,.
+.It Li BR_MISP_EXEC.TAKEN
+.Pq Event 89H , Umask 80H
+Qualify mispredicted taken near branches executed.
+Must combine with 01H,02H, 04H, 08H, 10H, 20H
.It Li BR_MISP_EXEC.ALL_BRANCHES
.Pq Event 89H , Umask FFH
-Counts all mispredicted near executed branches (not necessarily retired).
+Counts all near executed branches (not necessarily
+retired).
.It Li IDQ_UOPS_NOT_DELIVERED.CORE
.Pq Event 9CH , Umask 01H
Count number of non-delivered uops to RAT per
@@ -974,24 +987,23 @@ Split locks in SQ.
.Xr pmc 3 ,
.Xr pmc.atom 3 ,
.Xr pmc.core 3 ,
-.Xr pmc.corei7 3 ,
-.Xr pmc.corei7uc 3 ,
-.Xr pmc.haswelluc 3 ,
.Xr pmc.iaf 3 ,
-.Xr pmc.ivybridge 3 ,
-.Xr pmc.ivybridgexeon 3 ,
+.Xr pmc.ucf 3 ,
.Xr pmc.k7 3 ,
.Xr pmc.k8 3 ,
.Xr pmc.p4 3 ,
.Xr pmc.p5 3 ,
.Xr pmc.p6 3 ,
+.Xr pmc.corei7 3 ,
+.Xr pmc.corei7uc 3 ,
+.Xr pmc.ivybridge 3 ,
+.Xr pmc.ivybridgexeon 3 ,
.Xr pmc.sandybridge 3 ,
.Xr pmc.sandybridgeuc 3 ,
-.Xr pmc.soft 3 ,
-.Xr pmc.tsc 3 ,
-.Xr pmc.ucf 3 ,
.Xr pmc.westmere 3 ,
.Xr pmc.westmereuc 3 ,
+.Xr pmc.soft 3 ,
+.Xr pmc.tsc 3 ,
.Xr pmc_cpuinfo 3 ,
.Xr pmclog 3 ,
.Xr hwpmc 4
diff --git a/lib/libpmc/pmc.soft.3 b/lib/libpmc/pmc.soft.3
index ec53206..5d331e2 100644
--- a/lib/libpmc/pmc.soft.3
+++ b/lib/libpmc/pmc.soft.3
@@ -76,17 +76,17 @@ Write page fault.
.Xr pmc 3 ,
.Xr pmc.atom 3 ,
.Xr pmc.core 3 ,
-.Xr pmc.corei7 3 ,
-.Xr pmc.corei7uc 3 ,
.Xr pmc.iaf 3 ,
+.Xr pmc.ucf 3 ,
.Xr pmc.k7 3 ,
.Xr pmc.k8 3 ,
.Xr pmc.p4 3 ,
.Xr pmc.p5 3 ,
.Xr pmc.p6 3 ,
-.Xr pmc.tsc 3 ,
-.Xr pmc.ucf 3 ,
+.Xr pmc.corei7 3 ,
+.Xr pmc.corei7uc 3 ,
.Xr pmc.westmereuc 3 ,
+.Xr pmc.tsc 3 ,
.Xr pmc_cpuinfo 3 ,
.Xr pmclog 3 ,
.Xr hwpmc 4
diff --git a/lib/libpmc/pmc.ucf.3 b/lib/libpmc/pmc.ucf.3
index bdbb200..6b02786 100644
--- a/lib/libpmc/pmc.ucf.3
+++ b/lib/libpmc/pmc.ucf.3
@@ -86,18 +86,18 @@ offset C0H under device number 0 and Function 0.
.Xr pmc.atom 3 ,
.Xr pmc.core 3 ,
.Xr pmc.core2 3 ,
-.Xr pmc.corei7 3 ,
-.Xr pmc.corei7uc 3 ,
.Xr pmc.iaf 3 ,
.Xr pmc.k7 3 ,
.Xr pmc.k8 3 ,
.Xr pmc.p4 3 ,
.Xr pmc.p5 3 ,
.Xr pmc.p6 3 ,
-.Xr pmc.soft 3 ,
-.Xr pmc.tsc 3 ,
+.Xr pmc.corei7 3 ,
+.Xr pmc.corei7uc 3 ,
.Xr pmc.westmere 3 ,
.Xr pmc.westmereuc 3 ,
+.Xr pmc.soft 3 ,
+.Xr pmc.tsc 3 ,
.Xr pmc_cpuinfo 3 ,
.Xr pmclog 3 ,
.Xr hwpmc 4
diff --git a/lib/libpmc/pmc.westmere.3 b/lib/libpmc/pmc.westmere.3
index 3668460..6bfdf39 100644
--- a/lib/libpmc/pmc.westmere.3
+++ b/lib/libpmc/pmc.westmere.3
@@ -1371,18 +1371,18 @@ Counts number of SID integer 64 bit shift or move operations.
.Xr pmc 3 ,
.Xr pmc.atom 3 ,
.Xr pmc.core 3 ,
-.Xr pmc.corei7 3 ,
-.Xr pmc.corei7uc 3 ,
.Xr pmc.iaf 3 ,
+.Xr pmc.ucf 3 ,
.Xr pmc.k7 3 ,
.Xr pmc.k8 3 ,
.Xr pmc.p4 3 ,
.Xr pmc.p5 3 ,
.Xr pmc.p6 3 ,
+.Xr pmc.corei7 3 ,
+.Xr pmc.corei7uc 3 ,
+.Xr pmc.westmereuc 3 ,
.Xr pmc.soft 3 ,
.Xr pmc.tsc 3 ,
-.Xr pmc.ucf 3 ,
-.Xr pmc.westmereuc 3 ,
.Xr pmc_cpuinfo 3 ,
.Xr pmclog 3 ,
.Xr hwpmc 4
diff --git a/lib/libpmc/pmc.westmereuc.3 b/lib/libpmc/pmc.westmereuc.3
index 23319cf..2f260c2 100644
--- a/lib/libpmc/pmc.westmereuc.3
+++ b/lib/libpmc/pmc.westmereuc.3
@@ -1056,18 +1056,18 @@ disabled.
.Xr pmc 3 ,
.Xr pmc.atom 3 ,
.Xr pmc.core 3 ,
-.Xr pmc.corei7 3 ,
-.Xr pmc.corei7uc 3 ,
.Xr pmc.iaf 3 ,
+.Xr pmc.ucf 3 ,
.Xr pmc.k7 3 ,
.Xr pmc.k8 3 ,
.Xr pmc.p4 3 ,
.Xr pmc.p5 3 ,
.Xr pmc.p6 3 ,
+.Xr pmc.corei7 3 ,
+.Xr pmc.corei7uc 3 ,
+.Xr pmc.westmere 3 ,
.Xr pmc.soft 3 ,
.Xr pmc.tsc 3 ,
-.Xr pmc.ucf 3 ,
-.Xr pmc.westmere 3 ,
.Xr pmc_cpuinfo 3 ,
.Xr pmclog 3 ,
.Xr hwpmc 4
diff --git a/lib/libpmc/pmc.xscale.3 b/lib/libpmc/pmc.xscale.3
index d5766e3..5a496b9 100644
--- a/lib/libpmc/pmc.xscale.3
+++ b/lib/libpmc/pmc.xscale.3
@@ -132,9 +132,9 @@ and the underlying hardware events used.
.El
.Sh SEE ALSO
.Xr pmc 3 ,
-.Xr pmc.soft 3 ,
.Xr pmc_cpuinfo 3 ,
.Xr pmclog 3 ,
+.Xr pmc.soft 3 ,
.Xr hwpmc 4
.Sh HISTORY
The
diff --git a/lib/libpmc/pmc_capabilities.3 b/lib/libpmc/pmc_capabilities.3
index c0df754..8c5916e 100644
--- a/lib/libpmc/pmc_capabilities.3
+++ b/lib/libpmc/pmc_capabilities.3
@@ -223,8 +223,8 @@ The argument to the function was invalid.
.Xr pmc_allocate 3 ,
.Xr pmc_get_driver_stats 3 ,
.Xr pmc_name_of_capability 3 ,
-.Xr pmc_name_of_class 3 ,
.Xr pmc_name_of_cputype 3 ,
+.Xr pmc_name_of_class 3 ,
.Xr pmc_name_of_event 3 ,
.Xr pmc_name_of_mode 3 ,
.Xr hwpmc 4
diff --git a/lib/libproc/Makefile b/lib/libproc/Makefile
index 8c4f484..bfb9492 100644
--- a/lib/libproc/Makefile
+++ b/lib/libproc/Makefile
@@ -14,19 +14,22 @@ SRCS= proc_bkpt.c \
INCS= libproc.h
CFLAGS+= -I${.CURDIR}
+# avoid cyclic dependency
+CFLAGS+= -I${.CURDIR:H}/librtld_db
.if ${MK_CXX} == "no"
CFLAGS+= -DNO_CXA_DEMANGLE
.elif ${MK_LIBCPLUSPLUS} != "no"
-LIBADD+= cxxrt
+LDADD+= -lcxxrt
+DPADD+= ${LIBCXXRT}
.else
-LIBADD+= supcplusplus
+LDADD+= -lsupc++
+DPADD+= ${LIBSTDCPLUSPLUS}
.endif
-LIBADD+= elf rtld_db util
-
.if ${MK_CDDL} != "no"
-LIBADD+= ctf
+LDADD+= -lctf
+DPADD+= ${LIBCTF}
IGNORE_PRAGMA= YES
CFLAGS+= -I${.CURDIR}/../../cddl/contrib/opensolaris/lib/libctf/common \
-I${.CURDIR}/../../sys/cddl/contrib/opensolaris/uts/common \
diff --git a/lib/libproc/Makefile.depend b/lib/libproc/Makefile.depend
new file mode 100644
index 0000000..46c4714
--- /dev/null
+++ b/lib/libproc/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libcxxrt \
+ lib/libelf \
+ lib/libutil \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libproc/proc_bkpt.c b/lib/libproc/proc_bkpt.c
index 1e4a6cc..fe6ed4a 100644
--- a/lib/libproc/proc_bkpt.c
+++ b/lib/libproc/proc_bkpt.c
@@ -51,9 +51,6 @@ __FBSDID("$FreeBSD$");
#elif defined(__powerpc__)
#define BREAKPOINT_INSTR 0x7fe00008 /* trap */
#define BREAKPOINT_INSTR_SZ 4
-#elif defined(__arm__)
-#define BREAKPOINT_INSTR 0xe7ffffff /* bkpt */
-#define BREAKPOINT_INSTR_SZ 4
#else
#error "Add support for your architecture"
#endif
diff --git a/lib/libproc/proc_regs.c b/lib/libproc/proc_regs.c
index 35d8d38..145c8fe 100644
--- a/lib/libproc/proc_regs.c
+++ b/lib/libproc/proc_regs.c
@@ -56,8 +56,6 @@ proc_regget(struct proc_handle *phdl, proc_reg_t reg, unsigned long *regvalue)
case REG_PC:
#if defined(__amd64__)
*regvalue = regs.r_rip;
-#elif defined(__arm__)
- *regvalue = regs.r_pc;
#elif defined(__i386__)
*regvalue = regs.r_eip;
#elif defined(__mips__)
@@ -69,8 +67,6 @@ proc_regget(struct proc_handle *phdl, proc_reg_t reg, unsigned long *regvalue)
case REG_SP:
#if defined(__amd64__)
*regvalue = regs.r_rsp;
-#elif defined(__arm__)
- *regvalue = regs.r_sp;
#elif defined(__i386__)
*regvalue = regs.r_esp;
#elif defined(__mips__)
@@ -103,8 +99,6 @@ proc_regset(struct proc_handle *phdl, proc_reg_t reg, unsigned long regvalue)
case REG_PC:
#if defined(__amd64__)
regs.r_rip = regvalue;
-#elif defined(__arm__)
- regs.r_pc = regvalue;
#elif defined(__i386__)
regs.r_eip = regvalue;
#elif defined(__mips__)
@@ -116,8 +110,6 @@ proc_regset(struct proc_handle *phdl, proc_reg_t reg, unsigned long regvalue)
case REG_SP:
#if defined(__amd64__)
regs.r_rsp = regvalue;
-#elif defined(__arm__)
- regs.r_sp = regvalue;
#elif defined(__i386__)
regs.r_esp = regvalue;
#elif defined(__mips__)
diff --git a/lib/libproc/proc_sym.c b/lib/libproc/proc_sym.c
index dd52638..766ff73 100644
--- a/lib/libproc/proc_sym.c
+++ b/lib/libproc/proc_sym.c
@@ -82,21 +82,6 @@ fail:
strlcpy(buf, symbol, len);
}
-static int
-find_dbg_obj(const char *path)
-{
- int fd;
- char dbg_path[PATH_MAX];
-
- snprintf(dbg_path, sizeof(dbg_path),
- "/usr/lib/debug/%s.debug", path);
- fd = open(dbg_path, O_RDONLY);
- if (fd >= 0)
- return (fd);
- else
- return (open(path, O_RDONLY));
-}
-
static void
proc_rdl2prmap(rd_loadobj_t *rdl, prmap_t *map)
{
@@ -168,12 +153,9 @@ proc_iter_objs(struct proc_handle *p, proc_map_f *func, void *cd)
prmap_t map;
char path[MAXPATHLEN];
char last[MAXPATHLEN];
- int error;
if (p->nobjs == 0)
return (-1);
-
- error = 0;
memset(last, 0, sizeof(last));
for (i = 0; i < p->nobjs; i++) {
rdl = &p->rdobjs[i];
@@ -187,11 +169,11 @@ proc_iter_objs(struct proc_handle *p, proc_map_f *func, void *cd)
*/
if (strcmp(path, last) == 0)
continue;
- if ((error = (*func)(cd, &map, path)) != 0)
- break;
+ (*func)(cd, &map, path);
strlcpy(last, path, sizeof(last));
}
- return (error);
+
+ return (0);
}
prmap_t *
@@ -310,7 +292,7 @@ proc_addr2sym(struct proc_handle *p, uintptr_t addr, char *name,
if ((map = proc_addr2map(p, addr)) == NULL)
return (-1);
- if ((fd = find_dbg_obj(map->pr_mapname)) < 0) {
+ if ((fd = open(map->pr_mapname, O_RDONLY, 0)) < 0) {
DPRINTF("ERROR: open %s failed", map->pr_mapname);
goto err0;
}
@@ -353,8 +335,8 @@ proc_addr2sym(struct proc_handle *p, uintptr_t addr, char *name,
goto out;
error = lookup_addr(e, symtabscn, symtabstridx, off, addr, &s, symcopy);
- if (error != 0)
- goto err2;
+ if (error == 0)
+ goto out;
out:
demangle(s, name, namesz);
@@ -458,7 +440,7 @@ proc_name2sym(struct proc_handle *p, const char *object, const char *symbol,
DPRINTFX("ERROR: couldn't find object %s", object);
goto err0;
}
- if ((fd = find_dbg_obj(map->pr_mapname)) < 0) {
+ if ((fd = open(map->pr_mapname, O_RDONLY, 0)) < 0) {
DPRINTF("ERROR: open %s failed", map->pr_mapname);
goto err0;
}
@@ -519,16 +501,13 @@ ctf_file_t *
proc_name2ctf(struct proc_handle *p, const char *name)
{
#ifndef NO_CTF
- ctf_file_t *ctf;
prmap_t *map;
int error;
if ((map = proc_name2map(p, name)) == NULL)
return (NULL);
- ctf = ctf_open(map->pr_mapname, &error);
- free(map);
- return (ctf);
+ return (ctf_open(map->pr_mapname, &error));
#else
(void)p;
(void)name;
@@ -554,7 +533,7 @@ proc_iter_symbyaddr(struct proc_handle *p, const char *object, int which,
if ((map = proc_name2map(p, object)) == NULL)
return (-1);
- if ((fd = find_dbg_obj(map->pr_mapname)) < 0) {
+ if ((fd = open(map->pr_mapname, O_RDONLY)) < 0) {
DPRINTF("ERROR: open %s failed", map->pr_mapname);
goto err0;
}
@@ -617,8 +596,7 @@ proc_iter_symbyaddr(struct proc_handle *p, const char *object, int which,
s = elf_strptr(e, stridx, sym.st_name);
if (ehdr.e_type != ET_EXEC)
sym.st_value += map->pr_vaddr;
- if ((error = (*func)(cd, &sym, s)) != 0)
- goto err2;
+ (*func)(cd, &sym, s);
}
error = 0;
err2:
diff --git a/lib/libproc/tests/proc_test.c b/lib/libproc/tests/proc_test.c
index dbaace8..0242b5b 100644
--- a/lib/libproc/tests/proc_test.c
+++ b/lib/libproc/tests/proc_test.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014, 2015 Mark Johnston <markj@FreeBSD.org>
+ * Copyright (c) 2014 Mark Johnston <markj@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -295,43 +295,6 @@ ATF_TC_BODY(symbol_lookup, tc)
proc_free(phdl);
}
-ATF_TC(symbol_lookup_fail);
-ATF_TC_HEAD(symbol_lookup_fail, tc)
-{
- atf_tc_set_md_var(tc, "descr",
- "Verify that proc_addr2sym() returns an error when given an offset "
- "that it cannot resolve.");
-}
-ATF_TC_BODY(symbol_lookup_fail, tc)
-{
- char symname[32];
- GElf_Sym sym;
- struct proc_handle *phdl;
- prmap_t *map;
- int error;
-
- phdl = start_prog(tc, false);
-
- /* Initialize the rtld_db handle. */
- (void)proc_rdagent(phdl);
-
- map = proc_obj2map(phdl, target_prog_file);
- ATF_REQUIRE_MSG(map != NULL, "failed to look up map for '%s'",
- target_prog_file);
-
- /*
- * We shouldn't be able to find symbols at the beginning of a mapped
- * file.
- */
- error = proc_addr2sym(phdl, map->pr_vaddr, symname, sizeof(symname),
- &sym);
- ATF_REQUIRE_MSG(error != 0, "unexpectedly found a symbol");
-
- ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution");
-
- proc_free(phdl);
-}
-
ATF_TC(signal_forward);
ATF_TC_HEAD(signal_forward, tc)
{
@@ -380,7 +343,6 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, map_alias_name2map);
ATF_TP_ADD_TC(tp, map_alias_name2sym);
ATF_TP_ADD_TC(tp, symbol_lookup);
- ATF_TP_ADD_TC(tp, symbol_lookup_fail);
ATF_TP_ADD_TC(tp, signal_forward);
return (atf_no_error());
diff --git a/lib/libprocstat/Makefile b/lib/libprocstat/Makefile
index fc71dbc..32c7daa 100644
--- a/lib/libprocstat/Makefile
+++ b/lib/libprocstat/Makefile
@@ -19,39 +19,10 @@ INCS= libprocstat.h
CFLAGS+= -I. -I${.CURDIR} -D_KVM_VNODE
SHLIB_MAJOR= 1
-LIBADD= elf kvm util
+DPADD= ${LIBELF} ${LIBKVM} ${LIBUTIL}
+LDADD= -lelf -lkvm -lutil
MAN= libprocstat.3
-MLINKS+=libprocstat.3 procstat_close.3 \
- libprocstat.3 procstat_freeargv.3 \
- libprocstat.3 procstat_freeauxv.3 \
- libprocstat.3 procstat_freeenvv.3 \
- libprocstat.3 procstat_freefiles.3 \
- libprocstat.3 procstat_freegroups.3 \
- libprocstat.3 procstat_freekstack.3 \
- libprocstat.3 procstat_freeprocs.3 \
- libprocstat.3 procstat_freevmmap.3 \
- libprocstat.3 procstat_get_pipe_info.3 \
- libprocstat.3 procstat_get_pts_info.3 \
- libprocstat.3 procstat_get_sem_info.3 \
- libprocstat.3 procstat_get_shm_info.3 \
- libprocstat.3 procstat_get_socket_info.3 \
- libprocstat.3 procstat_get_vnode_info.3 \
- libprocstat.3 procstat_getargv.3 \
- libprocstat.3 procstat_getauxv.3 \
- libprocstat.3 procstat_getenvv.3 \
- libprocstat.3 procstat_getfiles.3 \
- libprocstat.3 procstat_getgroups.3 \
- libprocstat.3 procstat_getkstack.3 \
- libprocstat.3 procstat_getosrel.3 \
- libprocstat.3 procstat_getpathname.3 \
- libprocstat.3 procstat_getprocs.3 \
- libprocstat.3 procstat_getrlimit.3 \
- libprocstat.3 procstat_getumask.3 \
- libprocstat.3 procstat_getvmmap.3 \
- libprocstat.3 procstat_open_core.3 \
- libprocstat.3 procstat_open_kvm.3 \
- libprocstat.3 procstat_open_sysctl.3
# XXX This is a hack.
.if ${MK_CDDL} != "no"
diff --git a/lib/libprocstat/Makefile.depend b/lib/libprocstat/Makefile.depend
new file mode 100644
index 0000000..9147669
--- /dev/null
+++ b/lib/libprocstat/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libelf \
+ lib/libkvm \
+ lib/libprocstat/zfs \
+ lib/libutil \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libprocstat/libprocstat.3 b/lib/libprocstat/libprocstat.3
index e8be41c..1c1f811 100644
--- a/lib/libprocstat/libprocstat.3
+++ b/lib/libprocstat/libprocstat.3
@@ -24,11 +24,25 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 18, 2015
+.Dd May 3, 2013
.Dt LIBPROCSTAT 3
.Os
.Sh NAME
+.Nm procstat_open_core ,
+.Nm procstat_open_kvm ,
+.Nm procstat_open_sysctl ,
.Nm procstat_close ,
+.Nm procstat_getargv ,
+.Nm procstat_getauxv ,
+.Nm procstat_getenvv ,
+.Nm procstat_getfiles ,
+.Nm procstat_getgroups ,
+.Nm procstat_getkstack ,
+.Nm procstat_getosrel ,
+.Nm procstat_getpathname ,
+.Nm procstat_getprocs ,
+.Nm procstat_getumask ,
+.Nm procstat_getvmmap ,
.Nm procstat_freeargv ,
.Nm procstat_freeauxv ,
.Nm procstat_freeenvv ,
@@ -42,22 +56,7 @@
.Nm procstat_get_sem_info ,
.Nm procstat_get_shm_info ,
.Nm procstat_get_socket_info ,
-.Nm procstat_get_vnode_info ,
-.Nm procstat_getargv ,
-.Nm procstat_getauxv ,
-.Nm procstat_getenvv ,
-.Nm procstat_getfiles ,
-.Nm procstat_getgroups ,
-.Nm procstat_getkstack ,
-.Nm procstat_getosrel ,
-.Nm procstat_getpathname ,
-.Nm procstat_getprocs ,
-.Nm procstat_getrlimit ,
-.Nm procstat_getumask ,
-.Nm procstat_getvmmap ,
-.Nm procstat_open_core ,
-.Nm procstat_open_kvm ,
-.Nm procstat_open_sysctl
+.Nm procstat_get_vnode_info
.Nd library interface for file and process information retrieval
.Sh LIBRARY
.Lb libprocstat
@@ -176,24 +175,17 @@
.Fa "struct kinfo_proc *kp"
.Fa "unsigned int *count"
.Fc
-.Ft "struct kinfo_kstack *"
-.Fo procstat_getkstack
-.Fa "struct procstat *procstat"
-.Fa "struct kinfo_proc *kp"
-.Fa "unsigned int *count"
-.Fc
.Ft int
.Fo procstat_getosrel
.Fa "struct procstat *procstat"
.Fa "struct kinfo_proc *kp"
.Fa "int *osrelp"
.Fc
-.Ft "int"
-.Fo procstat_getpathname
+.Ft "struct kinfo_kstack *"
+.Fo procstat_getkstack
.Fa "struct procstat *procstat"
.Fa "struct kinfo_proc *kp"
-.Fa "char *pathname"
-.Fa "size_t maxlen"
+.Fa "unsigned int *count"
.Fc
.Ft "struct kinfo_proc *"
.Fo procstat_getprocs
@@ -203,6 +195,13 @@
.Fa "unsigned int *count"
.Fc
.Ft "int"
+.Fo procstat_getpathname
+.Fa "struct procstat *procstat"
+.Fa "struct kinfo_proc *kp"
+.Fa "char *pathname"
+.Fa "size_t maxlen"
+.Fc
+.Ft "int"
.Fo procstat_getrlimit
.Fa "struct procstat *procstat"
.Fa "struct kinfo_proc *kp"
diff --git a/lib/libprocstat/udf.c b/lib/libprocstat/udf.c
index 90c369c..5d9310e 100644
--- a/lib/libprocstat/udf.c
+++ b/lib/libprocstat/udf.c
@@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/vnode.h>
+#include <sys/buf.h>
#define _KERNEL
#include <sys/mount.h>
#undef _KERNEL
diff --git a/lib/libprocstat/zfs/Makefile.depend b/lib/libprocstat/zfs/Makefile.depend
new file mode 100644
index 0000000..b142a67
--- /dev/null
+++ b/lib/libprocstat/zfs/Makefile.depend
@@ -0,0 +1,16 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libkvm \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libradius/Makefile b/lib/libradius/Makefile
index 42f5def..2b769d9 100644
--- a/lib/libradius/Makefile
+++ b/lib/libradius/Makefile
@@ -70,11 +70,13 @@ MLINKS+=libradius.3 rad_acct_open.3 \
WARNS?= 3
-.if ${MK_OPENSSL} != "no"
-LIBADD+= crypto
-CFLAGS+= -DWITH_SSL
+.if ${MK_OPENSSL} == "no"
+DPADD= ${LIBMD}
+LDADD= -lmd
.else
-LIBADD+= md
+DPADD= ${LIBCRYPTO}
+LDADD= -lcrypto
+CFLAGS+= -DWITH_SSL
.endif
.include <bsd.lib.mk>
diff --git a/lib/libradius/Makefile.depend b/lib/libradius/Makefile.depend
new file mode 100644
index 0000000..6047b89
--- /dev/null
+++ b/lib/libradius/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ secure/lib/libcrypto \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/librpcsec_gss/Makefile b/lib/librpcsec_gss/Makefile
index c3e76844..67a7963 100644
--- a/lib/librpcsec_gss/Makefile
+++ b/lib/librpcsec_gss/Makefile
@@ -5,7 +5,8 @@ SHLIB_MAJOR= 1
SRCS+= rpcsec_gss.c rpcsec_gss_prot.c rpcsec_gss_conf.c rpcsec_gss_misc.c \
svc_rpcsec_gss.c
-LIBADD= gssapi
+DPADD+= ${LIBGSSAPI}
+LDADD+= -lgssapi
VERSION_DEF= ${.CURDIR}/../libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
diff --git a/lib/librpcsec_gss/Makefile.depend b/lib/librpcsec_gss/Makefile.depend
new file mode 100644
index 0000000..fc5d471
--- /dev/null
+++ b/lib/librpcsec_gss/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/rpc \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libgssapi \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/librpcsec_gss/rpc_gss_get_error.3 b/lib/librpcsec_gss/rpc_gss_get_error.3
index a16c58e..eea77c7 100644
--- a/lib/librpcsec_gss/rpc_gss_get_error.3
+++ b/lib/librpcsec_gss/rpc_gss_get_error.3
@@ -44,8 +44,8 @@ Get details of the last RPCSEC_GSS error.
A pointer to a structure where the error details will be returned
.El
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_get_mech_info.3 b/lib/librpcsec_gss/rpc_gss_get_mech_info.3
index 8fcade3..0bf6d45 100644
--- a/lib/librpcsec_gss/rpc_gss_get_mech_info.3
+++ b/lib/librpcsec_gss/rpc_gss_get_mech_info.3
@@ -54,8 +54,8 @@ a list of the supported qualities of protection is returned,
otherwise
.Dv NULL .
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_get_mechanisms.3 b/lib/librpcsec_gss/rpc_gss_get_mechanisms.3
index 224ab42..7c3bcca 100644
--- a/lib/librpcsec_gss/rpc_gss_get_mechanisms.3
+++ b/lib/librpcsec_gss/rpc_gss_get_mechanisms.3
@@ -41,8 +41,8 @@ Return a
.Dv NULL
terminated list of installed security mechanisms.
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_get_principal_name.3 b/lib/librpcsec_gss/rpc_gss_get_principal_name.3
index ba12835..286c09f 100644
--- a/lib/librpcsec_gss/rpc_gss_get_principal_name.3
+++ b/lib/librpcsec_gss/rpc_gss_get_principal_name.3
@@ -67,9 +67,9 @@ if the principal was created or
.Dv FALSE
otherwise
.Sh SEE ALSO
-.Xr gss_export_name 3 ,
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
+.Xr gss_export_name 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_get_versions.3 b/lib/librpcsec_gss/rpc_gss_get_versions.3
index 725b2c0..9d79db4 100644
--- a/lib/librpcsec_gss/rpc_gss_get_versions.3
+++ b/lib/librpcsec_gss/rpc_gss_get_versions.3
@@ -50,8 +50,8 @@ The value of
is set to the lowest supported protocol version
.El
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_getcred.3 b/lib/librpcsec_gss/rpc_gss_getcred.3
index 3bb4b6d..515bd99 100644
--- a/lib/librpcsec_gss/rpc_gss_getcred.3
+++ b/lib/librpcsec_gss/rpc_gss_getcred.3
@@ -70,8 +70,8 @@ if successful,
.Dv FALSE
otherwise.
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
.Xr rpc_gss_set_callback 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
diff --git a/lib/librpcsec_gss/rpc_gss_is_installed.3 b/lib/librpcsec_gss/rpc_gss_is_installed.3
index 20df8bd..3d83b71 100644
--- a/lib/librpcsec_gss/rpc_gss_is_installed.3
+++ b/lib/librpcsec_gss/rpc_gss_is_installed.3
@@ -51,8 +51,8 @@ if the mechanism is installed,
.Dv FALSE
otherwise.
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_max_data_length.3 b/lib/librpcsec_gss/rpc_gss_max_data_length.3
index 6438ab8..57cf673 100644
--- a/lib/librpcsec_gss/rpc_gss_max_data_length.3
+++ b/lib/librpcsec_gss/rpc_gss_max_data_length.3
@@ -50,8 +50,8 @@ Maximum packet size of the underlying transport protocol
.Sh RETURN VALUES
The maximum message size that can be encoded
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_mech_to_oid.3 b/lib/librpcsec_gss/rpc_gss_mech_to_oid.3
index 6268880..1156325 100644
--- a/lib/librpcsec_gss/rpc_gss_mech_to_oid.3
+++ b/lib/librpcsec_gss/rpc_gss_mech_to_oid.3
@@ -54,8 +54,8 @@ If the mechanism is found,
is returned, otherwise
.Dv FALSE .
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_oid_to_mech.3 b/lib/librpcsec_gss/rpc_gss_oid_to_mech.3
index 175e361..8ab8340 100644
--- a/lib/librpcsec_gss/rpc_gss_oid_to_mech.3
+++ b/lib/librpcsec_gss/rpc_gss_oid_to_mech.3
@@ -54,8 +54,8 @@ If the mechanism is found,
is returned, otherwise
.Dv FALSE .
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_qop_to_num.3 b/lib/librpcsec_gss/rpc_gss_qop_to_num.3
index 4041e80..bb8b50a 100644
--- a/lib/librpcsec_gss/rpc_gss_qop_to_num.3
+++ b/lib/librpcsec_gss/rpc_gss_qop_to_num.3
@@ -56,8 +56,8 @@ If the value is found,
is returned, otherwise
.Dv FALSE .
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_seccreate.3 b/lib/librpcsec_gss/rpc_gss_seccreate.3
index 7e9bc34..37e9efd 100644
--- a/lib/librpcsec_gss/rpc_gss_seccreate.3
+++ b/lib/librpcsec_gss/rpc_gss_seccreate.3
@@ -96,11 +96,11 @@ To use this security context for subsequent RPC calls, set
.Va clnt->cl_auth
to this value.
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
-.Xr rpcset_gss 3 ,
+.Xr gssapi 3 ,
.Xr mech 5 ,
-.Xr qop 5
+.Xr qop 5 ,
+.Xr rpcset_gss 3
.Sh HISTORY
The
.Nm
diff --git a/lib/librpcsec_gss/rpc_gss_set_callback.3 b/lib/librpcsec_gss/rpc_gss_set_callback.3
index 54f3f51..2d202a5 100644
--- a/lib/librpcsec_gss/rpc_gss_set_callback.3
+++ b/lib/librpcsec_gss/rpc_gss_set_callback.3
@@ -93,9 +93,9 @@ if the callback was registered successfully or
.Dv FALSE
otherwise
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
-.Xr rpc_gss_getcred 3 ,
+.Xr gssapi 3 ,
+.Xr rpc_gss_getcred 3
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_set_defaults.3 b/lib/librpcsec_gss/rpc_gss_set_defaults.3
index 983d2c0..dcef9da 100644
--- a/lib/librpcsec_gss/rpc_gss_set_defaults.3
+++ b/lib/librpcsec_gss/rpc_gss_set_defaults.3
@@ -56,8 +56,8 @@ Returns
.Dv TRUE
if the values were set
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_set_svc_name.3 b/lib/librpcsec_gss/rpc_gss_set_svc_name.3
index 44b15c7..97f1dee 100644
--- a/lib/librpcsec_gss/rpc_gss_set_svc_name.3
+++ b/lib/librpcsec_gss/rpc_gss_set_svc_name.3
@@ -72,9 +72,9 @@ if the service principal was registered or
.Dv FALSE
otherwise.
.Sh SEE ALSO
-.Xr gss_acquire_cred 3 ,
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
+.Xr gss_acquire_cred 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3 b/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3
index 59ee837..24eeae9 100644
--- a/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3
+++ b/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3
@@ -50,8 +50,8 @@ Maximum packet size of the underlying transport protocol
.Sh RETURN VALUES
The maximum message size that can be encoded
.Sh SEE ALSO
-.Xr gssapi 3 ,
.Xr rpc 3 ,
+.Xr gssapi 3 ,
.Xr rpcset_gss 3
.Sh HISTORY
The
diff --git a/lib/librpcsec_gss/rpcsec_gss.3 b/lib/librpcsec_gss/rpcsec_gss.3
index 966a1e0..d3120a6 100644
--- a/lib/librpcsec_gss/rpcsec_gss.3
+++ b/lib/librpcsec_gss/rpcsec_gss.3
@@ -214,12 +214,12 @@ Create a client principal name from various strings
Calculate maximum server message sizes.
.El
.Sh SEE ALSO
-.Xr gss_export_name 3 ,
-.Xr gssapi 3 ,
.Xr rpc 3 ,
-.Xr rpcset_gss 3 ,
+.Xr gssapi 3 ,
+.Xr gss_export_name 3 ,
.Xr mech 5 ,
-.Xr qop 5
+.Xr qop 5 ,
+.Xr rpcset_gss 3
.Sh HISTORY
The
.Nm
diff --git a/lib/librpcsvc/Makefile.depend b/lib/librpcsvc/Makefile.depend
new file mode 100644
index 0000000..0c8f02a
--- /dev/null
+++ b/lib/librpcsvc/Makefile.depend
@@ -0,0 +1,64 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/rpc \
+ include/rpcsvc \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+klm_prot_xdr.So: klm_prot_xdr.c
+klm_prot_xdr.o: klm_prot_xdr.c
+klm_prot_xdr.po: klm_prot_xdr.c
+mount_xdr.So: mount_xdr.c
+mount_xdr.o: mount_xdr.c
+mount_xdr.po: mount_xdr.c
+nfs_prot_xdr.So: nfs_prot_xdr.c
+nfs_prot_xdr.o: nfs_prot_xdr.c
+nfs_prot_xdr.po: nfs_prot_xdr.c
+nlm_prot_xdr.So: nlm_prot_xdr.c
+nlm_prot_xdr.o: nlm_prot_xdr.c
+nlm_prot_xdr.po: nlm_prot_xdr.c
+rex_xdr.So: rex_xdr.c
+rex_xdr.o: rex_xdr.c
+rex_xdr.po: rex_xdr.c
+rnusers_xdr.So: rnusers_xdr.c
+rnusers_xdr.o: rnusers_xdr.c
+rnusers_xdr.po: rnusers_xdr.c
+rquota_xdr.So: rquota_xdr.c
+rquota_xdr.o: rquota_xdr.c
+rquota_xdr.po: rquota_xdr.c
+rstat_xdr.So: rstat_xdr.c
+rstat_xdr.o: rstat_xdr.c
+rstat_xdr.po: rstat_xdr.c
+rwall_xdr.So: rwall_xdr.c
+rwall_xdr.o: rwall_xdr.c
+rwall_xdr.po: rwall_xdr.c
+sm_inter_xdr.So: sm_inter_xdr.c
+sm_inter_xdr.o: sm_inter_xdr.c
+sm_inter_xdr.po: sm_inter_xdr.c
+spray_xdr.So: spray_xdr.c
+spray_xdr.o: spray_xdr.c
+spray_xdr.po: spray_xdr.c
+yppasswd_xdr.So: yppasswd_xdr.c
+yppasswd_xdr.o: yppasswd_xdr.c
+yppasswd_xdr.po: yppasswd_xdr.c
+ypupdate_prot_xdr.So: ypupdate_prot_xdr.c
+ypupdate_prot_xdr.o: ypupdate_prot_xdr.c
+ypupdate_prot_xdr.po: ypupdate_prot_xdr.c
+ypxfrd_xdr.So: ypxfrd_xdr.c
+ypxfrd_xdr.o: ypxfrd_xdr.c
+ypxfrd_xdr.po: ypxfrd_xdr.c
+.endif
diff --git a/lib/librt/Makefile b/lib/librt/Makefile
index 5696610..bd6ec07 100644
--- a/lib/librt/Makefile
+++ b/lib/librt/Makefile
@@ -9,7 +9,8 @@ CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}
CFLAGS+=-fexceptions
.endif
CFLAGS+=-Winline -Wall
-LIBADD= pthread
+DPADD= ${LIBPTHREAD}
+LDADD= -lpthread
WARNS?= 2
@@ -19,8 +20,6 @@ PRECIOUSLIB=
VERSION_MAP= ${.CURDIR}/Version.map
-.if ${MK_TESTS} != "no"
-SUBDIR+= tests
-.endif
+.include <bsd.arch.inc.mk>
.include <bsd.lib.mk>
diff --git a/lib/librt/Makefile.amd64 b/lib/librt/Makefile.amd64
new file mode 100644
index 0000000..dd0f5b0
--- /dev/null
+++ b/lib/librt/Makefile.amd64
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
diff --git a/lib/librt/Makefile.depend b/lib/librt/Makefile.depend
new file mode 100644
index 0000000..37acbe0
--- /dev/null
+++ b/lib/librt/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libthr \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/librt/Makefile.i386 b/lib/librt/Makefile.i386
new file mode 100644
index 0000000..dd0f5b0
--- /dev/null
+++ b/lib/librt/Makefile.i386
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
diff --git a/lib/librt/tests/Makefile b/lib/librt/tests/Makefile
index 95c5259..224f52e 100644
--- a/lib/librt/tests/Makefile
+++ b/lib/librt/tests/Makefile
@@ -6,7 +6,8 @@ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/librt
TESTSDIR= ${TESTSBASE}/lib/librt
-LIBADD= rt
+DPADD+= ${LIBRT}
+LDADD+= -lrt
NETBSD_ATF_TESTS_C= sched_test
NETBSD_ATF_TESTS_C+= sem_test
diff --git a/lib/librtld_db/Makefile.depend b/lib/librtld_db/Makefile.depend
new file mode 100644
index 0000000..8a7801e
--- /dev/null
+++ b/lib/librtld_db/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libelf \
+ lib/libproc \
+ lib/libutil \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/librtld_db/librtld_db.3 b/lib/librtld_db/librtld_db.3
index f310abf..211ce79 100644
--- a/lib/librtld_db/librtld_db.3
+++ b/lib/librtld_db/librtld_db.3
@@ -167,8 +167,8 @@ You can get the error string using
.Xr ld 1 ,
.Xr ld-elf.so.1 1 ,
.Xr ld.so 1 ,
-.Xr rtld 1 ,
-.Xr libproc 3
+.Xr libproc 3 ,
+.Xr rtld 1
.Sh HISTORY
The
.Nm librtld_db
diff --git a/lib/libsbuf/Makefile.depend b/lib/libsbuf/Makefile.depend
new file mode 100644
index 0000000..4acc32f
--- /dev/null
+++ b/lib/libsbuf/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libsdp/Makefile.depend b/lib/libsdp/Makefile.depend
new file mode 100644
index 0000000..7a7a3e3
--- /dev/null
+++ b/lib/libsdp/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libbluetooth \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libsdp/search.c b/lib/libsdp/search.c
index fa2a92d..868fbe5 100644
--- a/lib/libsdp/search.c
+++ b/lib/libsdp/search.c
@@ -32,7 +32,6 @@
#include <sys/uio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdio.h>
diff --git a/lib/libsdp/service.c b/lib/libsdp/service.c
index 53c8909..2667966 100644
--- a/lib/libsdp/service.c
+++ b/lib/libsdp/service.c
@@ -32,7 +32,6 @@
#include <sys/uio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <string.h>
diff --git a/lib/libsdp/session.c b/lib/libsdp/session.c
index a74ce5f..a31f327 100644
--- a/lib/libsdp/session.c
+++ b/lib/libsdp/session.c
@@ -28,7 +28,7 @@
* $Id: session.c,v 1.2 2003/09/04 22:12:13 max Exp $
* $FreeBSD$
*/
-#define L2CAP_SOCKET_CHECKED
+
#include <bluetooth.h>
#include <errno.h>
#include <stdlib.h>
@@ -62,9 +62,6 @@ sdp_open(bdaddr_t const *l, bdaddr_t const *r)
sa.l2cap_len = sizeof(sa);
sa.l2cap_family = AF_BLUETOOTH;
sa.l2cap_psm = 0;
- sa.l2cap_cid = 0;
- sa.l2cap_bdaddr_type = BDADDR_BREDR;
-
memcpy(&sa.l2cap_bdaddr, l, sizeof(sa.l2cap_bdaddr));
if (bind(ss->s, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
ss->error = errno;
diff --git a/lib/libsdp/util.c b/lib/libsdp/util.c
index 5ef4a1d..b996bd2 100644
--- a/lib/libsdp/util.c
+++ b/lib/libsdp/util.c
@@ -30,7 +30,6 @@
*/
#include <netinet/in.h>
-#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <sdp.h>
diff --git a/lib/libsm/Makefile.depend b/lib/libsm/Makefile.depend
new file mode 100644
index 0000000..6053a6b
--- /dev/null
+++ b/lib/libsm/Makefile.depend
@@ -0,0 +1,155 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+assert.o: sm_os.h
+assert.po: sm_os.h
+cf.o: sm_os.h
+cf.po: sm_os.h
+clock.o: sm_os.h
+clock.po: sm_os.h
+clrerr.o: sm_os.h
+clrerr.po: sm_os.h
+config.o: sm_os.h
+config.po: sm_os.h
+debug.o: sm_os.h
+debug.po: sm_os.h
+errstring.o: sm_os.h
+errstring.po: sm_os.h
+exc.o: sm_os.h
+exc.po: sm_os.h
+fclose.o: sm_os.h
+fclose.po: sm_os.h
+feof.o: sm_os.h
+feof.po: sm_os.h
+ferror.o: sm_os.h
+ferror.po: sm_os.h
+fflush.o: sm_os.h
+fflush.po: sm_os.h
+fget.o: sm_os.h
+fget.po: sm_os.h
+findfp.o: sm_os.h
+findfp.po: sm_os.h
+flags.o: sm_os.h
+flags.po: sm_os.h
+fopen.o: sm_os.h
+fopen.po: sm_os.h
+fpos.o: sm_os.h
+fpos.po: sm_os.h
+fprintf.o: sm_os.h
+fprintf.po: sm_os.h
+fpurge.o: sm_os.h
+fpurge.po: sm_os.h
+fput.o: sm_os.h
+fput.po: sm_os.h
+fread.o: sm_os.h
+fread.po: sm_os.h
+fscanf.o: sm_os.h
+fscanf.po: sm_os.h
+fseek.o: sm_os.h
+fseek.po: sm_os.h
+fvwrite.o: sm_os.h
+fvwrite.po: sm_os.h
+fwalk.o: sm_os.h
+fwalk.po: sm_os.h
+fwrite.o: sm_os.h
+fwrite.po: sm_os.h
+get.o: sm_os.h
+get.po: sm_os.h
+heap.o: sm_os.h
+heap.po: sm_os.h
+inet6_ntop.o: sm_os.h
+inet6_ntop.po: sm_os.h
+ldap.o: sm_os.h
+ldap.po: sm_os.h
+makebuf.o: sm_os.h
+makebuf.po: sm_os.h
+match.o: sm_os.h
+match.po: sm_os.h
+mbdb.o: sm_os.h
+mbdb.po: sm_os.h
+memstat.o: sm_os.h
+memstat.po: sm_os.h
+mpeix.o: sm_os.h
+mpeix.po: sm_os.h
+niprop.o: sm_os.h
+niprop.po: sm_os.h
+path.o: sm_os.h
+path.po: sm_os.h
+put.o: sm_os.h
+put.po: sm_os.h
+refill.o: sm_os.h
+refill.po: sm_os.h
+rewind.o: sm_os.h
+rewind.po: sm_os.h
+rpool.o: sm_os.h
+rpool.po: sm_os.h
+sem.o: sm_os.h
+sem.po: sm_os.h
+setvbuf.o: sm_os.h
+setvbuf.po: sm_os.h
+shm.o: sm_os.h
+shm.po: sm_os.h
+signal.o: sm_os.h
+signal.po: sm_os.h
+smstdio.o: sm_os.h
+smstdio.po: sm_os.h
+snprintf.o: sm_os.h
+snprintf.po: sm_os.h
+sscanf.o: sm_os.h
+sscanf.po: sm_os.h
+stdio.o: sm_os.h
+stdio.po: sm_os.h
+strcasecmp.o: sm_os.h
+strcasecmp.po: sm_os.h
+strdup.o: sm_os.h
+strdup.po: sm_os.h
+strerror.o: sm_os.h
+strerror.po: sm_os.h
+strexit.o: sm_os.h
+strexit.po: sm_os.h
+string.o: sm_os.h
+string.po: sm_os.h
+stringf.o: sm_os.h
+stringf.po: sm_os.h
+strio.o: sm_os.h
+strio.po: sm_os.h
+strl.o: sm_os.h
+strl.po: sm_os.h
+strrevcmp.o: sm_os.h
+strrevcmp.po: sm_os.h
+strto.o: sm_os.h
+strto.po: sm_os.h
+test.o: sm_os.h
+test.po: sm_os.h
+ungetc.o: sm_os.h
+ungetc.po: sm_os.h
+util.o: sm_os.h
+util.po: sm_os.h
+vasprintf.o: sm_os.h
+vasprintf.po: sm_os.h
+vfprintf.o: sm_os.h
+vfprintf.po: sm_os.h
+vfscanf.o: sm_os.h
+vfscanf.po: sm_os.h
+vprintf.o: sm_os.h
+vprintf.po: sm_os.h
+vsnprintf.o: sm_os.h
+vsnprintf.po: sm_os.h
+wbuf.o: sm_os.h
+wbuf.po: sm_os.h
+wsetup.o: sm_os.h
+wsetup.po: sm_os.h
+xtrap.o: sm_os.h
+xtrap.po: sm_os.h
+.endif
diff --git a/lib/libsmb/Makefile b/lib/libsmb/Makefile
index b63754b..ea7327b 100644
--- a/lib/libsmb/Makefile
+++ b/lib/libsmb/Makefile
@@ -7,7 +7,8 @@ CONTRIBDIR= ${.CURDIR}/../../contrib/smbfs
LIB= smb
SHLIB_MAJOR= 4
-LIBADD= kiconv
+DPADD= ${LIBKICONV}
+LDADD= -lkiconv
SRCS= rcfile.c ctx.c cfopt.c subr.c nls.c rap.c mbuf.c rq.c file.c \
print.c \
diff --git a/lib/libsmb/Makefile.depend b/lib/libsmb/Makefile.depend
new file mode 100644
index 0000000..b370707
--- /dev/null
+++ b/lib/libsmb/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libkiconv \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libsmdb/Makefile.depend b/lib/libsmdb/Makefile.depend
new file mode 100644
index 0000000..fa096c8
--- /dev/null
+++ b/lib/libsmdb/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+smdb.o: sm_os.h
+smdb.po: sm_os.h
+smdb1.o: sm_os.h
+smdb1.po: sm_os.h
+smdb2.o: sm_os.h
+smdb2.po: sm_os.h
+smndbm.o: sm_os.h
+smndbm.po: sm_os.h
+.endif
diff --git a/lib/libsmutil/Makefile.depend b/lib/libsmutil/Makefile.depend
new file mode 100644
index 0000000..2a24094
--- /dev/null
+++ b/lib/libsmutil/Makefile.depend
@@ -0,0 +1,28 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+cf.o: sm_os.h
+cf.po: sm_os.h
+debug.o: sm_os.h
+debug.po: sm_os.h
+err.o: sm_os.h
+err.po: sm_os.h
+lockfile.o: sm_os.h
+lockfile.po: sm_os.h
+safefile.o: sm_os.h
+safefile.po: sm_os.h
+snprintf.o: sm_os.h
+snprintf.po: sm_os.h
+.endif
diff --git a/lib/libsqlite3/Makefile b/lib/libsqlite3/Makefile
deleted file mode 100644
index 2db85fb..0000000
--- a/lib/libsqlite3/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-# $FreeBSD$
-
-PRIVATELIB= yes
-LIB= sqlite3
-SHLIB_MAJOR?= 0
-LIBADD+= pthread
-
-SRCS= sqlite3.c
-
-SQLITE= ${.CURDIR}/../../contrib/sqlite3
-.PATH: ${SQLITE}
-
-WARNS= 3
-CFLAGS+= -I${SQLITE} \
- -DSTDC_HEADERS=1 \
- -DHAVE_SYS_TYPES_H=1 \
- -DHAVE_SYS_STAT_H=1 \
- -DUSE_PREAD=1 \
- -DHAVE_STDLIB_H=1 \
- -DHAVE_STRING_H=1 \
- -DHAVE_MEMORY_H=1 \
- -DHAVE_STRINGS_H=1 \
- -DHAVE_INTTYPES_H=1 \
- -DHAVE_STDINT_H=1 \
- -DHAVE_UNISTD_H=1 \
- -DHAVE_DLFCN_H=1 \
- -DHAVE_USLEEP=1 \
- -DHAVE_LOCALTIME_R=1 \
- -DHAVE_GMTIME_R=1 \
- -DHAVE_DECL_STRERROR_R=1 \
- -DHAVE_STRERROR_R=1 \
- -DHAVE_POSIX_FALLOCATE=1 \
- -D_REENTRANT=1 \
- -DSQLITE_THREADSAFE=1 \
- -DSQLITE_ENABLE_FTS3 \
- -DSQLITE_ENABLE_FTS4 \
- -DSQLITE_ENABLE_RTREE
-
-.include <bsd.lib.mk>
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile
index 2ee2921..e57407f 100644
--- a/lib/libstand/Makefile
+++ b/lib/libstand/Makefile
@@ -11,9 +11,6 @@ MK_SSP= no
.include <src.opts.mk>
-LIBSTAND_SRC= ${.CURDIR}
-LIBC_SRC= ${LIBSTAND_SRC}/../libc
-
LIB= stand
NO_PIC=
INCS= stand.h
@@ -22,7 +19,7 @@ MAN= libstand.3
WARNS?= 0
CFLAGS+= -ffreestanding -Wformat
-CFLAGS+= -I${LIBSTAND_SRC}
+CFLAGS+= -I${.CURDIR}
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
@@ -31,7 +28,7 @@ CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
CFLAGS.gcc+= -mpreferred-stack-boundary=2
.endif
.if ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+= -fPIC -mno-red-zone
+CFLAGS+= -fPIC
.endif
.if ${MACHINE} == "pc98"
CFLAGS+= -Os
@@ -42,9 +39,6 @@ CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG
.if ${MACHINE_CPUARCH} == "arm"
CFLAGS+= -msoft-float -D_STANDALONE
.endif
-.if ${MACHINE_CPUARCH} == "aarch64"
-CFLAGS+= -D_STANDALONE -mgeneral-regs-only
-.endif
.if ${MACHINE_CPUARCH} == "mips"
CFLAGS+= -G0 -fno-pic -mno-abicalls
.endif
@@ -57,54 +51,55 @@ SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c g
# private (pruned) versions of libc string functions
SRCS+= strcasecmp.c
-.PATH: ${LIBC_SRC}/net
+.PATH: ${.CURDIR}/../libc/net
SRCS+= ntoh.c
# string functions from libc
-.PATH: ${LIBC_SRC}/string
+.PATH: ${.CURDIR}/../libc/string
SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \
memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \
strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \
strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
.if ${MACHINE_CPUARCH} == "arm"
-.PATH: ${LIBC_SRC}/arm/gen
+.PATH: ${.CURDIR}/../libc/arm/gen
# Compiler support functions
-.PATH: ${LIBSTAND_SRC}/../../contrib/compiler-rt/lib/builtins/
+.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/
# __clzsi2 and ctzsi2 for various builtin functions
SRCS+= clzsi2.c ctzsi2.c
# Divide and modulus functions called by the compiler
SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c
SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c
-.PATH: ${LIBSTAND_SRC}/../../contrib/compiler-rt/lib/builtins/arm/
+.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/arm/
SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S
SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S
-.endif
-.if ${MACHINE_CPUARCH} == "aarch64"
-.PATH: ${LIBC_SRC}/aarch64/gen
.endif
-
.if ${MACHINE_CPUARCH} == "powerpc"
-.PATH: ${LIBC_SRC}/quad
+.PATH: ${.CURDIR}/../libc/quad
SRCS+= ashldi3.c ashrdi3.c
+.PATH: ${.CURDIR}/../libc/powerpc/gen
SRCS+= syncicache.c
.endif
# uuid functions from libc
-.PATH: ${LIBC_SRC}/uuid
+.PATH: ${.CURDIR}/../libc/uuid
SRCS+= uuid_equal.c uuid_is_nil.c
# _setjmp/_longjmp
-.PATH: ${LIBSTAND_SRC}/${MACHINE_CPUARCH}
+.if ${MACHINE_ARCH} == "powerpc64"
+.PATH: ${.CURDIR}/powerpc
+.else
+.PATH: ${.CURDIR}/${MACHINE_CPUARCH}
+.endif
SRCS+= _setjmp.S
# decompression functionality from libbz2
# NOTE: to actually test this functionality after libbz2 upgrade compile
# loader(8) with LOADER_BZIP2_SUPPORT defined
-.PATH: ${LIBSTAND_SRC}/../../contrib/bzip2
+.PATH: ${.CURDIR}/../../contrib/bzip2
CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS
SRCS+= libstand_bzlib_private.h
@@ -113,8 +108,7 @@ SRCS+= _${file}
CLEANFILES+= _${file}
_${file}: ${file}
- sed "s|bzlib_private\.h|libstand_bzlib_private.h|" \
- ${.ALLSRC} > ${.TARGET}
+ sed "s|bzlib_private\.h|libstand_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
.endfor
CLEANFILES+= libstand_bzlib_private.h
@@ -123,8 +117,8 @@ libstand_bzlib_private.h: bzlib_private.h
${.ALLSRC} > ${.TARGET}
# decompression functionality from libz
-.PATH: ${LIBSTAND_SRC}/../libz
-CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../libz
+.PATH: ${.CURDIR}/../libz
+CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../libz
SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h
.for file in infback.c inffast.c inflate.c inftrees.c zutil.c
@@ -169,3 +163,4 @@ SRCS+= nandfs.c
.endif
.include <bsd.lib.mk>
+
diff --git a/lib/libstand/Makefile.depend b/lib/libstand/Makefile.depend
new file mode 100644
index 0000000..34236cb
--- /dev/null
+++ b/lib/libstand/Makefile.depend
@@ -0,0 +1,58 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/libbz2 \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+_bzlib.o: _bzlib.c
+_bzlib.o: libstand_bzlib_private.h
+_bzlib.po: _bzlib.c
+_bzlib.po: libstand_bzlib_private.h
+_crctable.o: _crctable.c
+_crctable.o: libstand_bzlib_private.h
+_crctable.po: _crctable.c
+_crctable.po: libstand_bzlib_private.h
+_decompress.o: _decompress.c
+_decompress.o: libstand_bzlib_private.h
+_decompress.po: _decompress.c
+_decompress.po: libstand_bzlib_private.h
+_huffman.o: _huffman.c
+_huffman.o: libstand_bzlib_private.h
+_huffman.po: _huffman.c
+_huffman.po: libstand_bzlib_private.h
+_infback.o: _infback.c
+_infback.o: libstand_zutil.h
+_infback.po: _infback.c
+_infback.po: libstand_zutil.h
+_inffast.o: _inffast.c
+_inffast.o: libstand_zutil.h
+_inffast.po: _inffast.c
+_inffast.po: libstand_zutil.h
+_inflate.o: _inflate.c
+_inflate.o: libstand_zutil.h
+_inflate.po: _inflate.c
+_inflate.po: libstand_zutil.h
+_inftrees.o: _inftrees.c
+_inftrees.o: libstand_zutil.h
+_inftrees.po: _inftrees.c
+_inftrees.po: libstand_zutil.h
+_randtable.o: _randtable.c
+_randtable.o: libstand_bzlib_private.h
+_randtable.po: _randtable.c
+_randtable.po: libstand_bzlib_private.h
+_zutil.o: _zutil.c
+_zutil.o: libstand_gzguts.h
+_zutil.o: libstand_zutil.h
+_zutil.po: _zutil.c
+_zutil.po: libstand_gzguts.h
+_zutil.po: libstand_zutil.h
+.endif
diff --git a/lib/libstand/cd9660.c b/lib/libstand/cd9660.c
index 09cc7f8..c6bcef2 100644
--- a/lib/libstand/cd9660.c
+++ b/lib/libstand/cd9660.c
@@ -151,14 +151,9 @@ susp_lookup_record(struct open_file *f, const char *identifier,
return (NULL);
p = susp_buffer + isonum_733(shc->offset);
end = p + isonum_733(shc->length);
- } else {
+ } else
/* Ignore this record and skip to the next. */
p += isonum_711(sh->length);
-
- /* Avoid infinite loops with corrupted file systems */
- if (isonum_711(sh->length) == 0)
- return (NULL);
- }
}
return (NULL);
}
@@ -286,7 +281,7 @@ cd9660_open(const char *path, struct open_file *f)
buf = malloc(buf_size = ISO_DEFAULT_BLOCK_SIZE);
vd = buf;
for (bno = 16;; bno++) {
- twiddle(1);
+ twiddle();
rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno),
ISO_DEFAULT_BLOCK_SIZE, buf, &read);
if (rc)
@@ -319,7 +314,7 @@ cd9660_open(const char *path, struct open_file *f)
while (off < dsize) {
if ((off % ISO_DEFAULT_BLOCK_SIZE) == 0) {
- twiddle(1);
+ twiddle();
rc = f->f_dev->dv_strategy
(f->f_devdata, F_READ,
cdb2devb(bno + boff),
@@ -379,7 +374,7 @@ cd9660_open(const char *path, struct open_file *f)
/* Check for Rock Ridge since we didn't in the loop above. */
bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length);
- twiddle(1);
+ twiddle();
rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno),
ISO_DEFAULT_BLOCK_SIZE, buf, &read);
if (rc)
@@ -436,7 +431,7 @@ buf_read_file(struct open_file *f, char **buf_p, size_t *size_p)
if (fp->f_buf == (char *)0)
fp->f_buf = malloc(ISO_DEFAULT_BLOCK_SIZE);
- twiddle(16);
+ twiddle();
rc = f->f_dev->dv_strategy(f->f_devdata, F_READ,
cdb2devb(blkno), ISO_DEFAULT_BLOCK_SIZE, fp->f_buf, &read);
if (rc)
diff --git a/lib/libstand/dosfs.c b/lib/libstand/dosfs.c
index b75d752..72205a2 100644
--- a/lib/libstand/dosfs.c
+++ b/lib/libstand/dosfs.c
@@ -786,8 +786,7 @@ static int
ioget(struct open_file *fd, u_int lsec, void *buf, u_int nsec)
{
int err;
-
- twiddle(1);
+
if ((err = (fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec,
secbyt(nsec), buf, NULL)))
return(err);
diff --git a/lib/libstand/ext2fs.c b/lib/libstand/ext2fs.c
index d0b91e0..e0afb3e 100644
--- a/lib/libstand/ext2fs.c
+++ b/lib/libstand/ext2fs.c
@@ -353,7 +353,7 @@ ext2fs_open(const char *upath, struct open_file *f)
/* allocate space and read super block */
fs = (struct ext2fs *)malloc(sizeof(*fs));
fp->f_fs = fs;
- twiddle(1);
+ twiddle();
error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
EXT2_SBLOCK, EXT2_SBSIZE, (char *)fs, &buf_size);
if (error)
@@ -395,7 +395,7 @@ ext2fs_open(const char *upath, struct open_file *f)
len = blkgrps * fs->fs_bsize;
fp->f_bg = malloc(len);
- twiddle(1);
+ twiddle();
error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, len,
(char *)fp->f_bg, &buf_size);
@@ -507,7 +507,7 @@ ext2fs_open(const char *upath, struct open_file *f)
if (error)
goto out;
- twiddle(1);
+ twiddle();
error = (f->f_dev->dv_strategy)(f->f_devdata,
F_READ, fsb_to_db(fs, disk_block),
fs->fs_bsize, buf, &buf_size);
@@ -568,7 +568,7 @@ read_inode(ino_t inumber, struct open_file *f)
* Read inode and save it.
*/
buf = malloc(fs->fs_bsize);
- twiddle(1);
+ twiddle();
error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
ino_to_db(fs, fp->f_bg, inumber), fs->fs_bsize, buf, &rsize);
if (error)
@@ -665,7 +665,7 @@ block_map(struct open_file *f, daddr_t file_block, daddr_t *disk_block_p)
if (fp->f_blk[level] == (char *)0)
fp->f_blk[level] =
malloc(fs->fs_bsize);
- twiddle(1);
+ twiddle();
error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
fsb_to_db(fp->f_fs, ind_block_num), fs->fs_bsize,
fp->f_blk[level], &fp->f_blksize[level]);
@@ -723,7 +723,7 @@ buf_read_file(struct open_file *f, char **buf_p, size_t *size_p)
bzero(fp->f_buf, block_size);
fp->f_buf_size = block_size;
} else {
- twiddle(4);
+ twiddle();
error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
fsb_to_db(fs, disk_block), block_size,
fp->f_buf, &fp->f_buf_size);
diff --git a/lib/libstand/libstand.3 b/lib/libstand/libstand.3
index 42289c1..b42c8b5 100644
--- a/lib/libstand/libstand.3
+++ b/lib/libstand/libstand.3
@@ -288,7 +288,7 @@ Thus
printf(
.Qq reg=%b\en ,
3,
-.Qq \e10\e2BITTWO\e1BITONE
+.Qq \e10\e2BITTWO\e1BITONE\en
);
.Ed
.Pp
diff --git a/lib/libstand/nandfs.c b/lib/libstand/nandfs.c
index b8c51e3..713dc12 100644
--- a/lib/libstand/nandfs.c
+++ b/lib/libstand/nandfs.c
@@ -921,7 +921,7 @@ nandfs_bmap_lookup(struct nandfs *fs, struct nandfs_node *node,
return (0);
}
- twiddle(1);
+ twiddle();
NANDFS_DEBUG("calling get_map with %jx\n", ind_block_num);
map = nandfs_get_map(fs, node, ind_block_num, phys);
if (map == NULL)
diff --git a/lib/libstand/nfs.c b/lib/libstand/nfs.c
index a0b726c..adb0a11 100644
--- a/lib/libstand/nfs.c
+++ b/lib/libstand/nfs.c
@@ -662,7 +662,7 @@ nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid)
(int)fp->off);
#endif
while ((int)size > 0) {
- twiddle(16);
+ twiddle();
cc = nfs_readdata(fp, fp->off, (void *)addr, size);
/* XXX maybe should retry on certain errors */
if (cc == -1) {
@@ -1311,7 +1311,7 @@ nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid)
(int)fp->off);
#endif
while ((int)size > 0) {
- twiddle(16);
+ twiddle();
cc = nfs_readdata(fp, fp->off, (void *)addr, size);
/* XXX maybe should retry on certain errors */
if (cc == -1) {
diff --git a/lib/libstand/powerpc/_setjmp.S b/lib/libstand/powerpc/_setjmp.S
index 7c7c24b..3884b11 100644
--- a/lib/libstand/powerpc/_setjmp.S
+++ b/lib/libstand/powerpc/_setjmp.S
@@ -42,7 +42,7 @@
#define JMP_xer 24*REGWIDTH
#define JMP_sig 25*REGWIDTH
-ASENTRY_NOPROF(_setjmp)
+ASENTRY_NOPROF(setjmp)
ST_REG 31, JMP_r31(3)
/* r1, r2, r14-r30 */
ST_REG 1, JMP_r1 (3)
@@ -79,7 +79,7 @@ ASENTRY_NOPROF(_setjmp)
.extern sigsetmask
-ASENTRY_NOPROF(_longjmp)
+ASENTRY_NOPROF(longjmp)
LD_REG 31, JMP_r31(3)
/* r1, r2, r14-r30 */
LD_REG 1, JMP_r1 (3)
diff --git a/lib/libstand/powerpc/syncicache.c b/lib/libstand/powerpc/syncicache.c
deleted file mode 100644
index 434dcec..0000000
--- a/lib/libstand/powerpc/syncicache.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * Copyright (C) 1995-1997, 1999 Wolfgang Solfrank.
- * Copyright (C) 1995-1997, 1999 TooLs GmbH.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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 TooLs GmbH.
- * 4. The name of TooLs GmbH may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (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: syncicache.c,v 1.2 1999/05/05 12:36:40 tsubai Exp $
- */
-
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <sys/param.h>
-#if defined(_KERNEL) || defined(_STANDALONE)
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <vm/vm.h>
-#endif
-#include <sys/sysctl.h>
-
-#include <machine/cpu.h>
-#include <machine/md_var.h>
-
-#ifdef _STANDALONE
-int cacheline_size = 32;
-#endif
-
-#if !defined(_KERNEL) && !defined(_STANDALONE)
-#include <stdlib.h>
-
-int cacheline_size = 0;
-
-static void getcachelinesize(void);
-
-static void
-getcachelinesize()
-{
- static int cachemib[] = { CTL_MACHDEP, CPU_CACHELINE };
- int clen;
-
- clen = sizeof(cacheline_size);
-
- if (sysctl(cachemib, sizeof(cachemib) / sizeof(cachemib[0]),
- &cacheline_size, &clen, NULL, 0) < 0 || !cacheline_size) {
- abort();
- }
-}
-#endif
-
-void
-__syncicache(void *from, int len)
-{
- int l, off;
- char *p;
-
-#if !defined(_KERNEL) && !defined(_STANDALONE)
- if (!cacheline_size)
- getcachelinesize();
-#endif
-
- off = (u_int)from & (cacheline_size - 1);
- l = len += off;
- p = (char *)from - off;
-
- do {
- __asm __volatile ("dcbst 0,%0" :: "r"(p));
- p += cacheline_size;
- } while ((l -= cacheline_size) > 0);
- __asm __volatile ("sync");
- p = (char *)from - off;
- do {
- __asm __volatile ("icbi 0,%0" :: "r"(p));
- p += cacheline_size;
- } while ((len -= cacheline_size) > 0);
- __asm __volatile ("sync; isync");
-}
-
diff --git a/lib/libstand/printf.c b/lib/libstand/printf.c
index fef5341..157b327 100644
--- a/lib/libstand/printf.c
+++ b/lib/libstand/printf.c
@@ -187,7 +187,7 @@ ksprintn(char *nbuf, uintmax_t num, int base, int *lenp, int upper)
* the next characters (up to a control character, i.e. a character <= 32),
* give the name of the register. Thus:
*
- * kvprintf("reg=%b\n", 3, "\10\2BITTWO\1BITONE");
+ * kvprintf("reg=%b\n", 3, "\10\2BITTWO\1BITONE\n");
*
* would produce output:
*
@@ -500,7 +500,7 @@ number:
while (percent < fmt)
PCHAR(*percent++);
/*
- * Since we ignore a formatting argument it is no
+ * Since we ignore an formatting argument it is no
* longer safe to obey the remaining formatting
* arguments as the arguments will no longer match
* the format specs.
diff --git a/lib/libstand/read.c b/lib/libstand/read.c
index a984dbe..4c67dbe 100644
--- a/lib/libstand/read.c
+++ b/lib/libstand/read.c
@@ -77,7 +77,7 @@ read(int fd, void *dest, size_t bcount)
return (-1);
}
if (f->f_flags & F_RAW) {
- twiddle(4);
+ twiddle();
errno = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
btodb(f->f_offset), bcount, dest, &resid);
if (errno)
diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h
index 22ee319..bcd146a 100644
--- a/lib/libstand/stand.h
+++ b/lib/libstand/stand.h
@@ -242,8 +242,7 @@ extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3);
extern int snprintf(char *buf, size_t size, const char *cfmt, ...) __printflike(3, 4);
extern void vsprintf(char *buf, const char *cfmt, __va_list);
-extern void twiddle(u_int callerdiv);
-extern void twiddle_divisor(u_int globaldiv);
+extern void twiddle(void);
extern void ngets(char *, int);
#define gets(x) ngets((x), 0)
diff --git a/lib/libstand/tftp.c b/lib/libstand/tftp.c
index 6527c4e..e3983c3 100644
--- a/lib/libstand/tftp.c
+++ b/lib/libstand/tftp.c
@@ -447,12 +447,14 @@ tftp_read(struct open_file *f, void *addr, size_t size,
size_t *resid /* out */)
{
struct tftp_handle *tftpfile;
+ static int tc = 0;
tftpfile = (struct tftp_handle *) f->f_fsdata;
while (size > 0) {
int needblock, count;
- twiddle(32);
+ if (!(tc++ % 16))
+ twiddle();
needblock = tftpfile->off / tftpfile->tftp_blksize + 1;
diff --git a/lib/libstand/twiddle.c b/lib/libstand/twiddle.c
index 96ebbbe..e0a4c08 100644
--- a/lib/libstand/twiddle.c
+++ b/lib/libstand/twiddle.c
@@ -42,28 +42,11 @@ __FBSDID("$FreeBSD$");
/* Extra functions from NetBSD standalone printf.c */
-static u_int globaldiv;
-
void
-twiddle(u_int callerdiv)
+twiddle()
{
- static u_int callercnt, globalcnt, pos;
-
- callercnt++;
- if (callerdiv > 1 && (callercnt % callerdiv) != 0)
- return;
-
- globalcnt++;
- if (globaldiv > 1 && (globalcnt % globaldiv) != 0)
- return;
+ static int pos;
putchar("|/-\\"[pos++ & 3]);
putchar('\b');
}
-
-void
-twiddle_divisor(u_int gdiv)
-{
-
- globaldiv = gdiv;
-}
diff --git a/lib/libstand/ufs.c b/lib/libstand/ufs.c
index 928a1d1..b6f7815 100644
--- a/lib/libstand/ufs.c
+++ b/lib/libstand/ufs.c
@@ -155,7 +155,7 @@ read_inode(inumber, f)
* Read inode and save it.
*/
buf = malloc(fs->fs_bsize);
- twiddle(1);
+ twiddle();
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
fsbtodb(fs, ino_to_fsba(fs, inumber)), fs->fs_bsize,
buf, &rsize);
@@ -265,7 +265,7 @@ block_map(f, file_block, disk_block_p)
if (fp->f_blk[level] == (char *)0)
fp->f_blk[level] =
malloc(fs->fs_bsize);
- twiddle(1);
+ twiddle();
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
fsbtodb(fp->f_fs, ind_block_num),
fs->fs_bsize,
@@ -346,7 +346,7 @@ buf_write_file(f, buf_p, size_p)
if (fp->f_buf == (char *)0)
fp->f_buf = malloc(fs->fs_bsize);
- twiddle(4);
+ twiddle();
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
fsbtodb(fs, disk_block),
block_size, fp->f_buf, &fp->f_buf_size);
@@ -365,7 +365,7 @@ buf_write_file(f, buf_p, size_p)
* Write the block out to storage.
*/
- twiddle(4);
+ twiddle();
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE,
fsbtodb(fs, disk_block),
block_size, fp->f_buf, &fp->f_buf_size);
@@ -406,7 +406,7 @@ buf_read_file(f, buf_p, size_p)
bzero(fp->f_buf, block_size);
fp->f_buf_size = block_size;
} else {
- twiddle(4);
+ twiddle();
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
fsbtodb(fs, disk_block),
block_size, fp->f_buf, &fp->f_buf_size);
@@ -515,7 +515,7 @@ ufs_open(upath, f)
/* allocate space and read super block */
fs = malloc(SBLOCKSIZE);
fp->f_fs = fs;
- twiddle(1);
+ twiddle();
/*
* Try reading the superblock in each of its possible locations.
*/
@@ -649,7 +649,7 @@ ufs_open(upath, f)
if (rc)
goto out;
- twiddle(1);
+ twiddle();
rc = (f->f_dev->dv_strategy)(f->f_devdata,
F_READ, fsbtodb(fs, disk_block),
fs->fs_bsize, buf, &buf_size);
diff --git a/lib/libstand/write.c b/lib/libstand/write.c
index 9e02f08..dccdb8b 100644
--- a/lib/libstand/write.c
+++ b/lib/libstand/write.c
@@ -80,7 +80,7 @@ write(fd, dest, bcount)
return (-1);
}
if (f->f_flags & F_RAW) {
- twiddle(4);
+ twiddle();
errno = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE,
btodb(f->f_offset), bcount, dest, &resid);
if (errno)
diff --git a/lib/libstdbuf/Makefile.depend b/lib/libstdbuf/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libstdbuf/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libstdthreads/Makefile b/lib/libstdthreads/Makefile
index 8daee58..544eeb0 100644
--- a/lib/libstdthreads/Makefile
+++ b/lib/libstdthreads/Makefile
@@ -32,7 +32,8 @@ MLINKS= thrd_create.3 call_once.3 \
thrd_create.3 tss_get.3 \
thrd_create.3 tss_set.3
-LIBADD= pthread
+DPADD= ${LIBPTHREAD}
+LDADD= -lpthread
VERSION_DEF= ${.CURDIR}/../libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
diff --git a/lib/libstdthreads/Makefile.depend b/lib/libstdthreads/Makefile.depend
new file mode 100644
index 0000000..3b39ad7
--- /dev/null
+++ b/lib/libstdthreads/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libthr \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libstdthreads/mtx.c b/lib/libstdthreads/mtx.c
index f38fbae..6c9166d 100644
--- a/lib/libstdthreads/mtx.c
+++ b/lib/libstdthreads/mtx.c
@@ -96,7 +96,7 @@ int
mtx_trylock(mtx_t *mtx)
{
- switch (pthread_mutex_trylock(mtx)) {
+ switch (pthread_mutex_lock(mtx)) {
case 0:
return (thrd_success);
case EBUSY:
diff --git a/lib/libstdthreads/thrd.c b/lib/libstdthreads/thrd.c
index b0e36ef..f0ce55a 100644
--- a/lib/libstdthreads/thrd.c
+++ b/lib/libstdthreads/thrd.c
@@ -108,8 +108,7 @@ thrd_join(thrd_t thr, int *res)
if (pthread_join(thr, &value_ptr) != 0)
return (thrd_error);
- if (res != NULL)
- *res = (intptr_t)value_ptr;
+ *res = (intptr_t)value_ptr;
return (thrd_success);
}
diff --git a/lib/libtacplus/Makefile b/lib/libtacplus/Makefile
index 01345e1..798c949 100644
--- a/lib/libtacplus/Makefile
+++ b/lib/libtacplus/Makefile
@@ -28,7 +28,8 @@ LIB= tacplus
SRCS= taclib.c
INCS= taclib.h
CFLAGS+= -Wall
-LIBADD= md
+DPADD= ${LIBMD}
+LDADD= -lmd
SHLIB_MAJOR= 5
MAN= libtacplus.3 tacplus.conf.5
diff --git a/lib/libtacplus/Makefile.depend b/lib/libtacplus/Makefile.depend
new file mode 100644
index 0000000..9c2e453
--- /dev/null
+++ b/lib/libtacplus/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libmd \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libtelnet/Makefile b/lib/libtelnet/Makefile
index 3ddecf0..7f73733 100644
--- a/lib/libtelnet/Makefile
+++ b/lib/libtelnet/Makefile
@@ -26,7 +26,4 @@ CFLAGS+= -DKRB5 -I${KRB5DIR}/lib/krb5 -I${KRB5OBJDIR} -I${ASN1OBJDIR}
CFLAGS+= -DFORWARD -Dnet_write=telnet_net_write
.endif
-INCS= ${TELNETDIR}/arpa/telnet.h
-INCSDIR= ${INCLUDEDIR}/arpa
-
.include <bsd.lib.mk>
diff --git a/lib/libtelnet/Makefile.depend b/lib/libtelnet/Makefile.depend
new file mode 100644
index 0000000..3c42067
--- /dev/null
+++ b/lib/libtelnet/Makefile.depend
@@ -0,0 +1,19 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ kerberos5/lib/libasn1 \
+ kerberos5/lib/libkrb5 \
+ lib/libmp \
+ lib/libpam/libpam \
+ secure/lib/libcrypto \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile
index 1717672..5cbd0aa 100644
--- a/lib/libthr/Makefile
+++ b/lib/libthr/Makefile
@@ -40,14 +40,13 @@ MAN= libthr.3
# enable extra internal consistancy checks
CFLAGS+=-D_PTHREADS_INVARIANTS
+#CFLAGS+=-g
PRECIOUSLIB=
.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
-.if exists(${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc)
.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc"
-.endif
.include "${.CURDIR}/sys/Makefile.inc"
.include "${.CURDIR}/thread/Makefile.inc"
@@ -61,8 +60,10 @@ SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so
SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a
.endif
-.if ${MK_TESTS} != "no"
-SUBDIR+= tests
+.if ${MK_SYSCALL_COMPAT} != "no"
+CFLAGS+=-DSYSCALL_COMPAT
.endif
+.include <bsd.arch.inc.mk>
+
.include <bsd.lib.mk>
diff --git a/lib/libthr/Makefile.amd64 b/lib/libthr/Makefile.amd64
new file mode 100644
index 0000000..dd0f5b0
--- /dev/null
+++ b/lib/libthr/Makefile.amd64
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
diff --git a/lib/libthr/Makefile.depend b/lib/libthr/Makefile.depend
new file mode 100644
index 0000000..be21aee
--- /dev/null
+++ b/lib/libthr/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libthr/Makefile.i386 b/lib/libthr/Makefile.i386
new file mode 100644
index 0000000..dd0f5b0
--- /dev/null
+++ b/lib/libthr/Makefile.i386
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
diff --git a/lib/libthr/arch/aarch64/Makefile.inc b/lib/libthr/arch/aarch64/Makefile.inc
deleted file mode 100644
index b720e3d..0000000
--- a/lib/libthr/arch/aarch64/Makefile.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-# $FreeBSD$
-
diff --git a/lib/libthr/arch/aarch64/include/pthread_md.h b/lib/libthr/arch/aarch64/include/pthread_md.h
deleted file mode 100644
index 14c1893..0000000
--- a/lib/libthr/arch/aarch64/include/pthread_md.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * Copyright (c) 2005 David Xu <davidxu@freebsd.org>.
- * Copyright (c) 2014 the FreeBSD Foundation
- * All rights reserved.
- *
- * Portions of this software were developed by Andrew Turner
- * 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 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$
- */
-
-/*
- * Machine-dependent thread prototypes/definitions.
- */
-#ifndef _PTHREAD_MD_H_
-#define _PTHREAD_MD_H_
-
-#include <sys/types.h>
-#include <machine/sysarch.h>
-#include <stddef.h>
-
-#define CPU_SPINWAIT
-#define DTV_OFFSET offsetof(struct tcb, tcb_dtv)
-
-/*
- * Variant I tcb. The structure layout is fixed, don't blindly
- * change it.
- */
-struct tcb {
- void *tcb_dtv;
- struct pthread *tcb_thread;
-};
-
-/* Called from the thread to set its private data. */
-static __inline void
-_tcb_set(struct tcb *tcb)
-{
-
- __asm __volatile("msr tpidr_el0, %x0" :: "r" (tcb));
-}
-
-/*
- * Get the current tcb.
- */
-static __inline struct tcb *
-_tcb_get(void)
-{
- struct tcb *tcb;
-
- __asm __volatile("mrs %x0, tpidr_el0" : "=r" (tcb));
- return (tcb);
-}
-
-extern struct pthread *_thr_initial;
-
-static __inline struct pthread *
-_get_curthread(void)
-{
-
- return (_tcb_get()->tcb_thread);
-}
-
-#endif /* _PTHREAD_MD_H_ */
diff --git a/lib/libthr/arch/amd64/Makefile.inc b/lib/libthr/arch/amd64/Makefile.inc
index 797618d..e6d99ec 100644
--- a/lib/libthr/arch/amd64/Makefile.inc
+++ b/lib/libthr/arch/amd64/Makefile.inc
@@ -1,3 +1,3 @@
#$FreeBSD$
-SRCS+= _umtx_op_err.S
+SRCS+= pthread_md.c _umtx_op_err.S
diff --git a/lib/libthr/arch/amd64/amd64/pthread_md.c b/lib/libthr/arch/amd64/amd64/pthread_md.c
new file mode 100644
index 0000000..b661657
--- /dev/null
+++ b/lib/libthr/arch/amd64/amd64/pthread_md.c
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2003 Daniel Eischen <deischen@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Neither the name of the author nor the names of its 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 ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED 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$
+ */
+
+#include <sys/types.h>
+#include <rtld_tls.h>
+
+#include "pthread_md.h"
+
+/*
+ * The constructors.
+ */
+struct tcb *
+_tcb_ctor(struct pthread *thread, int initial)
+{
+ struct tcb *tcb;
+
+ if (initial)
+ __asm __volatile("movq %%fs:0, %0" : "=r" (tcb));
+ else
+ tcb = _rtld_allocate_tls(NULL, sizeof(struct tcb), 16);
+ if (tcb)
+ tcb->tcb_thread = thread;
+ return (tcb);
+}
+
+void
+_tcb_dtor(struct tcb *tcb)
+{
+ _rtld_free_tls(tcb, sizeof(struct tcb), 16);
+}
diff --git a/lib/libthr/arch/amd64/include/pthread_md.h b/lib/libthr/arch/amd64/include/pthread_md.h
index e4a0dd2..0ebea2e 100644
--- a/lib/libthr/arch/amd64/include/pthread_md.h
+++ b/lib/libthr/arch/amd64/include/pthread_md.h
@@ -77,6 +77,9 @@ struct tcb {
__result; \
})
+struct tcb *_tcb_ctor(struct pthread *, int);
+void _tcb_dtor(struct tcb *tcb);
+
static __inline void
_tcb_set(struct tcb *tcb)
{
diff --git a/lib/libthr/arch/arm/Makefile.inc b/lib/libthr/arch/arm/Makefile.inc
new file mode 100644
index 0000000..2ee2247
--- /dev/null
+++ b/lib/libthr/arch/arm/Makefile.inc
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+SRCS+= pthread_md.c
diff --git a/lib/libthr/arch/arm/arm/pthread_md.c b/lib/libthr/arch/arm/arm/pthread_md.c
new file mode 100644
index 0000000..028f06c
--- /dev/null
+++ b/lib/libthr/arch/arm/arm/pthread_md.c
@@ -0,0 +1,53 @@
+/*-
+ * Copyright (C) 2005 David Xu <davidxu@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Neither the name of the author nor the names of its 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.
+ *
+ * $FreeBSD$
+ */
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <rtld_tls.h>
+
+#include "pthread_md.h"
+
+struct tcb *
+_tcb_ctor(struct pthread *thread, int initial)
+{
+ struct tcb *tcb;
+
+ tcb = _rtld_allocate_tls((initial) ? _tcb_get() : NULL,
+ sizeof(struct tcb), 16);
+ if (tcb)
+ tcb->tcb_thread = thread;
+
+ return (tcb);
+}
+
+void
+_tcb_dtor(struct tcb *tcb)
+{
+
+ _rtld_free_tls(tcb, sizeof(struct tcb), 16);
+}
diff --git a/lib/libthr/arch/arm/include/pthread_md.h b/lib/libthr/arch/arm/include/pthread_md.h
index 9a6b523..3c3dd6d 100644
--- a/lib/libthr/arch/arm/include/pthread_md.h
+++ b/lib/libthr/arch/arm/include/pthread_md.h
@@ -47,6 +47,12 @@ struct tcb {
struct pthread *tcb_thread; /* our hook */
};
+/*
+ * The tcb constructors.
+ */
+struct tcb *_tcb_ctor(struct pthread *, int);
+void _tcb_dtor(struct tcb *);
+
/* Called from the thread to set its private data. */
static __inline void
_tcb_set(struct tcb *tcb)
diff --git a/lib/libthr/arch/i386/Makefile.inc b/lib/libthr/arch/i386/Makefile.inc
index bdab0bc..01290d5 100644
--- a/lib/libthr/arch/i386/Makefile.inc
+++ b/lib/libthr/arch/i386/Makefile.inc
@@ -1,3 +1,3 @@
# $FreeBSD$
-SRCS+= _umtx_op_err.S
+SRCS+= pthread_md.c _umtx_op_err.S
diff --git a/lib/libthr/arch/i386/i386/pthread_md.c b/lib/libthr/arch/i386/i386/pthread_md.c
new file mode 100644
index 0000000..a8b31d5
--- /dev/null
+++ b/lib/libthr/arch/i386/i386/pthread_md.c
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (C) 2003 David Xu <davidxu@freebsd.org>
+ * Copyright (c) 2001,2003 Daniel Eischen <deischen@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Neither the name of the author nor the names of its 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.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/types.h>
+#include <machine/segments.h>
+#include <machine/sysarch.h>
+#include <string.h>
+#include <rtld_tls.h>
+
+#include "pthread_md.h"
+
+struct tcb *
+_tcb_ctor(struct pthread *thread, int initial)
+{
+ struct tcb *tcb;
+
+ if (initial)
+ __asm __volatile("movl %%gs:0, %0" : "=r" (tcb));
+ else
+ tcb = _rtld_allocate_tls(NULL, sizeof(struct tcb), 16);
+ if (tcb)
+ tcb->tcb_thread = thread;
+ return (tcb);
+}
+
+void
+_tcb_dtor(struct tcb *tcb)
+{
+
+ _rtld_free_tls(tcb, sizeof(struct tcb), 16);
+}
diff --git a/lib/libthr/arch/i386/include/pthread_md.h b/lib/libthr/arch/i386/include/pthread_md.h
index ba7b75c..c160aa4 100644
--- a/lib/libthr/arch/i386/include/pthread_md.h
+++ b/lib/libthr/arch/i386/include/pthread_md.h
@@ -76,6 +76,12 @@ struct tcb {
__result; \
})
+/*
+ * The constructors.
+ */
+struct tcb *_tcb_ctor(struct pthread *, int);
+void _tcb_dtor(struct tcb *tcb);
+
/* Called from the thread to set its private data. */
static __inline void
_tcb_set(struct tcb *tcb)
diff --git a/lib/libthr/arch/mips/Makefile.inc b/lib/libthr/arch/mips/Makefile.inc
new file mode 100644
index 0000000..2ee2247
--- /dev/null
+++ b/lib/libthr/arch/mips/Makefile.inc
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+SRCS+= pthread_md.c
diff --git a/lib/libthr/arch/mips/include/pthread_md.h b/lib/libthr/arch/mips/include/pthread_md.h
index 32af964..19c9f38 100644
--- a/lib/libthr/arch/mips/include/pthread_md.h
+++ b/lib/libthr/arch/mips/include/pthread_md.h
@@ -50,6 +50,12 @@ struct tcb {
struct pthread *tcb_thread;
};
+/*
+ * The tcb constructors.
+ */
+struct tcb *_tcb_ctor(struct pthread *, int);
+void _tcb_dtor(struct tcb *);
+
/* Called from the thread to set its private data. */
static __inline void
_tcb_set(struct tcb *tcb)
diff --git a/lib/libkvm/kvm_aarch64.c b/lib/libthr/arch/mips/mips/pthread_md.c
index f98ef36..e596edc 100644
--- a/lib/libkvm/kvm_aarch64.c
+++ b/lib/libthr/arch/mips/mips/pthread_md.c
@@ -1,18 +1,15 @@
/*-
- * Copyright (c) 2014 The FreeBSD Foundation
+ * Copyright (C) 2005 David Xu <davidxu@freebsd.org>
* All rights reserved.
*
- * This software was developed by Andrew Turner 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.
+ * 2. Neither the name of the author nor the names of its 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
@@ -25,40 +22,38 @@
* LIABILITY, OR TORT (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: src/lib/libthr/arch/arm/arm/pthread_md.c,v 1.2 2005/10/29 13:40:31 davidxu
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
-
-#include <limits.h>
-#include <kvm.h>
-#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
+#include <rtld_tls.h>
+#include <strings.h>
-#include "kvm_private.h"
+#include <machine/sysarch.h>
-void
-_kvm_freevtop(kvm_t *kd)
-{
+#include "pthread_md.h"
- printf("_kvm_freevtop\n");
- abort();
-}
-
-int
-_kvm_initvtop(kvm_t *kd)
+struct tcb *
+_tcb_ctor(struct pthread *thread, int initial)
{
+ struct tcb *tcb;
- printf("_kvm_initvtop\n");
- abort();
+ tcb = _rtld_allocate_tls((initial) ? _tcb_get() : NULL,
+ sizeof(struct tcb), 16);
+ if (tcb)
+ tcb->tcb_thread = thread;
+
+ return (tcb);
}
-int
-_kvm_kvatop(kvm_t *kd, u_long va, off_t *pa)
+void
+_tcb_dtor(struct tcb *tcb)
{
- printf("_kvm_kvatop\n");
- abort();
+ _rtld_free_tls(tcb, sizeof(struct tcb), 16);
}
diff --git a/lib/libthr/arch/powerpc/Makefile.inc b/lib/libthr/arch/powerpc/Makefile.inc
new file mode 100644
index 0000000..2ee2247
--- /dev/null
+++ b/lib/libthr/arch/powerpc/Makefile.inc
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+SRCS+= pthread_md.c
diff --git a/lib/libthr/arch/powerpc/include/pthread_md.h b/lib/libthr/arch/powerpc/include/pthread_md.h
index 544ee1c..91102b4 100644
--- a/lib/libthr/arch/powerpc/include/pthread_md.h
+++ b/lib/libthr/arch/powerpc/include/pthread_md.h
@@ -55,26 +55,29 @@ struct tcb {
struct pthread *tcb_thread;
};
+struct tcb *_tcb_ctor(struct pthread *, int);
+void _tcb_dtor(struct tcb *);
+
static __inline void
_tcb_set(struct tcb *tcb)
{
#ifdef __powerpc64__
- __asm __volatile("mr 13,%0" ::
- "r"((uint8_t *)tcb + TP_OFFSET));
+ register uint8_t *_tp __asm__("%r13");
#else
- __asm __volatile("mr 2,%0" ::
- "r"((uint8_t *)tcb + TP_OFFSET));
+ register uint8_t *_tp __asm__("%r2");
#endif
+
+ __asm __volatile("mr %0,%1" : "=r"(_tp) :
+ "r"((uint8_t *)tcb + TP_OFFSET));
}
static __inline struct tcb *
_tcb_get(void)
{
- register uint8_t *_tp;
#ifdef __powerpc64__
- __asm __volatile("mr %0,13" : "=r"(_tp));
+ register uint8_t *_tp __asm__("%r13");
#else
- __asm __volatile("mr %0,2" : "=r"(_tp));
+ register uint8_t *_tp __asm__("%r2");
#endif
return ((struct tcb *)(_tp - TP_OFFSET));
diff --git a/lib/libthr/arch/powerpc/powerpc/pthread_md.c b/lib/libthr/arch/powerpc/powerpc/pthread_md.c
new file mode 100644
index 0000000..66f043e
--- /dev/null
+++ b/lib/libthr/arch/powerpc/powerpc/pthread_md.c
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2003 Daniel Eischen <deischen@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Neither the name of the author nor the names of its 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 ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED 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$
+ */
+
+#include <sys/types.h>
+#include <rtld_tls.h>
+
+#include "pthread_md.h"
+
+/*
+ * The constructors.
+ */
+struct tcb *
+_tcb_ctor(struct pthread *thread, int initial)
+{
+ struct tcb *tcb;
+
+ tcb = _rtld_allocate_tls((initial) ? _tcb_get() : NULL,
+ sizeof(struct tcb), 1);
+ if (tcb)
+ tcb->tcb_thread = thread;
+ return (tcb);
+
+}
+
+void
+_tcb_dtor(struct tcb *tcb)
+{
+ _rtld_free_tls(tcb, sizeof(struct tcb), 1);
+}
diff --git a/lib/libthr/arch/sparc64/Makefile.inc b/lib/libthr/arch/sparc64/Makefile.inc
index bdab0bc..88586b4 100644
--- a/lib/libthr/arch/sparc64/Makefile.inc
+++ b/lib/libthr/arch/sparc64/Makefile.inc
@@ -1,3 +1,3 @@
# $FreeBSD$
-SRCS+= _umtx_op_err.S
+SRCS+= _umtx_op_err.S pthread_md.c
diff --git a/lib/libthr/arch/sparc64/include/pthread_md.h b/lib/libthr/arch/sparc64/include/pthread_md.h
index 35d8405..7ee9654 100644
--- a/lib/libthr/arch/sparc64/include/pthread_md.h
+++ b/lib/libthr/arch/sparc64/include/pthread_md.h
@@ -50,6 +50,12 @@ struct tcb {
void *tcb_spare[1];
};
+/*
+ * The tcb constructors.
+ */
+struct tcb *_tcb_ctor(struct pthread *, int);
+void _tcb_dtor(struct tcb *);
+
/* Called from the thread to set its private data. */
static __inline void
_tcb_set(struct tcb *tcb)
diff --git a/lib/libthr/thread/thr_ctrdtr.c b/lib/libthr/arch/sparc64/sparc64/pthread_md.c
index 9d4301e..e1d439a 100644
--- a/lib/libthr/thread/thr_ctrdtr.c
+++ b/lib/libthr/arch/sparc64/sparc64/pthread_md.c
@@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <rtld_tls.h>
-#include "thr_private.h"
+#include "pthread_md.h"
struct tcb *
_tcb_ctor(struct pthread *thread, int initial)
diff --git a/lib/libthr/libthr.3 b/lib/libthr/libthr.3
index 8108e2f..4b636ce 100644
--- a/lib/libthr/libthr.3
+++ b/lib/libthr/libthr.3
@@ -1,5 +1,5 @@
.\" Copyright (c) 2005 Robert N. M. Watson
-.\" Copyright (c) 2014,2015 The FreeBSD Foundation, Inc.
+.\" Copyright (c) 2014 The FreeBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" Part of this documentation was written by
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 12, 2015
+.Dd September 26, 2014
.Dt LIBTHR 3
.Os
.Sh NAME
@@ -200,25 +200,45 @@ Bigger values reduce the frequency of the FIFO discipline.
The value must be between 0 and 255.
.El
.Sh INTERACTION WITH RUN-TIME LINKER
-On load,
+The
.Nm
-installs interposing handlers into the hooks exported by
-.Li libc .
-The interposers provide real locking implementation instead of the
-stubs for single-threaded processes in
-.Li ,
-cancellation support and some modifications to the signal operations.
+library must appear before
+.Li libc
+in the global order of depended objects.
+.Pp
+Loading
+.Nm
+with the
+.Xr dlopen 3
+call in the process after the program binary is activated
+is not supported, and causes miscellaneous and hard-to-diagnose misbehaviour.
+This is due to
+.Nm
+interposing several important
+.Li libc
+symbols to provide thread-safe services.
+In particular,
+.Dv errno
+and the locking stubs from
+.Li libc
+are affected.
+This requirement is currently not enforced.
+.Pp
+If the program loads any modules at run-time, and those modules may require
+threading services, the main program binary must be linked with
+.Li libpthread ,
+even if it does not require any services from the library.
.Pp
.Nm
cannot be unloaded; the
.Xr dlclose 3
function does not perform any action when called with a handle for
.Nm .
-One of the reasons is that the internal interposing of
+One of the reasons is that the interposing of
.Li libc
functions cannot be undone.
.Sh SIGNALS
-The implementation interposes the user-installed
+The implementation also interposes the user-installed
.Xr signal 3
handlers.
This interposing is done to postpone signal delivery to threads which
diff --git a/lib/libthr/pthread.map b/lib/libthr/pthread.map
index 0903989..bbbd930e 100644
--- a/lib/libthr/pthread.map
+++ b/lib/libthr/pthread.map
@@ -6,6 +6,22 @@
* Use the same naming scheme as libc.
*/
FBSD_1.0 {
+ __error;
+ accept;
+ aio_suspend;
+ close;
+ connect;
+ creat;
+ execve;
+ fcntl;
+ fork;
+ fsync;
+ msync;
+ nanosleep;
+ open;
+ pause;
+ poll;
+ pselect;
pthread_atfork;
pthread_barrier_destroy;
pthread_barrier_init;
@@ -123,6 +139,30 @@ FBSD_1.0 {
pthread_testcancel;
pthread_timedjoin_np;
pthread_yield;
+ raise;
+ read;
+ readv;
+ recvfrom;
+ recvmsg;
+ select;
+ sendmsg;
+ sendto;
+ sigaction;
+ sigprocmask;
+ sigsuspend;
+ sigwait;
+ sigwaitinfo;
+ sigtimedwait;
+ sleep;
+ system;
+ tcdrain;
+ usleep;
+ wait;
+ wait3;
+ wait4;
+ waitpid;
+ write;
+ writev;
};
/*
@@ -130,6 +170,28 @@ FBSD_1.0 {
* These are not part of our application ABI.
*/
FBSDprivate_1.0 {
+ ___creat;
+ ___pause;
+ ___pselect;
+ ___sigwait;
+ ___sleep;
+ ___system;
+ ___tcdrain;
+ ___usleep;
+ ___wait;
+ ___waitpid;
+ __accept;
+ __accept4;
+ __aio_suspend;
+ __close;
+ __connect;
+ __fcntl;
+ __fsync;
+ __msync;
+ __nanosleep;
+ __open;
+ __openat;
+ __poll;
__pthread_cond_timedwait;
__pthread_cond_wait;
__pthread_cxa_finalize;
@@ -137,6 +199,21 @@ FBSDprivate_1.0 {
__pthread_mutex_lock;
__pthread_mutex_timedlock;
__pthread_mutex_trylock;
+ __read;
+ __readv;
+ __recvfrom;
+ __recvmsg;
+ __select;
+ __sendmsg;
+ __sendto;
+ __sigsuspend;
+ __sigtimedwait;
+ __sigwaitinfo;
+ __wait3;
+ __wait4;
+ __write;
+ __writev;
+ _fork;
_pthread_atfork;
_pthread_barrier_destroy;
_pthread_barrier_init;
@@ -268,6 +345,18 @@ FBSDprivate_1.0 {
_pthread_testcancel;
_pthread_timedjoin_np;
_pthread_yield;
+ _raise;
+ _setcontext;
+ _sigaction;
+ _sigprocmask;
+ _sigsuspend;
+ _sigtimedwait;
+ _sigwait;
+ _sigwaitinfo;
+ _spinlock;
+ _spinlock_debug;
+ _spinunlock;
+ _swapcontext;
/* Debugger needs these. */
_libthr_debug;
@@ -315,5 +404,12 @@ FBSD_1.1 {
};
FBSD_1.2 {
+ openat;
pthread_getthreadid_np;
+ setcontext;
+ swapcontext;
+};
+
+FBSD_1.3 {
+ accept4;
};
diff --git a/lib/libthr/sys/thr_error.c b/lib/libthr/sys/thr_error.c
index 852588a..45295c5 100644
--- a/lib/libthr/sys/thr_error.c
+++ b/lib/libthr/sys/thr_error.c
@@ -42,9 +42,8 @@
#undef errno
extern int errno;
-__weak_reference(__error_threaded, __error);
int *
-__error_threaded(void)
+__error(void)
{
struct pthread *curthread;
diff --git a/lib/libthr/tests/Makefile b/lib/libthr/tests/Makefile
index 11cf0e7..50f07f0 100644
--- a/lib/libthr/tests/Makefile
+++ b/lib/libthr/tests/Makefile
@@ -25,9 +25,7 @@ NETBSD_ATF_TESTS_C+= sigmask_test
NETBSD_ATF_TESTS_C+= sigsuspend_test
NETBSD_ATF_TESTS_C+= siglongjmp_test
NETBSD_ATF_TESTS_C+= sleep_test
-.if ${MACHINE} != "arm64" # ARM64TODO: Missing makecontext
NETBSD_ATF_TESTS_C+= swapcontext_test
-.endif
NETBSD_ATF_TESTS_SH= atexit_test
NETBSD_ATF_TESTS_SH+= cancel_test
diff --git a/lib/libthr/thread/Makefile.inc b/lib/libthr/thread/Makefile.inc
index 1a7c63d..ddde6e9 100644
--- a/lib/libthr/thread/Makefile.inc
+++ b/lib/libthr/thread/Makefile.inc
@@ -14,7 +14,6 @@ SRCS+= \
thr_cond.c \
thr_condattr.c \
thr_create.c \
- thr_ctrdtr.c \
thr_detach.c \
thr_equal.c \
thr_event.c \
diff --git a/lib/libthr/thread/thr_barrier.c b/lib/libthr/thread/thr_barrier.c
index 10b6346..86f880e 100644
--- a/lib/libthr/thread/thr_barrier.c
+++ b/lib/libthr/thread/thr_barrier.c
@@ -86,13 +86,16 @@ _pthread_barrier_init(pthread_barrier_t *barrier,
if (barrier == NULL || count <= 0)
return (EINVAL);
- bar = calloc(1, sizeof(struct pthread_barrier));
+ bar = malloc(sizeof(struct pthread_barrier));
if (bar == NULL)
return (ENOMEM);
_thr_umutex_init(&bar->b_lock);
_thr_ucond_init(&bar->b_cv);
+ bar->b_cycle = 0;
+ bar->b_waiters = 0;
bar->b_count = count;
+ bar->b_refcount = 0;
*barrier = bar;
return (0);
diff --git a/lib/libthr/thread/thr_clean.c b/lib/libthr/thread/thr_clean.c
index f200726..dc5b0c7 100644
--- a/lib/libthr/thread/thr_clean.c
+++ b/lib/libthr/thread/thr_clean.c
@@ -84,7 +84,7 @@ _pthread_cleanup_push(void (*routine) (void *), void *arg)
curthread->unwind_disabled = 1;
#endif
if ((newbuf = (struct pthread_cleanup *)
- malloc(sizeof(struct pthread_cleanup))) != NULL) {
+ malloc(sizeof(struct _pthread_cleanup_info))) != NULL) {
newbuf->routine = routine;
newbuf->routine_arg = arg;
newbuf->onheap = 1;
diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c
index df3509d..a41b33f 100644
--- a/lib/libthr/thread/thr_create.c
+++ b/lib/libthr/thread/thr_create.c
@@ -40,7 +40,6 @@
#include <pthread_np.h>
#include "un-namespace.h"
-#include "libc_private.h"
#include "thr_private.h"
static int create_stack(struct pthread_attr *pattr);
@@ -67,11 +66,8 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
/*
* Tell libc and others now they need lock to protect their data.
*/
- if (_thr_isthreaded() == 0) {
- _malloc_first_thread();
- if (_thr_setthreaded(1))
- return (EAGAIN);
- }
+ if (_thr_isthreaded() == 0 && _thr_setthreaded(1))
+ return (EAGAIN);
curthread = _get_curthread();
if ((new_thread = _thr_alloc(curthread)) == NULL)
diff --git a/lib/libthr/thread/thr_fork.c b/lib/libthr/thread/thr_fork.c
index 7dc8ca8..fc87688 100644
--- a/lib/libthr/thread/thr_fork.c
+++ b/lib/libthr/thread/thr_fork.c
@@ -128,10 +128,12 @@ __pthread_cxa_finalize(struct dl_phdr_info *phdr_info)
_thr_sigact_unload(phdr_info);
}
-__weak_reference(__thr_fork, _fork);
+__weak_reference(_fork, fork);
+
+pid_t _fork(void);
pid_t
-__thr_fork(void)
+_fork(void)
{
struct pthread *curthread;
struct pthread_atfork *af;
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c
index 9a1a67a..6d6a532 100644
--- a/lib/libthr/thread/thr_init.c
+++ b/lib/libthr/thread/thr_init.c
@@ -37,7 +37,6 @@
#include <sys/types.h>
#include <sys/signalvar.h>
#include <sys/ioctl.h>
-#include <sys/link_elf.h>
#include <sys/resource.h>
#include <sys/sysctl.h>
#include <sys/ttycom.h>
@@ -303,7 +302,7 @@ _thread_init_hack(void)
void
_libpthread_init(struct pthread *curthread)
{
- int fd, first, dlopened;
+ int fd, first = 0;
/* Check if this function has already been called: */
if ((_thr_initial != NULL) && (curthread == NULL))
@@ -317,7 +316,6 @@ _libpthread_init(struct pthread *curthread)
if (sizeof(jmp_table) != (sizeof(pthread_func_t) * PJT_MAX * 2))
PANIC("Thread jump table not properly initialized");
memcpy(__thr_jtable, jmp_table, sizeof(jmp_table));
- __thr_interpose_libc();
/*
* Check for the special case of this process running as
@@ -351,10 +349,7 @@ _libpthread_init(struct pthread *curthread)
if (curthread == NULL)
PANIC("Can't allocate initial thread");
init_main_thread(curthread);
- } else {
- first = 0;
}
-
/*
* Add the thread to the thread list queue.
*/
@@ -366,8 +361,7 @@ _libpthread_init(struct pthread *curthread)
if (first) {
_thr_initial = curthread;
- dlopened = _rtld_is_dlopened(&_thread_autoinit_dummy_decl) != 0;
- _thr_signal_init(dlopened);
+ _thr_signal_init();
if (_thread_event_mask & TD_CREATE)
_thr_report_creation(curthread, curthread);
/*
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
index 26e8776..61ff077 100644
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -633,7 +633,7 @@ mutex_unlock_common(struct pthread_mutex *m, int cv, int *mtx_defer)
{
struct pthread *curthread = _get_curthread();
uint32_t id;
- int defered, error;
+ int defered;
if (__predict_false(m <= THR_MUTEX_DESTROYED)) {
if (m == THR_MUTEX_DESTROYED)
@@ -647,7 +647,6 @@ mutex_unlock_common(struct pthread_mutex *m, int cv, int *mtx_defer)
if (__predict_false(m->m_owner != curthread))
return (EPERM);
- error = 0;
id = TID(curthread);
if (__predict_false(
PMUTEX_TYPE(m->m_flags) == PTHREAD_MUTEX_RECURSIVE &&
@@ -661,7 +660,7 @@ mutex_unlock_common(struct pthread_mutex *m, int cv, int *mtx_defer)
defered = 0;
DEQUEUE_MUTEX(curthread, m);
- error = _thr_umutex_unlock2(&m->m_lock, id, mtx_defer);
+ _thr_umutex_unlock2(&m->m_lock, id, mtx_defer);
if (mtx_defer == NULL && defered) {
_thr_wake_all(curthread->defer_waiters,
@@ -671,7 +670,7 @@ mutex_unlock_common(struct pthread_mutex *m, int cv, int *mtx_defer)
}
if (!cv && m->m_flags & PMUTEX_FLAG_PRIVATE)
THR_CRITICAL_LEAVE(curthread);
- return (error);
+ return (0);
}
int
diff --git a/lib/libthr/thread/thr_printf.c b/lib/libthr/thread/thr_printf.c
index a64b446..7d32ae7 100644
--- a/lib/libthr/thread/thr_printf.c
+++ b/lib/libthr/thread/thr_printf.c
@@ -31,7 +31,6 @@
#include <unistd.h>
#include <pthread.h>
-#include "libc_private.h"
#include "thr_private.h"
static void pchar(int fd, char c);
diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h
index ed24c38..c6651cd 100644
--- a/lib/libthr/thread/thr_private.h
+++ b/lib/libthr/thread/thr_private.h
@@ -337,7 +337,7 @@ struct pthread_key {
/*
* lwpid_t is 32bit but kernel thr API exports tid as long type
- * to preserve the ABI for M:N model in very early date (r131431).
+ * in very earily date.
*/
#define TID(thread) ((uint32_t) ((thread)->tid))
@@ -763,7 +763,7 @@ void _thr_cancel_leave(struct pthread *, int) __hidden;
void _thr_testcancel(struct pthread *) __hidden;
void _thr_signal_block(struct pthread *) __hidden;
void _thr_signal_unblock(struct pthread *) __hidden;
-void _thr_signal_init(int) __hidden;
+void _thr_signal_init(void) __hidden;
void _thr_signal_deinit(void) __hidden;
int _thr_send_sig(struct pthread *, int sig) __hidden;
void _thr_list_init(void) __hidden;
@@ -839,6 +839,7 @@ int __sys_close(int);
int __sys_fork(void);
pid_t __sys_getpid(void);
ssize_t __sys_read(int, void *, size_t);
+ssize_t __sys_write(int, const void *, size_t);
void __sys_exit(int);
#endif
@@ -905,36 +906,12 @@ int _sleepq_remove(struct sleepqueue *, struct pthread *) __hidden;
void _sleepq_drop(struct sleepqueue *,
void (*cb)(struct pthread *, void *arg), void *) __hidden;
-int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex,
- void *(calloc_cb)(size_t, size_t));
-
struct dl_phdr_info;
void __pthread_cxa_finalize(struct dl_phdr_info *phdr_info);
void _thr_tsd_unload(struct dl_phdr_info *phdr_info) __hidden;
void _thr_sigact_unload(struct dl_phdr_info *phdr_info) __hidden;
void _thr_stack_fix_protection(struct pthread *thrd);
-int *__error_threaded(void) __hidden;
-void __thr_interpose_libc(void) __hidden;
-pid_t __thr_fork(void);
-int __thr_setcontext(const ucontext_t *ucp);
-int __thr_sigaction(int sig, const struct sigaction *act,
- struct sigaction *oact) __hidden;
-int __thr_sigprocmask(int how, const sigset_t *set, sigset_t *oset);
-int __thr_sigsuspend(const sigset_t * set);
-int __thr_sigtimedwait(const sigset_t *set, siginfo_t *info,
- const struct timespec * timeout);
-int __thr_sigwait(const sigset_t *set, int *sig);
-int __thr_sigwaitinfo(const sigset_t *set, siginfo_t *info);
-int __thr_swapcontext(ucontext_t *oucp, const ucontext_t *ucp);
-
-struct _spinlock;
-void __thr_spinunlock(struct _spinlock *lck);
-void __thr_spinlock(struct _spinlock *lck);
-
-struct tcb *_tcb_ctor(struct pthread *, int);
-void _tcb_dtor(struct tcb *);
-
__END_DECLS
#endif /* !_THR_PRIVATE_H */
diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c
index 11a131c..57c9406 100644
--- a/lib/libthr/thread/thr_sig.c
+++ b/lib/libthr/thread/thr_sig.c
@@ -38,7 +38,6 @@
#include "un-namespace.h"
#include "libc_private.h"
-#include "libc_private.h"
#include "thr_private.h"
/* #define DEBUG_SIGNAL */
@@ -55,23 +54,24 @@ struct usigaction {
static struct usigaction _thr_sigact[_SIG_MAXSIG];
-static inline struct usigaction *
-__libc_sigaction_slot(int signo)
-{
-
- return (&_thr_sigact[signo - 1]);
-}
-
static void thr_sighandler(int, siginfo_t *, void *);
static void handle_signal(struct sigaction *, int, siginfo_t *, ucontext_t *);
static void check_deferred_signal(struct pthread *);
static void check_suspend(struct pthread *);
static void check_cancel(struct pthread *curthread, ucontext_t *ucp);
+int ___pause(void);
+int _raise(int);
+int __sigtimedwait(const sigset_t *set, siginfo_t *info,
+ const struct timespec * timeout);
int _sigtimedwait(const sigset_t *set, siginfo_t *info,
const struct timespec * timeout);
+int __sigwaitinfo(const sigset_t *set, siginfo_t *info);
int _sigwaitinfo(const sigset_t *set, siginfo_t *info);
+int ___sigwait(const sigset_t *set, int *sig);
int _sigwait(const sigset_t *set, int *sig);
+int __sigsuspend(const sigset_t *sigmask);
+int _sigaction(int, const struct sigaction *, struct sigaction *);
int _setcontext(const ucontext_t *);
int _swapcontext(ucontext_t *, const ucontext_t *);
@@ -143,8 +143,8 @@ sigcancel_handler(int sig __unused,
errno = err;
}
-typedef void (*ohandler)(int sig, int code, struct sigcontext *scp,
- char *addr, __sighandler_t *catcher);
+typedef void (*ohandler)(int sig, int code,
+ struct sigcontext *scp, char *addr, __sighandler_t *catcher);
/*
* The signal handler wrapper is entered with all signal masked.
@@ -152,19 +152,15 @@ typedef void (*ohandler)(int sig, int code, struct sigcontext *scp,
static void
thr_sighandler(int sig, siginfo_t *info, void *_ucp)
{
- struct pthread *curthread;
- ucontext_t *ucp;
+ struct pthread *curthread = _get_curthread();
+ ucontext_t *ucp = _ucp;
struct sigaction act;
- struct usigaction *usa;
int err;
err = errno;
- curthread = _get_curthread();
- ucp = _ucp;
- usa = __libc_sigaction_slot(sig);
- _thr_rwl_rdlock(&usa->lock);
- act = usa->sigact;
- _thr_rwl_unlock(&usa->lock);
+ _thr_rwl_rdlock(&_thr_sigact[sig-1].lock);
+ act = _thr_sigact[sig-1].sigact;
+ _thr_rwl_unlock(&_thr_sigact[sig-1].lock);
errno = err;
curthread->deferred_run = 0;
@@ -238,12 +234,12 @@ handle_signal(struct sigaction *actp, int sig, siginfo_t *info, ucontext_t *ucp)
* so after setjmps() returns once more, the user code may need to
* re-set cancel_enable flag by calling pthread_setcancelstate().
*/
- if ((actp->sa_flags & SA_SIGINFO) != 0) {
- sigfunc(sig, info, ucp);
- } else {
- ((ohandler)sigfunc)(sig, info->si_code,
- (struct sigcontext *)ucp, info->si_addr,
- (__sighandler_t *)sigfunc);
+ if ((actp->sa_flags & SA_SIGINFO) != 0)
+ (*(sigfunc))(sig, info, ucp);
+ else {
+ ((ohandler)(*sigfunc))(
+ sig, info->si_code, (struct sigcontext *)ucp,
+ info->si_addr, (__sighandler_t *)sigfunc);
}
err = errno;
@@ -399,34 +395,9 @@ check_suspend(struct pthread *curthread)
}
void
-_thr_signal_init(int dlopened)
+_thr_signal_init(void)
{
- struct sigaction act, nact, oact;
- struct usigaction *usa;
- sigset_t oldset;
- int sig, error;
-
- if (dlopened) {
- __sys_sigprocmask(SIG_SETMASK, &_thr_maskset, &oldset);
- for (sig = 1; sig <= _SIG_MAXSIG; sig++) {
- if (sig == SIGCANCEL)
- continue;
- error = __sys_sigaction(sig, NULL, &oact);
- if (error == -1 || oact.sa_handler == SIG_DFL ||
- oact.sa_handler == SIG_IGN)
- continue;
- usa = __libc_sigaction_slot(sig);
- usa->sigact = oact;
- nact = oact;
- remove_thr_signals(&usa->sigact.sa_mask);
- nact.sa_flags &= ~SA_NODEFER;
- nact.sa_flags |= SA_SIGINFO;
- nact.sa_sigaction = thr_sighandler;
- nact.sa_mask = _thr_maskset;
- (void)__sys_sigaction(sig, &nact, NULL);
- }
- __sys_sigprocmask(SIG_SETMASK, &oldset, NULL);
- }
+ struct sigaction act;
/* Install SIGCANCEL handler. */
SIGFILLSET(act.sa_mask);
@@ -447,20 +418,18 @@ _thr_sigact_unload(struct dl_phdr_info *phdr_info)
struct pthread *curthread = _get_curthread();
struct urwlock *rwlp;
struct sigaction *actp;
- struct usigaction *usa;
struct sigaction kact;
void (*handler)(int);
int sig;
_thr_signal_block(curthread);
for (sig = 1; sig <= _SIG_MAXSIG; sig++) {
- usa = __libc_sigaction_slot(sig);
- actp = &usa->sigact;
+ actp = &_thr_sigact[sig-1].sigact;
retry:
handler = actp->sa_handler;
if (handler != SIG_DFL && handler != SIG_IGN &&
__elf_phdr_match_addr(phdr_info, handler)) {
- rwlp = &usa->lock;
+ rwlp = &_thr_sigact[sig-1].lock;
_thr_rwl_wrlock(rwlp);
if (handler != actp->sa_handler) {
_thr_rwl_unlock(rwlp);
@@ -486,7 +455,7 @@ _thr_signal_prefork(void)
int i;
for (i = 1; i <= _SIG_MAXSIG; ++i)
- _thr_rwl_rdlock(&__libc_sigaction_slot(i)->lock);
+ _thr_rwl_rdlock(&_thr_sigact[i-1].lock);
}
void
@@ -495,7 +464,7 @@ _thr_signal_postfork(void)
int i;
for (i = 1; i <= _SIG_MAXSIG; ++i)
- _thr_rwl_unlock(&__libc_sigaction_slot(i)->lock);
+ _thr_rwl_unlock(&_thr_sigact[i-1].lock);
}
void
@@ -503,10 +472,8 @@ _thr_signal_postfork_child(void)
{
int i;
- for (i = 1; i <= _SIG_MAXSIG; ++i) {
- bzero(&__libc_sigaction_slot(i) -> lock,
- sizeof(struct urwlock));
- }
+ for (i = 1; i <= _SIG_MAXSIG; ++i)
+ bzero(&_thr_sigact[i-1].lock, sizeof(struct urwlock));
}
void
@@ -514,64 +481,84 @@ _thr_signal_deinit(void)
{
}
+__weak_reference(___pause, pause);
+
+int
+___pause(void)
+{
+ sigset_t oset;
+
+ if (_sigprocmask(SIG_BLOCK, NULL, &oset) == -1)
+ return (-1);
+ return (__sigsuspend(&oset));
+}
+
+__weak_reference(_raise, raise);
+
+int
+_raise(int sig)
+{
+ return _thr_send_sig(_get_curthread(), sig);
+}
+
+__weak_reference(_sigaction, sigaction);
+
int
-__thr_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
+_sigaction(int sig, const struct sigaction * act, struct sigaction * oact)
{
struct sigaction newact, oldact, oldact2;
sigset_t oldset;
- struct usigaction *usa;
- int ret, err;
+ int ret = 0, err = 0;
if (!_SIG_VALID(sig) || sig == SIGCANCEL) {
errno = EINVAL;
return (-1);
}
- ret = 0;
- err = 0;
- usa = __libc_sigaction_slot(sig);
+ if (act)
+ newact = *act;
__sys_sigprocmask(SIG_SETMASK, &_thr_maskset, &oldset);
- _thr_rwl_wrlock(&usa->lock);
+ _thr_rwl_wrlock(&_thr_sigact[sig-1].lock);
if (act != NULL) {
- oldact2 = usa->sigact;
- newact = *act;
+ oldact2 = _thr_sigact[sig-1].sigact;
/*
* if a new sig handler is SIG_DFL or SIG_IGN,
- * don't remove old handler from __libc_sigact[],
+ * don't remove old handler from _thr_sigact[],
* so deferred signals still can use the handlers,
* multiple threads invoking sigaction itself is
* a race condition, so it is not a problem.
*/
if (newact.sa_handler != SIG_DFL &&
newact.sa_handler != SIG_IGN) {
- usa->sigact = newact;
- remove_thr_signals(&usa->sigact.sa_mask);
+ _thr_sigact[sig-1].sigact = newact;
+ remove_thr_signals(
+ &_thr_sigact[sig-1].sigact.sa_mask);
newact.sa_flags &= ~SA_NODEFER;
newact.sa_flags |= SA_SIGINFO;
newact.sa_sigaction = thr_sighandler;
newact.sa_mask = _thr_maskset; /* mask all signals */
}
- ret = __sys_sigaction(sig, &newact, &oldact);
- if (ret == -1) {
+ if ((ret = __sys_sigaction(sig, &newact, &oldact))) {
err = errno;
- usa->sigact = oldact2;
+ _thr_sigact[sig-1].sigact = oldact2;
}
} else if (oact != NULL) {
ret = __sys_sigaction(sig, NULL, &oldact);
err = errno;
}
- if (oldact.sa_handler != SIG_DFL && oldact.sa_handler != SIG_IGN) {
+ if (oldact.sa_handler != SIG_DFL &&
+ oldact.sa_handler != SIG_IGN) {
if (act != NULL)
oldact = oldact2;
else if (oact != NULL)
- oldact = usa->sigact;
+ oldact = _thr_sigact[sig-1].sigact;
}
- _thr_rwl_unlock(&usa->lock);
+ _thr_rwl_unlock(&_thr_sigact[sig-1].lock);
__sys_sigprocmask(SIG_SETMASK, &oldset, NULL);
if (ret == 0) {
@@ -583,8 +570,10 @@ __thr_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
return (ret);
}
+__weak_reference(_sigprocmask, sigprocmask);
+
int
-__thr_sigprocmask(int how, const sigset_t *set, sigset_t *oset)
+_sigprocmask(int how, const sigset_t *set, sigset_t *oset)
{
const sigset_t *p = set;
sigset_t newset;
@@ -604,12 +593,13 @@ __weak_reference(_pthread_sigmask, pthread_sigmask);
int
_pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
{
-
- if (__thr_sigprocmask(how, set, oset))
+ if (_sigprocmask(how, set, oset))
return (errno);
return (0);
}
+__weak_reference(__sigsuspend, sigsuspend);
+
int
_sigsuspend(const sigset_t * set)
{
@@ -619,7 +609,7 @@ _sigsuspend(const sigset_t * set)
}
int
-__thr_sigsuspend(const sigset_t * set)
+__sigsuspend(const sigset_t * set)
{
struct pthread *curthread;
sigset_t newset;
@@ -643,6 +633,10 @@ __thr_sigsuspend(const sigset_t * set)
return (ret);
}
+__weak_reference(___sigwait, sigwait);
+__weak_reference(__sigtimedwait, sigtimedwait);
+__weak_reference(__sigwaitinfo, sigwaitinfo);
+
int
_sigtimedwait(const sigset_t *set, siginfo_t *info,
const struct timespec * timeout)
@@ -659,8 +653,8 @@ _sigtimedwait(const sigset_t *set, siginfo_t *info,
* it is not canceled.
*/
int
-__thr_sigtimedwait(const sigset_t *set, siginfo_t *info,
- const struct timespec * timeout)
+__sigtimedwait(const sigset_t *set, siginfo_t *info,
+ const struct timespec * timeout)
{
struct pthread *curthread = _get_curthread();
sigset_t newset;
@@ -687,7 +681,7 @@ _sigwaitinfo(const sigset_t *set, siginfo_t *info)
* it is not canceled.
*/
int
-__thr_sigwaitinfo(const sigset_t *set, siginfo_t *info)
+__sigwaitinfo(const sigset_t *set, siginfo_t *info)
{
struct pthread *curthread = _get_curthread();
sigset_t newset;
@@ -713,7 +707,7 @@ _sigwait(const sigset_t *set, int *sig)
* it is not canceled.
*/
int
-__thr_sigwait(const sigset_t *set, int *sig)
+___sigwait(const sigset_t *set, int *sig)
{
struct pthread *curthread = _get_curthread();
sigset_t newset;
@@ -727,8 +721,9 @@ __thr_sigwait(const sigset_t *set, int *sig)
return (ret);
}
+__weak_reference(_setcontext, setcontext);
int
-__thr_setcontext(const ucontext_t *ucp)
+_setcontext(const ucontext_t *ucp)
{
ucontext_t uc;
@@ -740,11 +735,12 @@ __thr_setcontext(const ucontext_t *ucp)
return __sys_setcontext(ucp);
(void) memcpy(&uc, ucp, sizeof(uc));
SIGDELSET(uc.uc_sigmask, SIGCANCEL);
- return (__sys_setcontext(&uc));
+ return __sys_setcontext(&uc);
}
+__weak_reference(_swapcontext, swapcontext);
int
-__thr_swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
+_swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
{
ucontext_t uc;
@@ -757,5 +753,5 @@ __thr_swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
SIGDELSET(uc.uc_sigmask, SIGCANCEL);
ucp = &uc;
}
- return (__sys_swapcontext(oucp, ucp));
+ return __sys_swapcontext(oucp, ucp);
}
diff --git a/lib/libthr/thread/thr_spec.c b/lib/libthr/thread/thr_spec.c
index b53c4b7..46a6105 100644
--- a/lib/libthr/thread/thr_spec.c
+++ b/lib/libthr/thread/thr_spec.c
@@ -30,7 +30,6 @@
*/
#include "namespace.h"
-#include <sys/mman.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
@@ -41,6 +40,7 @@
#include "thr_private.h"
+/* Static variables: */
struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX];
__weak_reference(_pthread_key_create, pthread_key_create);
@@ -50,7 +50,7 @@ __weak_reference(_pthread_setspecific, pthread_setspecific);
int
-_pthread_key_create(pthread_key_t *key, void (*destructor)(void *))
+_pthread_key_create(pthread_key_t *key, void (*destructor) (void *))
{
struct pthread *curthread;
int i;
@@ -59,6 +59,7 @@ _pthread_key_create(pthread_key_t *key, void (*destructor)(void *))
curthread = _get_curthread();
+ /* Lock the key table: */
THR_LOCK_ACQUIRE(curthread, &_keytable_lock);
for (i = 0; i < PTHREAD_KEYS_MAX; i++) {
@@ -67,12 +68,14 @@ _pthread_key_create(pthread_key_t *key, void (*destructor)(void *))
_thread_keytable[i].destructor = destructor;
_thread_keytable[i].seqno++;
+ /* Unlock the key table: */
THR_LOCK_RELEASE(curthread, &_keytable_lock);
*key = i + 1;
return (0);
}
}
+ /* Unlock the key table: */
THR_LOCK_RELEASE(curthread, &_keytable_lock);
return (EAGAIN);
}
@@ -80,40 +83,44 @@ _pthread_key_create(pthread_key_t *key, void (*destructor)(void *))
int
_pthread_key_delete(pthread_key_t userkey)
{
- struct pthread *curthread;
- int key, ret;
+ struct pthread *curthread = _get_curthread();
+ int key = userkey - 1;
+ int ret = 0;
- key = userkey - 1;
- if ((unsigned int)key >= PTHREAD_KEYS_MAX)
- return (EINVAL);
- curthread = _get_curthread();
- THR_LOCK_ACQUIRE(curthread, &_keytable_lock);
- if (_thread_keytable[key].allocated) {
- _thread_keytable[key].allocated = 0;
- ret = 0;
- } else {
+ if ((unsigned int)key < PTHREAD_KEYS_MAX) {
+ /* Lock the key table: */
+ THR_LOCK_ACQUIRE(curthread, &_keytable_lock);
+
+ if (_thread_keytable[key].allocated)
+ _thread_keytable[key].allocated = 0;
+ else
+ ret = EINVAL;
+
+ /* Unlock the key table: */
+ THR_LOCK_RELEASE(curthread, &_keytable_lock);
+ } else
ret = EINVAL;
- }
- THR_LOCK_RELEASE(curthread, &_keytable_lock);
return (ret);
}
void
_thread_cleanupspecific(void)
{
- struct pthread *curthread;
- void (*destructor)(void *);
- const void *data;
- int i, key;
+ struct pthread *curthread = _get_curthread();
+ void (*destructor)( void *);
+ const void *data = NULL;
+ int key;
+ int i;
- curthread = _get_curthread();
if (curthread->specific == NULL)
return;
+
+ /* Lock the key table: */
THR_LOCK_ACQUIRE(curthread, &_keytable_lock);
- for (i = 0; i < PTHREAD_DESTRUCTOR_ITERATIONS &&
- curthread->specific_data_count > 0; i++) {
- for (key = 0; key < PTHREAD_KEYS_MAX &&
- curthread->specific_data_count > 0; key++) {
+ for (i = 0; (i < PTHREAD_DESTRUCTOR_ITERATIONS) &&
+ (curthread->specific_data_count > 0); i++) {
+ for (key = 0; (key < PTHREAD_KEYS_MAX) &&
+ (curthread->specific_data_count > 0); key++) {
destructor = NULL;
if (_thread_keytable[key].allocated &&
@@ -121,29 +128,31 @@ _thread_cleanupspecific(void)
if (curthread->specific[key].seqno ==
_thread_keytable[key].seqno) {
data = curthread->specific[key].data;
- destructor = _thread_keytable[key].
- destructor;
+ destructor = _thread_keytable[key].destructor;
}
curthread->specific[key].data = NULL;
curthread->specific_data_count--;
- } else if (curthread->specific[key].data != NULL) {
+ }
+ else if (curthread->specific[key].data != NULL) {
/*
- * This can happen if the key is
- * deleted via pthread_key_delete
- * without first setting the value to
- * NULL in all threads. POSIX says
- * that the destructor is not invoked
- * in this case.
+ * This can happen if the key is deleted via
+ * pthread_key_delete without first setting the value
+ * to NULL in all threads. POSIX says that the
+ * destructor is not invoked in this case.
*/
curthread->specific[key].data = NULL;
curthread->specific_data_count--;
}
/*
- * If there is a destructor, call it with the
- * key table entry unlocked.
+ * If there is a destructor, call it
+ * with the key table entry unlocked:
*/
if (destructor != NULL) {
+ /*
+ * Don't hold the lock while calling the
+ * destructor:
+ */
THR_LOCK_RELEASE(curthread, &_keytable_lock);
destructor(__DECONST(void *, data));
THR_LOCK_ACQUIRE(curthread, &_keytable_lock);
@@ -151,92 +160,102 @@ _thread_cleanupspecific(void)
}
}
THR_LOCK_RELEASE(curthread, &_keytable_lock);
- munmap(curthread->specific, PTHREAD_KEYS_MAX * sizeof(struct
- pthread_specific_elem));
+ free(curthread->specific);
curthread->specific = NULL;
- if (curthread->specific_data_count > 0) {
+ if (curthread->specific_data_count > 0)
stderr_debug("Thread %p has exited with leftover "
"thread-specific data after %d destructor iterations\n",
curthread, PTHREAD_DESTRUCTOR_ITERATIONS);
- }
+}
+
+static inline struct pthread_specific_elem *
+pthread_key_allocate_data(void)
+{
+ struct pthread_specific_elem *new_data;
+
+ new_data = (struct pthread_specific_elem *)
+ calloc(1, sizeof(struct pthread_specific_elem) * PTHREAD_KEYS_MAX);
+ return (new_data);
}
int
_pthread_setspecific(pthread_key_t userkey, const void *value)
{
- struct pthread *pthread;
- void *tmp;
- pthread_key_t key;
-
- key = userkey - 1;
- if ((unsigned int)key >= PTHREAD_KEYS_MAX ||
- !_thread_keytable[key].allocated)
- return (EINVAL);
+ struct pthread *pthread;
+ pthread_key_t key = userkey - 1;
+ int ret = 0;
+ /* Point to the running thread: */
pthread = _get_curthread();
- if (pthread->specific == NULL) {
- tmp = mmap(NULL, PTHREAD_KEYS_MAX *
- sizeof(struct pthread_specific_elem),
- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
- if (tmp == MAP_FAILED)
- return (ENOMEM);
- pthread->specific = tmp;
- }
- if (pthread->specific[key].data == NULL) {
- if (value != NULL)
- pthread->specific_data_count++;
- } else if (value == NULL)
- pthread->specific_data_count--;
- pthread->specific[key].data = value;
- pthread->specific[key].seqno = _thread_keytable[key].seqno;
- return (0);
+
+ if ((pthread->specific) ||
+ (pthread->specific = pthread_key_allocate_data())) {
+ if ((unsigned int)key < PTHREAD_KEYS_MAX) {
+ if (_thread_keytable[key].allocated) {
+ if (pthread->specific[key].data == NULL) {
+ if (value != NULL)
+ pthread->specific_data_count++;
+ } else if (value == NULL)
+ pthread->specific_data_count--;
+ pthread->specific[key].data = value;
+ pthread->specific[key].seqno =
+ _thread_keytable[key].seqno;
+ ret = 0;
+ } else
+ ret = EINVAL;
+ } else
+ ret = EINVAL;
+ } else
+ ret = ENOMEM;
+ return (ret);
}
void *
_pthread_getspecific(pthread_key_t userkey)
{
- struct pthread *pthread;
- const void *data;
- pthread_key_t key;
-
- /* Check if there is specific data. */
- key = userkey - 1;
- if ((unsigned int)key >= PTHREAD_KEYS_MAX)
- return (NULL);
+ struct pthread *pthread;
+ pthread_key_t key = userkey - 1;
+ const void *data;
+ /* Point to the running thread: */
pthread = _get_curthread();
- /* Check if this key has been used before. */
- if (_thread_keytable[key].allocated && pthread->specific != NULL &&
- pthread->specific[key].seqno == _thread_keytable[key].seqno) {
- /* Return the value: */
- data = pthread->specific[key].data;
- } else {
- /*
- * This key has not been used before, so return NULL
- * instead.
- */
+
+ /* Check if there is specific data: */
+ if (pthread->specific != NULL && (unsigned int)key < PTHREAD_KEYS_MAX) {
+ /* Check if this key has been used before: */
+ if (_thread_keytable[key].allocated &&
+ (pthread->specific[key].seqno == _thread_keytable[key].seqno)) {
+ /* Return the value: */
+ data = pthread->specific[key].data;
+ } else {
+ /*
+ * This key has not been used before, so return NULL
+ * instead:
+ */
+ data = NULL;
+ }
+ } else
+ /* No specific data has been created, so just return NULL: */
data = NULL;
- }
return (__DECONST(void *, data));
}
void
_thr_tsd_unload(struct dl_phdr_info *phdr_info)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
void (*destructor)(void *);
int key;
- curthread = _get_curthread();
THR_LOCK_ACQUIRE(curthread, &_keytable_lock);
for (key = 0; key < PTHREAD_KEYS_MAX; key++) {
- if (!_thread_keytable[key].allocated)
- continue;
- destructor = _thread_keytable[key].destructor;
- if (destructor == NULL)
- continue;
- if (__elf_phdr_match_addr(phdr_info, destructor))
- _thread_keytable[key].destructor = NULL;
+ if (_thread_keytable[key].allocated) {
+ destructor = _thread_keytable[key].destructor;
+ if (destructor != NULL) {
+ if (__elf_phdr_match_addr(phdr_info, destructor))
+ _thread_keytable[key].destructor = NULL;
+ }
+ }
}
THR_LOCK_RELEASE(curthread, &_keytable_lock);
}
diff --git a/lib/libthr/thread/thr_spinlock.c b/lib/libthr/thread/thr_spinlock.c
index 380d10d..ecc8067 100644
--- a/lib/libthr/thread/thr_spinlock.c
+++ b/lib/libthr/thread/thr_spinlock.c
@@ -61,7 +61,7 @@ static void init_spinlock(spinlock_t *lck);
*/
void
-__thr_spinunlock(spinlock_t *lck)
+_spinunlock(spinlock_t *lck)
{
struct spinlock_extra *_extra;
@@ -70,7 +70,7 @@ __thr_spinunlock(spinlock_t *lck)
}
void
-__thr_spinlock(spinlock_t *lck)
+_spinlock(spinlock_t *lck)
{
struct spinlock_extra *_extra;
@@ -84,6 +84,12 @@ __thr_spinlock(spinlock_t *lck)
THR_UMUTEX_LOCK(_get_curthread(), &_extra->lock);
}
+void
+_spinlock_debug(spinlock_t *lck, char *fname __unused, int lineno __unused)
+{
+ _spinlock(lck);
+}
+
static void
init_spinlock(spinlock_t *lck)
{
diff --git a/lib/libthr/thread/thr_syscalls.c b/lib/libthr/thread/thr_syscalls.c
index 7c05697..7a08302 100644
--- a/lib/libthr/thread/thr_syscalls.c
+++ b/lib/libthr/thread/thr_syscalls.c
@@ -1,13 +1,9 @@
/*
- * Copyright (c) 2014 The FreeBSD Foundation.
* Copyright (C) 2005 David Xu <davidxu@freebsd.org>.
* Copyright (c) 2003 Daniel Eischen <deischen@freebsd.org>.
* Copyright (C) 2000 Jason Evans <jasone@freebsd.org>.
* All rights reserved.
*
- * Portions of this software were developed by Konstantin Belousov
- * 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:
@@ -31,6 +27,8 @@
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (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$
*/
/*
@@ -63,9 +61,6 @@
*
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include "namespace.h"
#include <sys/types.h>
#include <sys/mman.h>
@@ -92,11 +87,85 @@ __FBSDID("$FreeBSD$");
#include <pthread.h>
#include "un-namespace.h"
-#include "libc_private.h"
#include "thr_private.h"
-static int
-__thr_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
+extern int __creat(const char *, mode_t);
+extern int __pselect(int, fd_set *, fd_set *, fd_set *,
+ const struct timespec *, const sigset_t *);
+extern unsigned __sleep(unsigned int);
+extern int __system(const char *);
+extern int __tcdrain(int);
+extern int __usleep(useconds_t);
+extern pid_t __wait(int *);
+extern pid_t __waitpid(pid_t, int *, int);
+extern int __sys_aio_suspend(const struct aiocb * const[], int,
+ const struct timespec *);
+extern int __sys_accept(int, struct sockaddr *, socklen_t *);
+extern int __sys_accept4(int, struct sockaddr *, socklen_t *, int);
+extern int __sys_connect(int, const struct sockaddr *, socklen_t);
+extern int __sys_fsync(int);
+extern int __sys_msync(void *, size_t, int);
+extern int __sys_pselect(int, fd_set *, fd_set *, fd_set *,
+ const struct timespec *, const sigset_t *);
+extern int __sys_poll(struct pollfd *, unsigned, int);
+extern ssize_t __sys_recv(int, void *, size_t, int);
+extern ssize_t __sys_recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *);
+extern ssize_t __sys_recvmsg(int, struct msghdr *, int);
+extern int __sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+extern int __sys_sendfile(int, int, off_t, size_t, struct sf_hdtr *,
+ off_t *, int);
+extern ssize_t __sys_sendmsg(int, const struct msghdr *, int);
+extern ssize_t __sys_sendto(int, const void *,size_t, int, const struct sockaddr *, socklen_t);
+extern ssize_t __sys_readv(int, const struct iovec *, int);
+extern pid_t __sys_wait4(pid_t, int *, int, struct rusage *);
+extern ssize_t __sys_writev(int, const struct iovec *, int);
+
+int ___creat(const char *, mode_t);
+int ___pselect(int, fd_set *, fd_set *, fd_set *,
+ const struct timespec *, const sigset_t *);
+unsigned ___sleep(unsigned);
+int ___system(const char *);
+int ___tcdrain(int);
+int ___usleep(useconds_t useconds);
+pid_t ___wait(int *);
+pid_t ___waitpid(pid_t, int *, int);
+int __accept(int, struct sockaddr *, socklen_t *);
+int __accept4(int, struct sockaddr *, socklen_t *, int);
+int __aio_suspend(const struct aiocb * const iocbs[], int,
+ const struct timespec *);
+int __close(int);
+int __connect(int, const struct sockaddr *, socklen_t);
+int __fcntl(int, int,...);
+#ifdef SYSCALL_COMPAT
+extern int __fcntl_compat(int, int,...);
+#endif
+int __fsync(int);
+int __msync(void *, size_t, int);
+int __nanosleep(const struct timespec *, struct timespec *);
+int __open(const char *, int,...);
+int __openat(int, const char *, int,...);
+int __poll(struct pollfd *, unsigned int, int);
+ssize_t __read(int, void *buf, size_t);
+ssize_t __readv(int, const struct iovec *, int);
+ssize_t __recvfrom(int, void *, size_t, int f, struct sockaddr *, socklen_t *);
+ssize_t __recvmsg(int, struct msghdr *, int);
+int __select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+ssize_t __sendmsg(int, const struct msghdr *, int);
+ssize_t __sendto(int, const void *, size_t, int,
+ const struct sockaddr *, socklen_t);
+pid_t __wait3(int *, int, struct rusage *);
+pid_t __wait4(pid_t, int *, int, struct rusage *);
+ssize_t __write(int, const void *, size_t);
+ssize_t __writev(int, const struct iovec *, int);
+
+__weak_reference(__accept, accept);
+
+/*
+ * Cancellation behavior:
+ * If thread is canceled, no socket is created.
+ */
+int
+__accept(int s, struct sockaddr *addr, socklen_t *addrlen)
{
struct pthread *curthread;
int ret;
@@ -109,12 +178,14 @@ __thr_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
return (ret);
}
+__weak_reference(__accept4, accept4);
+
/*
* Cancellation behavior:
* If thread is canceled, no socket is created.
*/
-static int
-__thr_accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
+int
+__accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
{
struct pthread *curthread;
int ret;
@@ -127,14 +198,15 @@ __thr_accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
return (ret);
}
-static int
-__thr_aio_suspend(const struct aiocb * const iocbs[], int niocb, const struct
+__weak_reference(__aio_suspend, aio_suspend);
+
+int
+__aio_suspend(const struct aiocb * const iocbs[], int niocb, const struct
timespec *timeout)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
int ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_aio_suspend(iocbs, niocb, timeout);
_thr_cancel_leave(curthread, 1);
@@ -142,6 +214,8 @@ __thr_aio_suspend(const struct aiocb * const iocbs[], int niocb, const struct
return (ret);
}
+__weak_reference(__close, close);
+
/*
* Cancellation behavior:
* According to manual of close(), the file descriptor is always deleted.
@@ -149,13 +223,12 @@ __thr_aio_suspend(const struct aiocb * const iocbs[], int niocb, const struct
* descriptor is always deleted despite whether the thread is canceled
* or not.
*/
-static int
-__thr_close(int fd)
+int
+__close(int fd)
{
- struct pthread *curthread;
- int ret;
+ struct pthread *curthread = _get_curthread();
+ int ret;
- curthread = _get_curthread();
_thr_cancel_enter2(curthread, 0);
ret = __sys_close(fd);
_thr_cancel_leave(curthread, 1);
@@ -163,17 +236,18 @@ __thr_close(int fd)
return (ret);
}
+__weak_reference(__connect, connect);
+
/*
* Cancellation behavior:
* If the thread is canceled, connection is not made.
*/
-static int
-__thr_connect(int fd, const struct sockaddr *name, socklen_t namelen)
+int
+__connect(int fd, const struct sockaddr *name, socklen_t namelen)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
int ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_connect(fd, name, namelen);
_thr_cancel_leave(curthread, ret == -1);
@@ -181,6 +255,27 @@ __thr_connect(int fd, const struct sockaddr *name, socklen_t namelen)
return (ret);
}
+__weak_reference(___creat, creat);
+
+/*
+ * Cancellation behavior:
+ * If thread is canceled, file is not created.
+ */
+int
+___creat(const char *path, mode_t mode)
+{
+ struct pthread *curthread = _get_curthread();
+ int ret;
+
+ _thr_cancel_enter(curthread);
+ ret = __creat(path, mode);
+ _thr_cancel_leave(curthread, ret == -1);
+
+ return ret;
+}
+
+__weak_reference(__fcntl, fcntl);
+
/*
* Cancellation behavior:
* According to specification, only F_SETLKW is a cancellation point.
@@ -188,38 +283,46 @@ __thr_connect(int fd, const struct sockaddr *name, socklen_t namelen)
* is failure, this means the function does not generate side effect
* if it is canceled.
*/
-static int
-__thr_fcntl(int fd, int cmd, ...)
+int
+__fcntl(int fd, int cmd,...)
{
- struct pthread *curthread;
- int ret;
+ struct pthread *curthread = _get_curthread();
+ int ret;
va_list ap;
- curthread = _get_curthread();
va_start(ap, cmd);
if (cmd == F_OSETLKW || cmd == F_SETLKW) {
_thr_cancel_enter(curthread);
+#ifdef SYSCALL_COMPAT
+ ret = __fcntl_compat(fd, cmd, va_arg(ap, void *));
+#else
ret = __sys_fcntl(fd, cmd, va_arg(ap, void *));
+#endif
_thr_cancel_leave(curthread, ret == -1);
} else {
+#ifdef SYSCALL_COMPAT
+ ret = __fcntl_compat(fd, cmd, va_arg(ap, void *));
+#else
ret = __sys_fcntl(fd, cmd, va_arg(ap, void *));
+#endif
}
va_end(ap);
return (ret);
}
+__weak_reference(__fsync, fsync);
+
/*
* Cancellation behavior:
* Thread may be canceled after system call.
*/
-static int
-__thr_fsync(int fd)
+int
+__fsync(int fd)
{
- struct pthread *curthread;
- int ret;
+ struct pthread *curthread = _get_curthread();
+ int ret;
- curthread = _get_curthread();
_thr_cancel_enter2(curthread, 0);
ret = __sys_fsync(fd);
_thr_cancel_leave(curthread, 1);
@@ -227,32 +330,34 @@ __thr_fsync(int fd)
return (ret);
}
+__weak_reference(__msync, msync);
+
/*
* Cancellation behavior:
* Thread may be canceled after system call.
*/
-static int
-__thr_msync(void *addr, size_t len, int flags)
+int
+__msync(void *addr, size_t len, int flags)
{
- struct pthread *curthread;
- int ret;
+ struct pthread *curthread = _get_curthread();
+ int ret;
- curthread = _get_curthread();
_thr_cancel_enter2(curthread, 0);
ret = __sys_msync(addr, len, flags);
_thr_cancel_leave(curthread, 1);
- return (ret);
+ return ret;
}
-static int
-__thr_nanosleep(const struct timespec *time_to_sleep,
+__weak_reference(__nanosleep, nanosleep);
+
+int
+__nanosleep(const struct timespec *time_to_sleep,
struct timespec *time_remaining)
{
- struct pthread *curthread;
- int ret;
+ struct pthread *curthread = _get_curthread();
+ int ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_nanosleep(time_to_sleep, time_remaining);
_thr_cancel_leave(curthread, 1);
@@ -260,88 +365,99 @@ __thr_nanosleep(const struct timespec *time_to_sleep,
return (ret);
}
+__weak_reference(__open, open);
+
/*
* Cancellation behavior:
* If the thread is canceled, file is not opened.
*/
-static int
-__thr_openat(int fd, const char *path, int flags, ...)
+int
+__open(const char *path, int flags,...)
{
- struct pthread *curthread;
- int mode, ret;
+ struct pthread *curthread = _get_curthread();
+ int ret;
+ int mode = 0;
va_list ap;
-
/* Check if the file is being created: */
- if ((flags & O_CREAT) != 0) {
+ if (flags & O_CREAT) {
/* Get the creation mode: */
va_start(ap, flags);
mode = va_arg(ap, int);
va_end(ap);
- } else {
- mode = 0;
}
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
- ret = __sys_openat(fd, path, flags, mode);
+ ret = __sys_open(path, flags, mode);
_thr_cancel_leave(curthread, ret == -1);
- return (ret);
+ return ret;
}
+__weak_reference(__openat, openat);
+
/*
* Cancellation behavior:
- * Thread may be canceled at start, but if the system call returns something,
- * the thread is not canceled.
+ * If the thread is canceled, file is not opened.
*/
-static int
-__thr_poll(struct pollfd *fds, unsigned int nfds, int timeout)
+int
+__openat(int fd, const char *path, int flags, ...)
{
- struct pthread *curthread;
- int ret;
+ struct pthread *curthread = _get_curthread();
+ int ret;
+ int mode = 0;
+ va_list ap;
- curthread = _get_curthread();
+
+ /* Check if the file is being created: */
+ if (flags & O_CREAT) {
+ /* Get the creation mode: */
+ va_start(ap, flags);
+ mode = va_arg(ap, int);
+ va_end(ap);
+ }
+
_thr_cancel_enter(curthread);
- ret = __sys_poll(fds, nfds, timeout);
+ ret = __sys_openat(fd, path, flags, mode);
_thr_cancel_leave(curthread, ret == -1);
- return (ret);
+ return ret;
}
+__weak_reference(__poll, poll);
+
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the system call returns something,
* the thread is not canceled.
*/
-static int
-__thr_ppoll(struct pollfd pfd[], nfds_t nfds, const struct timespec *
- timeout, const sigset_t *newsigmask)
+int
+__poll(struct pollfd *fds, unsigned int nfds, int timeout)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
int ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
- ret = __sys_ppoll(pfd, nfds, timeout, newsigmask);
+ ret = __sys_poll(fds, nfds, timeout);
_thr_cancel_leave(curthread, ret == -1);
- return (ret);
+ return ret;
}
+__weak_reference(___pselect, pselect);
+
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the system call returns something,
* the thread is not canceled.
*/
-static int
-__thr_pselect(int count, fd_set *rfds, fd_set *wfds, fd_set *efds,
+int
+___pselect(int count, fd_set *rfds, fd_set *wfds, fd_set *efds,
const struct timespec *timo, const sigset_t *mask)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
int ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_pselect(count, rfds, wfds, efds, timo, mask);
_thr_cancel_leave(curthread, ret == -1);
@@ -349,311 +465,321 @@ __thr_pselect(int count, fd_set *rfds, fd_set *wfds, fd_set *efds,
return (ret);
}
-static int
-__thr_kevent(int kq, const struct kevent *changelist, int nchanges,
- struct kevent *eventlist, int nevents, const struct timespec *timeout)
-{
- struct pthread *curthread;
- int ret;
-
- if (nevents == 0) {
- /*
- * No blocking, do not make the call cancellable.
- */
- return (__sys_kevent(kq, changelist, nchanges, eventlist,
- nevents, timeout));
- }
- curthread = _get_curthread();
- _thr_cancel_enter(curthread);
- ret = __sys_kevent(kq, changelist, nchanges, eventlist, nevents,
- timeout);
- _thr_cancel_leave(curthread, ret == -1 && nchanges == 0);
-
- return (ret);
-}
+__weak_reference(__read, read);
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the system call got some data,
* the thread is not canceled.
*/
-static ssize_t
-__thr_read(int fd, void *buf, size_t nbytes)
+ssize_t
+__read(int fd, void *buf, size_t nbytes)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
ssize_t ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_read(fd, buf, nbytes);
_thr_cancel_leave(curthread, ret == -1);
- return (ret);
+ return ret;
}
+__weak_reference(__readv, readv);
+
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the system call got some data,
* the thread is not canceled.
*/
-static ssize_t
-__thr_readv(int fd, const struct iovec *iov, int iovcnt)
+ssize_t
+__readv(int fd, const struct iovec *iov, int iovcnt)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
ssize_t ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_readv(fd, iov, iovcnt);
_thr_cancel_leave(curthread, ret == -1);
- return (ret);
+ return ret;
}
+__weak_reference(__recvfrom, recvfrom);
+
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the system call got some data,
* the thread is not canceled.
*/
-static ssize_t
-__thr_recvfrom(int s, void *b, size_t l, int f, struct sockaddr *from,
+ssize_t
+__recvfrom(int s, void *b, size_t l, int f, struct sockaddr *from,
socklen_t *fl)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
ssize_t ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_recvfrom(s, b, l, f, from, fl);
_thr_cancel_leave(curthread, ret == -1);
return (ret);
}
+__weak_reference(__recvmsg, recvmsg);
+
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the system call got some data,
* the thread is not canceled.
*/
-static ssize_t
-__thr_recvmsg(int s, struct msghdr *m, int f)
+ssize_t
+__recvmsg(int s, struct msghdr *m, int f)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
ssize_t ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_recvmsg(s, m, f);
_thr_cancel_leave(curthread, ret == -1);
return (ret);
}
+__weak_reference(__select, select);
+
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the system call returns something,
* the thread is not canceled.
*/
-static int
-__thr_select(int numfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+int
+__select(int numfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
struct timeval *timeout)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
int ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_select(numfds, readfds, writefds, exceptfds, timeout);
_thr_cancel_leave(curthread, ret == -1);
- return (ret);
+ return ret;
}
+__weak_reference(__sendmsg, sendmsg);
+
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the system call sent
* data, the thread is not canceled.
*/
-static ssize_t
-__thr_sendmsg(int s, const struct msghdr *m, int f)
+ssize_t
+__sendmsg(int s, const struct msghdr *m, int f)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
ssize_t ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_sendmsg(s, m, f);
_thr_cancel_leave(curthread, ret <= 0);
return (ret);
}
+__weak_reference(__sendto, sendto);
+
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the system call sent some
* data, the thread is not canceled.
*/
-static ssize_t
-__thr_sendto(int s, const void *m, size_t l, int f, const struct sockaddr *t,
+ssize_t
+__sendto(int s, const void *m, size_t l, int f, const struct sockaddr *t,
socklen_t tl)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
ssize_t ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_sendto(s, m, l, f, t, tl);
_thr_cancel_leave(curthread, ret <= 0);
return (ret);
}
-static int
-__thr_system(const char *string)
+__weak_reference(___sleep, sleep);
+
+unsigned int
+___sleep(unsigned int seconds)
{
- struct pthread *curthread;
- int ret;
+ struct pthread *curthread = _get_curthread();
+ unsigned int ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
- ret = __libc_system(string);
+ ret = __sleep(seconds);
_thr_cancel_leave(curthread, 1);
+
return (ret);
}
+__weak_reference(___system, system);
+
+int
+___system(const char *string)
+{
+ struct pthread *curthread = _get_curthread();
+ int ret;
+
+ _thr_cancel_enter(curthread);
+ ret = __system(string);
+ _thr_cancel_leave(curthread, 1);
+
+ return ret;
+}
+
+__weak_reference(___tcdrain, tcdrain);
+
/*
* Cancellation behavior:
* If thread is canceled, the system call is not completed,
* this means not all bytes were drained.
*/
-static int
-__thr_tcdrain(int fd)
+int
+___tcdrain(int fd)
{
- struct pthread *curthread;
- int ret;
+ struct pthread *curthread = _get_curthread();
+ int ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
- ret = __libc_tcdrain(fd);
+ ret = __tcdrain(fd);
_thr_cancel_leave(curthread, ret == -1);
return (ret);
}
+__weak_reference(___usleep, usleep);
+
+int
+___usleep(useconds_t useconds)
+{
+ struct pthread *curthread = _get_curthread();
+ int ret;
+
+ _thr_cancel_enter(curthread);
+ ret = __usleep(useconds);
+ _thr_cancel_leave(curthread, 1);
+
+ return (ret);
+}
+
+__weak_reference(___wait, wait);
+
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the system call returns
* a child pid, the thread is not canceled.
*/
-static pid_t
-__thr_wait4(pid_t pid, int *status, int options, struct rusage *rusage)
+pid_t
+___wait(int *istat)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
+ pid_t ret;
+
+ _thr_cancel_enter(curthread);
+ ret = __wait(istat);
+ _thr_cancel_leave(curthread, ret <= 0);
+
+ return ret;
+}
+
+__weak_reference(__wait3, wait3);
+
+/*
+ * Cancellation behavior:
+ * Thread may be canceled at start, but if the system call returns
+ * a child pid, the thread is not canceled.
+ */
+pid_t
+__wait3(int *status, int options, struct rusage *rusage)
+{
+ struct pthread *curthread = _get_curthread();
pid_t ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
- ret = __sys_wait4(pid, status, options, rusage);
+ ret = _wait4(WAIT_ANY, status, options, rusage);
_thr_cancel_leave(curthread, ret <= 0);
+
return (ret);
}
+__weak_reference(__wait4, wait4);
+
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the system call returns
* a child pid, the thread is not canceled.
*/
-static pid_t
-__thr_wait6(idtype_t idtype, id_t id, int *status, int options,
- struct __wrusage *ru, siginfo_t *infop)
+pid_t
+__wait4(pid_t pid, int *status, int options, struct rusage *rusage)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
pid_t ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
- ret = __sys_wait6(idtype, id, status, options, ru, infop);
+ ret = __sys_wait4(pid, status, options, rusage);
_thr_cancel_leave(curthread, ret <= 0);
- return (ret);
+
+ return ret;
}
+__weak_reference(___waitpid, waitpid);
+
+/*
+ * Cancellation behavior:
+ * Thread may be canceled at start, but if the system call returns
+ * a child pid, the thread is not canceled.
+ */
+pid_t
+___waitpid(pid_t wpid, int *status, int options)
+{
+ struct pthread *curthread = _get_curthread();
+ pid_t ret;
+
+ _thr_cancel_enter(curthread);
+ ret = __waitpid(wpid, status, options);
+ _thr_cancel_leave(curthread, ret <= 0);
+
+ return ret;
+}
+
+__weak_reference(__write, write);
+
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the thread wrote some data,
* it is not canceled.
*/
-static ssize_t
-__thr_write(int fd, const void *buf, size_t nbytes)
+ssize_t
+__write(int fd, const void *buf, size_t nbytes)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
ssize_t ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_write(fd, buf, nbytes);
_thr_cancel_leave(curthread, (ret <= 0));
- return (ret);
+ return ret;
}
+__weak_reference(__writev, writev);
+
/*
* Cancellation behavior:
* Thread may be canceled at start, but if the thread wrote some data,
* it is not canceled.
*/
-static ssize_t
-__thr_writev(int fd, const struct iovec *iov, int iovcnt)
+ssize_t
+__writev(int fd, const struct iovec *iov, int iovcnt)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
ssize_t ret;
- curthread = _get_curthread();
_thr_cancel_enter(curthread);
ret = __sys_writev(fd, iov, iovcnt);
_thr_cancel_leave(curthread, (ret <= 0));
- return (ret);
-}
-
-void
-__thr_interpose_libc(void)
-{
-
- __set_error_selector(__error_threaded);
-#define SLOT(name) \
- *(__libc_interposing_slot(INTERPOS_##name)) = \
- (interpos_func_t)__thr_##name;
- SLOT(accept);
- SLOT(accept4);
- SLOT(aio_suspend);
- SLOT(close);
- SLOT(connect);
- SLOT(fcntl);
- SLOT(fsync);
- SLOT(fork);
- SLOT(msync);
- SLOT(nanosleep);
- SLOT(openat);
- SLOT(poll);
- SLOT(pselect);
- SLOT(read);
- SLOT(readv);
- SLOT(recvfrom);
- SLOT(recvmsg);
- SLOT(select);
- SLOT(sendmsg);
- SLOT(sendto);
- SLOT(setcontext);
- SLOT(sigaction);
- SLOT(sigprocmask);
- SLOT(sigsuspend);
- SLOT(sigwait);
- SLOT(sigtimedwait);
- SLOT(sigwaitinfo);
- SLOT(swapcontext);
- SLOT(system);
- SLOT(tcdrain);
- SLOT(wait4);
- SLOT(write);
- SLOT(writev);
- SLOT(spinlock);
- SLOT(spinunlock);
- SLOT(kevent);
- SLOT(wait6);
- SLOT(ppoll);
-#undef SLOT
- *(__libc_interposing_slot(
- INTERPOS__pthread_mutex_init_calloc_cb)) =
- (interpos_func_t)_pthread_mutex_init_calloc_cb;
+ return ret;
}
diff --git a/lib/libthread_db/Makefile.depend b/lib/libthread_db/Makefile.depend
new file mode 100644
index 0000000..4acc32f
--- /dev/null
+++ b/lib/libthread_db/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libthread_db/arch/aarch64/libpthread_md.c b/lib/libthread_db/arch/aarch64/libpthread_md.c
deleted file mode 100644
index 75f4553..0000000
--- a/lib/libthread_db/arch/aarch64/libpthread_md.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-
- * Copyright (c) 2014-2015 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner 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 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 <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <string.h>
-#include <thread_db.h>
-
-#include "libpthread_db.h"
-
-void abort(void);
-
-void
-pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc)
-{
- mcontext_t *mc = &uc->uc_mcontext;
-
- memcpy(mc->mc_gpregs.gp_x, r->x, sizeof(mc->mc_gpregs.gp_x));
- mc->mc_gpregs.gp_sp = r->sp;
- mc->mc_gpregs.gp_lr = r->lr;
- mc->mc_gpregs.gp_elr = r->elr;
- mc->mc_gpregs.gp_spsr = r->spsr;
-}
-
-void
-pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r)
-{
- const mcontext_t *mc = &uc->uc_mcontext;
-
- memcpy(r->x, mc->mc_gpregs.gp_x, sizeof(mc->mc_gpregs.gp_x));
- r->sp = mc->mc_gpregs.gp_sp;
- r->lr = mc->mc_gpregs.gp_lr;
- r->elr = mc->mc_gpregs.gp_elr;
- r->spsr = mc->mc_gpregs.gp_spsr;
-}
-
-void
-pt_fpreg_to_ucontext(const struct fpreg *r, ucontext_t *uc)
-{
- mcontext_t *mc = &uc->uc_mcontext;
-
- memcpy(&mc->mc_fpregs, r, sizeof(*r));
- mc->mc_flags |= _MC_FP_VALID;
-}
-
-void
-pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r)
-{
- const mcontext_t *mc = &uc->uc_mcontext;
-
- if (mc->mc_flags & _MC_FP_VALID)
- memcpy(r, &mc->mc_fpregs, sizeof(*r));
- else
- memset(r, 0, sizeof(*r));
-
-}
-
-void
-pt_md_init(void)
-{
-}
-
-int
-pt_reg_sstep(struct reg *reg __unused, int step __unused)
-{
-
- return (0);
-}
diff --git a/lib/libthread_db/arch/i386/libpthread_md.c b/lib/libthread_db/arch/i386/libpthread_md.c
index 784c245..d41865f 100644
--- a/lib/libthread_db/arch/i386/libpthread_md.c
+++ b/lib/libthread_db/arch/i386/libpthread_md.c
@@ -72,7 +72,7 @@ pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r)
memcpy(r, &uc->uc_mcontext.mc_fpstate, sizeof(struct save87));
else {
int i;
- const struct savexmm *sx = (const struct savexmm *)&uc->uc_mcontext.mc_fpstate;
+ struct savexmm *sx = (struct savexmm *)&uc->uc_mcontext.mc_fpstate;
memcpy(&r->fpr_env, &sx->sv_env, sizeof(r->fpr_env));
for (i = 0; i < 8; ++i)
memcpy(&r->fpr_acc[i], &sx->sv_fp[i].fp_acc, 10);
diff --git a/lib/libucl/Makefile b/lib/libucl/Makefile
index 310e8b7..830c198 100644
--- a/lib/libucl/Makefile
+++ b/lib/libucl/Makefile
@@ -14,16 +14,11 @@ SRCS= ucl_emitter_streamline.c \
ucl_util.c \
xxhash.c
-.PATH: ${LIBUCL}/src \
- ${LIBUCL}/include
-
-INCS= ucl.h
-LIBADD= m
+.PATH: ${LIBUCL}/src
WARNS= 1
CFLAGS+= -I${LIBUCL}/include \
-I${LIBUCL}/src \
- -I${LIBUCL}/uthash \
- -I${LIBUCL}/klib
+ -I${LIBUCL}/uthash
.include <bsd.lib.mk>
diff --git a/lib/libucl/Makefile.depend b/lib/libucl/Makefile.depend
new file mode 100644
index 0000000..bee153c
--- /dev/null
+++ b/lib/libucl/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/msun \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libufs/Makefile b/lib/libufs/Makefile
index 24efd0c..78832d8 100644
--- a/lib/libufs/Makefile
+++ b/lib/libufs/Makefile
@@ -21,6 +21,7 @@ MLINKS+= ufs_disk_close.3 ufs_disk_write.3
WARNS?= 2
+DEBUG_FLAGS = -g
CFLAGS+= -D_LIBUFS
.if defined(LIBUFS_DEBUG)
CFLAGS+= -D_LIBUFS_DEBUGGING
diff --git a/lib/libufs/Makefile.depend b/lib/libufs/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libufs/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libugidfw/Makefile.depend b/lib/libugidfw/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libugidfw/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libulog/Makefile b/lib/libulog/Makefile
index fedd114..efbaece 100644
--- a/lib/libulog/Makefile
+++ b/lib/libulog/Makefile
@@ -19,7 +19,8 @@ MLINKS+=ulog_login.3 ulog_login_pseudo.3 \
utempter_remove_added_record.3 removeFromUtmp.3 \
utempter_remove_record.3 removeLineFromUtmp.3
-LIBADD= md
+DPADD= ${LIBMD}
+LDADD= -lmd
VERSION_DEF= ${.CURDIR}/../libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
diff --git a/lib/libulog/Makefile.depend b/lib/libulog/Makefile.depend
new file mode 100644
index 0000000..c448c48
--- /dev/null
+++ b/lib/libulog/Makefile.depend
@@ -0,0 +1,22 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libmd \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libunbound/Makefile b/lib/libunbound/Makefile
index fb593f2..aca3023 100644
--- a/lib/libunbound/Makefile
+++ b/lib/libunbound/Makefile
@@ -5,15 +5,15 @@ LDNSDIR= ${.CURDIR}/../../contrib/ldns
UNBOUNDDIR= ${.CURDIR}/../../contrib/unbound
# Hold my beer and watch this
-.PATH: ${UNBOUNDDIR} ${UNBOUNDDIR}/dns64 ${UNBOUNDDIR}/iterator ${UNBOUNDDIR}/ldns ${UNBOUNDDIR}/libunbound ${UNBOUNDDIR}/services ${UNBOUNDDIR}/services/cache ${UNBOUNDDIR}/util ${UNBOUNDDIR}/util/data ${UNBOUNDDIR}/util/storage ${UNBOUNDDIR}/validator
+.PATH: ${UNBOUNDDIR} ${UNBOUNDDIR}/iterator ${UNBOUNDDIR}/ldns ${UNBOUNDDIR}/libunbound ${UNBOUNDDIR}/services ${UNBOUNDDIR}/services/cache ${UNBOUNDDIR}/util ${UNBOUNDDIR}/util/data ${UNBOUNDDIR}/util/storage ${UNBOUNDDIR}/validator
LIB= unbound
PRIVATELIB=
-CFLAGS= -I${UNBOUNDDIR} -I${LDNSDIR} -I${.OBJDIR}
+CFLAGS= -I${UNBOUNDDIR} -I${LDNSDIR} -I${.OBJDIR}
SRCS= alloc.c autotrust.c config_file.c configlexer.l configparser.y \
- context.c dname.c dns.c dns64.c dnstree.c fptr_wlist.c infra.c \
+ context.c dname.c dns.c dnstree.c fptr_wlist.c infra.c \
iter_delegpt.c iter_donotq.c iter_fwd.c iter_hints.c iter_priv.c \
iter_resptype.c iter_scrub.c iter_utils.c iterator.c keyraw.c \
libunbound.c libworker.c listen_dnsport.c localzone.c locks.c log.c \
@@ -28,11 +28,12 @@ SRCS= alloc.c autotrust.c config_file.c configlexer.l configparser.y \
WARNS?= 3
-LIBADD= ssl crypto pthread
+DPADD+= ${LIBSSL} ${LIBCRYPTO} ${LIBPTHREAD}
+LDADD+= -lssl -lcrypto -lpthread
# Misnamed file in upstream source
configlexer.l: configlexer.lex
- ${CP} ${.ALLSRC} ${.TARGET}
+ cp -fp ${.ALLSRC} ${.TARGET}
CLEANFILES+= configlexer.l
# Symbol prefix for lex and yacc
diff --git a/lib/libunbound/Makefile.depend b/lib/libunbound/Makefile.depend
new file mode 100644
index 0000000..2dac9b8
--- /dev/null
+++ b/lib/libunbound/Makefile.depend
@@ -0,0 +1,36 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libthr \
+ secure/lib/libcrypto \
+ secure/lib/libssl \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+config_file.So: configparser.h
+config_file.o: configparser.h
+config_file.po: configparser.h
+configlexer.So: configlexer.c
+configlexer.So: configparser.h
+configlexer.o: configlexer.c
+configlexer.o: configparser.h
+configlexer.po: configlexer.c
+configlexer.po: configparser.h
+configparser.So: configparser.c
+configparser.o: configparser.c
+configparser.po: configparser.c
+.endif
diff --git a/lib/libusb/Makefile b/lib/libusb/Makefile
index 24d97fd..1ef85d4 100644
--- a/lib/libusb/Makefile
+++ b/lib/libusb/Makefile
@@ -19,7 +19,8 @@ PTHREAD_LIBS?= -lpthread
WARNS?= 2
-LIBADD= pthread
+DPADD= ${LIBPTHREAD}
+LDADD= ${PTHREAD_LIBS}
MLINKS+= libusb.3 usb.3
diff --git a/lib/libusb/Makefile.depend b/lib/libusb/Makefile.depend
new file mode 100644
index 0000000..37acbe0
--- /dev/null
+++ b/lib/libusb/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libthr \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libusb/libusb.3 b/lib/libusb/libusb.3
index d00cb3f..785c8c4 100644
--- a/lib/libusb/libusb.3
+++ b/lib/libusb/libusb.3
@@ -42,9 +42,9 @@ The
.Nm
library contains interfaces for directly managing a usb device.
The current implementation supports v1.0 of the libusb API.
-.Sh LIBRARY INITIALISATION AND DEINITIALISATION
+.Sh LIBRARY INITIALISATION / DEINITIALISATION
.Ft int
-.Fn libusb_init "libusb_context **ctx"
+.Fn libusb_init libusb_context **ctx
This function initialises libusb.
It must be called at the beginning
of the program, before other libusb routines are used.
diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h
index ab20e92..7f8634f 100644
--- a/lib/libusb/libusb.h
+++ b/lib/libusb/libusb.h
@@ -128,8 +128,6 @@ enum libusb_standard_request {
LIBUSB_REQUEST_GET_INTERFACE = 0x0A,
LIBUSB_REQUEST_SET_INTERFACE = 0x0B,
LIBUSB_REQUEST_SYNCH_FRAME = 0x0C,
- LIBUSB_REQUEST_SET_SEL = 0x30,
- LIBUSB_REQUEST_SET_ISOCH_DELAY = 0x31,
};
enum libusb_request_type {
diff --git a/lib/libusb/libusb20.3 b/lib/libusb/libusb20.3
index 590ff3c..f6004a5 100644
--- a/lib/libusb/libusb20.3
+++ b/lib/libusb/libusb20.3
@@ -1053,8 +1053,8 @@ This function does not return NULL.
.It Pa /dev/usb
.El
.Sh SEE ALSO
-.Xr libusb 3 ,
.Xr usb 4 ,
+.Xr libusb 3 ,
.Xr usbconfig 8 ,
.Xr usbdump 8
.
diff --git a/lib/libusb/libusb20_desc.h b/lib/libusb/libusb20_desc.h
index c5f085f..48e2715 100644
--- a/lib/libusb/libusb20_desc.h
+++ b/lib/libusb/libusb20_desc.h
@@ -481,12 +481,6 @@ enum libusb20_standard_request {
/** Set then report an endpoint's synchronization frame */
LIBUSB20_REQUEST_SYNCH_FRAME = 0x0C,
-
- /** Set U1 and U2 system exit latency */
- LIBUSB20_REQUEST_SET_SEL = 0x30,
-
- /** Set isochronous delay */
- LIBUSB20_REQUEST_SET_ISOCH_DELAY = 0x31,
};
/** \ingroup misc
diff --git a/lib/libusbhid/Makefile.depend b/lib/libusbhid/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libusbhid/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libutil/Makefile.depend b/lib/libutil/Makefile.depend
new file mode 100644
index 0000000..807c0a4
--- /dev/null
+++ b/lib/libutil/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c
index b0b0b36f..465efd9 100644
--- a/lib/libutil/gr_util.c
+++ b/lib/libutil/gr_util.c
@@ -351,6 +351,8 @@ gr_fini(void)
int
gr_equal(const struct group *gr1, const struct group *gr2)
{
+ int gr1_ndx;
+ int gr2_ndx;
/* Check that the non-member information is the same. */
if (gr1->gr_name == NULL || gr2->gr_name == NULL) {
@@ -366,8 +368,7 @@ gr_equal(const struct group *gr1, const struct group *gr2)
if (gr1->gr_gid != gr2->gr_gid)
return (false);
- /*
- * Check all members in both groups.
+ /* Check all members in both groups.
* getgrnam can return gr_mem with a pointer to NULL.
* gr_dup and gr_add strip out this superfluous NULL, setting
* gr_mem to NULL for no members.
@@ -375,18 +376,22 @@ gr_equal(const struct group *gr1, const struct group *gr2)
if (gr1->gr_mem != NULL && gr2->gr_mem != NULL) {
int i;
- for (i = 0;
- gr1->gr_mem[i] != NULL && gr2->gr_mem[i] != NULL; i++) {
+ for (i = 0; gr1->gr_mem[i] != NULL; i++) {
if (strcmp(gr1->gr_mem[i], gr2->gr_mem[i]) != 0)
return (false);
}
- if (gr1->gr_mem[i] != NULL || gr2->gr_mem[i] != NULL)
- return (false);
- } else if (gr1->gr_mem != NULL && gr1->gr_mem[0] != NULL) {
- return (false);
- } else if (gr2->gr_mem != NULL && gr2->gr_mem[0] != NULL) {
- return (false);
}
+ /* Count number of members in both structs */
+ gr2_ndx = 0;
+ if (gr2->gr_mem != NULL)
+ for(; gr2->gr_mem[gr2_ndx] != NULL; gr2_ndx++)
+ /* empty */;
+ gr1_ndx = 0;
+ if (gr1->gr_mem != NULL)
+ for(; gr1->gr_mem[gr1_ndx] != NULL; gr1_ndx++)
+ /* empty */;
+ if (gr1_ndx != gr2_ndx)
+ return (false);
return (true);
}
diff --git a/lib/libutil/quotafile.3 b/lib/libutil/quotafile.3
index 362cf01..001a66c 100644
--- a/lib/libutil/quotafile.3
+++ b/lib/libutil/quotafile.3
@@ -273,8 +273,8 @@ and set
to indicate the error.
.Sh SEE ALSO
.Xr quotactl 2 ,
-.Xr quota.group 5 ,
-.Xr quota.user 5
+.Xr quota.user 5 ,
+.Xr quota.group 5
.Sh HISTORY
The
.Nm quotafile
diff --git a/lib/libutil/tests/Makefile b/lib/libutil/tests/Makefile
index 36eb2ae..31b6c54 100644
--- a/lib/libutil/tests/Makefile
+++ b/lib/libutil/tests/Makefile
@@ -9,6 +9,7 @@ TAP_TESTS_C+= pidfile_test
TAP_TESTS_C+= trimdomain_test
TAP_TESTS_C+= trimdomain-nodomain_test
-LIBADD+= util
+DPADD+= ${LIBUTIL}
+LDADD+= -lutil
.include <bsd.test.mk>
diff --git a/lib/libvgl/Makefile.depend b/lib/libvgl/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libvgl/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libvmmapi/Makefile b/lib/libvmmapi/Makefile
index 26cf86f..93d3c85 100644
--- a/lib/libvmmapi/Makefile
+++ b/lib/libvmmapi/Makefile
@@ -6,8 +6,6 @@ INCS= vmmapi.h
WARNS?= 2
-LIBADD= util
-
CFLAGS+= -I${.CURDIR}
.include <bsd.lib.mk>
diff --git a/lib/libvmmapi/Makefile.depend b/lib/libvmmapi/Makefile.depend
new file mode 100644
index 0000000..074ac81
--- /dev/null
+++ b/lib/libvmmapi/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libutil \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c
index 1e6e627..93955c7 100644
--- a/lib/libvmmapi/vmmapi.c
+++ b/lib/libvmmapi/vmmapi.c
@@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
#include <machine/specialreg.h>
#include <machine/param.h>
-#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
@@ -369,13 +368,14 @@ vm_get_register(struct vmctx *ctx, int vcpu, int reg, uint64_t *ret_val)
}
int
-vm_run(struct vmctx *ctx, int vcpu, struct vm_exit *vmexit)
+vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, struct vm_exit *vmexit)
{
int error;
struct vm_run vmrun;
bzero(&vmrun, sizeof(vmrun));
vmrun.cpuid = vcpu;
+ vmrun.rip = rip;
error = ioctl(ctx->fd, VM_RUN, &vmrun);
bcopy(&vmrun.vm_exit, vmexit, sizeof(struct vm_exit));
@@ -399,22 +399,36 @@ vm_reinit(struct vmctx *ctx)
return (ioctl(ctx->fd, VM_REINIT, 0));
}
-int
-vm_inject_exception(struct vmctx *ctx, int vcpu, int vector, int errcode_valid,
- uint32_t errcode, int restart_instruction)
+static int
+vm_inject_exception_real(struct vmctx *ctx, int vcpu, int vector,
+ int error_code, int error_code_valid)
{
struct vm_exception exc;
+ bzero(&exc, sizeof(exc));
exc.cpuid = vcpu;
exc.vector = vector;
- exc.error_code = errcode;
- exc.error_code_valid = errcode_valid;
- exc.restart_instruction = restart_instruction;
+ exc.error_code = error_code;
+ exc.error_code_valid = error_code_valid;
return (ioctl(ctx->fd, VM_INJECT_EXCEPTION, &exc));
}
int
+vm_inject_exception(struct vmctx *ctx, int vcpu, int vector)
+{
+
+ return (vm_inject_exception_real(ctx, vcpu, vector, 0, 0));
+}
+
+int
+vm_inject_exception2(struct vmctx *ctx, int vcpu, int vector, int errcode)
+{
+
+ return (vm_inject_exception_real(ctx, vcpu, vector, errcode, 1));
+}
+
+int
vm_apicid2vcpu(struct vmctx *ctx, int apicid)
{
/*
@@ -959,9 +973,9 @@ vm_get_hpet_capabilities(struct vmctx *ctx, uint32_t *capabilities)
return (error);
}
-int
-vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging,
- uint64_t gla, int prot, uint64_t *gpa, int *fault)
+static int
+gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging,
+ uint64_t gla, int prot, int *fault, uint64_t *gpa)
{
struct vm_gla2gpa gg;
int error;
@@ -986,12 +1000,10 @@ vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging,
int
vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging,
- uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt,
- int *fault)
+ uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt)
{
- void *va;
uint64_t gpa;
- int error, i, n, off;
+ int error, fault, i, n, off;
for (i = 0; i < iovcnt; i++) {
iov[i].iov_base = 0;
@@ -1000,18 +1012,16 @@ vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging,
while (len) {
assert(iovcnt > 0);
- error = vm_gla2gpa(ctx, vcpu, paging, gla, prot, &gpa, fault);
- if (error || *fault)
- return (error);
+ error = gla2gpa(ctx, vcpu, paging, gla, prot, &fault, &gpa);
+ if (error)
+ return (-1);
+ if (fault)
+ return (1);
off = gpa & PAGE_MASK;
n = min(len, PAGE_SIZE - off);
- va = vm_map_gpa(ctx, gpa, n);
- if (va == NULL)
- return (EFAULT);
-
- iov->iov_base = va;
+ iov->iov_base = (void *)gpa;
iov->iov_len = n;
iov++;
iovcnt--;
@@ -1023,24 +1033,19 @@ vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging,
}
void
-vm_copy_teardown(struct vmctx *ctx, int vcpu, struct iovec *iov, int iovcnt)
-{
-
- return;
-}
-
-void
vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *iov, void *vp, size_t len)
{
const char *src;
char *dst;
+ uint64_t gpa;
size_t n;
dst = vp;
while (len) {
assert(iov->iov_len);
+ gpa = (uint64_t)iov->iov_base;
n = min(len, iov->iov_len);
- src = iov->iov_base;
+ src = vm_map_gpa(ctx, gpa, n);
bcopy(src, dst, n);
iov++;
@@ -1055,13 +1060,15 @@ vm_copyout(struct vmctx *ctx, int vcpu, const void *vp, struct iovec *iov,
{
const char *src;
char *dst;
+ uint64_t gpa;
size_t n;
src = vp;
while (len) {
assert(iov->iov_len);
+ gpa = (uint64_t)iov->iov_base;
n = min(len, iov->iov_len);
- dst = iov->iov_base;
+ dst = vm_map_gpa(ctx, gpa, n);
bcopy(src, dst, n);
iov++;
@@ -1139,63 +1146,3 @@ vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t info1)
error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii);
return (error);
}
-
-int
-vm_rtc_write(struct vmctx *ctx, int offset, uint8_t value)
-{
- struct vm_rtc_data rtcdata;
- int error;
-
- bzero(&rtcdata, sizeof(struct vm_rtc_data));
- rtcdata.offset = offset;
- rtcdata.value = value;
- error = ioctl(ctx->fd, VM_RTC_WRITE, &rtcdata);
- return (error);
-}
-
-int
-vm_rtc_read(struct vmctx *ctx, int offset, uint8_t *retval)
-{
- struct vm_rtc_data rtcdata;
- int error;
-
- bzero(&rtcdata, sizeof(struct vm_rtc_data));
- rtcdata.offset = offset;
- error = ioctl(ctx->fd, VM_RTC_READ, &rtcdata);
- if (error == 0)
- *retval = rtcdata.value;
- return (error);
-}
-
-int
-vm_rtc_settime(struct vmctx *ctx, time_t secs)
-{
- struct vm_rtc_time rtctime;
- int error;
-
- bzero(&rtctime, sizeof(struct vm_rtc_time));
- rtctime.secs = secs;
- error = ioctl(ctx->fd, VM_RTC_SETTIME, &rtctime);
- return (error);
-}
-
-int
-vm_rtc_gettime(struct vmctx *ctx, time_t *secs)
-{
- struct vm_rtc_time rtctime;
- int error;
-
- bzero(&rtctime, sizeof(struct vm_rtc_time));
- error = ioctl(ctx->fd, VM_RTC_GETTIME, &rtctime);
- if (error == 0)
- *secs = rtctime.secs;
- return (error);
-}
-
-int
-vm_restart_instruction(void *arg, int vcpu)
-{
- struct vmctx *ctx = arg;
-
- return (ioctl(ctx->fd, VM_RESTART_INSTRUCTION, &vcpu));
-}
diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h
index d3ecdc4..fbb6ddd 100644
--- a/lib/libvmmapi/vmmapi.h
+++ b/lib/libvmmapi/vmmapi.h
@@ -32,12 +32,6 @@
#include <sys/param.h>
#include <sys/cpuset.h>
-/*
- * API version for out-of-tree consumers like grub-bhyve for making compile
- * time decisions.
- */
-#define VMMAPI_VERSION 0101 /* 2 digit major followed by 2 digit minor */
-
struct iovec;
struct vmctx;
enum x2apic_state;
@@ -63,8 +57,6 @@ int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len,
int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s);
void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len);
int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num);
-int vm_gla2gpa(struct vmctx *, int vcpuid, struct vm_guest_paging *paging,
- uint64_t gla, int prot, uint64_t *gpa, int *fault);
uint32_t vm_get_lowmem_limit(struct vmctx *ctx);
void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit);
void vm_set_memflags(struct vmctx *ctx, int flags);
@@ -78,12 +70,13 @@ int vm_get_seg_desc(struct vmctx *ctx, int vcpu, int reg,
struct seg_desc *seg_desc);
int vm_set_register(struct vmctx *ctx, int vcpu, int reg, uint64_t val);
int vm_get_register(struct vmctx *ctx, int vcpu, int reg, uint64_t *retval);
-int vm_run(struct vmctx *ctx, int vcpu, struct vm_exit *ret_vmexit);
+int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip,
+ struct vm_exit *ret_vmexit);
int vm_suspend(struct vmctx *ctx, enum vm_suspend_how how);
int vm_reinit(struct vmctx *ctx);
int vm_apicid2vcpu(struct vmctx *ctx, int apicid);
-int vm_inject_exception(struct vmctx *ctx, int vcpu, int vector,
- int errcode_valid, uint32_t errcode, int restart_instruction);
+int vm_inject_exception(struct vmctx *ctx, int vcpu, int vec);
+int vm_inject_exception2(struct vmctx *ctx, int vcpu, int vec, int errcode);
int vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector);
int vm_lapic_local_irq(struct vmctx *ctx, int vcpu, int vector);
int vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg);
@@ -131,27 +124,14 @@ int vm_get_hpet_capabilities(struct vmctx *ctx, uint32_t *capabilities);
/*
* Translate the GLA range [gla,gla+len) into GPA segments in 'iov'.
* The 'iovcnt' should be big enough to accomodate all GPA segments.
- *
- * retval fault Interpretation
- * 0 0 Success
- * 0 1 An exception was injected into the guest
- * EFAULT N/A Error
+ * Returns 0 on success, 1 on a guest fault condition and -1 otherwise.
*/
int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *pg,
- uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt,
- int *fault);
+ uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt);
void vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *guest_iov,
void *host_dst, size_t len);
void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src,
struct iovec *guest_iov, size_t len);
-void vm_copy_teardown(struct vmctx *ctx, int vcpu, struct iovec *iov,
- int iovcnt);
-
-/* RTC */
-int vm_rtc_write(struct vmctx *ctx, int offset, uint8_t value);
-int vm_rtc_read(struct vmctx *ctx, int offset, uint8_t *retval);
-int vm_rtc_settime(struct vmctx *ctx, time_t secs);
-int vm_rtc_gettime(struct vmctx *ctx, time_t *secs);
/* Reset vcpu register state */
int vcpu_reset(struct vmctx *ctx, int vcpu);
diff --git a/lib/libwrap/Makefile.depend b/lib/libwrap/Makefile.depend
new file mode 100644
index 0000000..807c0a4
--- /dev/null
+++ b/lib/libwrap/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libxo/Makefile b/lib/libxo/Makefile
index 62fface..644b71f 100644
--- a/lib/libxo/Makefile
+++ b/lib/libxo/Makefile
@@ -7,8 +7,6 @@ LIBXO= ${.CURDIR:H:H}/contrib/libxo
LIB= xo
SHLIB_MAJOR=0
-SHLIBDIR?= /lib
-
SRCS= libxo.c
CFLAGS+=-I${LIBXO}/libxo
@@ -21,12 +19,10 @@ MAN+= xo_attr.3 \
xo_create.3 \
xo_emit.3 \
xo_err.3 \
- xo_error.3 \
xo_finish.3 \
xo_flush.3 \
xo_no_setlocale.3 \
xo_open_container.3 \
- xo_open_marker.3 \
xo_open_list.3 \
xo_parse_args.3 \
xo_set_allocator.3 \
@@ -34,51 +30,7 @@ MAN+= xo_attr.3 \
xo_set_info.3 \
xo_set_options.3 \
xo_set_style.3 \
- xo_set_version.3 \
xo_set_writer.3
MAN+= xo_format.5
-MLINKS= xo_attr.3 xo_attr_h.3 \
- xo_attr.3 xo_attr_hv.3 \
- xo_create.3 xo_create_to_file.3 \
- xo_create.3 xo_destroy.3 \
- xo_emit.3 xo_emit_h.3 \
- xo_emit.3 xo_emit_hv.3 \
- xo_err.3 xo_warn.3 \
- xo_err.3 xo_warnx.3 \
- xo_err.3 xo_warn_c.3 \
- xo_err.3 xo_warn_hc.3 \
- xo_err.3 xo_errc.3 \
- xo_err.3 xo_errx.3 \
- xo_err.3 xo_message.3 \
- xo_err.3 xo_message_c.3 \
- xo_err.3 xo_message_hc.3 \
- xo_err.3 xo_message_hcv.3 \
- xo_finish.3 xo_finish_h.3 \
- xo_flush.3 xo_flush_h.3 \
- xo_open_container.3 xo_open_container_h.3 \
- xo_open_container.3 xo_open_container_hd.3 \
- xo_open_container.3 xo_open_container_d.3 \
- xo_open_container.3 xo_close_container.3 \
- xo_open_container.3 xo_close_container_h.3 \
- xo_open_container.3 xo_close_container_hd.3 \
- xo_open_container.3 xo_close_container_d.3 \
- xo_open_list.3 xo_open_list_h.3 \
- xo_open_list.3 xo_open_list_hd.3 \
- xo_open_list.3 xo_open_list_d.3 \
- xo_open_list.3 xo_open_instance.3 \
- xo_open_list.3 xo_open_instance_h.3 \
- xo_open_list.3 xo_open_instance_hd.3 \
- xo_open_list.3 xo_open_instance_d.3 \
- xo_open_list.3 xo_close_instance.3 \
- xo_open_list.3 xo_close_instance_h.3 \
- xo_open_list.3 xo_close_instance_hd.3 \
- xo_open_list.3 xo_close_instance_d.3 \
- xo_open_list.3 xo_close_list.3 \
- xo_open_list.3 xo_close_list_h.3 \
- xo_open_list.3 xo_close_list_hd.3 \
- xo_open_list.3 xo_close_list_d.3 \
- xo_set_flags.3 xo_clear_flags.3 \
- xo_set_style.3 xo_set_style_name.3
-
.include <bsd.lib.mk>
diff --git a/lib/libxo/Makefile.depend b/lib/libxo/Makefile.depend
new file mode 100644
index 0000000..467741f
--- /dev/null
+++ b/lib/libxo/Makefile.depend
@@ -0,0 +1,20 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/liby/Makefile.depend b/lib/liby/Makefile.depend
new file mode 100644
index 0000000..7d982eb
--- /dev/null
+++ b/lib/liby/Makefile.depend
@@ -0,0 +1,13 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libypclnt/Makefile.depend b/lib/libypclnt/Makefile.depend
new file mode 100644
index 0000000..7d7c744
--- /dev/null
+++ b/lib/libypclnt/Makefile.depend
@@ -0,0 +1,55 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/rpc \
+ include/rpcsvc \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+yp_clnt.So: yp.h
+yp_clnt.So: yp_clnt.c
+yp_clnt.o: yp.h
+yp_clnt.o: yp_clnt.c
+yp_clnt.po: yp.h
+yp_clnt.po: yp_clnt.c
+ypclnt_passwd.So: yppasswd_private.h
+ypclnt_passwd.o: yppasswd_private.h
+ypclnt_passwd.po: yppasswd_private.h
+yppasswd_clnt.So: yppasswd.h
+yppasswd_clnt.So: yppasswd_clnt.c
+yppasswd_clnt.o: yppasswd.h
+yppasswd_clnt.o: yppasswd_clnt.c
+yppasswd_clnt.po: yppasswd.h
+yppasswd_clnt.po: yppasswd_clnt.c
+yppasswd_private_clnt.So: yppasswd_private.h
+yppasswd_private_clnt.So: yppasswd_private_clnt.c
+yppasswd_private_clnt.o: yppasswd_private.h
+yppasswd_private_clnt.o: yppasswd_private_clnt.c
+yppasswd_private_clnt.po: yppasswd_private.h
+yppasswd_private_clnt.po: yppasswd_private_clnt.c
+yppasswd_private_xdr.So: yppasswd_private.h
+yppasswd_private_xdr.So: yppasswd_private_xdr.c
+yppasswd_private_xdr.o: yppasswd_private.h
+yppasswd_private_xdr.o: yppasswd_private_xdr.c
+yppasswd_private_xdr.po: yppasswd_private.h
+yppasswd_private_xdr.po: yppasswd_private_xdr.c
+yppasswd_xdr.So: yppasswd.h
+yppasswd_xdr.So: yppasswd_xdr.c
+yppasswd_xdr.o: yppasswd.h
+yppasswd_xdr.o: yppasswd_xdr.c
+yppasswd_xdr.po: yppasswd.h
+yppasswd_xdr.po: yppasswd_xdr.c
+.endif
diff --git a/lib/libz/Makefile.depend b/lib/libz/Makefile.depend
new file mode 100644
index 0000000..4acc32f
--- /dev/null
+++ b/lib/libz/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/msun/Makefile b/lib/msun/Makefile
index 5cb6292..afb7067 100644
--- a/lib/msun/Makefile
+++ b/lib/msun/Makefile
@@ -35,6 +35,8 @@ CFLAGS+= -I${.CURDIR}/ld80
CFLAGS+= -I${.CURDIR}/ld128
.endif
+CFLAGS+= -I${.CURDIR}/${ARCH_SUBDIR}
+
.PATH: ${.CURDIR}/bsdsrc
.PATH: ${.CURDIR}/src
.PATH: ${.CURDIR}/man
@@ -221,8 +223,6 @@ MLINKS+=trunc.3 truncf.3 trunc.3 truncl.3
.include <src.opts.mk>
-.if ${MK_TESTS} != "no"
-SUBDIR+= tests
-.endif
+.include <bsd.arch.inc.mk>
.include <bsd.lib.mk>
diff --git a/lib/msun/Makefile.amd64 b/lib/msun/Makefile.amd64
new file mode 100644
index 0000000..dd0f5b0
--- /dev/null
+++ b/lib/msun/Makefile.amd64
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
diff --git a/lib/msun/Makefile.depend b/lib/msun/Makefile.depend
new file mode 100644
index 0000000..4acc32f
--- /dev/null
+++ b/lib/msun/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/msun/Makefile.i386 b/lib/msun/Makefile.i386
new file mode 100644
index 0000000..dd0f5b0
--- /dev/null
+++ b/lib/msun/Makefile.i386
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
diff --git a/lib/msun/aarch64/Makefile.inc b/lib/msun/aarch64/Makefile.inc
deleted file mode 100644
index 286a608..0000000
--- a/lib/msun/aarch64/Makefile.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-LDBL_PREC = 113
-
diff --git a/lib/msun/aarch64/fenv.c b/lib/msun/aarch64/fenv.c
deleted file mode 100644
index 4ec362f..0000000
--- a/lib/msun/aarch64/fenv.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
- * Copyright (c) 2013 Andrew Turner <andrew@FreeBSD.ORG>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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$
- */
-
-#define __fenv_static
-#include "fenv.h"
-
-/*
- * Hopefully the system ID byte is immutable, so it's valid to use
- * this as a default environment.
- */
-const fenv_t __fe_dfl_env = 0;
-
-#ifdef __GNUC_GNU_INLINE__
-#error "This file must be compiled with C99 'inline' semantics"
-#endif
-
-extern inline int feclearexcept(int __excepts);
-extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts);
-extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
-extern inline int feraiseexcept(int __excepts);
-extern inline int fetestexcept(int __excepts);
-extern inline int fegetround(void);
-extern inline int fesetround(int __round);
-extern inline int fegetenv(fenv_t *__envp);
-extern inline int feholdexcept(fenv_t *__envp);
-extern inline int fesetenv(const fenv_t *__envp);
-extern inline int feupdateenv(const fenv_t *__envp);
-extern inline int feenableexcept(int __mask);
-extern inline int fedisableexcept(int __mask);
-extern inline int fegetexcept(void);
diff --git a/lib/msun/aarch64/fenv.h b/lib/msun/aarch64/fenv.h
deleted file mode 100644
index 2bd2987..0000000
--- a/lib/msun/aarch64/fenv.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/*-
- * Copyright (c) 2004-2005 David Schultz <das@FreeBSD.ORG>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must 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$
- */
-
-#ifndef _FENV_H_
-#define _FENV_H_
-
-#include <sys/_types.h>
-
-#ifndef __fenv_static
-#define __fenv_static static
-#endif
-
-typedef __uint64_t fenv_t;
-typedef __uint64_t fexcept_t;
-
-/* Exception flags */
-#define FE_INVALID 0x00000001
-#define FE_DIVBYZERO 0x00000002
-#define FE_OVERFLOW 0x00000004
-#define FE_UNDERFLOW 0x00000008
-#define FE_INEXACT 0x00000010
-#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | \
- FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
-
-/*
- * Rounding modes
- *
- * We can't just use the hardware bit values here, because that would
- * make FE_UPWARD and FE_DOWNWARD negative, which is not allowed.
- */
-#define FE_TONEAREST 0x0
-#define FE_UPWARD 0x1
-#define FE_DOWNWARD 0x2
-#define FE_TOWARDZERO 0x3
-#define _ROUND_MASK (FE_TONEAREST | FE_DOWNWARD | \
- FE_UPWARD | FE_TOWARDZERO)
-#define _ROUND_SHIFT 22
-
-__BEGIN_DECLS
-
-/* Default floating-point environment */
-extern const fenv_t __fe_dfl_env;
-#define FE_DFL_ENV (&__fe_dfl_env)
-
-/* We need to be able to map status flag positions to mask flag positions */
-#define _FPUSW_SHIFT 8
-#define _ENABLE_MASK (FE_ALL_EXCEPT << _FPUSW_SHIFT)
-
-#define __mrs_fpcr(__r) __asm __volatile("mrs %0, fpcr" : "=r" (__r))
-#define __msr_fpcr(__r) __asm __volatile("msr fpcr, %0" : : "r" (__r))
-
-#define __mrs_fpsr(__r) __asm __volatile("mrs %0, fpsr" : "=r" (__r))
-#define __msr_fpsr(__r) __asm __volatile("msr fpsr, %0" : : "r" (__r))
-
-__fenv_static __inline int
-feclearexcept(int __excepts)
-{
- fexcept_t __r;
-
- __mrs_fpsr(__r);
- __r &= ~__excepts;
- __msr_fpsr(__r);
- return (0);
-}
-
-__fenv_static inline int
-fegetexceptflag(fexcept_t *__flagp, int __excepts)
-{
- fexcept_t __r;
-
- __mrs_fpsr(__r);
- *__flagp = __r & __excepts;
- return (0);
-}
-
-__fenv_static inline int
-fesetexceptflag(const fexcept_t *__flagp, int __excepts)
-{
- fexcept_t __r;
-
- __mrs_fpsr(__r);
- __r &= ~__excepts;
- __r |= *__flagp & __excepts;
- __msr_fpsr(__r);
- return (0);
-}
-
-__fenv_static inline int
-feraiseexcept(int __excepts)
-{
- fexcept_t __r;
-
- __mrs_fpsr(__r);
- __r |= __excepts;
- __msr_fpsr(__r);
- return (0);
-}
-
-__fenv_static inline int
-fetestexcept(int __excepts)
-{
- fexcept_t __r;
-
- __mrs_fpsr(__r);
- return (__r & __excepts);
-}
-
-__fenv_static inline int
-fegetround(void)
-{
- fenv_t __r;
-
- __mrs_fpcr(__r);
- return ((__r >> _ROUND_SHIFT) & _ROUND_MASK);
-}
-
-__fenv_static inline int
-fesetround(int __round)
-{
- fenv_t __r;
-
- if (__round & ~_ROUND_MASK)
- return (-1);
- __mrs_fpcr(__r);
- __r &= ~(_ROUND_MASK << _ROUND_SHIFT);
- __r |= __round << _ROUND_SHIFT;
- __msr_fpcr(__r);
- return (0);
-}
-
-__fenv_static inline int
-fegetenv(fenv_t *__envp)
-{
- fenv_t __r;
-
- __mrs_fpcr(__r);
- *__envp = __r & _ENABLE_MASK;
-
- __mrs_fpsr(__r);
- *__envp |= __r & (FE_ALL_EXCEPT | (_ROUND_MASK << _ROUND_SHIFT));
-
- return (0);
-}
-
-__fenv_static inline int
-feholdexcept(fenv_t *__envp)
-{
- fenv_t __r;
-
- __mrs_fpcr(__r);
- *__envp = __r & _ENABLE_MASK;
- __r &= ~(_ENABLE_MASK);
- __msr_fpcr(__r);
-
- __mrs_fpsr(__r);
- *__envp |= __r & (FE_ALL_EXCEPT | (_ROUND_MASK << _ROUND_SHIFT));
- __r &= ~(_ENABLE_MASK);
- __msr_fpsr(__r);
- return (0);
-}
-
-__fenv_static inline int
-fesetenv(const fenv_t *__envp)
-{
-
- __msr_fpcr((*__envp) & _ENABLE_MASK);
- __msr_fpsr((*__envp) & (FE_ALL_EXCEPT | (_ROUND_MASK << _ROUND_SHIFT)));
- return (0);
-}
-
-__fenv_static inline int
-feupdateenv(const fenv_t *__envp)
-{
- fexcept_t __r;
-
- __mrs_fpsr(__r);
- fesetenv(__envp);
- feraiseexcept(__r & FE_ALL_EXCEPT);
- return (0);
-}
-
-#if __BSD_VISIBLE
-
-/* We currently provide no external definitions of the functions below. */
-
-static inline int
-feenableexcept(int __mask)
-{
- fenv_t __old_r, __new_r;
-
- __mrs_fpcr(__old_r);
- __new_r = __old_r | ((__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT);
- __msr_fpcr(__new_r);
- return ((__old_r >> _FPUSW_SHIFT) & FE_ALL_EXCEPT);
-}
-
-static inline int
-fedisableexcept(int __mask)
-{
- fenv_t __old_r, __new_r;
-
- __mrs_fpcr(__old_r);
- __new_r = __old_r & ~((__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT);
- __msr_fpcr(__new_r);
- return ((__old_r >> _FPUSW_SHIFT) & FE_ALL_EXCEPT);
-}
-
-static inline int
-fegetexcept(void)
-{
- fenv_t __r;
-
- __mrs_fpcr(__r);
- return ((__r & _ENABLE_MASK) >> _FPUSW_SHIFT);
-}
-
-#endif /* __BSD_VISIBLE */
-
-__END_DECLS
-
-#endif /* !_FENV_H_ */
diff --git a/lib/msun/ld128/k_expl.h b/lib/msun/ld128/k_expl.h
index e0a48fc..a5668fd 100644
--- a/lib/msun/ld128/k_expl.h
+++ b/lib/msun/ld128/k_expl.h
@@ -322,7 +322,7 @@ __ldexp_cexpl(long double complex z, int expt)
scale2 = 1;
SET_LDBL_EXPSIGN(scale1, BIAS + expt - half_expt);
- return (CMPLXL(cos(y) * exp_x * scale1 * scale2,
+ return (cpackl(cos(y) * exp_x * scale1 * scale2,
sinl(y) * exp_x * scale1 * scale2));
}
#endif /* _COMPLEX_H */
diff --git a/lib/msun/ld80/k_expl.h b/lib/msun/ld80/k_expl.h
index 9b081fa..ebfb9a8 100644
--- a/lib/msun/ld80/k_expl.h
+++ b/lib/msun/ld80/k_expl.h
@@ -299,7 +299,7 @@ __ldexp_cexpl(long double complex z, int expt)
scale2 = 1;
SET_LDBL_EXPSIGN(scale1, BIAS + expt - half_expt);
- return (CMPLXL(cos(y) * exp_x * scale1 * scale2,
+ return (cpackl(cos(y) * exp_x * scale1 * scale2,
sinl(y) * exp_x * scale1 * scale2));
}
#endif /* _COMPLEX_H */
diff --git a/lib/msun/man/cexp.3 b/lib/msun/man/cexp.3
index 776e6ce..97e36c1 100644
--- a/lib/msun/man/cexp.3
+++ b/lib/msun/man/cexp.3
@@ -103,7 +103,7 @@ is not finite, the sign of the result is indeterminate.
.Sh SEE ALSO
.Xr complex 3 ,
.Xr exp 3 ,
-.Xr math 3
+.Xr math 3 ,
.Sh STANDARDS
The
.Fn cexp
diff --git a/lib/msun/man/complex.3 b/lib/msun/man/complex.3
index d286494..34eb03e 100644
--- a/lib/msun/man/complex.3
+++ b/lib/msun/man/complex.3
@@ -103,9 +103,9 @@ ctan tangent
ctanh hyperbolic tangent
.El
.Sh SEE ALSO
+.Xr math 3 ,
.Xr fenv 3 ,
.Xr ieee 3 ,
-.Xr math 3 ,
.Xr tgmath 3
.Rs
.%T "ISO/IEC 9899:TC3"
diff --git a/lib/msun/man/csqrt.3 b/lib/msun/man/csqrt.3
index d8066ae..1a1dfa0 100644
--- a/lib/msun/man/csqrt.3
+++ b/lib/msun/man/csqrt.3
@@ -85,7 +85,7 @@ an \*(Na is generated, an invalid exception will be thrown.
.Sh SEE ALSO
.Xr cabs 3 ,
.Xr fenv 3 ,
-.Xr math 3
+.Xr math 3 ,
.Sh STANDARDS
The
.Fn csqrt ,
diff --git a/lib/msun/man/j0.3 b/lib/msun/man/j0.3
index 587b72e..91849da 100644
--- a/lib/msun/man/j0.3
+++ b/lib/msun/man/j0.3
@@ -28,7 +28,7 @@
.\" from: @(#)j0.3 6.7 (Berkeley) 4/19/91
.\" $FreeBSD$
.\"
-.Dd March 10, 2015
+.Dd February 18, 2008
.Dt J0 3
.Os
.Sh NAME
@@ -77,17 +77,24 @@
The functions
.Fn j0 ,
.Fn j0f ,
-.Fn j1 ,
+.Fn j1
and
.Fn j1f
-compute the Bessel function of the first kind of orders
-0 and 1 for the real value
+compute the
+.Em Bessel function of the first kind of the order
+0 and the
+.Em order
+1, respectively,
+for the
+real value
.Fa x ;
the functions
.Fn jn
and
.Fn jnf
-compute the Bessel function of the first kind of the integer order
+compute the
+.Em Bessel function of the first kind of the integer
+.Em order
.Fa n
for the real value
.Fa x .
@@ -98,8 +105,13 @@ The functions
.Fn y1 ,
and
.Fn y1f
-compute the linearly independent Bessel function of the second kind
-of orders 0 and 1 for the positive
+compute the linearly independent
+.Em Bessel function of the second kind of the order
+0 and the
+.Em order
+1, respectively,
+for the
+positive
.Em real
value
.Fa x ;
@@ -107,7 +119,9 @@ the functions
.Fn yn
and
.Fn ynf
-compute the Bessel function of the second kind for the integer order
+compute the
+.Em Bessel function of the second kind for the integer
+.Em order
.Fa n
for the positive
.Em real
@@ -127,20 +141,11 @@ and
.Fn ynf .
If
.Fa x
-is negative, including -\*(If, these routines will generate an invalid
-exception and return \*(Na.
-If
-.Fa x
-is \*(Pm0, these routines
-will generate a divide-by-zero exception and return -\*(If.
+is negative, these routines will generate an invalid exception and
+return \*(Na.
If
.Fa x
-is a sufficiently small positive number, then
-.Fn y1 ,
-.Fn y1f ,
-.Fn yn ,
-and
-.Fn ynf
+is 0 or a sufficiently small positive number, these routines
will generate an overflow exception and return -\*(If.
.Sh SEE ALSO
.Xr math 3
diff --git a/lib/msun/man/lgamma.3 b/lib/msun/man/lgamma.3
index c8a22a2..d244722 100644
--- a/lib/msun/man/lgamma.3
+++ b/lib/msun/man/lgamma.3
@@ -99,7 +99,7 @@ returns the sign of \(*G(x).
and
.Fn lgammal_r x signgamp
provide the same functionality as
-.Fn lgamma x ,
+.Fn lgamma x ,
.Fn lgammaf x ,
and
.Fn lgammal x ,
@@ -124,6 +124,7 @@ are deprecated aliases for
and
.Fn lgammaf_r ,
respectively.
+
.Sh IDIOSYNCRASIES
Do not use the expression
.Dq Li signgam\(**exp(lgamma(x))
diff --git a/lib/msun/man/nextafter.3 b/lib/msun/man/nextafter.3
index 01c472d..c8c4aa3 100644
--- a/lib/msun/man/nextafter.3
+++ b/lib/msun/man/nextafter.3
@@ -78,11 +78,11 @@ routines conform to
They implement the Nextafter function recommended by
.St -ieee754 ,
with the extension that
-.Fn nextafter "+0.0" "-0.0"
+.Fn nextafter +0.0, -0.0
returns
.Li -0.0 ,
and
-.Fn nextafter "-0.0" "+0.0"
+.Fn nextafter -0.0, +0.0
returns
.Li +0.0 .
.Sh HISTORY
diff --git a/lib/msun/man/sin.3 b/lib/msun/man/sin.3
index 4a5352e..c7daf09 100644
--- a/lib/msun/man/sin.3
+++ b/lib/msun/man/sin.3
@@ -70,9 +70,9 @@ functions return the sine value.
.Xr asin 3 ,
.Xr atan 3 ,
.Xr atan2 3 ,
+.Xr csin 3 ,
.Xr cos 3 ,
.Xr cosh 3 ,
-.Xr csin 3 ,
.Xr math 3 ,
.Xr sinh 3 ,
.Xr tan 3 ,
diff --git a/lib/msun/src/catrig.c b/lib/msun/src/catrig.c
index c0f5f55..200977c 100644
--- a/lib/msun/src/catrig.c
+++ b/lib/msun/src/catrig.c
@@ -286,19 +286,19 @@ casinh(double complex z)
if (isnan(x) || isnan(y)) {
/* casinh(+-Inf + I*NaN) = +-Inf + I*NaN */
if (isinf(x))
- return (CMPLX(x, y + y));
+ return (cpack(x, y + y));
/* casinh(NaN + I*+-Inf) = opt(+-)Inf + I*NaN */
if (isinf(y))
- return (CMPLX(y, x + x));
+ return (cpack(y, x + x));
/* casinh(NaN + I*0) = NaN + I*0 */
if (y == 0)
- return (CMPLX(x + x, y));
+ return (cpack(x + x, y));
/*
* All other cases involving NaN return NaN + I*NaN.
* C99 leaves it optional whether to raise invalid if one of
* the arguments is not NaN, so we opt not to raise it.
*/
- return (CMPLX(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
}
if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) {
@@ -307,7 +307,7 @@ casinh(double complex z)
w = clog_for_large_values(z) + m_ln2;
else
w = clog_for_large_values(-z) + m_ln2;
- return (CMPLX(copysign(creal(w), x), copysign(cimag(w), y)));
+ return (cpack(copysign(creal(w), x), copysign(cimag(w), y)));
}
/* Avoid spuriously raising inexact for z = 0. */
@@ -325,7 +325,7 @@ casinh(double complex z)
ry = asin(B);
else
ry = atan2(new_y, sqrt_A2my2);
- return (CMPLX(copysign(rx, x), copysign(ry, y)));
+ return (cpack(copysign(rx, x), copysign(ry, y)));
}
/*
@@ -335,9 +335,9 @@ casinh(double complex z)
double complex
casin(double complex z)
{
- double complex w = casinh(CMPLX(cimag(z), creal(z)));
+ double complex w = casinh(cpack(cimag(z), creal(z)));
- return (CMPLX(cimag(w), creal(w)));
+ return (cpack(cimag(w), creal(w)));
}
/*
@@ -370,19 +370,19 @@ cacos(double complex z)
if (isnan(x) || isnan(y)) {
/* cacos(+-Inf + I*NaN) = NaN + I*opt(-)Inf */
if (isinf(x))
- return (CMPLX(y + y, -INFINITY));
+ return (cpack(y + y, -INFINITY));
/* cacos(NaN + I*+-Inf) = NaN + I*-+Inf */
if (isinf(y))
- return (CMPLX(x + x, -y));
+ return (cpack(x + x, -y));
/* cacos(0 + I*NaN) = PI/2 + I*NaN with inexact */
if (x == 0)
- return (CMPLX(pio2_hi + pio2_lo, y + y));
+ return (cpack(pio2_hi + pio2_lo, y + y));
/*
* All other cases involving NaN return NaN + I*NaN.
* C99 leaves it optional whether to raise invalid if one of
* the arguments is not NaN, so we opt not to raise it.
*/
- return (CMPLX(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
}
if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) {
@@ -392,18 +392,18 @@ cacos(double complex z)
ry = creal(w) + m_ln2;
if (sy == 0)
ry = -ry;
- return (CMPLX(rx, ry));
+ return (cpack(rx, ry));
}
/* Avoid spuriously raising inexact for z = 1. */
if (x == 1 && y == 0)
- return (CMPLX(0, -y));
+ return (cpack(0, -y));
/* All remaining cases are inexact. */
raise_inexact();
if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
- return (CMPLX(pio2_hi - (x - pio2_lo), -y));
+ return (cpack(pio2_hi - (x - pio2_lo), -y));
do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x);
if (B_is_usable) {
@@ -419,7 +419,7 @@ cacos(double complex z)
}
if (sy == 0)
ry = -ry;
- return (CMPLX(rx, ry));
+ return (cpack(rx, ry));
}
/*
@@ -437,15 +437,15 @@ cacosh(double complex z)
ry = cimag(w);
/* cacosh(NaN + I*NaN) = NaN + I*NaN */
if (isnan(rx) && isnan(ry))
- return (CMPLX(ry, rx));
+ return (cpack(ry, rx));
/* cacosh(NaN + I*+-Inf) = +Inf + I*NaN */
/* cacosh(+-Inf + I*NaN) = +Inf + I*NaN */
if (isnan(rx))
- return (CMPLX(fabs(ry), rx));
+ return (cpack(fabs(ry), rx));
/* cacosh(0 + I*NaN) = NaN + I*NaN */
if (isnan(ry))
- return (CMPLX(ry, ry));
- return (CMPLX(fabs(ry), copysign(rx, cimag(z))));
+ return (cpack(ry, ry));
+ return (cpack(fabs(ry), copysign(rx, cimag(z))));
}
/*
@@ -475,16 +475,16 @@ clog_for_large_values(double complex z)
* this method is still poor since it is uneccessarily slow.
*/
if (ax > DBL_MAX / 2)
- return (CMPLX(log(hypot(x / m_e, y / m_e)) + 1, atan2(y, x)));
+ return (cpack(log(hypot(x / m_e, y / m_e)) + 1, atan2(y, x)));
/*
* Avoid overflow when x or y is large. Avoid underflow when x or
* y is small.
*/
if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN)
- return (CMPLX(log(hypot(x, y)), atan2(y, x)));
+ return (cpack(log(hypot(x, y)), atan2(y, x)));
- return (CMPLX(log(ax * ax + ay * ay) / 2, atan2(y, x)));
+ return (cpack(log(ax * ax + ay * ay) / 2, atan2(y, x)));
}
/*
@@ -575,30 +575,30 @@ catanh(double complex z)
/* This helps handle many cases. */
if (y == 0 && ax <= 1)
- return (CMPLX(atanh(x), y));
+ return (cpack(atanh(x), y));
/* To ensure the same accuracy as atan(), and to filter out z = 0. */
if (x == 0)
- return (CMPLX(x, atan(y)));
+ return (cpack(x, atan(y)));
if (isnan(x) || isnan(y)) {
/* catanh(+-Inf + I*NaN) = +-0 + I*NaN */
if (isinf(x))
- return (CMPLX(copysign(0, x), y + y));
+ return (cpack(copysign(0, x), y + y));
/* catanh(NaN + I*+-Inf) = sign(NaN)0 + I*+-PI/2 */
if (isinf(y))
- return (CMPLX(copysign(0, x),
+ return (cpack(copysign(0, x),
copysign(pio2_hi + pio2_lo, y)));
/*
* All other cases involving NaN return NaN + I*NaN.
* C99 leaves it optional whether to raise invalid if one of
* the arguments is not NaN, so we opt not to raise it.
*/
- return (CMPLX(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
}
if (ax > RECIP_EPSILON || ay > RECIP_EPSILON)
- return (CMPLX(real_part_reciprocal(x, y),
+ return (cpack(real_part_reciprocal(x, y),
copysign(pio2_hi + pio2_lo, y)));
if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2) {
@@ -623,7 +623,7 @@ catanh(double complex z)
else
ry = atan2(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2;
- return (CMPLX(copysign(rx, x), copysign(ry, y)));
+ return (cpack(copysign(rx, x), copysign(ry, y)));
}
/*
@@ -633,7 +633,7 @@ catanh(double complex z)
double complex
catan(double complex z)
{
- double complex w = catanh(CMPLX(cimag(z), creal(z)));
+ double complex w = catanh(cpack(cimag(z), creal(z)));
- return (CMPLX(cimag(w), creal(w)));
+ return (cpack(cimag(w), creal(w)));
}
diff --git a/lib/msun/src/catrigf.c b/lib/msun/src/catrigf.c
index ca84ce2..08ebef7 100644
--- a/lib/msun/src/catrigf.c
+++ b/lib/msun/src/catrigf.c
@@ -156,12 +156,12 @@ casinhf(float complex z)
if (isnan(x) || isnan(y)) {
if (isinf(x))
- return (CMPLXF(x, y + y));
+ return (cpackf(x, y + y));
if (isinf(y))
- return (CMPLXF(y, x + x));
+ return (cpackf(y, x + x));
if (y == 0)
- return (CMPLXF(x + x, y));
- return (CMPLXF(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ return (cpackf(x + x, y));
+ return (cpackf(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
}
if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) {
@@ -169,7 +169,7 @@ casinhf(float complex z)
w = clog_for_large_values(z) + m_ln2;
else
w = clog_for_large_values(-z) + m_ln2;
- return (CMPLXF(copysignf(crealf(w), x),
+ return (cpackf(copysignf(crealf(w), x),
copysignf(cimagf(w), y)));
}
@@ -186,15 +186,15 @@ casinhf(float complex z)
ry = asinf(B);
else
ry = atan2f(new_y, sqrt_A2my2);
- return (CMPLXF(copysignf(rx, x), copysignf(ry, y)));
+ return (cpackf(copysignf(rx, x), copysignf(ry, y)));
}
float complex
casinf(float complex z)
{
- float complex w = casinhf(CMPLXF(cimagf(z), crealf(z)));
+ float complex w = casinhf(cpackf(cimagf(z), crealf(z)));
- return (CMPLXF(cimagf(w), crealf(w)));
+ return (cpackf(cimagf(w), crealf(w)));
}
float complex
@@ -214,12 +214,12 @@ cacosf(float complex z)
if (isnan(x) || isnan(y)) {
if (isinf(x))
- return (CMPLXF(y + y, -INFINITY));
+ return (cpackf(y + y, -INFINITY));
if (isinf(y))
- return (CMPLXF(x + x, -y));
+ return (cpackf(x + x, -y));
if (x == 0)
- return (CMPLXF(pio2_hi + pio2_lo, y + y));
- return (CMPLXF(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ return (cpackf(pio2_hi + pio2_lo, y + y));
+ return (cpackf(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
}
if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) {
@@ -228,16 +228,16 @@ cacosf(float complex z)
ry = crealf(w) + m_ln2;
if (sy == 0)
ry = -ry;
- return (CMPLXF(rx, ry));
+ return (cpackf(rx, ry));
}
if (x == 1 && y == 0)
- return (CMPLXF(0, -y));
+ return (cpackf(0, -y));
raise_inexact();
if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
- return (CMPLXF(pio2_hi - (x - pio2_lo), -y));
+ return (cpackf(pio2_hi - (x - pio2_lo), -y));
do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x);
if (B_is_usable) {
@@ -253,7 +253,7 @@ cacosf(float complex z)
}
if (sy == 0)
ry = -ry;
- return (CMPLXF(rx, ry));
+ return (cpackf(rx, ry));
}
float complex
@@ -266,12 +266,12 @@ cacoshf(float complex z)
rx = crealf(w);
ry = cimagf(w);
if (isnan(rx) && isnan(ry))
- return (CMPLXF(ry, rx));
+ return (cpackf(ry, rx));
if (isnan(rx))
- return (CMPLXF(fabsf(ry), rx));
+ return (cpackf(fabsf(ry), rx));
if (isnan(ry))
- return (CMPLXF(ry, ry));
- return (CMPLXF(fabsf(ry), copysignf(rx, cimagf(z))));
+ return (cpackf(ry, ry));
+ return (cpackf(fabsf(ry), copysignf(rx, cimagf(z))));
}
static float complex
@@ -291,13 +291,13 @@ clog_for_large_values(float complex z)
}
if (ax > FLT_MAX / 2)
- return (CMPLXF(logf(hypotf(x / m_e, y / m_e)) + 1,
+ return (cpackf(logf(hypotf(x / m_e, y / m_e)) + 1,
atan2f(y, x)));
if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN)
- return (CMPLXF(logf(hypotf(x, y)), atan2f(y, x)));
+ return (cpackf(logf(hypotf(x, y)), atan2f(y, x)));
- return (CMPLXF(logf(ax * ax + ay * ay) / 2, atan2f(y, x)));
+ return (cpackf(logf(ax * ax + ay * ay) / 2, atan2f(y, x)));
}
static inline float
@@ -346,22 +346,22 @@ catanhf(float complex z)
ay = fabsf(y);
if (y == 0 && ax <= 1)
- return (CMPLXF(atanhf(x), y));
+ return (cpackf(atanhf(x), y));
if (x == 0)
- return (CMPLXF(x, atanf(y)));
+ return (cpackf(x, atanf(y)));
if (isnan(x) || isnan(y)) {
if (isinf(x))
- return (CMPLXF(copysignf(0, x), y + y));
+ return (cpackf(copysignf(0, x), y + y));
if (isinf(y))
- return (CMPLXF(copysignf(0, x),
+ return (cpackf(copysignf(0, x),
copysignf(pio2_hi + pio2_lo, y)));
- return (CMPLXF(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ return (cpackf(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
}
if (ax > RECIP_EPSILON || ay > RECIP_EPSILON)
- return (CMPLXF(real_part_reciprocal(x, y),
+ return (cpackf(real_part_reciprocal(x, y),
copysignf(pio2_hi + pio2_lo, y)));
if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2) {
@@ -381,13 +381,13 @@ catanhf(float complex z)
else
ry = atan2f(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2;
- return (CMPLXF(copysignf(rx, x), copysignf(ry, y)));
+ return (cpackf(copysignf(rx, x), copysignf(ry, y)));
}
float complex
catanf(float complex z)
{
- float complex w = catanhf(CMPLXF(cimagf(z), crealf(z)));
+ float complex w = catanhf(cpackf(cimagf(z), crealf(z)));
- return (CMPLXF(cimagf(w), crealf(w)));
+ return (cpackf(cimagf(w), crealf(w)));
}
diff --git a/lib/msun/src/e_j0.c b/lib/msun/src/e_j0.c
index a253ed1..8320f25 100644
--- a/lib/msun/src/e_j0.c
+++ b/lib/msun/src/e_j0.c
@@ -62,9 +62,7 @@ __FBSDID("$FreeBSD$");
#include "math.h"
#include "math_private.h"
-static __inline double pzero(double), qzero(double);
-
-static const volatile double vone = 1, vzero = 0;
+static double pzero(double), qzero(double);
static const double
huge = 1e300,
@@ -117,7 +115,7 @@ __ieee754_j0(double x)
if(ix<0x3f200000) { /* |x| < 2**-13 */
if(huge+x>one) { /* raise inexact if x != 0 */
if(ix<0x3e400000) return one; /* |x|<2**-27 */
- else return one - x*x/4;
+ else return one - 0.25*x*x;
}
}
z = x*x;
@@ -152,16 +150,10 @@ __ieee754_y0(double x)
EXTRACT_WORDS(hx,lx,x);
ix = 0x7fffffff&hx;
- /*
- * y0(NaN) = NaN.
- * y0(Inf) = 0.
- * y0(-Inf) = NaN and raise invalid exception.
- */
- if(ix>=0x7ff00000) return vone/(x+x*x);
- /* y0(+-0) = -inf and raise divide-by-zero exception. */
- if((ix|lx)==0) return -one/vzero;
- /* y0(x<0) = NaN and raise invalid exception. */
- if(hx<0) return vzero/vzero;
+ /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0 */
+ if(ix>=0x7ff00000) return one/(x+x*x);
+ if((ix|lx)==0) return -one/zero;
+ if(hx<0) return zero/zero;
if(ix >= 0x40000000) { /* |x| >= 2.0 */
/* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
* where x0 = x-pi/4
@@ -276,8 +268,7 @@ static const double pS2[5] = {
1.46576176948256193810e+01, /* 0x402D50B3, 0x44391809 */
};
-static __inline double
-pzero(double x)
+ static double pzero(double x)
{
const double *p,*q;
double z,r,s;
@@ -287,7 +278,7 @@ pzero(double x)
if(ix>=0x40200000) {p = pR8; q= pS8;}
else if(ix>=0x40122E8B){p = pR5; q= pS5;}
else if(ix>=0x4006DB6D){p = pR3; q= pS3;}
- else {p = pR2; q= pS2;} /* ix>=0x40000000 */
+ else if(ix>=0x40000000){p = pR2; q= pS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
@@ -372,8 +363,7 @@ static const double qS2[6] = {
-5.31095493882666946917e+00, /* 0xC0153E6A, 0xF8B32931 */
};
-static __inline double
-qzero(double x)
+ static double qzero(double x)
{
const double *p,*q;
double s,r,z;
@@ -383,7 +373,7 @@ qzero(double x)
if(ix>=0x40200000) {p = qR8; q= qS8;}
else if(ix>=0x40122E8B){p = qR5; q= qS5;}
else if(ix>=0x4006DB6D){p = qR3; q= qS3;}
- else {p = qR2; q= qS2;} /* ix>=0x40000000 */
+ else if(ix>=0x40000000){p = qR2; q= qS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
diff --git a/lib/msun/src/e_j0f.c b/lib/msun/src/e_j0f.c
index 3e2f7e8..c45faf3 100644
--- a/lib/msun/src/e_j0f.c
+++ b/lib/msun/src/e_j0f.c
@@ -16,16 +16,10 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/*
- * See e_j0.c for complete comments.
- */
-
#include "math.h"
#include "math_private.h"
-static __inline float pzerof(float), qzerof(float);
-
-static const volatile float vone = 1, vzero = 0;
+static float pzerof(float), qzerof(float);
static const float
huge = 1e30,
@@ -68,17 +62,17 @@ __ieee754_j0f(float x)
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
- if(ix>0x58000000) z = (invsqrtpi*cc)/sqrtf(x); /* |x|>2**49 */
+ if(ix>0x80000000) z = (invsqrtpi*cc)/sqrtf(x);
else {
u = pzerof(x); v = qzerof(x);
z = invsqrtpi*(u*cc-v*ss)/sqrtf(x);
}
return z;
}
- if(ix<0x3b000000) { /* |x| < 2**-9 */
+ if(ix<0x39000000) { /* |x| < 2**-13 */
if(huge+x>one) { /* raise inexact if x != 0 */
- if(ix<0x39800000) return one; /* |x|<2**-12 */
- else return one - x*x/4;
+ if(ix<0x32000000) return one; /* |x|<2**-27 */
+ else return one - (float)0.25*x*x;
}
}
z = x*x;
@@ -113,9 +107,10 @@ __ieee754_y0f(float x)
GET_FLOAT_WORD(hx,x);
ix = 0x7fffffff&hx;
- if(ix>=0x7f800000) return vone/(x+x*x);
- if(ix==0) return -one/vzero;
- if(hx<0) return vzero/vzero;
+ /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0 */
+ if(ix>=0x7f800000) return one/(x+x*x);
+ if(ix==0) return -one/zero;
+ if(hx<0) return zero/zero;
if(ix >= 0x40000000) { /* |x| >= 2.0 */
/* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
* where x0 = x-pi/4
@@ -141,14 +136,14 @@ __ieee754_y0f(float x)
if ((s*c)<zero) cc = z/ss;
else ss = z/cc;
}
- if(ix>0x58000000) z = (invsqrtpi*ss)/sqrtf(x); /* |x|>2**49 */
+ if(ix>0x80000000) z = (invsqrtpi*ss)/sqrtf(x);
else {
u = pzerof(x); v = qzerof(x);
z = invsqrtpi*(u*ss+v*cc)/sqrtf(x);
}
return z;
}
- if(ix<=0x39000000) { /* x < 2**-13 */
+ if(ix<=0x32000000) { /* x < 2**-27 */
return(u00 + tpi*__ieee754_logf(x));
}
z = x*x;
@@ -229,8 +224,7 @@ static const float pS2[5] = {
1.4657617569e+01, /* 0x416a859a */
};
-static __inline float
-pzerof(float x)
+ static float pzerof(float x)
{
const float *p,*q;
float z,r,s;
@@ -238,9 +232,9 @@ pzerof(float x)
GET_FLOAT_WORD(ix,x);
ix &= 0x7fffffff;
if(ix>=0x41000000) {p = pR8; q= pS8;}
- else if(ix>=0x409173eb){p = pR5; q= pS5;}
- else if(ix>=0x4036d917){p = pR3; q= pS3;}
- else {p = pR2; q= pS2;} /* ix>=0x40000000 */
+ else if(ix>=0x40f71c58){p = pR5; q= pS5;}
+ else if(ix>=0x4036db68){p = pR3; q= pS3;}
+ else if(ix>=0x40000000){p = pR2; q= pS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
@@ -325,8 +319,7 @@ static const float qS2[6] = {
-5.3109550476e+00, /* 0xc0a9f358 */
};
-static __inline float
-qzerof(float x)
+ static float qzerof(float x)
{
const float *p,*q;
float s,r,z;
@@ -334,9 +327,9 @@ qzerof(float x)
GET_FLOAT_WORD(ix,x);
ix &= 0x7fffffff;
if(ix>=0x41000000) {p = qR8; q= qS8;}
- else if(ix>=0x409173eb){p = qR5; q= qS5;}
- else if(ix>=0x4036d917){p = qR3; q= qS3;}
- else {p = qR2; q= qS2;} /* ix>=0x40000000 */
+ else if(ix>=0x40f71c58){p = qR5; q= qS5;}
+ else if(ix>=0x4036db68){p = qR3; q= qS3;}
+ else if(ix>=0x40000000){p = qR2; q= qS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
diff --git a/lib/msun/src/e_j1.c b/lib/msun/src/e_j1.c
index 74a7c69..63800ad 100644
--- a/lib/msun/src/e_j1.c
+++ b/lib/msun/src/e_j1.c
@@ -62,9 +62,7 @@ __FBSDID("$FreeBSD$");
#include "math.h"
#include "math_private.h"
-static __inline double pone(double), qone(double);
-
-static const volatile double vone = 1, vzero = 0;
+static double pone(double), qone(double);
static const double
huge = 1e300,
@@ -149,16 +147,10 @@ __ieee754_y1(double x)
EXTRACT_WORDS(hx,lx,x);
ix = 0x7fffffff&hx;
- /*
- * y1(NaN) = NaN.
- * y1(Inf) = 0.
- * y1(-Inf) = NaN and raise invalid exception.
- */
- if(ix>=0x7ff00000) return vone/(x+x*x);
- /* y1(+-0) = -inf and raise divide-by-zero exception. */
- if((ix|lx)==0) return -one/vzero;
- /* y1(x<0) = NaN and raise invalid exception. */
- if(hx<0) return vzero/vzero;
+ /* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
+ if(ix>=0x7ff00000) return one/(x+x*x);
+ if((ix|lx)==0) return -one/zero;
+ if(hx<0) return zero/zero;
if(ix >= 0x40000000) { /* |x| >= 2.0 */
s = sin(x);
c = cos(x);
@@ -270,8 +262,7 @@ static const double ps2[5] = {
8.36463893371618283368e+00, /* 0x4020BAB1, 0xF44E5192 */
};
-static __inline double
-pone(double x)
+ static double pone(double x)
{
const double *p,*q;
double z,r,s;
@@ -281,7 +272,7 @@ pone(double x)
if(ix>=0x40200000) {p = pr8; q= ps8;}
else if(ix>=0x40122E8B){p = pr5; q= ps5;}
else if(ix>=0x4006DB6D){p = pr3; q= ps3;}
- else {p = pr2; q= ps2;} /* ix>=0x40000000 */
+ else if(ix>=0x40000000){p = pr2; q= ps2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
@@ -367,8 +358,7 @@ static const double qs2[6] = {
-4.95949898822628210127e+00, /* 0xC013D686, 0xE71BE86B */
};
-static __inline double
-qone(double x)
+ static double qone(double x)
{
const double *p,*q;
double s,r,z;
@@ -378,7 +368,7 @@ qone(double x)
if(ix>=0x40200000) {p = qr8; q= qs8;}
else if(ix>=0x40122E8B){p = qr5; q= qs5;}
else if(ix>=0x4006DB6D){p = qr3; q= qs3;}
- else {p = qr2; q= qs2;} /* ix>=0x40000000 */
+ else if(ix>=0x40000000){p = qr2; q= qs2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
diff --git a/lib/msun/src/e_j1f.c b/lib/msun/src/e_j1f.c
index ec7f381..88e2d83 100644
--- a/lib/msun/src/e_j1f.c
+++ b/lib/msun/src/e_j1f.c
@@ -16,16 +16,10 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/*
- * See e_j1.c for complete comments.
- */
-
#include "math.h"
#include "math_private.h"
-static __inline float ponef(float), qonef(float);
-
-static const volatile float vone = 1, vzero = 0;
+static float ponef(float), qonef(float);
static const float
huge = 1e30,
@@ -69,7 +63,7 @@ __ieee754_j1f(float x)
* j1(x) = 1/sqrt(pi) * (P(1,x)*cc - Q(1,x)*ss) / sqrt(x)
* y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x)
*/
- if(ix>0x58000000) z = (invsqrtpi*cc)/sqrtf(y); /* |x|>2**49 */
+ if(ix>0x80000000) z = (invsqrtpi*cc)/sqrtf(y);
else {
u = ponef(y); v = qonef(y);
z = invsqrtpi*(u*cc-v*ss)/sqrtf(y);
@@ -77,7 +71,7 @@ __ieee754_j1f(float x)
if(hx<0) return -z;
else return z;
}
- if(ix<0x39000000) { /* |x|<2**-13 */
+ if(ix<0x32000000) { /* |x|<2**-27 */
if(huge+x>one) return (float)0.5*x;/* inexact if x!=0 necessary */
}
z = x*x;
@@ -110,9 +104,10 @@ __ieee754_y1f(float x)
GET_FLOAT_WORD(hx,x);
ix = 0x7fffffff&hx;
- if(ix>=0x7f800000) return vone/(x+x*x);
- if(ix==0) return -one/vzero;
- if(hx<0) return vzero/vzero;
+ /* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
+ if(ix>=0x7f800000) return one/(x+x*x);
+ if(ix==0) return -one/zero;
+ if(hx<0) return zero/zero;
if(ix >= 0x40000000) { /* |x| >= 2.0 */
s = sinf(x);
c = cosf(x);
@@ -134,14 +129,14 @@ __ieee754_y1f(float x)
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
* to compute the worse one.
*/
- if(ix>0x58000000) z = (invsqrtpi*ss)/sqrtf(x); /* |x|>2**49 */
+ if(ix>0x48000000) z = (invsqrtpi*ss)/sqrtf(x);
else {
u = ponef(x); v = qonef(x);
z = invsqrtpi*(u*ss+v*cc)/sqrtf(x);
}
return z;
}
- if(ix<=0x33000000) { /* x < 2**-25 */
+ if(ix<=0x24800000) { /* x < 2**-54 */
return(-tpi/x);
}
z = x*x;
@@ -224,8 +219,7 @@ static const float ps2[5] = {
8.3646392822e+00, /* 0x4105d590 */
};
-static __inline float
-ponef(float x)
+ static float ponef(float x)
{
const float *p,*q;
float z,r,s;
@@ -233,9 +227,9 @@ ponef(float x)
GET_FLOAT_WORD(ix,x);
ix &= 0x7fffffff;
if(ix>=0x41000000) {p = pr8; q= ps8;}
- else if(ix>=0x409173eb){p = pr5; q= ps5;}
- else if(ix>=0x4036d917){p = pr3; q= ps3;}
- else {p = pr2; q= ps2;} /* ix>=0x40000000 */
+ else if(ix>=0x40f71c58){p = pr5; q= ps5;}
+ else if(ix>=0x4036db68){p = pr3; q= ps3;}
+ else if(ix>=0x40000000){p = pr2; q= ps2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
@@ -321,18 +315,17 @@ static const float qs2[6] = {
-4.9594988823e+00, /* 0xc09eb437 */
};
-static __inline float
-qonef(float x)
+ static float qonef(float x)
{
const float *p,*q;
float s,r,z;
int32_t ix;
GET_FLOAT_WORD(ix,x);
ix &= 0x7fffffff;
- if(ix>=0x41000000) {p = qr8; q= qs8;}
- else if(ix>=0x409173eb){p = qr5; q= qs5;}
- else if(ix>=0x4036d917){p = qr3; q= qs3;}
- else {p = qr2; q= qs2;} /* ix>=0x40000000 */
+ if(ix>=0x40200000) {p = qr8; q= qs8;}
+ else if(ix>=0x40f71c58){p = qr5; q= qs5;}
+ else if(ix>=0x4036db68){p = qr3; q= qs3;}
+ else if(ix>=0x40000000){p = qr2; q= qs2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
diff --git a/lib/msun/src/e_jn.c b/lib/msun/src/e_jn.c
index eefd4ff..8b0bc62 100644
--- a/lib/msun/src/e_jn.c
+++ b/lib/msun/src/e_jn.c
@@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$");
#include "math.h"
#include "math_private.h"
-static const volatile double vone = 1, vzero = 0;
-
static const double
invsqrtpi= 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */
two = 2.00000000000000000000e+00, /* 0x40000000, 0x00000000 */
@@ -222,12 +220,10 @@ __ieee754_yn(int n, double x)
EXTRACT_WORDS(hx,lx,x);
ix = 0x7fffffff&hx;
- /* yn(n,NaN) = NaN */
+ /* if Y(n,NaN) is NaN */
if((ix|((u_int32_t)(lx|-lx))>>31)>0x7ff00000) return x+x;
- /* yn(n,+-0) = -inf and raise divide-by-zero exception. */
- if((ix|lx)==0) return -one/vzero;
- /* yn(n,x<0) = NaN and raise invalid exception. */
- if(hx<0) return vzero/vzero;
+ if((ix|lx)==0) return -one/zero;
+ if(hx<0) return zero/zero;
sign = 1;
if(n<0){
n = -n;
diff --git a/lib/msun/src/e_jnf.c b/lib/msun/src/e_jnf.c
index 965feeb..f564aec 100644
--- a/lib/msun/src/e_jnf.c
+++ b/lib/msun/src/e_jnf.c
@@ -16,15 +16,9 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/*
- * See e_jn.c for complete comments.
- */
-
#include "math.h"
#include "math_private.h"
-static const volatile float vone = 1, vzero = 0;
-
static const float
two = 2.0000000000e+00, /* 0x40000000 */
one = 1.0000000000e+00; /* 0x3F800000 */
@@ -178,9 +172,10 @@ __ieee754_ynf(int n, float x)
GET_FLOAT_WORD(hx,x);
ix = 0x7fffffff&hx;
+ /* if Y(n,NaN) is NaN */
if(ix>0x7f800000) return x+x;
- if(ix==0) return -one/vzero;
- if(hx<0) return vzero/vzero;
+ if(ix==0) return -one/zero;
+ if(hx<0) return zero/zero;
sign = 1;
if(n<0){
n = -n;
diff --git a/lib/msun/src/k_exp.c b/lib/msun/src/k_exp.c
index ecef54c..f592f69 100644
--- a/lib/msun/src/k_exp.c
+++ b/lib/msun/src/k_exp.c
@@ -103,6 +103,6 @@ __ldexp_cexp(double complex z, int expt)
half_expt = expt - half_expt;
INSERT_WORDS(scale2, (0x3ff + half_expt) << 20, 0);
- return (CMPLX(cos(y) * exp_x * scale1 * scale2,
+ return (cpack(cos(y) * exp_x * scale1 * scale2,
sin(y) * exp_x * scale1 * scale2));
}
diff --git a/lib/msun/src/k_expf.c b/lib/msun/src/k_expf.c
index f8c254d..548a008 100644
--- a/lib/msun/src/k_expf.c
+++ b/lib/msun/src/k_expf.c
@@ -82,6 +82,6 @@ __ldexp_cexpf(float complex z, int expt)
half_expt = expt - half_expt;
SET_FLOAT_WORD(scale2, (0x7f + half_expt) << 23);
- return (CMPLXF(cosf(y) * exp_x * scale1 * scale2,
+ return (cpackf(cosf(y) * exp_x * scale1 * scale2,
sinf(y) * exp_x * scale1 * scale2));
}
diff --git a/lib/msun/src/math_private.h b/lib/msun/src/math_private.h
index afaf201..8af2c65 100644
--- a/lib/msun/src/math_private.h
+++ b/lib/msun/src/math_private.h
@@ -454,15 +454,9 @@ typedef union {
* (0.0+I)*(y+0.0*I) and laboriously computing the full complex product.
* In particular, I*Inf is corrupted to NaN+I*Inf, and I*-0 is corrupted
* to -0.0+I*0.0.
- *
- * The C11 standard introduced the macros CMPLX(), CMPLXF() and CMPLXL()
- * to construct complex values. Compilers that conform to the C99
- * standard require the following functions to avoid the above issues.
*/
-
-#ifndef CMPLXF
static __inline float complex
-CMPLXF(float x, float y)
+cpackf(float x, float y)
{
float_complex z;
@@ -470,11 +464,9 @@ CMPLXF(float x, float y)
IMAGPART(z) = y;
return (z.f);
}
-#endif
-#ifndef CMPLX
static __inline double complex
-CMPLX(double x, double y)
+cpack(double x, double y)
{
double_complex z;
@@ -482,11 +474,9 @@ CMPLX(double x, double y)
IMAGPART(z) = y;
return (z.f);
}
-#endif
-#ifndef CMPLXL
static __inline long double complex
-CMPLXL(long double x, long double y)
+cpackl(long double x, long double y)
{
long_double_complex z;
@@ -494,8 +484,6 @@ CMPLXL(long double x, long double y)
IMAGPART(z) = y;
return (z.f);
}
-#endif
-
#endif /* _COMPLEX_H */
#ifdef __GNUCLIKE_ASM
diff --git a/lib/msun/src/s_ccosh.c b/lib/msun/src/s_ccosh.c
index fbe15fc..9ea962b 100644
--- a/lib/msun/src/s_ccosh.c
+++ b/lib/msun/src/s_ccosh.c
@@ -62,23 +62,23 @@ ccosh(double complex z)
/* Handle the nearly-non-exceptional cases where x and y are finite. */
if (ix < 0x7ff00000 && iy < 0x7ff00000) {
if ((iy | ly) == 0)
- return (CMPLX(cosh(x), x * y));
+ return (cpack(cosh(x), x * y));
if (ix < 0x40360000) /* small x: normal case */
- return (CMPLX(cosh(x) * cos(y), sinh(x) * sin(y)));
+ return (cpack(cosh(x) * cos(y), sinh(x) * sin(y)));
/* |x| >= 22, so cosh(x) ~= exp(|x|) */
if (ix < 0x40862e42) {
/* x < 710: exp(|x|) won't overflow */
h = exp(fabs(x)) * 0.5;
- return (CMPLX(h * cos(y), copysign(h, x) * sin(y)));
+ return (cpack(h * cos(y), copysign(h, x) * sin(y)));
} else if (ix < 0x4096bbaa) {
/* x < 1455: scale to avoid overflow */
- z = __ldexp_cexp(CMPLX(fabs(x), y), -1);
- return (CMPLX(creal(z), cimag(z) * copysign(1, x)));
+ z = __ldexp_cexp(cpack(fabs(x), y), -1);
+ return (cpack(creal(z), cimag(z) * copysign(1, x)));
} else {
/* x >= 1455: the result always overflows */
h = huge * x;
- return (CMPLX(h * h * cos(y), h * sin(y)));
+ return (cpack(h * h * cos(y), h * sin(y)));
}
}
@@ -92,7 +92,7 @@ ccosh(double complex z)
* the same as d(NaN).
*/
if ((ix | lx) == 0 && iy >= 0x7ff00000)
- return (CMPLX(y - y, copysign(0, x * (y - y))));
+ return (cpack(y - y, copysign(0, x * (y - y))));
/*
* cosh(+-Inf +- I 0) = +Inf + I (+-)(+-)0.
@@ -102,8 +102,8 @@ ccosh(double complex z)
*/
if ((iy | ly) == 0 && ix >= 0x7ff00000) {
if (((hx & 0xfffff) | lx) == 0)
- return (CMPLX(x * x, copysign(0, x) * y));
- return (CMPLX(x * x, copysign(0, (x + x) * y)));
+ return (cpack(x * x, copysign(0, x) * y));
+ return (cpack(x * x, copysign(0, (x + x) * y)));
}
/*
@@ -115,7 +115,7 @@ ccosh(double complex z)
* nonzero x. Choice = don't raise (except for signaling NaNs).
*/
if (ix < 0x7ff00000 && iy >= 0x7ff00000)
- return (CMPLX(y - y, x * (y - y)));
+ return (cpack(y - y, x * (y - y)));
/*
* cosh(+-Inf + I NaN) = +Inf + I d(NaN).
@@ -128,8 +128,8 @@ ccosh(double complex z)
*/
if (ix >= 0x7ff00000 && ((hx & 0xfffff) | lx) == 0) {
if (iy >= 0x7ff00000)
- return (CMPLX(x * x, x * (y - y)));
- return (CMPLX((x * x) * cos(y), x * sin(y)));
+ return (cpack(x * x, x * (y - y)));
+ return (cpack((x * x) * cos(y), x * sin(y)));
}
/*
@@ -143,7 +143,7 @@ ccosh(double complex z)
* Optionally raises the invalid floating-point exception for finite
* nonzero y. Choice = don't raise (except for signaling NaNs).
*/
- return (CMPLX((x * x) * (y - y), (x + x) * (y - y)));
+ return (cpack((x * x) * (y - y), (x + x) * (y - y)));
}
double complex
@@ -151,5 +151,5 @@ ccos(double complex z)
{
/* ccos(z) = ccosh(I * z) */
- return (ccosh(CMPLX(-cimag(z), creal(z))));
+ return (ccosh(cpack(-cimag(z), creal(z))));
}
diff --git a/lib/msun/src/s_ccoshf.c b/lib/msun/src/s_ccoshf.c
index fe8cf89..1de9ad4 100644
--- a/lib/msun/src/s_ccoshf.c
+++ b/lib/msun/src/s_ccoshf.c
@@ -55,50 +55,50 @@ ccoshf(float complex z)
if (ix < 0x7f800000 && iy < 0x7f800000) {
if (iy == 0)
- return (CMPLXF(coshf(x), x * y));
+ return (cpackf(coshf(x), x * y));
if (ix < 0x41100000) /* small x: normal case */
- return (CMPLXF(coshf(x) * cosf(y), sinhf(x) * sinf(y)));
+ return (cpackf(coshf(x) * cosf(y), sinhf(x) * sinf(y)));
/* |x| >= 9, so cosh(x) ~= exp(|x|) */
if (ix < 0x42b17218) {
/* x < 88.7: expf(|x|) won't overflow */
h = expf(fabsf(x)) * 0.5f;
- return (CMPLXF(h * cosf(y), copysignf(h, x) * sinf(y)));
+ return (cpackf(h * cosf(y), copysignf(h, x) * sinf(y)));
} else if (ix < 0x4340b1e7) {
/* x < 192.7: scale to avoid overflow */
- z = __ldexp_cexpf(CMPLXF(fabsf(x), y), -1);
- return (CMPLXF(crealf(z), cimagf(z) * copysignf(1, x)));
+ z = __ldexp_cexpf(cpackf(fabsf(x), y), -1);
+ return (cpackf(crealf(z), cimagf(z) * copysignf(1, x)));
} else {
/* x >= 192.7: the result always overflows */
h = huge * x;
- return (CMPLXF(h * h * cosf(y), h * sinf(y)));
+ return (cpackf(h * h * cosf(y), h * sinf(y)));
}
}
if (ix == 0 && iy >= 0x7f800000)
- return (CMPLXF(y - y, copysignf(0, x * (y - y))));
+ return (cpackf(y - y, copysignf(0, x * (y - y))));
if (iy == 0 && ix >= 0x7f800000) {
if ((hx & 0x7fffff) == 0)
- return (CMPLXF(x * x, copysignf(0, x) * y));
- return (CMPLXF(x * x, copysignf(0, (x + x) * y)));
+ return (cpackf(x * x, copysignf(0, x) * y));
+ return (cpackf(x * x, copysignf(0, (x + x) * y)));
}
if (ix < 0x7f800000 && iy >= 0x7f800000)
- return (CMPLXF(y - y, x * (y - y)));
+ return (cpackf(y - y, x * (y - y)));
if (ix >= 0x7f800000 && (hx & 0x7fffff) == 0) {
if (iy >= 0x7f800000)
- return (CMPLXF(x * x, x * (y - y)));
- return (CMPLXF((x * x) * cosf(y), x * sinf(y)));
+ return (cpackf(x * x, x * (y - y)));
+ return (cpackf((x * x) * cosf(y), x * sinf(y)));
}
- return (CMPLXF((x * x) * (y - y), (x + x) * (y - y)));
+ return (cpackf((x * x) * (y - y), (x + x) * (y - y)));
}
float complex
ccosf(float complex z)
{
- return (ccoshf(CMPLXF(-cimagf(z), crealf(z))));
+ return (ccoshf(cpackf(-cimagf(z), crealf(z))));
}
diff --git a/lib/msun/src/s_cexp.c b/lib/msun/src/s_cexp.c
index 9e11d51..abe178f 100644
--- a/lib/msun/src/s_cexp.c
+++ b/lib/msun/src/s_cexp.c
@@ -50,22 +50,22 @@ cexp(double complex z)
/* cexp(x + I 0) = exp(x) + I 0 */
if ((hy | ly) == 0)
- return (CMPLX(exp(x), y));
+ return (cpack(exp(x), y));
EXTRACT_WORDS(hx, lx, x);
/* cexp(0 + I y) = cos(y) + I sin(y) */
if (((hx & 0x7fffffff) | lx) == 0)
- return (CMPLX(cos(y), sin(y)));
+ return (cpack(cos(y), sin(y)));
if (hy >= 0x7ff00000) {
if (lx != 0 || (hx & 0x7fffffff) != 0x7ff00000) {
/* cexp(finite|NaN +- I Inf|NaN) = NaN + I NaN */
- return (CMPLX(y - y, y - y));
+ return (cpack(y - y, y - y));
} else if (hx & 0x80000000) {
/* cexp(-Inf +- I Inf|NaN) = 0 + I 0 */
- return (CMPLX(0.0, 0.0));
+ return (cpack(0.0, 0.0));
} else {
/* cexp(+Inf +- I Inf|NaN) = Inf + I NaN */
- return (CMPLX(x, y - y));
+ return (cpack(x, y - y));
}
}
@@ -84,6 +84,6 @@ cexp(double complex z)
* - x = NaN (spurious inexact exception from y)
*/
exp_x = exp(x);
- return (CMPLX(exp_x * cos(y), exp_x * sin(y)));
+ return (cpack(exp_x * cos(y), exp_x * sin(y)));
}
}
diff --git a/lib/msun/src/s_cexpf.c b/lib/msun/src/s_cexpf.c
index 0138cd1..0e30d08 100644
--- a/lib/msun/src/s_cexpf.c
+++ b/lib/msun/src/s_cexpf.c
@@ -50,22 +50,22 @@ cexpf(float complex z)
/* cexp(x + I 0) = exp(x) + I 0 */
if (hy == 0)
- return (CMPLXF(expf(x), y));
+ return (cpackf(expf(x), y));
GET_FLOAT_WORD(hx, x);
/* cexp(0 + I y) = cos(y) + I sin(y) */
if ((hx & 0x7fffffff) == 0)
- return (CMPLXF(cosf(y), sinf(y)));
+ return (cpackf(cosf(y), sinf(y)));
if (hy >= 0x7f800000) {
if ((hx & 0x7fffffff) != 0x7f800000) {
/* cexp(finite|NaN +- I Inf|NaN) = NaN + I NaN */
- return (CMPLXF(y - y, y - y));
+ return (cpackf(y - y, y - y));
} else if (hx & 0x80000000) {
/* cexp(-Inf +- I Inf|NaN) = 0 + I 0 */
- return (CMPLXF(0.0, 0.0));
+ return (cpackf(0.0, 0.0));
} else {
/* cexp(+Inf +- I Inf|NaN) = Inf + I NaN */
- return (CMPLXF(x, y - y));
+ return (cpackf(x, y - y));
}
}
@@ -84,6 +84,6 @@ cexpf(float complex z)
* - x = NaN (spurious inexact exception from y)
*/
exp_x = expf(x);
- return (CMPLXF(exp_x * cosf(y), exp_x * sinf(y)));
+ return (cpackf(exp_x * cosf(y), exp_x * sinf(y)));
}
}
diff --git a/lib/msun/src/s_conj.c b/lib/msun/src/s_conj.c
index d0dd051..5770c29 100644
--- a/lib/msun/src/s_conj.c
+++ b/lib/msun/src/s_conj.c
@@ -34,5 +34,5 @@ double complex
conj(double complex z)
{
- return (CMPLX(creal(z), -cimag(z)));
+ return (cpack(creal(z), -cimag(z)));
}
diff --git a/lib/msun/src/s_conjf.c b/lib/msun/src/s_conjf.c
index c4cf127..b090760 100644
--- a/lib/msun/src/s_conjf.c
+++ b/lib/msun/src/s_conjf.c
@@ -34,5 +34,5 @@ float complex
conjf(float complex z)
{
- return (CMPLXF(crealf(z), -cimagf(z)));
+ return (cpackf(crealf(z), -cimagf(z)));
}
diff --git a/lib/msun/src/s_conjl.c b/lib/msun/src/s_conjl.c
index a4604b6..0e431ef 100644
--- a/lib/msun/src/s_conjl.c
+++ b/lib/msun/src/s_conjl.c
@@ -34,5 +34,5 @@ long double complex
conjl(long double complex z)
{
- return (CMPLXL(creall(z), -cimagl(z)));
+ return (cpackl(creall(z), -cimagl(z)));
}
diff --git a/lib/msun/src/s_cproj.c b/lib/msun/src/s_cproj.c
index 2f0db6e..8e9404c 100644
--- a/lib/msun/src/s_cproj.c
+++ b/lib/msun/src/s_cproj.c
@@ -39,7 +39,7 @@ cproj(double complex z)
if (!isinf(creal(z)) && !isinf(cimag(z)))
return (z);
else
- return (CMPLX(INFINITY, copysign(0.0, cimag(z))));
+ return (cpack(INFINITY, copysign(0.0, cimag(z))));
}
#if LDBL_MANT_DIG == 53
diff --git a/lib/msun/src/s_cprojf.c b/lib/msun/src/s_cprojf.c
index bd27bdc..68ea77b 100644
--- a/lib/msun/src/s_cprojf.c
+++ b/lib/msun/src/s_cprojf.c
@@ -39,5 +39,5 @@ cprojf(float complex z)
if (!isinf(crealf(z)) && !isinf(cimagf(z)))
return (z);
else
- return (CMPLXF(INFINITY, copysignf(0.0, cimagf(z))));
+ return (cpackf(INFINITY, copysignf(0.0, cimagf(z))));
}
diff --git a/lib/msun/src/s_cprojl.c b/lib/msun/src/s_cprojl.c
index 5cccc91..07385bc 100644
--- a/lib/msun/src/s_cprojl.c
+++ b/lib/msun/src/s_cprojl.c
@@ -39,5 +39,5 @@ cprojl(long double complex z)
if (!isinf(creall(z)) && !isinf(cimagl(z)))
return (z);
else
- return (CMPLXL(INFINITY, copysignl(0.0, cimagl(z))));
+ return (cpackl(INFINITY, copysignl(0.0, cimagl(z))));
}
diff --git a/lib/msun/src/s_csinh.c b/lib/msun/src/s_csinh.c
index 37f46da..c192f30 100644
--- a/lib/msun/src/s_csinh.c
+++ b/lib/msun/src/s_csinh.c
@@ -62,23 +62,23 @@ csinh(double complex z)
/* Handle the nearly-non-exceptional cases where x and y are finite. */
if (ix < 0x7ff00000 && iy < 0x7ff00000) {
if ((iy | ly) == 0)
- return (CMPLX(sinh(x), y));
+ return (cpack(sinh(x), y));
if (ix < 0x40360000) /* small x: normal case */
- return (CMPLX(sinh(x) * cos(y), cosh(x) * sin(y)));
+ return (cpack(sinh(x) * cos(y), cosh(x) * sin(y)));
/* |x| >= 22, so cosh(x) ~= exp(|x|) */
if (ix < 0x40862e42) {
/* x < 710: exp(|x|) won't overflow */
h = exp(fabs(x)) * 0.5;
- return (CMPLX(copysign(h, x) * cos(y), h * sin(y)));
+ return (cpack(copysign(h, x) * cos(y), h * sin(y)));
} else if (ix < 0x4096bbaa) {
/* x < 1455: scale to avoid overflow */
- z = __ldexp_cexp(CMPLX(fabs(x), y), -1);
- return (CMPLX(creal(z) * copysign(1, x), cimag(z)));
+ z = __ldexp_cexp(cpack(fabs(x), y), -1);
+ return (cpack(creal(z) * copysign(1, x), cimag(z)));
} else {
/* x >= 1455: the result always overflows */
h = huge * x;
- return (CMPLX(h * cos(y), h * h * sin(y)));
+ return (cpack(h * cos(y), h * h * sin(y)));
}
}
@@ -92,7 +92,7 @@ csinh(double complex z)
* the same as d(NaN).
*/
if ((ix | lx) == 0 && iy >= 0x7ff00000)
- return (CMPLX(copysign(0, x * (y - y)), y - y));
+ return (cpack(copysign(0, x * (y - y)), y - y));
/*
* sinh(+-Inf +- I 0) = +-Inf + I +-0.
@@ -101,8 +101,8 @@ csinh(double complex z)
*/
if ((iy | ly) == 0 && ix >= 0x7ff00000) {
if (((hx & 0xfffff) | lx) == 0)
- return (CMPLX(x, y));
- return (CMPLX(x, copysign(0, y)));
+ return (cpack(x, y));
+ return (cpack(x, copysign(0, y)));
}
/*
@@ -114,7 +114,7 @@ csinh(double complex z)
* nonzero x. Choice = don't raise (except for signaling NaNs).
*/
if (ix < 0x7ff00000 && iy >= 0x7ff00000)
- return (CMPLX(y - y, x * (y - y)));
+ return (cpack(y - y, x * (y - y)));
/*
* sinh(+-Inf + I NaN) = +-Inf + I d(NaN).
@@ -129,8 +129,8 @@ csinh(double complex z)
*/
if (ix >= 0x7ff00000 && ((hx & 0xfffff) | lx) == 0) {
if (iy >= 0x7ff00000)
- return (CMPLX(x * x, x * (y - y)));
- return (CMPLX(x * cos(y), INFINITY * sin(y)));
+ return (cpack(x * x, x * (y - y)));
+ return (cpack(x * cos(y), INFINITY * sin(y)));
}
/*
@@ -144,7 +144,7 @@ csinh(double complex z)
* Optionally raises the invalid floating-point exception for finite
* nonzero y. Choice = don't raise (except for signaling NaNs).
*/
- return (CMPLX((x * x) * (y - y), (x + x) * (y - y)));
+ return (cpack((x * x) * (y - y), (x + x) * (y - y)));
}
double complex
@@ -152,6 +152,6 @@ csin(double complex z)
{
/* csin(z) = -I * csinh(I * z) */
- z = csinh(CMPLX(-cimag(z), creal(z)));
- return (CMPLX(cimag(z), -creal(z)));
+ z = csinh(cpack(-cimag(z), creal(z)));
+ return (cpack(cimag(z), -creal(z)));
}
diff --git a/lib/msun/src/s_csinhf.c b/lib/msun/src/s_csinhf.c
index 6348272..c523125 100644
--- a/lib/msun/src/s_csinhf.c
+++ b/lib/msun/src/s_csinhf.c
@@ -55,51 +55,51 @@ csinhf(float complex z)
if (ix < 0x7f800000 && iy < 0x7f800000) {
if (iy == 0)
- return (CMPLXF(sinhf(x), y));
+ return (cpackf(sinhf(x), y));
if (ix < 0x41100000) /* small x: normal case */
- return (CMPLXF(sinhf(x) * cosf(y), coshf(x) * sinf(y)));
+ return (cpackf(sinhf(x) * cosf(y), coshf(x) * sinf(y)));
/* |x| >= 9, so cosh(x) ~= exp(|x|) */
if (ix < 0x42b17218) {
/* x < 88.7: expf(|x|) won't overflow */
h = expf(fabsf(x)) * 0.5f;
- return (CMPLXF(copysignf(h, x) * cosf(y), h * sinf(y)));
+ return (cpackf(copysignf(h, x) * cosf(y), h * sinf(y)));
} else if (ix < 0x4340b1e7) {
/* x < 192.7: scale to avoid overflow */
- z = __ldexp_cexpf(CMPLXF(fabsf(x), y), -1);
- return (CMPLXF(crealf(z) * copysignf(1, x), cimagf(z)));
+ z = __ldexp_cexpf(cpackf(fabsf(x), y), -1);
+ return (cpackf(crealf(z) * copysignf(1, x), cimagf(z)));
} else {
/* x >= 192.7: the result always overflows */
h = huge * x;
- return (CMPLXF(h * cosf(y), h * h * sinf(y)));
+ return (cpackf(h * cosf(y), h * h * sinf(y)));
}
}
if (ix == 0 && iy >= 0x7f800000)
- return (CMPLXF(copysignf(0, x * (y - y)), y - y));
+ return (cpackf(copysignf(0, x * (y - y)), y - y));
if (iy == 0 && ix >= 0x7f800000) {
if ((hx & 0x7fffff) == 0)
- return (CMPLXF(x, y));
- return (CMPLXF(x, copysignf(0, y)));
+ return (cpackf(x, y));
+ return (cpackf(x, copysignf(0, y)));
}
if (ix < 0x7f800000 && iy >= 0x7f800000)
- return (CMPLXF(y - y, x * (y - y)));
+ return (cpackf(y - y, x * (y - y)));
if (ix >= 0x7f800000 && (hx & 0x7fffff) == 0) {
if (iy >= 0x7f800000)
- return (CMPLXF(x * x, x * (y - y)));
- return (CMPLXF(x * cosf(y), INFINITY * sinf(y)));
+ return (cpackf(x * x, x * (y - y)));
+ return (cpackf(x * cosf(y), INFINITY * sinf(y)));
}
- return (CMPLXF((x * x) * (y - y), (x + x) * (y - y)));
+ return (cpackf((x * x) * (y - y), (x + x) * (y - y)));
}
float complex
csinf(float complex z)
{
- z = csinhf(CMPLXF(-cimagf(z), crealf(z)));
- return (CMPLXF(cimagf(z), -crealf(z)));
+ z = csinhf(cpackf(-cimagf(z), crealf(z)));
+ return (cpackf(cimagf(z), -crealf(z)));
}
diff --git a/lib/msun/src/s_csqrt.c b/lib/msun/src/s_csqrt.c
index 75e12d8..18a7ae3 100644
--- a/lib/msun/src/s_csqrt.c
+++ b/lib/msun/src/s_csqrt.c
@@ -58,12 +58,12 @@ csqrt(double complex z)
/* Handle special cases. */
if (z == 0)
- return (CMPLX(0, b));
+ return (cpack(0, b));
if (isinf(b))
- return (CMPLX(INFINITY, b));
+ return (cpack(INFINITY, b));
if (isnan(a)) {
t = (b - b) / (b - b); /* raise invalid if b is not a NaN */
- return (CMPLX(a, t)); /* return NaN + NaN i */
+ return (cpack(a, t)); /* return NaN + NaN i */
}
if (isinf(a)) {
/*
@@ -73,9 +73,9 @@ csqrt(double complex z)
* csqrt(-inf + y i) = 0 + inf i
*/
if (signbit(a))
- return (CMPLX(fabs(b - b), copysign(a, b)));
+ return (cpack(fabs(b - b), copysign(a, b)));
else
- return (CMPLX(a, copysign(b - b, b)));
+ return (cpack(a, copysign(b - b, b)));
}
/*
* The remaining special case (b is NaN) is handled just fine by
@@ -94,10 +94,10 @@ csqrt(double complex z)
/* Algorithm 312, CACM vol 10, Oct 1967. */
if (a >= 0) {
t = sqrt((a + hypot(a, b)) * 0.5);
- result = CMPLX(t, b / (2 * t));
+ result = cpack(t, b / (2 * t));
} else {
t = sqrt((-a + hypot(a, b)) * 0.5);
- result = CMPLX(fabs(b) / (2 * t), copysign(t, b));
+ result = cpack(fabs(b) / (2 * t), copysign(t, b));
}
/* Rescale. */
diff --git a/lib/msun/src/s_csqrtf.c b/lib/msun/src/s_csqrtf.c
index 7ee513f..da7fe18 100644
--- a/lib/msun/src/s_csqrtf.c
+++ b/lib/msun/src/s_csqrtf.c
@@ -49,12 +49,12 @@ csqrtf(float complex z)
/* Handle special cases. */
if (z == 0)
- return (CMPLXF(0, b));
+ return (cpackf(0, b));
if (isinf(b))
- return (CMPLXF(INFINITY, b));
+ return (cpackf(INFINITY, b));
if (isnan(a)) {
t = (b - b) / (b - b); /* raise invalid if b is not a NaN */
- return (CMPLXF(a, t)); /* return NaN + NaN i */
+ return (cpackf(a, t)); /* return NaN + NaN i */
}
if (isinf(a)) {
/*
@@ -64,9 +64,9 @@ csqrtf(float complex z)
* csqrtf(-inf + y i) = 0 + inf i
*/
if (signbit(a))
- return (CMPLXF(fabsf(b - b), copysignf(a, b)));
+ return (cpackf(fabsf(b - b), copysignf(a, b)));
else
- return (CMPLXF(a, copysignf(b - b, b)));
+ return (cpackf(a, copysignf(b - b, b)));
}
/*
* The remaining special case (b is NaN) is handled just fine by
@@ -80,9 +80,9 @@ csqrtf(float complex z)
*/
if (a >= 0) {
t = sqrt((a + hypot(a, b)) * 0.5);
- return (CMPLXF(t, b / (2.0 * t)));
+ return (cpackf(t, b / (2.0 * t)));
} else {
t = sqrt((-a + hypot(a, b)) * 0.5);
- return (CMPLXF(fabsf(b) / (2.0 * t), copysignf(t, b)));
+ return (cpackf(fabsf(b) / (2.0 * t), copysignf(t, b)));
}
}
diff --git a/lib/msun/src/s_csqrtl.c b/lib/msun/src/s_csqrtl.c
index ea2ef27..dd18e1e 100644
--- a/lib/msun/src/s_csqrtl.c
+++ b/lib/msun/src/s_csqrtl.c
@@ -58,12 +58,12 @@ csqrtl(long double complex z)
/* Handle special cases. */
if (z == 0)
- return (CMPLXL(0, b));
+ return (cpackl(0, b));
if (isinf(b))
- return (CMPLXL(INFINITY, b));
+ return (cpackl(INFINITY, b));
if (isnan(a)) {
t = (b - b) / (b - b); /* raise invalid if b is not a NaN */
- return (CMPLXL(a, t)); /* return NaN + NaN i */
+ return (cpackl(a, t)); /* return NaN + NaN i */
}
if (isinf(a)) {
/*
@@ -73,9 +73,9 @@ csqrtl(long double complex z)
* csqrt(-inf + y i) = 0 + inf i
*/
if (signbit(a))
- return (CMPLXL(fabsl(b - b), copysignl(a, b)));
+ return (cpackl(fabsl(b - b), copysignl(a, b)));
else
- return (CMPLXL(a, copysignl(b - b, b)));
+ return (cpackl(a, copysignl(b - b, b)));
}
/*
* The remaining special case (b is NaN) is handled just fine by
@@ -94,10 +94,10 @@ csqrtl(long double complex z)
/* Algorithm 312, CACM vol 10, Oct 1967. */
if (a >= 0) {
t = sqrtl((a + hypotl(a, b)) * 0.5);
- result = CMPLXL(t, b / (2 * t));
+ result = cpackl(t, b / (2 * t));
} else {
t = sqrtl((-a + hypotl(a, b)) * 0.5);
- result = CMPLXL(fabsl(b) / (2 * t), copysignl(t, b));
+ result = cpackl(fabsl(b) / (2 * t), copysignl(t, b));
}
/* Rescale. */
diff --git a/lib/msun/src/s_ctanh.c b/lib/msun/src/s_ctanh.c
index b15c814..d427e28 100644
--- a/lib/msun/src/s_ctanh.c
+++ b/lib/msun/src/s_ctanh.c
@@ -102,9 +102,9 @@ ctanh(double complex z)
*/
if (ix >= 0x7ff00000) {
if ((ix & 0xfffff) | lx) /* x is NaN */
- return (CMPLX(x, (y == 0 ? y : x * y)));
+ return (cpack(x, (y == 0 ? y : x * y)));
SET_HIGH_WORD(x, hx - 0x40000000); /* x = copysign(1, x) */
- return (CMPLX(x, copysign(0, isinf(y) ? y : sin(y) * cos(y))));
+ return (cpack(x, copysign(0, isinf(y) ? y : sin(y) * cos(y))));
}
/*
@@ -112,7 +112,7 @@ ctanh(double complex z)
* ctanh(x +- i Inf) = NaN + i NaN
*/
if (!isfinite(y))
- return (CMPLX(y - y, y - y));
+ return (cpack(y - y, y - y));
/*
* ctanh(+-huge + i +-y) ~= +-1 +- i 2sin(2y)/exp(2x), using the
@@ -121,7 +121,7 @@ ctanh(double complex z)
*/
if (ix >= 0x40360000) { /* x >= 22 */
double exp_mx = exp(-fabs(x));
- return (CMPLX(copysign(1, x),
+ return (cpack(copysign(1, x),
4 * sin(y) * cos(y) * exp_mx * exp_mx));
}
@@ -131,7 +131,7 @@ ctanh(double complex z)
s = sinh(x);
rho = sqrt(1 + s * s); /* = cosh(x) */
denom = 1 + beta * s * s;
- return (CMPLX((beta * rho * s) / denom, t / denom));
+ return (cpack((beta * rho * s) / denom, t / denom));
}
double complex
@@ -139,6 +139,6 @@ ctan(double complex z)
{
/* ctan(z) = -I * ctanh(I * z) */
- z = ctanh(CMPLX(-cimag(z), creal(z)));
- return (CMPLX(cimag(z), -creal(z)));
+ z = ctanh(cpack(-cimag(z), creal(z)));
+ return (cpack(cimag(z), -creal(z)));
}
diff --git a/lib/msun/src/s_ctanhf.c b/lib/msun/src/s_ctanhf.c
index 9b0cda1..4be28d8 100644
--- a/lib/msun/src/s_ctanhf.c
+++ b/lib/msun/src/s_ctanhf.c
@@ -51,18 +51,18 @@ ctanhf(float complex z)
if (ix >= 0x7f800000) {
if (ix & 0x7fffff)
- return (CMPLXF(x, (y == 0 ? y : x * y)));
+ return (cpackf(x, (y == 0 ? y : x * y)));
SET_FLOAT_WORD(x, hx - 0x40000000);
- return (CMPLXF(x,
+ return (cpackf(x,
copysignf(0, isinf(y) ? y : sinf(y) * cosf(y))));
}
if (!isfinite(y))
- return (CMPLXF(y - y, y - y));
+ return (cpackf(y - y, y - y));
if (ix >= 0x41300000) { /* x >= 11 */
float exp_mx = expf(-fabsf(x));
- return (CMPLXF(copysignf(1, x),
+ return (cpackf(copysignf(1, x),
4 * sinf(y) * cosf(y) * exp_mx * exp_mx));
}
@@ -71,14 +71,14 @@ ctanhf(float complex z)
s = sinhf(x);
rho = sqrtf(1 + s * s);
denom = 1 + beta * s * s;
- return (CMPLXF((beta * rho * s) / denom, t / denom));
+ return (cpackf((beta * rho * s) / denom, t / denom));
}
float complex
ctanf(float complex z)
{
- z = ctanhf(CMPLXF(-cimagf(z), crealf(z)));
- return (CMPLXF(cimagf(z), -crealf(z)));
+ z = ctanhf(cpackf(-cimagf(z), crealf(z)));
+ return (cpackf(cimagf(z), -crealf(z)));
}
diff --git a/lib/msun/src/s_scalbln.c b/lib/msun/src/s_scalbln.c
index 5e4e42e..d609d4e 100644
--- a/lib/msun/src/s_scalbln.c
+++ b/lib/msun/src/s_scalbln.c
@@ -27,28 +27,50 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <limits.h>
#include <math.h>
-#define NMAX 65536
-#define NMIN -65536
-
double
-scalbln(double x, long n)
+scalbln (double x, long n)
{
+ int in;
- return (scalbn(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n));
+ in = (int)n;
+ if (in != n) {
+ if (n > 0)
+ in = INT_MAX;
+ else
+ in = INT_MIN;
+ }
+ return (scalbn(x, in));
}
float
-scalblnf(float x, long n)
+scalblnf (float x, long n)
{
+ int in;
- return (scalbnf(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n));
+ in = (int)n;
+ if (in != n) {
+ if (n > 0)
+ in = INT_MAX;
+ else
+ in = INT_MIN;
+ }
+ return (scalbnf(x, in));
}
long double
-scalblnl(long double x, long n)
+scalblnl (long double x, long n)
{
+ int in;
- return (scalbnl(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n));
+ in = (int)n;
+ if (in != n) {
+ if (n > 0)
+ in = INT_MAX;
+ else
+ in = INT_MIN;
+ }
+ return (scalbnl(x, (int)n));
}
diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile
index 0479cfb..4261e48 100644
--- a/lib/msun/tests/Makefile
+++ b/lib/msun/tests/Makefile
@@ -6,12 +6,13 @@ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libm
TESTSDIR= ${TESTSBASE}/lib/msun
-# All architectures on FreeBSD have fenv.h
+.if ${MACHINE} == "sparc" || ${MACHINE} == "i386" \
+ || ${MACHINE} == "amd64" || ${MACHINE_CPU} == "arm" \
+ || ${MACHINE} == "sparc64"
CFLAGS+= -DHAVE_FENV_H
+.endif
-# Not sure why this isn't defined for all architectures, since most
-# have long double.
-.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+.if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
CFLAGS+= -D__HAVE_LONG_DOUBLE
.endif
@@ -40,7 +41,8 @@ NETBSD_ATF_TESTS_C+= tanh_test
CSTD= c99
-LIBADD+= m
+LDADD+= -lm
+DPADD+= ${LIBM}
#COPTS+= -Wfloat-equal
# Copied from lib/msun/Makefile
diff --git a/lib/ncurses/Makefile b/lib/ncurses/Makefile
index a5a19dea..05cd7a2 100644
--- a/lib/ncurses/Makefile
+++ b/lib/ncurses/Makefile
@@ -3,11 +3,4 @@
SUBDIR= ncurses form menu panel \
ncursesw formw menuw panelw
-SUBDIR_PARALLEL=
-
-.for subdir in ${SUBDIR:Nncurses*:N*w}
-SUBDIR_DEPEND_${subdir}= ncurses
-SUBDIR_DEPEND_${subdir}w= ncursesw
-.endfor
-
.include <bsd.subdir.mk>
diff --git a/lib/ncurses/form/Makefile b/lib/ncurses/form/Makefile
index beefb2c..dd903b0 100644
--- a/lib/ncurses/form/Makefile
+++ b/lib/ncurses/form/Makefile
@@ -54,7 +54,8 @@ CLEANFILES= ncurses_def.h
CFLAGS+= -I${SRCDIR}
CFLAGS+= -I${NCURSES_DIR}/menu
-LIBADD+= ncurses${LIB_SUFFIX}
+DPADD= ${LIBNCURSES${LIB_SUFFIX:tu}}
+LDADD= -lncurses${LIB_SUFFIX}
.if defined(ENABLE_WIDEC)
INCS= form.h
diff --git a/lib/ncurses/form/Makefile.depend b/lib/ncurses/form/Makefile.depend
new file mode 100644
index 0000000..bca7368
--- /dev/null
+++ b/lib/ncurses/form/Makefile.depend
@@ -0,0 +1,140 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/ncurses/ncurses \
+ lib/ncurses/ncursesw \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+fld_arg.So: ncurses_def.h
+fld_arg.o: ncurses_def.h
+fld_arg.po: ncurses_def.h
+fld_attr.So: ncurses_def.h
+fld_attr.o: ncurses_def.h
+fld_attr.po: ncurses_def.h
+fld_current.So: ncurses_def.h
+fld_current.o: ncurses_def.h
+fld_current.po: ncurses_def.h
+fld_def.So: ncurses_def.h
+fld_def.o: ncurses_def.h
+fld_def.po: ncurses_def.h
+fld_dup.So: ncurses_def.h
+fld_dup.o: ncurses_def.h
+fld_dup.po: ncurses_def.h
+fld_ftchoice.So: ncurses_def.h
+fld_ftchoice.o: ncurses_def.h
+fld_ftchoice.po: ncurses_def.h
+fld_ftlink.So: ncurses_def.h
+fld_ftlink.o: ncurses_def.h
+fld_ftlink.po: ncurses_def.h
+fld_info.So: ncurses_def.h
+fld_info.o: ncurses_def.h
+fld_info.po: ncurses_def.h
+fld_just.So: ncurses_def.h
+fld_just.o: ncurses_def.h
+fld_just.po: ncurses_def.h
+fld_link.So: ncurses_def.h
+fld_link.o: ncurses_def.h
+fld_link.po: ncurses_def.h
+fld_max.So: ncurses_def.h
+fld_max.o: ncurses_def.h
+fld_max.po: ncurses_def.h
+fld_move.So: ncurses_def.h
+fld_move.o: ncurses_def.h
+fld_move.po: ncurses_def.h
+fld_newftyp.So: ncurses_def.h
+fld_newftyp.o: ncurses_def.h
+fld_newftyp.po: ncurses_def.h
+fld_opts.So: ncurses_def.h
+fld_opts.o: ncurses_def.h
+fld_opts.po: ncurses_def.h
+fld_pad.So: ncurses_def.h
+fld_pad.o: ncurses_def.h
+fld_pad.po: ncurses_def.h
+fld_page.So: ncurses_def.h
+fld_page.o: ncurses_def.h
+fld_page.po: ncurses_def.h
+fld_stat.So: ncurses_def.h
+fld_stat.o: ncurses_def.h
+fld_stat.po: ncurses_def.h
+fld_type.So: ncurses_def.h
+fld_type.o: ncurses_def.h
+fld_type.po: ncurses_def.h
+fld_user.So: ncurses_def.h
+fld_user.o: ncurses_def.h
+fld_user.po: ncurses_def.h
+frm_cursor.So: ncurses_def.h
+frm_cursor.o: ncurses_def.h
+frm_cursor.po: ncurses_def.h
+frm_data.So: ncurses_def.h
+frm_data.o: ncurses_def.h
+frm_data.po: ncurses_def.h
+frm_def.So: ncurses_def.h
+frm_def.o: ncurses_def.h
+frm_def.po: ncurses_def.h
+frm_driver.So: ncurses_def.h
+frm_driver.o: ncurses_def.h
+frm_driver.po: ncurses_def.h
+frm_hook.So: ncurses_def.h
+frm_hook.o: ncurses_def.h
+frm_hook.po: ncurses_def.h
+frm_opts.So: ncurses_def.h
+frm_opts.o: ncurses_def.h
+frm_opts.po: ncurses_def.h
+frm_page.So: ncurses_def.h
+frm_page.o: ncurses_def.h
+frm_page.po: ncurses_def.h
+frm_post.So: ncurses_def.h
+frm_post.o: ncurses_def.h
+frm_post.po: ncurses_def.h
+frm_req_name.So: ncurses_def.h
+frm_req_name.o: ncurses_def.h
+frm_req_name.po: ncurses_def.h
+frm_scale.So: ncurses_def.h
+frm_scale.o: ncurses_def.h
+frm_scale.po: ncurses_def.h
+frm_sub.So: ncurses_def.h
+frm_sub.o: ncurses_def.h
+frm_sub.po: ncurses_def.h
+frm_user.So: ncurses_def.h
+frm_user.o: ncurses_def.h
+frm_user.po: ncurses_def.h
+frm_win.So: ncurses_def.h
+frm_win.o: ncurses_def.h
+frm_win.po: ncurses_def.h
+fty_alnum.So: ncurses_def.h
+fty_alnum.o: ncurses_def.h
+fty_alnum.po: ncurses_def.h
+fty_alpha.So: ncurses_def.h
+fty_alpha.o: ncurses_def.h
+fty_alpha.po: ncurses_def.h
+fty_enum.So: ncurses_def.h
+fty_enum.o: ncurses_def.h
+fty_enum.po: ncurses_def.h
+fty_int.So: ncurses_def.h
+fty_int.o: ncurses_def.h
+fty_int.po: ncurses_def.h
+fty_ipv4.So: ncurses_def.h
+fty_ipv4.o: ncurses_def.h
+fty_ipv4.po: ncurses_def.h
+fty_num.So: ncurses_def.h
+fty_num.o: ncurses_def.h
+fty_num.po: ncurses_def.h
+fty_regex.So: ncurses_def.h
+fty_regex.o: ncurses_def.h
+fty_regex.po: ncurses_def.h
+.endif
diff --git a/lib/ncurses/formw/Makefile.depend b/lib/ncurses/formw/Makefile.depend
new file mode 100644
index 0000000..63cf559
--- /dev/null
+++ b/lib/ncurses/formw/Makefile.depend
@@ -0,0 +1,139 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/ncurses/ncursesw \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+fld_arg.So: ncurses_def.h
+fld_arg.o: ncurses_def.h
+fld_arg.po: ncurses_def.h
+fld_attr.So: ncurses_def.h
+fld_attr.o: ncurses_def.h
+fld_attr.po: ncurses_def.h
+fld_current.So: ncurses_def.h
+fld_current.o: ncurses_def.h
+fld_current.po: ncurses_def.h
+fld_def.So: ncurses_def.h
+fld_def.o: ncurses_def.h
+fld_def.po: ncurses_def.h
+fld_dup.So: ncurses_def.h
+fld_dup.o: ncurses_def.h
+fld_dup.po: ncurses_def.h
+fld_ftchoice.So: ncurses_def.h
+fld_ftchoice.o: ncurses_def.h
+fld_ftchoice.po: ncurses_def.h
+fld_ftlink.So: ncurses_def.h
+fld_ftlink.o: ncurses_def.h
+fld_ftlink.po: ncurses_def.h
+fld_info.So: ncurses_def.h
+fld_info.o: ncurses_def.h
+fld_info.po: ncurses_def.h
+fld_just.So: ncurses_def.h
+fld_just.o: ncurses_def.h
+fld_just.po: ncurses_def.h
+fld_link.So: ncurses_def.h
+fld_link.o: ncurses_def.h
+fld_link.po: ncurses_def.h
+fld_max.So: ncurses_def.h
+fld_max.o: ncurses_def.h
+fld_max.po: ncurses_def.h
+fld_move.So: ncurses_def.h
+fld_move.o: ncurses_def.h
+fld_move.po: ncurses_def.h
+fld_newftyp.So: ncurses_def.h
+fld_newftyp.o: ncurses_def.h
+fld_newftyp.po: ncurses_def.h
+fld_opts.So: ncurses_def.h
+fld_opts.o: ncurses_def.h
+fld_opts.po: ncurses_def.h
+fld_pad.So: ncurses_def.h
+fld_pad.o: ncurses_def.h
+fld_pad.po: ncurses_def.h
+fld_page.So: ncurses_def.h
+fld_page.o: ncurses_def.h
+fld_page.po: ncurses_def.h
+fld_stat.So: ncurses_def.h
+fld_stat.o: ncurses_def.h
+fld_stat.po: ncurses_def.h
+fld_type.So: ncurses_def.h
+fld_type.o: ncurses_def.h
+fld_type.po: ncurses_def.h
+fld_user.So: ncurses_def.h
+fld_user.o: ncurses_def.h
+fld_user.po: ncurses_def.h
+frm_cursor.So: ncurses_def.h
+frm_cursor.o: ncurses_def.h
+frm_cursor.po: ncurses_def.h
+frm_data.So: ncurses_def.h
+frm_data.o: ncurses_def.h
+frm_data.po: ncurses_def.h
+frm_def.So: ncurses_def.h
+frm_def.o: ncurses_def.h
+frm_def.po: ncurses_def.h
+frm_driver.So: ncurses_def.h
+frm_driver.o: ncurses_def.h
+frm_driver.po: ncurses_def.h
+frm_hook.So: ncurses_def.h
+frm_hook.o: ncurses_def.h
+frm_hook.po: ncurses_def.h
+frm_opts.So: ncurses_def.h
+frm_opts.o: ncurses_def.h
+frm_opts.po: ncurses_def.h
+frm_page.So: ncurses_def.h
+frm_page.o: ncurses_def.h
+frm_page.po: ncurses_def.h
+frm_post.So: ncurses_def.h
+frm_post.o: ncurses_def.h
+frm_post.po: ncurses_def.h
+frm_req_name.So: ncurses_def.h
+frm_req_name.o: ncurses_def.h
+frm_req_name.po: ncurses_def.h
+frm_scale.So: ncurses_def.h
+frm_scale.o: ncurses_def.h
+frm_scale.po: ncurses_def.h
+frm_sub.So: ncurses_def.h
+frm_sub.o: ncurses_def.h
+frm_sub.po: ncurses_def.h
+frm_user.So: ncurses_def.h
+frm_user.o: ncurses_def.h
+frm_user.po: ncurses_def.h
+frm_win.So: ncurses_def.h
+frm_win.o: ncurses_def.h
+frm_win.po: ncurses_def.h
+fty_alnum.So: ncurses_def.h
+fty_alnum.o: ncurses_def.h
+fty_alnum.po: ncurses_def.h
+fty_alpha.So: ncurses_def.h
+fty_alpha.o: ncurses_def.h
+fty_alpha.po: ncurses_def.h
+fty_enum.So: ncurses_def.h
+fty_enum.o: ncurses_def.h
+fty_enum.po: ncurses_def.h
+fty_int.So: ncurses_def.h
+fty_int.o: ncurses_def.h
+fty_int.po: ncurses_def.h
+fty_ipv4.So: ncurses_def.h
+fty_ipv4.o: ncurses_def.h
+fty_ipv4.po: ncurses_def.h
+fty_num.So: ncurses_def.h
+fty_num.o: ncurses_def.h
+fty_num.po: ncurses_def.h
+fty_regex.So: ncurses_def.h
+fty_regex.o: ncurses_def.h
+fty_regex.po: ncurses_def.h
+.endif
diff --git a/lib/ncurses/menu/Makefile b/lib/ncurses/menu/Makefile
index d3890de7..3aac081 100644
--- a/lib/ncurses/menu/Makefile
+++ b/lib/ncurses/menu/Makefile
@@ -40,7 +40,8 @@ CLEANFILES= ncurses_def.h
CFLAGS+= -I${SRCDIR}
-LIBADD+= ncurses${LIB_SUFFIX}
+DPADD= ${LIBNCURSES${LIB_SUFFIX:tu}}
+LDADD= -lncurses${LIB_SUFFIX}
.if defined(ENABLE_WIDEC)
INCS= menu.h eti.h
diff --git a/lib/ncurses/menu/Makefile.depend b/lib/ncurses/menu/Makefile.depend
new file mode 100644
index 0000000..01b1fd0
--- /dev/null
+++ b/lib/ncurses/menu/Makefile.depend
@@ -0,0 +1,101 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/ncurses/ncurses \
+ lib/ncurses/ncursesw \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+m_attribs.So: ncurses_def.h
+m_attribs.o: ncurses_def.h
+m_attribs.po: ncurses_def.h
+m_cursor.So: ncurses_def.h
+m_cursor.o: ncurses_def.h
+m_cursor.po: ncurses_def.h
+m_driver.So: ncurses_def.h
+m_driver.o: ncurses_def.h
+m_driver.po: ncurses_def.h
+m_format.So: ncurses_def.h
+m_format.o: ncurses_def.h
+m_format.po: ncurses_def.h
+m_global.So: ncurses_def.h
+m_global.o: ncurses_def.h
+m_global.po: ncurses_def.h
+m_hook.So: ncurses_def.h
+m_hook.o: ncurses_def.h
+m_hook.po: ncurses_def.h
+m_item_cur.So: ncurses_def.h
+m_item_cur.o: ncurses_def.h
+m_item_cur.po: ncurses_def.h
+m_item_nam.So: ncurses_def.h
+m_item_nam.o: ncurses_def.h
+m_item_nam.po: ncurses_def.h
+m_item_new.So: ncurses_def.h
+m_item_new.o: ncurses_def.h
+m_item_new.po: ncurses_def.h
+m_item_opt.So: ncurses_def.h
+m_item_opt.o: ncurses_def.h
+m_item_opt.po: ncurses_def.h
+m_item_top.So: ncurses_def.h
+m_item_top.o: ncurses_def.h
+m_item_top.po: ncurses_def.h
+m_item_use.So: ncurses_def.h
+m_item_use.o: ncurses_def.h
+m_item_use.po: ncurses_def.h
+m_item_val.So: ncurses_def.h
+m_item_val.o: ncurses_def.h
+m_item_val.po: ncurses_def.h
+m_item_vis.So: ncurses_def.h
+m_item_vis.o: ncurses_def.h
+m_item_vis.po: ncurses_def.h
+m_items.So: ncurses_def.h
+m_items.o: ncurses_def.h
+m_items.po: ncurses_def.h
+m_new.So: ncurses_def.h
+m_new.o: ncurses_def.h
+m_new.po: ncurses_def.h
+m_opts.So: ncurses_def.h
+m_opts.o: ncurses_def.h
+m_opts.po: ncurses_def.h
+m_pad.So: ncurses_def.h
+m_pad.o: ncurses_def.h
+m_pad.po: ncurses_def.h
+m_pattern.So: ncurses_def.h
+m_pattern.o: ncurses_def.h
+m_pattern.po: ncurses_def.h
+m_post.So: ncurses_def.h
+m_post.o: ncurses_def.h
+m_post.po: ncurses_def.h
+m_req_name.So: ncurses_def.h
+m_req_name.o: ncurses_def.h
+m_req_name.po: ncurses_def.h
+m_scale.So: ncurses_def.h
+m_scale.o: ncurses_def.h
+m_scale.po: ncurses_def.h
+m_spacing.So: ncurses_def.h
+m_spacing.o: ncurses_def.h
+m_spacing.po: ncurses_def.h
+m_sub.So: ncurses_def.h
+m_sub.o: ncurses_def.h
+m_sub.po: ncurses_def.h
+m_userptr.So: ncurses_def.h
+m_userptr.o: ncurses_def.h
+m_userptr.po: ncurses_def.h
+m_win.So: ncurses_def.h
+m_win.o: ncurses_def.h
+m_win.po: ncurses_def.h
+.endif
diff --git a/lib/ncurses/menuw/Makefile.depend b/lib/ncurses/menuw/Makefile.depend
new file mode 100644
index 0000000..1033d6e
--- /dev/null
+++ b/lib/ncurses/menuw/Makefile.depend
@@ -0,0 +1,100 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/ncurses/ncursesw \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+m_attribs.So: ncurses_def.h
+m_attribs.o: ncurses_def.h
+m_attribs.po: ncurses_def.h
+m_cursor.So: ncurses_def.h
+m_cursor.o: ncurses_def.h
+m_cursor.po: ncurses_def.h
+m_driver.So: ncurses_def.h
+m_driver.o: ncurses_def.h
+m_driver.po: ncurses_def.h
+m_format.So: ncurses_def.h
+m_format.o: ncurses_def.h
+m_format.po: ncurses_def.h
+m_global.So: ncurses_def.h
+m_global.o: ncurses_def.h
+m_global.po: ncurses_def.h
+m_hook.So: ncurses_def.h
+m_hook.o: ncurses_def.h
+m_hook.po: ncurses_def.h
+m_item_cur.So: ncurses_def.h
+m_item_cur.o: ncurses_def.h
+m_item_cur.po: ncurses_def.h
+m_item_nam.So: ncurses_def.h
+m_item_nam.o: ncurses_def.h
+m_item_nam.po: ncurses_def.h
+m_item_new.So: ncurses_def.h
+m_item_new.o: ncurses_def.h
+m_item_new.po: ncurses_def.h
+m_item_opt.So: ncurses_def.h
+m_item_opt.o: ncurses_def.h
+m_item_opt.po: ncurses_def.h
+m_item_top.So: ncurses_def.h
+m_item_top.o: ncurses_def.h
+m_item_top.po: ncurses_def.h
+m_item_use.So: ncurses_def.h
+m_item_use.o: ncurses_def.h
+m_item_use.po: ncurses_def.h
+m_item_val.So: ncurses_def.h
+m_item_val.o: ncurses_def.h
+m_item_val.po: ncurses_def.h
+m_item_vis.So: ncurses_def.h
+m_item_vis.o: ncurses_def.h
+m_item_vis.po: ncurses_def.h
+m_items.So: ncurses_def.h
+m_items.o: ncurses_def.h
+m_items.po: ncurses_def.h
+m_new.So: ncurses_def.h
+m_new.o: ncurses_def.h
+m_new.po: ncurses_def.h
+m_opts.So: ncurses_def.h
+m_opts.o: ncurses_def.h
+m_opts.po: ncurses_def.h
+m_pad.So: ncurses_def.h
+m_pad.o: ncurses_def.h
+m_pad.po: ncurses_def.h
+m_pattern.So: ncurses_def.h
+m_pattern.o: ncurses_def.h
+m_pattern.po: ncurses_def.h
+m_post.So: ncurses_def.h
+m_post.o: ncurses_def.h
+m_post.po: ncurses_def.h
+m_req_name.So: ncurses_def.h
+m_req_name.o: ncurses_def.h
+m_req_name.po: ncurses_def.h
+m_scale.So: ncurses_def.h
+m_scale.o: ncurses_def.h
+m_scale.po: ncurses_def.h
+m_spacing.So: ncurses_def.h
+m_spacing.o: ncurses_def.h
+m_spacing.po: ncurses_def.h
+m_sub.So: ncurses_def.h
+m_sub.o: ncurses_def.h
+m_sub.po: ncurses_def.h
+m_userptr.So: ncurses_def.h
+m_userptr.o: ncurses_def.h
+m_userptr.po: ncurses_def.h
+m_win.So: ncurses_def.h
+m_win.o: ncurses_def.h
+m_win.po: ncurses_def.h
+.endif
diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile
index 3c2e5d9..31c68cd 100644
--- a/lib/ncurses/ncurses/Makefile
+++ b/lib/ncurses/ncurses/Makefile
@@ -308,6 +308,7 @@ SYMLINKS+= libncurses${LIB_SUFFIX}_p.a ${LIBDIR}/libtermlib${LIB_SUFFIX}_p.a
SYMLINKS+= libncurses${LIB_SUFFIX}_p.a ${LIBDIR}/libtinfo${LIB_SUFFIX}_p.a
.endif
+.if ${.CURDIR:T} == "ncurses"
.if defined(ENABLE_WIDEC)
DOCSDIR= ${SHAREDIR}/doc/ncurses
DOCS= ncurses-intro.html hackguide.html
@@ -317,6 +318,7 @@ DOCS= ncurses-intro.html hackguide.html
.PATH: ${NCURSES_DIR}/doc/html
FILESGROUPS= DOCS
.endif
+.endif
# Generated source
.ORDER: names.c codes.c
diff --git a/lib/ncurses/ncurses/Makefile.depend b/lib/ncurses/ncurses/Makefile.depend
new file mode 100644
index 0000000..919abe5
--- /dev/null
+++ b/lib/ncurses/ncurses/Makefile.depend
@@ -0,0 +1,1801 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/ncurses/ncursesw \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+access.So: curses.h
+access.So: ncurses_def.h
+access.So: term.h
+access.So: unctrl.h
+access.o: curses.h
+access.o: ncurses_def.h
+access.o: term.h
+access.o: unctrl.h
+access.po: curses.h
+access.po: ncurses_def.h
+access.po: term.h
+access.po: unctrl.h
+add_tries.So: curses.h
+add_tries.So: ncurses_def.h
+add_tries.So: term.h
+add_tries.So: unctrl.h
+add_tries.o: curses.h
+add_tries.o: ncurses_def.h
+add_tries.o: term.h
+add_tries.o: unctrl.h
+add_tries.po: curses.h
+add_tries.po: ncurses_def.h
+add_tries.po: term.h
+add_tries.po: unctrl.h
+alloc_entry.So: curses.h
+alloc_entry.So: ncurses_def.h
+alloc_entry.So: term.h
+alloc_entry.So: unctrl.h
+alloc_entry.o: curses.h
+alloc_entry.o: ncurses_def.h
+alloc_entry.o: term.h
+alloc_entry.o: unctrl.h
+alloc_entry.po: curses.h
+alloc_entry.po: ncurses_def.h
+alloc_entry.po: term.h
+alloc_entry.po: unctrl.h
+alloc_ttype.So: curses.h
+alloc_ttype.So: ncurses_def.h
+alloc_ttype.So: term.h
+alloc_ttype.So: unctrl.h
+alloc_ttype.o: curses.h
+alloc_ttype.o: ncurses_def.h
+alloc_ttype.o: term.h
+alloc_ttype.o: unctrl.h
+alloc_ttype.po: curses.h
+alloc_ttype.po: ncurses_def.h
+alloc_ttype.po: term.h
+alloc_ttype.po: unctrl.h
+captoinfo.So: curses.h
+captoinfo.So: ncurses_def.h
+captoinfo.So: term.h
+captoinfo.So: unctrl.h
+captoinfo.o: curses.h
+captoinfo.o: ncurses_def.h
+captoinfo.o: term.h
+captoinfo.o: unctrl.h
+captoinfo.po: curses.h
+captoinfo.po: ncurses_def.h
+captoinfo.po: term.h
+captoinfo.po: unctrl.h
+codes.So: codes.c
+codes.So: curses.h
+codes.So: ncurses_def.h
+codes.So: term.h
+codes.So: unctrl.h
+codes.o: codes.c
+codes.o: curses.h
+codes.o: ncurses_def.h
+codes.o: term.h
+codes.o: unctrl.h
+codes.po: codes.c
+codes.po: curses.h
+codes.po: ncurses_def.h
+codes.po: term.h
+codes.po: unctrl.h
+comp_captab.So: comp_captab.c
+comp_captab.So: curses.h
+comp_captab.So: hashsize.h
+comp_captab.So: ncurses_def.h
+comp_captab.So: term.h
+comp_captab.So: unctrl.h
+comp_captab.o: comp_captab.c
+comp_captab.o: curses.h
+comp_captab.o: hashsize.h
+comp_captab.o: ncurses_def.h
+comp_captab.o: term.h
+comp_captab.o: unctrl.h
+comp_captab.po: comp_captab.c
+comp_captab.po: curses.h
+comp_captab.po: hashsize.h
+comp_captab.po: ncurses_def.h
+comp_captab.po: term.h
+comp_captab.po: unctrl.h
+comp_error.So: curses.h
+comp_error.So: ncurses_def.h
+comp_error.So: term.h
+comp_error.So: unctrl.h
+comp_error.o: curses.h
+comp_error.o: ncurses_def.h
+comp_error.o: term.h
+comp_error.o: unctrl.h
+comp_error.po: curses.h
+comp_error.po: ncurses_def.h
+comp_error.po: term.h
+comp_error.po: unctrl.h
+comp_expand.So: curses.h
+comp_expand.So: ncurses_def.h
+comp_expand.So: term.h
+comp_expand.So: unctrl.h
+comp_expand.o: curses.h
+comp_expand.o: ncurses_def.h
+comp_expand.o: term.h
+comp_expand.o: unctrl.h
+comp_expand.po: curses.h
+comp_expand.po: ncurses_def.h
+comp_expand.po: term.h
+comp_expand.po: unctrl.h
+comp_hash.So: curses.h
+comp_hash.So: hashsize.h
+comp_hash.So: ncurses_def.h
+comp_hash.So: term.h
+comp_hash.So: unctrl.h
+comp_hash.o: curses.h
+comp_hash.o: hashsize.h
+comp_hash.o: ncurses_def.h
+comp_hash.o: term.h
+comp_hash.o: unctrl.h
+comp_hash.po: curses.h
+comp_hash.po: hashsize.h
+comp_hash.po: ncurses_def.h
+comp_hash.po: term.h
+comp_hash.po: unctrl.h
+comp_parse.So: curses.h
+comp_parse.So: ncurses_def.h
+comp_parse.So: term.h
+comp_parse.So: unctrl.h
+comp_parse.o: curses.h
+comp_parse.o: ncurses_def.h
+comp_parse.o: term.h
+comp_parse.o: unctrl.h
+comp_parse.po: curses.h
+comp_parse.po: ncurses_def.h
+comp_parse.po: term.h
+comp_parse.po: unctrl.h
+comp_scan.So: curses.h
+comp_scan.So: ncurses_def.h
+comp_scan.So: term.h
+comp_scan.So: unctrl.h
+comp_scan.o: curses.h
+comp_scan.o: ncurses_def.h
+comp_scan.o: term.h
+comp_scan.o: unctrl.h
+comp_scan.po: curses.h
+comp_scan.po: ncurses_def.h
+comp_scan.po: term.h
+comp_scan.po: unctrl.h
+db_iterator.So: curses.h
+db_iterator.So: ncurses_def.h
+db_iterator.So: term.h
+db_iterator.So: unctrl.h
+db_iterator.o: curses.h
+db_iterator.o: ncurses_def.h
+db_iterator.o: term.h
+db_iterator.o: unctrl.h
+db_iterator.po: curses.h
+db_iterator.po: ncurses_def.h
+db_iterator.po: term.h
+db_iterator.po: unctrl.h
+define_key.So: curses.h
+define_key.So: ncurses_def.h
+define_key.So: term.h
+define_key.So: unctrl.h
+define_key.o: curses.h
+define_key.o: ncurses_def.h
+define_key.o: term.h
+define_key.o: unctrl.h
+define_key.po: curses.h
+define_key.po: ncurses_def.h
+define_key.po: term.h
+define_key.po: unctrl.h
+doalloc.So: curses.h
+doalloc.So: ncurses_def.h
+doalloc.So: term.h
+doalloc.So: unctrl.h
+doalloc.o: curses.h
+doalloc.o: ncurses_def.h
+doalloc.o: term.h
+doalloc.o: unctrl.h
+doalloc.po: curses.h
+doalloc.po: ncurses_def.h
+doalloc.po: term.h
+doalloc.po: unctrl.h
+entries.So: curses.h
+entries.So: ncurses_def.h
+entries.So: term.h
+entries.So: unctrl.h
+entries.o: curses.h
+entries.o: ncurses_def.h
+entries.o: term.h
+entries.o: unctrl.h
+entries.po: curses.h
+entries.po: ncurses_def.h
+entries.po: term.h
+entries.po: unctrl.h
+expanded.So: curses.h
+expanded.So: expanded.c
+expanded.So: ncurses_def.h
+expanded.So: term.h
+expanded.So: unctrl.h
+expanded.o: curses.h
+expanded.o: expanded.c
+expanded.o: ncurses_def.h
+expanded.o: term.h
+expanded.o: unctrl.h
+expanded.po: curses.h
+expanded.po: expanded.c
+expanded.po: ncurses_def.h
+expanded.po: term.h
+expanded.po: unctrl.h
+fallback.So: curses.h
+fallback.So: fallback.c
+fallback.So: ncurses_def.h
+fallback.So: term.h
+fallback.So: unctrl.h
+fallback.o: curses.h
+fallback.o: fallback.c
+fallback.o: ncurses_def.h
+fallback.o: term.h
+fallback.o: unctrl.h
+fallback.po: curses.h
+fallback.po: fallback.c
+fallback.po: ncurses_def.h
+fallback.po: term.h
+fallback.po: unctrl.h
+free_ttype.So: curses.h
+free_ttype.So: ncurses_def.h
+free_ttype.So: term.h
+free_ttype.So: unctrl.h
+free_ttype.o: curses.h
+free_ttype.o: ncurses_def.h
+free_ttype.o: term.h
+free_ttype.o: unctrl.h
+free_ttype.po: curses.h
+free_ttype.po: ncurses_def.h
+free_ttype.po: term.h
+free_ttype.po: unctrl.h
+getenv_num.So: curses.h
+getenv_num.So: ncurses_def.h
+getenv_num.So: term.h
+getenv_num.So: unctrl.h
+getenv_num.o: curses.h
+getenv_num.o: ncurses_def.h
+getenv_num.o: term.h
+getenv_num.o: unctrl.h
+getenv_num.po: curses.h
+getenv_num.po: ncurses_def.h
+getenv_num.po: term.h
+getenv_num.po: unctrl.h
+hardscroll.So: curses.h
+hardscroll.So: ncurses_def.h
+hardscroll.So: term.h
+hardscroll.So: unctrl.h
+hardscroll.o: curses.h
+hardscroll.o: ncurses_def.h
+hardscroll.o: term.h
+hardscroll.o: unctrl.h
+hardscroll.po: curses.h
+hardscroll.po: ncurses_def.h
+hardscroll.po: term.h
+hardscroll.po: unctrl.h
+hashed_db.So: curses.h
+hashed_db.So: ncurses_def.h
+hashed_db.So: term.h
+hashed_db.So: unctrl.h
+hashed_db.o: curses.h
+hashed_db.o: ncurses_def.h
+hashed_db.o: term.h
+hashed_db.o: unctrl.h
+hashed_db.po: curses.h
+hashed_db.po: ncurses_def.h
+hashed_db.po: term.h
+hashed_db.po: unctrl.h
+hashmap.So: curses.h
+hashmap.So: ncurses_def.h
+hashmap.So: term.h
+hashmap.So: unctrl.h
+hashmap.o: curses.h
+hashmap.o: ncurses_def.h
+hashmap.o: term.h
+hashmap.o: unctrl.h
+hashmap.po: curses.h
+hashmap.po: ncurses_def.h
+hashmap.po: term.h
+hashmap.po: unctrl.h
+home_terminfo.So: curses.h
+home_terminfo.So: ncurses_def.h
+home_terminfo.So: term.h
+home_terminfo.So: unctrl.h
+home_terminfo.o: curses.h
+home_terminfo.o: ncurses_def.h
+home_terminfo.o: term.h
+home_terminfo.o: unctrl.h
+home_terminfo.po: curses.h
+home_terminfo.po: ncurses_def.h
+home_terminfo.po: term.h
+home_terminfo.po: unctrl.h
+init_keytry.So: curses.h
+init_keytry.So: init_keytry.h
+init_keytry.So: ncurses_def.h
+init_keytry.So: term.h
+init_keytry.So: unctrl.h
+init_keytry.o: curses.h
+init_keytry.o: init_keytry.h
+init_keytry.o: ncurses_def.h
+init_keytry.o: term.h
+init_keytry.o: unctrl.h
+init_keytry.po: curses.h
+init_keytry.po: init_keytry.h
+init_keytry.po: ncurses_def.h
+init_keytry.po: term.h
+init_keytry.po: unctrl.h
+key_defined.So: curses.h
+key_defined.So: ncurses_def.h
+key_defined.So: term.h
+key_defined.So: unctrl.h
+key_defined.o: curses.h
+key_defined.o: ncurses_def.h
+key_defined.o: term.h
+key_defined.o: unctrl.h
+key_defined.po: curses.h
+key_defined.po: ncurses_def.h
+key_defined.po: term.h
+key_defined.po: unctrl.h
+keybound.So: curses.h
+keybound.So: ncurses_def.h
+keybound.So: term.h
+keybound.So: unctrl.h
+keybound.o: curses.h
+keybound.o: ncurses_def.h
+keybound.o: term.h
+keybound.o: unctrl.h
+keybound.po: curses.h
+keybound.po: ncurses_def.h
+keybound.po: term.h
+keybound.po: unctrl.h
+keyok.So: curses.h
+keyok.So: ncurses_def.h
+keyok.So: term.h
+keyok.So: unctrl.h
+keyok.o: curses.h
+keyok.o: ncurses_def.h
+keyok.o: term.h
+keyok.o: unctrl.h
+keyok.po: curses.h
+keyok.po: ncurses_def.h
+keyok.po: term.h
+keyok.po: unctrl.h
+legacy_coding.So: curses.h
+legacy_coding.So: ncurses_def.h
+legacy_coding.So: term.h
+legacy_coding.So: unctrl.h
+legacy_coding.o: curses.h
+legacy_coding.o: ncurses_def.h
+legacy_coding.o: term.h
+legacy_coding.o: unctrl.h
+legacy_coding.po: curses.h
+legacy_coding.po: ncurses_def.h
+legacy_coding.po: term.h
+legacy_coding.po: unctrl.h
+lib_acs.So: curses.h
+lib_acs.So: ncurses_def.h
+lib_acs.So: term.h
+lib_acs.So: unctrl.h
+lib_acs.o: curses.h
+lib_acs.o: ncurses_def.h
+lib_acs.o: term.h
+lib_acs.o: unctrl.h
+lib_acs.po: curses.h
+lib_acs.po: ncurses_def.h
+lib_acs.po: term.h
+lib_acs.po: unctrl.h
+lib_addch.So: curses.h
+lib_addch.So: ncurses_def.h
+lib_addch.So: term.h
+lib_addch.So: unctrl.h
+lib_addch.o: curses.h
+lib_addch.o: ncurses_def.h
+lib_addch.o: term.h
+lib_addch.o: unctrl.h
+lib_addch.po: curses.h
+lib_addch.po: ncurses_def.h
+lib_addch.po: term.h
+lib_addch.po: unctrl.h
+lib_addstr.So: curses.h
+lib_addstr.So: ncurses_def.h
+lib_addstr.So: term.h
+lib_addstr.So: unctrl.h
+lib_addstr.o: curses.h
+lib_addstr.o: ncurses_def.h
+lib_addstr.o: term.h
+lib_addstr.o: unctrl.h
+lib_addstr.po: curses.h
+lib_addstr.po: ncurses_def.h
+lib_addstr.po: term.h
+lib_addstr.po: unctrl.h
+lib_baudrate.So: curses.h
+lib_baudrate.So: ncurses_def.h
+lib_baudrate.So: term.h
+lib_baudrate.So: termcap.h
+lib_baudrate.So: unctrl.h
+lib_baudrate.o: curses.h
+lib_baudrate.o: ncurses_def.h
+lib_baudrate.o: term.h
+lib_baudrate.o: termcap.h
+lib_baudrate.o: unctrl.h
+lib_baudrate.po: curses.h
+lib_baudrate.po: ncurses_def.h
+lib_baudrate.po: term.h
+lib_baudrate.po: termcap.h
+lib_baudrate.po: unctrl.h
+lib_beep.So: curses.h
+lib_beep.So: ncurses_def.h
+lib_beep.So: term.h
+lib_beep.So: unctrl.h
+lib_beep.o: curses.h
+lib_beep.o: ncurses_def.h
+lib_beep.o: term.h
+lib_beep.o: unctrl.h
+lib_beep.po: curses.h
+lib_beep.po: ncurses_def.h
+lib_beep.po: term.h
+lib_beep.po: unctrl.h
+lib_bkgd.So: curses.h
+lib_bkgd.So: ncurses_def.h
+lib_bkgd.So: term.h
+lib_bkgd.So: unctrl.h
+lib_bkgd.o: curses.h
+lib_bkgd.o: ncurses_def.h
+lib_bkgd.o: term.h
+lib_bkgd.o: unctrl.h
+lib_bkgd.po: curses.h
+lib_bkgd.po: ncurses_def.h
+lib_bkgd.po: term.h
+lib_bkgd.po: unctrl.h
+lib_box.So: curses.h
+lib_box.So: ncurses_def.h
+lib_box.So: term.h
+lib_box.So: unctrl.h
+lib_box.o: curses.h
+lib_box.o: ncurses_def.h
+lib_box.o: term.h
+lib_box.o: unctrl.h
+lib_box.po: curses.h
+lib_box.po: ncurses_def.h
+lib_box.po: term.h
+lib_box.po: unctrl.h
+lib_chgat.So: curses.h
+lib_chgat.So: ncurses_def.h
+lib_chgat.So: term.h
+lib_chgat.So: unctrl.h
+lib_chgat.o: curses.h
+lib_chgat.o: ncurses_def.h
+lib_chgat.o: term.h
+lib_chgat.o: unctrl.h
+lib_chgat.po: curses.h
+lib_chgat.po: ncurses_def.h
+lib_chgat.po: term.h
+lib_chgat.po: unctrl.h
+lib_clear.So: curses.h
+lib_clear.So: ncurses_def.h
+lib_clear.So: term.h
+lib_clear.So: unctrl.h
+lib_clear.o: curses.h
+lib_clear.o: ncurses_def.h
+lib_clear.o: term.h
+lib_clear.o: unctrl.h
+lib_clear.po: curses.h
+lib_clear.po: ncurses_def.h
+lib_clear.po: term.h
+lib_clear.po: unctrl.h
+lib_clearok.So: curses.h
+lib_clearok.So: ncurses_def.h
+lib_clearok.So: term.h
+lib_clearok.So: unctrl.h
+lib_clearok.o: curses.h
+lib_clearok.o: ncurses_def.h
+lib_clearok.o: term.h
+lib_clearok.o: unctrl.h
+lib_clearok.po: curses.h
+lib_clearok.po: ncurses_def.h
+lib_clearok.po: term.h
+lib_clearok.po: unctrl.h
+lib_clrbot.So: curses.h
+lib_clrbot.So: ncurses_def.h
+lib_clrbot.So: term.h
+lib_clrbot.So: unctrl.h
+lib_clrbot.o: curses.h
+lib_clrbot.o: ncurses_def.h
+lib_clrbot.o: term.h
+lib_clrbot.o: unctrl.h
+lib_clrbot.po: curses.h
+lib_clrbot.po: ncurses_def.h
+lib_clrbot.po: term.h
+lib_clrbot.po: unctrl.h
+lib_clreol.So: curses.h
+lib_clreol.So: ncurses_def.h
+lib_clreol.So: term.h
+lib_clreol.So: unctrl.h
+lib_clreol.o: curses.h
+lib_clreol.o: ncurses_def.h
+lib_clreol.o: term.h
+lib_clreol.o: unctrl.h
+lib_clreol.po: curses.h
+lib_clreol.po: ncurses_def.h
+lib_clreol.po: term.h
+lib_clreol.po: unctrl.h
+lib_color.So: curses.h
+lib_color.So: ncurses_def.h
+lib_color.So: term.h
+lib_color.So: unctrl.h
+lib_color.o: curses.h
+lib_color.o: ncurses_def.h
+lib_color.o: term.h
+lib_color.o: unctrl.h
+lib_color.po: curses.h
+lib_color.po: ncurses_def.h
+lib_color.po: term.h
+lib_color.po: unctrl.h
+lib_colorset.So: curses.h
+lib_colorset.So: ncurses_def.h
+lib_colorset.So: term.h
+lib_colorset.So: unctrl.h
+lib_colorset.o: curses.h
+lib_colorset.o: ncurses_def.h
+lib_colorset.o: term.h
+lib_colorset.o: unctrl.h
+lib_colorset.po: curses.h
+lib_colorset.po: ncurses_def.h
+lib_colorset.po: term.h
+lib_colorset.po: unctrl.h
+lib_cur_term.So: curses.h
+lib_cur_term.So: ncurses_def.h
+lib_cur_term.So: term.h
+lib_cur_term.So: termcap.h
+lib_cur_term.So: unctrl.h
+lib_cur_term.o: curses.h
+lib_cur_term.o: ncurses_def.h
+lib_cur_term.o: term.h
+lib_cur_term.o: termcap.h
+lib_cur_term.o: unctrl.h
+lib_cur_term.po: curses.h
+lib_cur_term.po: ncurses_def.h
+lib_cur_term.po: term.h
+lib_cur_term.po: termcap.h
+lib_cur_term.po: unctrl.h
+lib_data.So: curses.h
+lib_data.So: ncurses_def.h
+lib_data.So: term.h
+lib_data.So: unctrl.h
+lib_data.o: curses.h
+lib_data.o: ncurses_def.h
+lib_data.o: term.h
+lib_data.o: unctrl.h
+lib_data.po: curses.h
+lib_data.po: ncurses_def.h
+lib_data.po: term.h
+lib_data.po: unctrl.h
+lib_delch.So: curses.h
+lib_delch.So: ncurses_def.h
+lib_delch.So: term.h
+lib_delch.So: unctrl.h
+lib_delch.o: curses.h
+lib_delch.o: ncurses_def.h
+lib_delch.o: term.h
+lib_delch.o: unctrl.h
+lib_delch.po: curses.h
+lib_delch.po: ncurses_def.h
+lib_delch.po: term.h
+lib_delch.po: unctrl.h
+lib_delwin.So: curses.h
+lib_delwin.So: ncurses_def.h
+lib_delwin.So: term.h
+lib_delwin.So: unctrl.h
+lib_delwin.o: curses.h
+lib_delwin.o: ncurses_def.h
+lib_delwin.o: term.h
+lib_delwin.o: unctrl.h
+lib_delwin.po: curses.h
+lib_delwin.po: ncurses_def.h
+lib_delwin.po: term.h
+lib_delwin.po: unctrl.h
+lib_dft_fgbg.So: curses.h
+lib_dft_fgbg.So: ncurses_def.h
+lib_dft_fgbg.So: term.h
+lib_dft_fgbg.So: unctrl.h
+lib_dft_fgbg.o: curses.h
+lib_dft_fgbg.o: ncurses_def.h
+lib_dft_fgbg.o: term.h
+lib_dft_fgbg.o: unctrl.h
+lib_dft_fgbg.po: curses.h
+lib_dft_fgbg.po: ncurses_def.h
+lib_dft_fgbg.po: term.h
+lib_dft_fgbg.po: unctrl.h
+lib_echo.So: curses.h
+lib_echo.So: ncurses_def.h
+lib_echo.So: term.h
+lib_echo.So: unctrl.h
+lib_echo.o: curses.h
+lib_echo.o: ncurses_def.h
+lib_echo.o: term.h
+lib_echo.o: unctrl.h
+lib_echo.po: curses.h
+lib_echo.po: ncurses_def.h
+lib_echo.po: term.h
+lib_echo.po: unctrl.h
+lib_endwin.So: curses.h
+lib_endwin.So: ncurses_def.h
+lib_endwin.So: term.h
+lib_endwin.So: unctrl.h
+lib_endwin.o: curses.h
+lib_endwin.o: ncurses_def.h
+lib_endwin.o: term.h
+lib_endwin.o: unctrl.h
+lib_endwin.po: curses.h
+lib_endwin.po: ncurses_def.h
+lib_endwin.po: term.h
+lib_endwin.po: unctrl.h
+lib_erase.So: curses.h
+lib_erase.So: ncurses_def.h
+lib_erase.So: term.h
+lib_erase.So: unctrl.h
+lib_erase.o: curses.h
+lib_erase.o: ncurses_def.h
+lib_erase.o: term.h
+lib_erase.o: unctrl.h
+lib_erase.po: curses.h
+lib_erase.po: ncurses_def.h
+lib_erase.po: term.h
+lib_erase.po: unctrl.h
+lib_flash.So: curses.h
+lib_flash.So: ncurses_def.h
+lib_flash.So: term.h
+lib_flash.So: unctrl.h
+lib_flash.o: curses.h
+lib_flash.o: ncurses_def.h
+lib_flash.o: term.h
+lib_flash.o: unctrl.h
+lib_flash.po: curses.h
+lib_flash.po: ncurses_def.h
+lib_flash.po: term.h
+lib_flash.po: unctrl.h
+lib_freeall.So: curses.h
+lib_freeall.So: ncurses_def.h
+lib_freeall.So: term.h
+lib_freeall.So: unctrl.h
+lib_freeall.o: curses.h
+lib_freeall.o: ncurses_def.h
+lib_freeall.o: term.h
+lib_freeall.o: unctrl.h
+lib_freeall.po: curses.h
+lib_freeall.po: ncurses_def.h
+lib_freeall.po: term.h
+lib_freeall.po: unctrl.h
+lib_gen.So: curses.h
+lib_gen.So: lib_gen.c
+lib_gen.So: ncurses_def.h
+lib_gen.So: term.h
+lib_gen.So: unctrl.h
+lib_gen.o: curses.h
+lib_gen.o: lib_gen.c
+lib_gen.o: ncurses_def.h
+lib_gen.o: term.h
+lib_gen.o: unctrl.h
+lib_gen.po: curses.h
+lib_gen.po: lib_gen.c
+lib_gen.po: ncurses_def.h
+lib_gen.po: term.h
+lib_gen.po: unctrl.h
+lib_getch.So: curses.h
+lib_getch.So: ncurses_def.h
+lib_getch.So: term.h
+lib_getch.So: unctrl.h
+lib_getch.o: curses.h
+lib_getch.o: ncurses_def.h
+lib_getch.o: term.h
+lib_getch.o: unctrl.h
+lib_getch.po: curses.h
+lib_getch.po: ncurses_def.h
+lib_getch.po: term.h
+lib_getch.po: unctrl.h
+lib_getstr.So: curses.h
+lib_getstr.So: ncurses_def.h
+lib_getstr.So: term.h
+lib_getstr.So: unctrl.h
+lib_getstr.o: curses.h
+lib_getstr.o: ncurses_def.h
+lib_getstr.o: term.h
+lib_getstr.o: unctrl.h
+lib_getstr.po: curses.h
+lib_getstr.po: ncurses_def.h
+lib_getstr.po: term.h
+lib_getstr.po: unctrl.h
+lib_has_cap.So: curses.h
+lib_has_cap.So: ncurses_def.h
+lib_has_cap.So: term.h
+lib_has_cap.So: unctrl.h
+lib_has_cap.o: curses.h
+lib_has_cap.o: ncurses_def.h
+lib_has_cap.o: term.h
+lib_has_cap.o: unctrl.h
+lib_has_cap.po: curses.h
+lib_has_cap.po: ncurses_def.h
+lib_has_cap.po: term.h
+lib_has_cap.po: unctrl.h
+lib_hline.So: curses.h
+lib_hline.So: ncurses_def.h
+lib_hline.So: term.h
+lib_hline.So: unctrl.h
+lib_hline.o: curses.h
+lib_hline.o: ncurses_def.h
+lib_hline.o: term.h
+lib_hline.o: unctrl.h
+lib_hline.po: curses.h
+lib_hline.po: ncurses_def.h
+lib_hline.po: term.h
+lib_hline.po: unctrl.h
+lib_immedok.So: curses.h
+lib_immedok.So: ncurses_def.h
+lib_immedok.So: term.h
+lib_immedok.So: unctrl.h
+lib_immedok.o: curses.h
+lib_immedok.o: ncurses_def.h
+lib_immedok.o: term.h
+lib_immedok.o: unctrl.h
+lib_immedok.po: curses.h
+lib_immedok.po: ncurses_def.h
+lib_immedok.po: term.h
+lib_immedok.po: unctrl.h
+lib_inchstr.So: curses.h
+lib_inchstr.So: ncurses_def.h
+lib_inchstr.So: term.h
+lib_inchstr.So: unctrl.h
+lib_inchstr.o: curses.h
+lib_inchstr.o: ncurses_def.h
+lib_inchstr.o: term.h
+lib_inchstr.o: unctrl.h
+lib_inchstr.po: curses.h
+lib_inchstr.po: ncurses_def.h
+lib_inchstr.po: term.h
+lib_inchstr.po: unctrl.h
+lib_initscr.So: curses.h
+lib_initscr.So: ncurses_def.h
+lib_initscr.So: term.h
+lib_initscr.So: unctrl.h
+lib_initscr.o: curses.h
+lib_initscr.o: ncurses_def.h
+lib_initscr.o: term.h
+lib_initscr.o: unctrl.h
+lib_initscr.po: curses.h
+lib_initscr.po: ncurses_def.h
+lib_initscr.po: term.h
+lib_initscr.po: unctrl.h
+lib_insch.So: curses.h
+lib_insch.So: ncurses_def.h
+lib_insch.So: term.h
+lib_insch.So: unctrl.h
+lib_insch.o: curses.h
+lib_insch.o: ncurses_def.h
+lib_insch.o: term.h
+lib_insch.o: unctrl.h
+lib_insch.po: curses.h
+lib_insch.po: ncurses_def.h
+lib_insch.po: term.h
+lib_insch.po: unctrl.h
+lib_insdel.So: curses.h
+lib_insdel.So: ncurses_def.h
+lib_insdel.So: term.h
+lib_insdel.So: unctrl.h
+lib_insdel.o: curses.h
+lib_insdel.o: ncurses_def.h
+lib_insdel.o: term.h
+lib_insdel.o: unctrl.h
+lib_insdel.po: curses.h
+lib_insdel.po: ncurses_def.h
+lib_insdel.po: term.h
+lib_insdel.po: unctrl.h
+lib_insnstr.So: curses.h
+lib_insnstr.So: ncurses_def.h
+lib_insnstr.So: term.h
+lib_insnstr.So: unctrl.h
+lib_insnstr.o: curses.h
+lib_insnstr.o: ncurses_def.h
+lib_insnstr.o: term.h
+lib_insnstr.o: unctrl.h
+lib_insnstr.po: curses.h
+lib_insnstr.po: ncurses_def.h
+lib_insnstr.po: term.h
+lib_insnstr.po: unctrl.h
+lib_instr.So: curses.h
+lib_instr.So: ncurses_def.h
+lib_instr.So: term.h
+lib_instr.So: unctrl.h
+lib_instr.o: curses.h
+lib_instr.o: ncurses_def.h
+lib_instr.o: term.h
+lib_instr.o: unctrl.h
+lib_instr.po: curses.h
+lib_instr.po: ncurses_def.h
+lib_instr.po: term.h
+lib_instr.po: unctrl.h
+lib_isendwin.So: curses.h
+lib_isendwin.So: ncurses_def.h
+lib_isendwin.So: term.h
+lib_isendwin.So: unctrl.h
+lib_isendwin.o: curses.h
+lib_isendwin.o: ncurses_def.h
+lib_isendwin.o: term.h
+lib_isendwin.o: unctrl.h
+lib_isendwin.po: curses.h
+lib_isendwin.po: ncurses_def.h
+lib_isendwin.po: term.h
+lib_isendwin.po: unctrl.h
+lib_kernel.So: curses.h
+lib_kernel.So: ncurses_def.h
+lib_kernel.So: term.h
+lib_kernel.So: unctrl.h
+lib_kernel.o: curses.h
+lib_kernel.o: ncurses_def.h
+lib_kernel.o: term.h
+lib_kernel.o: unctrl.h
+lib_kernel.po: curses.h
+lib_kernel.po: ncurses_def.h
+lib_kernel.po: term.h
+lib_kernel.po: unctrl.h
+lib_keyname.So: curses.h
+lib_keyname.So: lib_keyname.c
+lib_keyname.So: ncurses_def.h
+lib_keyname.So: term.h
+lib_keyname.So: unctrl.h
+lib_keyname.o: curses.h
+lib_keyname.o: lib_keyname.c
+lib_keyname.o: ncurses_def.h
+lib_keyname.o: term.h
+lib_keyname.o: unctrl.h
+lib_keyname.po: curses.h
+lib_keyname.po: lib_keyname.c
+lib_keyname.po: ncurses_def.h
+lib_keyname.po: term.h
+lib_keyname.po: unctrl.h
+lib_leaveok.So: curses.h
+lib_leaveok.So: ncurses_def.h
+lib_leaveok.So: term.h
+lib_leaveok.So: unctrl.h
+lib_leaveok.o: curses.h
+lib_leaveok.o: ncurses_def.h
+lib_leaveok.o: term.h
+lib_leaveok.o: unctrl.h
+lib_leaveok.po: curses.h
+lib_leaveok.po: ncurses_def.h
+lib_leaveok.po: term.h
+lib_leaveok.po: unctrl.h
+lib_longname.So: curses.h
+lib_longname.So: ncurses_def.h
+lib_longname.So: term.h
+lib_longname.So: unctrl.h
+lib_longname.o: curses.h
+lib_longname.o: ncurses_def.h
+lib_longname.o: term.h
+lib_longname.o: unctrl.h
+lib_longname.po: curses.h
+lib_longname.po: ncurses_def.h
+lib_longname.po: term.h
+lib_longname.po: unctrl.h
+lib_mouse.So: curses.h
+lib_mouse.So: ncurses_def.h
+lib_mouse.So: term.h
+lib_mouse.So: unctrl.h
+lib_mouse.o: curses.h
+lib_mouse.o: ncurses_def.h
+lib_mouse.o: term.h
+lib_mouse.o: unctrl.h
+lib_mouse.po: curses.h
+lib_mouse.po: ncurses_def.h
+lib_mouse.po: term.h
+lib_mouse.po: unctrl.h
+lib_move.So: curses.h
+lib_move.So: ncurses_def.h
+lib_move.So: term.h
+lib_move.So: unctrl.h
+lib_move.o: curses.h
+lib_move.o: ncurses_def.h
+lib_move.o: term.h
+lib_move.o: unctrl.h
+lib_move.po: curses.h
+lib_move.po: ncurses_def.h
+lib_move.po: term.h
+lib_move.po: unctrl.h
+lib_mvcur.So: curses.h
+lib_mvcur.So: ncurses_def.h
+lib_mvcur.So: term.h
+lib_mvcur.So: unctrl.h
+lib_mvcur.o: curses.h
+lib_mvcur.o: ncurses_def.h
+lib_mvcur.o: term.h
+lib_mvcur.o: unctrl.h
+lib_mvcur.po: curses.h
+lib_mvcur.po: ncurses_def.h
+lib_mvcur.po: term.h
+lib_mvcur.po: unctrl.h
+lib_mvwin.So: curses.h
+lib_mvwin.So: ncurses_def.h
+lib_mvwin.So: term.h
+lib_mvwin.So: unctrl.h
+lib_mvwin.o: curses.h
+lib_mvwin.o: ncurses_def.h
+lib_mvwin.o: term.h
+lib_mvwin.o: unctrl.h
+lib_mvwin.po: curses.h
+lib_mvwin.po: ncurses_def.h
+lib_mvwin.po: term.h
+lib_mvwin.po: unctrl.h
+lib_napms.So: curses.h
+lib_napms.So: ncurses_def.h
+lib_napms.So: term.h
+lib_napms.So: unctrl.h
+lib_napms.o: curses.h
+lib_napms.o: ncurses_def.h
+lib_napms.o: term.h
+lib_napms.o: unctrl.h
+lib_napms.po: curses.h
+lib_napms.po: ncurses_def.h
+lib_napms.po: term.h
+lib_napms.po: unctrl.h
+lib_newterm.So: curses.h
+lib_newterm.So: ncurses_def.h
+lib_newterm.So: term.h
+lib_newterm.So: unctrl.h
+lib_newterm.o: curses.h
+lib_newterm.o: ncurses_def.h
+lib_newterm.o: term.h
+lib_newterm.o: unctrl.h
+lib_newterm.po: curses.h
+lib_newterm.po: ncurses_def.h
+lib_newterm.po: term.h
+lib_newterm.po: unctrl.h
+lib_newwin.So: curses.h
+lib_newwin.So: ncurses_def.h
+lib_newwin.So: term.h
+lib_newwin.So: unctrl.h
+lib_newwin.o: curses.h
+lib_newwin.o: ncurses_def.h
+lib_newwin.o: term.h
+lib_newwin.o: unctrl.h
+lib_newwin.po: curses.h
+lib_newwin.po: ncurses_def.h
+lib_newwin.po: term.h
+lib_newwin.po: unctrl.h
+lib_nl.So: curses.h
+lib_nl.So: ncurses_def.h
+lib_nl.So: term.h
+lib_nl.So: unctrl.h
+lib_nl.o: curses.h
+lib_nl.o: ncurses_def.h
+lib_nl.o: term.h
+lib_nl.o: unctrl.h
+lib_nl.po: curses.h
+lib_nl.po: ncurses_def.h
+lib_nl.po: term.h
+lib_nl.po: unctrl.h
+lib_options.So: curses.h
+lib_options.So: ncurses_def.h
+lib_options.So: term.h
+lib_options.So: unctrl.h
+lib_options.o: curses.h
+lib_options.o: ncurses_def.h
+lib_options.o: term.h
+lib_options.o: unctrl.h
+lib_options.po: curses.h
+lib_options.po: ncurses_def.h
+lib_options.po: term.h
+lib_options.po: unctrl.h
+lib_overlay.So: curses.h
+lib_overlay.So: ncurses_def.h
+lib_overlay.So: term.h
+lib_overlay.So: unctrl.h
+lib_overlay.o: curses.h
+lib_overlay.o: ncurses_def.h
+lib_overlay.o: term.h
+lib_overlay.o: unctrl.h
+lib_overlay.po: curses.h
+lib_overlay.po: ncurses_def.h
+lib_overlay.po: term.h
+lib_overlay.po: unctrl.h
+lib_pad.So: curses.h
+lib_pad.So: ncurses_def.h
+lib_pad.So: term.h
+lib_pad.So: unctrl.h
+lib_pad.o: curses.h
+lib_pad.o: ncurses_def.h
+lib_pad.o: term.h
+lib_pad.o: unctrl.h
+lib_pad.po: curses.h
+lib_pad.po: ncurses_def.h
+lib_pad.po: term.h
+lib_pad.po: unctrl.h
+lib_print.So: curses.h
+lib_print.So: ncurses_def.h
+lib_print.So: term.h
+lib_print.So: unctrl.h
+lib_print.o: curses.h
+lib_print.o: ncurses_def.h
+lib_print.o: term.h
+lib_print.o: unctrl.h
+lib_print.po: curses.h
+lib_print.po: ncurses_def.h
+lib_print.po: term.h
+lib_print.po: unctrl.h
+lib_printw.So: curses.h
+lib_printw.So: ncurses_def.h
+lib_printw.So: term.h
+lib_printw.So: unctrl.h
+lib_printw.o: curses.h
+lib_printw.o: ncurses_def.h
+lib_printw.o: term.h
+lib_printw.o: unctrl.h
+lib_printw.po: curses.h
+lib_printw.po: ncurses_def.h
+lib_printw.po: term.h
+lib_printw.po: unctrl.h
+lib_raw.So: curses.h
+lib_raw.So: ncurses_def.h
+lib_raw.So: term.h
+lib_raw.So: unctrl.h
+lib_raw.o: curses.h
+lib_raw.o: ncurses_def.h
+lib_raw.o: term.h
+lib_raw.o: unctrl.h
+lib_raw.po: curses.h
+lib_raw.po: ncurses_def.h
+lib_raw.po: term.h
+lib_raw.po: unctrl.h
+lib_redrawln.So: curses.h
+lib_redrawln.So: ncurses_def.h
+lib_redrawln.So: term.h
+lib_redrawln.So: unctrl.h
+lib_redrawln.o: curses.h
+lib_redrawln.o: ncurses_def.h
+lib_redrawln.o: term.h
+lib_redrawln.o: unctrl.h
+lib_redrawln.po: curses.h
+lib_redrawln.po: ncurses_def.h
+lib_redrawln.po: term.h
+lib_redrawln.po: unctrl.h
+lib_refresh.So: curses.h
+lib_refresh.So: ncurses_def.h
+lib_refresh.So: term.h
+lib_refresh.So: unctrl.h
+lib_refresh.o: curses.h
+lib_refresh.o: ncurses_def.h
+lib_refresh.o: term.h
+lib_refresh.o: unctrl.h
+lib_refresh.po: curses.h
+lib_refresh.po: ncurses_def.h
+lib_refresh.po: term.h
+lib_refresh.po: unctrl.h
+lib_restart.So: curses.h
+lib_restart.So: ncurses_def.h
+lib_restart.So: term.h
+lib_restart.So: unctrl.h
+lib_restart.o: curses.h
+lib_restart.o: ncurses_def.h
+lib_restart.o: term.h
+lib_restart.o: unctrl.h
+lib_restart.po: curses.h
+lib_restart.po: ncurses_def.h
+lib_restart.po: term.h
+lib_restart.po: unctrl.h
+lib_scanw.So: curses.h
+lib_scanw.So: ncurses_def.h
+lib_scanw.So: term.h
+lib_scanw.So: unctrl.h
+lib_scanw.o: curses.h
+lib_scanw.o: ncurses_def.h
+lib_scanw.o: term.h
+lib_scanw.o: unctrl.h
+lib_scanw.po: curses.h
+lib_scanw.po: ncurses_def.h
+lib_scanw.po: term.h
+lib_scanw.po: unctrl.h
+lib_screen.So: curses.h
+lib_screen.So: ncurses_def.h
+lib_screen.So: term.h
+lib_screen.So: unctrl.h
+lib_screen.o: curses.h
+lib_screen.o: ncurses_def.h
+lib_screen.o: term.h
+lib_screen.o: unctrl.h
+lib_screen.po: curses.h
+lib_screen.po: ncurses_def.h
+lib_screen.po: term.h
+lib_screen.po: unctrl.h
+lib_scroll.So: curses.h
+lib_scroll.So: ncurses_def.h
+lib_scroll.So: term.h
+lib_scroll.So: unctrl.h
+lib_scroll.o: curses.h
+lib_scroll.o: ncurses_def.h
+lib_scroll.o: term.h
+lib_scroll.o: unctrl.h
+lib_scroll.po: curses.h
+lib_scroll.po: ncurses_def.h
+lib_scroll.po: term.h
+lib_scroll.po: unctrl.h
+lib_scrollok.So: curses.h
+lib_scrollok.So: ncurses_def.h
+lib_scrollok.So: term.h
+lib_scrollok.So: unctrl.h
+lib_scrollok.o: curses.h
+lib_scrollok.o: ncurses_def.h
+lib_scrollok.o: term.h
+lib_scrollok.o: unctrl.h
+lib_scrollok.po: curses.h
+lib_scrollok.po: ncurses_def.h
+lib_scrollok.po: term.h
+lib_scrollok.po: unctrl.h
+lib_scrreg.So: curses.h
+lib_scrreg.So: ncurses_def.h
+lib_scrreg.So: term.h
+lib_scrreg.So: unctrl.h
+lib_scrreg.o: curses.h
+lib_scrreg.o: ncurses_def.h
+lib_scrreg.o: term.h
+lib_scrreg.o: unctrl.h
+lib_scrreg.po: curses.h
+lib_scrreg.po: ncurses_def.h
+lib_scrreg.po: term.h
+lib_scrreg.po: unctrl.h
+lib_set_term.So: curses.h
+lib_set_term.So: ncurses_def.h
+lib_set_term.So: term.h
+lib_set_term.So: unctrl.h
+lib_set_term.o: curses.h
+lib_set_term.o: ncurses_def.h
+lib_set_term.o: term.h
+lib_set_term.o: unctrl.h
+lib_set_term.po: curses.h
+lib_set_term.po: ncurses_def.h
+lib_set_term.po: term.h
+lib_set_term.po: unctrl.h
+lib_setup.So: curses.h
+lib_setup.So: ncurses_def.h
+lib_setup.So: term.h
+lib_setup.So: unctrl.h
+lib_setup.o: curses.h
+lib_setup.o: ncurses_def.h
+lib_setup.o: term.h
+lib_setup.o: unctrl.h
+lib_setup.po: curses.h
+lib_setup.po: ncurses_def.h
+lib_setup.po: term.h
+lib_setup.po: unctrl.h
+lib_slk.So: curses.h
+lib_slk.So: ncurses_def.h
+lib_slk.So: term.h
+lib_slk.So: unctrl.h
+lib_slk.o: curses.h
+lib_slk.o: ncurses_def.h
+lib_slk.o: term.h
+lib_slk.o: unctrl.h
+lib_slk.po: curses.h
+lib_slk.po: ncurses_def.h
+lib_slk.po: term.h
+lib_slk.po: unctrl.h
+lib_slkatr_set.So: curses.h
+lib_slkatr_set.So: ncurses_def.h
+lib_slkatr_set.So: term.h
+lib_slkatr_set.So: unctrl.h
+lib_slkatr_set.o: curses.h
+lib_slkatr_set.o: ncurses_def.h
+lib_slkatr_set.o: term.h
+lib_slkatr_set.o: unctrl.h
+lib_slkatr_set.po: curses.h
+lib_slkatr_set.po: ncurses_def.h
+lib_slkatr_set.po: term.h
+lib_slkatr_set.po: unctrl.h
+lib_slkatrof.So: curses.h
+lib_slkatrof.So: ncurses_def.h
+lib_slkatrof.So: term.h
+lib_slkatrof.So: unctrl.h
+lib_slkatrof.o: curses.h
+lib_slkatrof.o: ncurses_def.h
+lib_slkatrof.o: term.h
+lib_slkatrof.o: unctrl.h
+lib_slkatrof.po: curses.h
+lib_slkatrof.po: ncurses_def.h
+lib_slkatrof.po: term.h
+lib_slkatrof.po: unctrl.h
+lib_slkatron.So: curses.h
+lib_slkatron.So: ncurses_def.h
+lib_slkatron.So: term.h
+lib_slkatron.So: unctrl.h
+lib_slkatron.o: curses.h
+lib_slkatron.o: ncurses_def.h
+lib_slkatron.o: term.h
+lib_slkatron.o: unctrl.h
+lib_slkatron.po: curses.h
+lib_slkatron.po: ncurses_def.h
+lib_slkatron.po: term.h
+lib_slkatron.po: unctrl.h
+lib_slkatrset.So: curses.h
+lib_slkatrset.So: ncurses_def.h
+lib_slkatrset.So: term.h
+lib_slkatrset.So: unctrl.h
+lib_slkatrset.o: curses.h
+lib_slkatrset.o: ncurses_def.h
+lib_slkatrset.o: term.h
+lib_slkatrset.o: unctrl.h
+lib_slkatrset.po: curses.h
+lib_slkatrset.po: ncurses_def.h
+lib_slkatrset.po: term.h
+lib_slkatrset.po: unctrl.h
+lib_slkattr.So: curses.h
+lib_slkattr.So: ncurses_def.h
+lib_slkattr.So: term.h
+lib_slkattr.So: unctrl.h
+lib_slkattr.o: curses.h
+lib_slkattr.o: ncurses_def.h
+lib_slkattr.o: term.h
+lib_slkattr.o: unctrl.h
+lib_slkattr.po: curses.h
+lib_slkattr.po: ncurses_def.h
+lib_slkattr.po: term.h
+lib_slkattr.po: unctrl.h
+lib_slkclear.So: curses.h
+lib_slkclear.So: ncurses_def.h
+lib_slkclear.So: term.h
+lib_slkclear.So: unctrl.h
+lib_slkclear.o: curses.h
+lib_slkclear.o: ncurses_def.h
+lib_slkclear.o: term.h
+lib_slkclear.o: unctrl.h
+lib_slkclear.po: curses.h
+lib_slkclear.po: ncurses_def.h
+lib_slkclear.po: term.h
+lib_slkclear.po: unctrl.h
+lib_slkcolor.So: curses.h
+lib_slkcolor.So: ncurses_def.h
+lib_slkcolor.So: term.h
+lib_slkcolor.So: unctrl.h
+lib_slkcolor.o: curses.h
+lib_slkcolor.o: ncurses_def.h
+lib_slkcolor.o: term.h
+lib_slkcolor.o: unctrl.h
+lib_slkcolor.po: curses.h
+lib_slkcolor.po: ncurses_def.h
+lib_slkcolor.po: term.h
+lib_slkcolor.po: unctrl.h
+lib_slkinit.So: curses.h
+lib_slkinit.So: ncurses_def.h
+lib_slkinit.So: term.h
+lib_slkinit.So: unctrl.h
+lib_slkinit.o: curses.h
+lib_slkinit.o: ncurses_def.h
+lib_slkinit.o: term.h
+lib_slkinit.o: unctrl.h
+lib_slkinit.po: curses.h
+lib_slkinit.po: ncurses_def.h
+lib_slkinit.po: term.h
+lib_slkinit.po: unctrl.h
+lib_slklab.So: curses.h
+lib_slklab.So: ncurses_def.h
+lib_slklab.So: term.h
+lib_slklab.So: unctrl.h
+lib_slklab.o: curses.h
+lib_slklab.o: ncurses_def.h
+lib_slklab.o: term.h
+lib_slklab.o: unctrl.h
+lib_slklab.po: curses.h
+lib_slklab.po: ncurses_def.h
+lib_slklab.po: term.h
+lib_slklab.po: unctrl.h
+lib_slkrefr.So: curses.h
+lib_slkrefr.So: ncurses_def.h
+lib_slkrefr.So: term.h
+lib_slkrefr.So: unctrl.h
+lib_slkrefr.o: curses.h
+lib_slkrefr.o: ncurses_def.h
+lib_slkrefr.o: term.h
+lib_slkrefr.o: unctrl.h
+lib_slkrefr.po: curses.h
+lib_slkrefr.po: ncurses_def.h
+lib_slkrefr.po: term.h
+lib_slkrefr.po: unctrl.h
+lib_slkset.So: curses.h
+lib_slkset.So: ncurses_def.h
+lib_slkset.So: term.h
+lib_slkset.So: unctrl.h
+lib_slkset.o: curses.h
+lib_slkset.o: ncurses_def.h
+lib_slkset.o: term.h
+lib_slkset.o: unctrl.h
+lib_slkset.po: curses.h
+lib_slkset.po: ncurses_def.h
+lib_slkset.po: term.h
+lib_slkset.po: unctrl.h
+lib_slktouch.So: curses.h
+lib_slktouch.So: ncurses_def.h
+lib_slktouch.So: term.h
+lib_slktouch.So: unctrl.h
+lib_slktouch.o: curses.h
+lib_slktouch.o: ncurses_def.h
+lib_slktouch.o: term.h
+lib_slktouch.o: unctrl.h
+lib_slktouch.po: curses.h
+lib_slktouch.po: ncurses_def.h
+lib_slktouch.po: term.h
+lib_slktouch.po: unctrl.h
+lib_termcap.So: curses.h
+lib_termcap.So: ncurses_def.h
+lib_termcap.So: term.h
+lib_termcap.So: termcap.h
+lib_termcap.So: unctrl.h
+lib_termcap.o: curses.h
+lib_termcap.o: ncurses_def.h
+lib_termcap.o: term.h
+lib_termcap.o: termcap.h
+lib_termcap.o: unctrl.h
+lib_termcap.po: curses.h
+lib_termcap.po: ncurses_def.h
+lib_termcap.po: term.h
+lib_termcap.po: termcap.h
+lib_termcap.po: unctrl.h
+lib_termname.So: curses.h
+lib_termname.So: ncurses_def.h
+lib_termname.So: term.h
+lib_termname.So: unctrl.h
+lib_termname.o: curses.h
+lib_termname.o: ncurses_def.h
+lib_termname.o: term.h
+lib_termname.o: unctrl.h
+lib_termname.po: curses.h
+lib_termname.po: ncurses_def.h
+lib_termname.po: term.h
+lib_termname.po: unctrl.h
+lib_tgoto.So: curses.h
+lib_tgoto.So: ncurses_def.h
+lib_tgoto.So: term.h
+lib_tgoto.So: termcap.h
+lib_tgoto.So: unctrl.h
+lib_tgoto.o: curses.h
+lib_tgoto.o: ncurses_def.h
+lib_tgoto.o: term.h
+lib_tgoto.o: termcap.h
+lib_tgoto.o: unctrl.h
+lib_tgoto.po: curses.h
+lib_tgoto.po: ncurses_def.h
+lib_tgoto.po: term.h
+lib_tgoto.po: termcap.h
+lib_tgoto.po: unctrl.h
+lib_ti.So: curses.h
+lib_ti.So: ncurses_def.h
+lib_ti.So: term.h
+lib_ti.So: unctrl.h
+lib_ti.o: curses.h
+lib_ti.o: ncurses_def.h
+lib_ti.o: term.h
+lib_ti.o: unctrl.h
+lib_ti.po: curses.h
+lib_ti.po: ncurses_def.h
+lib_ti.po: term.h
+lib_ti.po: unctrl.h
+lib_touch.So: curses.h
+lib_touch.So: ncurses_def.h
+lib_touch.So: term.h
+lib_touch.So: unctrl.h
+lib_touch.o: curses.h
+lib_touch.o: ncurses_def.h
+lib_touch.o: term.h
+lib_touch.o: unctrl.h
+lib_touch.po: curses.h
+lib_touch.po: ncurses_def.h
+lib_touch.po: term.h
+lib_touch.po: unctrl.h
+lib_tparm.So: curses.h
+lib_tparm.So: ncurses_def.h
+lib_tparm.So: term.h
+lib_tparm.So: unctrl.h
+lib_tparm.o: curses.h
+lib_tparm.o: ncurses_def.h
+lib_tparm.o: term.h
+lib_tparm.o: unctrl.h
+lib_tparm.po: curses.h
+lib_tparm.po: ncurses_def.h
+lib_tparm.po: term.h
+lib_tparm.po: unctrl.h
+lib_tputs.So: curses.h
+lib_tputs.So: ncurses_def.h
+lib_tputs.So: term.h
+lib_tputs.So: termcap.h
+lib_tputs.So: unctrl.h
+lib_tputs.o: curses.h
+lib_tputs.o: ncurses_def.h
+lib_tputs.o: term.h
+lib_tputs.o: termcap.h
+lib_tputs.o: unctrl.h
+lib_tputs.po: curses.h
+lib_tputs.po: ncurses_def.h
+lib_tputs.po: term.h
+lib_tputs.po: termcap.h
+lib_tputs.po: unctrl.h
+lib_trace.So: curses.h
+lib_trace.So: ncurses_def.h
+lib_trace.So: term.h
+lib_trace.So: unctrl.h
+lib_trace.o: curses.h
+lib_trace.o: ncurses_def.h
+lib_trace.o: term.h
+lib_trace.o: unctrl.h
+lib_trace.po: curses.h
+lib_trace.po: ncurses_def.h
+lib_trace.po: term.h
+lib_trace.po: unctrl.h
+lib_tstp.So: curses.h
+lib_tstp.So: ncurses_def.h
+lib_tstp.So: term.h
+lib_tstp.So: unctrl.h
+lib_tstp.o: curses.h
+lib_tstp.o: ncurses_def.h
+lib_tstp.o: term.h
+lib_tstp.o: unctrl.h
+lib_tstp.po: curses.h
+lib_tstp.po: ncurses_def.h
+lib_tstp.po: term.h
+lib_tstp.po: unctrl.h
+lib_ttyflags.So: curses.h
+lib_ttyflags.So: ncurses_def.h
+lib_ttyflags.So: term.h
+lib_ttyflags.So: unctrl.h
+lib_ttyflags.o: curses.h
+lib_ttyflags.o: ncurses_def.h
+lib_ttyflags.o: term.h
+lib_ttyflags.o: unctrl.h
+lib_ttyflags.po: curses.h
+lib_ttyflags.po: ncurses_def.h
+lib_ttyflags.po: term.h
+lib_ttyflags.po: unctrl.h
+lib_twait.So: curses.h
+lib_twait.So: ncurses_def.h
+lib_twait.So: term.h
+lib_twait.So: unctrl.h
+lib_twait.o: curses.h
+lib_twait.o: ncurses_def.h
+lib_twait.o: term.h
+lib_twait.o: unctrl.h
+lib_twait.po: curses.h
+lib_twait.po: ncurses_def.h
+lib_twait.po: term.h
+lib_twait.po: unctrl.h
+lib_ungetch.So: curses.h
+lib_ungetch.So: ncurses_def.h
+lib_ungetch.So: term.h
+lib_ungetch.So: unctrl.h
+lib_ungetch.o: curses.h
+lib_ungetch.o: ncurses_def.h
+lib_ungetch.o: term.h
+lib_ungetch.o: unctrl.h
+lib_ungetch.po: curses.h
+lib_ungetch.po: ncurses_def.h
+lib_ungetch.po: term.h
+lib_ungetch.po: unctrl.h
+lib_vidattr.So: curses.h
+lib_vidattr.So: ncurses_def.h
+lib_vidattr.So: term.h
+lib_vidattr.So: unctrl.h
+lib_vidattr.o: curses.h
+lib_vidattr.o: ncurses_def.h
+lib_vidattr.o: term.h
+lib_vidattr.o: unctrl.h
+lib_vidattr.po: curses.h
+lib_vidattr.po: ncurses_def.h
+lib_vidattr.po: term.h
+lib_vidattr.po: unctrl.h
+lib_vline.So: curses.h
+lib_vline.So: ncurses_def.h
+lib_vline.So: term.h
+lib_vline.So: unctrl.h
+lib_vline.o: curses.h
+lib_vline.o: ncurses_def.h
+lib_vline.o: term.h
+lib_vline.o: unctrl.h
+lib_vline.po: curses.h
+lib_vline.po: ncurses_def.h
+lib_vline.po: term.h
+lib_vline.po: unctrl.h
+lib_wattroff.So: curses.h
+lib_wattroff.So: ncurses_def.h
+lib_wattroff.So: term.h
+lib_wattroff.So: unctrl.h
+lib_wattroff.o: curses.h
+lib_wattroff.o: ncurses_def.h
+lib_wattroff.o: term.h
+lib_wattroff.o: unctrl.h
+lib_wattroff.po: curses.h
+lib_wattroff.po: ncurses_def.h
+lib_wattroff.po: term.h
+lib_wattroff.po: unctrl.h
+lib_wattron.So: curses.h
+lib_wattron.So: ncurses_def.h
+lib_wattron.So: term.h
+lib_wattron.So: unctrl.h
+lib_wattron.o: curses.h
+lib_wattron.o: ncurses_def.h
+lib_wattron.o: term.h
+lib_wattron.o: unctrl.h
+lib_wattron.po: curses.h
+lib_wattron.po: ncurses_def.h
+lib_wattron.po: term.h
+lib_wattron.po: unctrl.h
+lib_winch.So: curses.h
+lib_winch.So: ncurses_def.h
+lib_winch.So: term.h
+lib_winch.So: unctrl.h
+lib_winch.o: curses.h
+lib_winch.o: ncurses_def.h
+lib_winch.o: term.h
+lib_winch.o: unctrl.h
+lib_winch.po: curses.h
+lib_winch.po: ncurses_def.h
+lib_winch.po: term.h
+lib_winch.po: unctrl.h
+lib_window.So: curses.h
+lib_window.So: ncurses_def.h
+lib_window.So: term.h
+lib_window.So: unctrl.h
+lib_window.o: curses.h
+lib_window.o: ncurses_def.h
+lib_window.o: term.h
+lib_window.o: unctrl.h
+lib_window.po: curses.h
+lib_window.po: ncurses_def.h
+lib_window.po: term.h
+lib_window.po: unctrl.h
+name_match.So: curses.h
+name_match.So: ncurses_def.h
+name_match.So: term.h
+name_match.So: unctrl.h
+name_match.o: curses.h
+name_match.o: ncurses_def.h
+name_match.o: term.h
+name_match.o: unctrl.h
+name_match.po: curses.h
+name_match.po: ncurses_def.h
+name_match.po: term.h
+name_match.po: unctrl.h
+names.So: curses.h
+names.So: names.c
+names.So: ncurses_def.h
+names.So: term.h
+names.So: unctrl.h
+names.o: curses.h
+names.o: names.c
+names.o: ncurses_def.h
+names.o: term.h
+names.o: unctrl.h
+names.po: curses.h
+names.po: names.c
+names.po: ncurses_def.h
+names.po: term.h
+names.po: unctrl.h
+nc_panel.So: curses.h
+nc_panel.So: ncurses_def.h
+nc_panel.So: term.h
+nc_panel.So: unctrl.h
+nc_panel.o: curses.h
+nc_panel.o: ncurses_def.h
+nc_panel.o: term.h
+nc_panel.o: unctrl.h
+nc_panel.po: curses.h
+nc_panel.po: ncurses_def.h
+nc_panel.po: term.h
+nc_panel.po: unctrl.h
+obsolete.So: curses.h
+obsolete.So: ncurses_def.h
+obsolete.So: term.h
+obsolete.So: unctrl.h
+obsolete.o: curses.h
+obsolete.o: ncurses_def.h
+obsolete.o: term.h
+obsolete.o: unctrl.h
+obsolete.po: curses.h
+obsolete.po: ncurses_def.h
+obsolete.po: term.h
+obsolete.po: unctrl.h
+parse_entry.So: curses.h
+parse_entry.So: ncurses_def.h
+parse_entry.So: parametrized.h
+parse_entry.So: term.h
+parse_entry.So: unctrl.h
+parse_entry.o: curses.h
+parse_entry.o: ncurses_def.h
+parse_entry.o: parametrized.h
+parse_entry.o: term.h
+parse_entry.o: unctrl.h
+parse_entry.po: curses.h
+parse_entry.po: ncurses_def.h
+parse_entry.po: parametrized.h
+parse_entry.po: term.h
+parse_entry.po: unctrl.h
+read_entry.So: curses.h
+read_entry.So: ncurses_def.h
+read_entry.So: term.h
+read_entry.So: unctrl.h
+read_entry.o: curses.h
+read_entry.o: ncurses_def.h
+read_entry.o: term.h
+read_entry.o: unctrl.h
+read_entry.po: curses.h
+read_entry.po: ncurses_def.h
+read_entry.po: term.h
+read_entry.po: unctrl.h
+resizeterm.So: curses.h
+resizeterm.So: ncurses_def.h
+resizeterm.So: term.h
+resizeterm.So: unctrl.h
+resizeterm.o: curses.h
+resizeterm.o: ncurses_def.h
+resizeterm.o: term.h
+resizeterm.o: unctrl.h
+resizeterm.po: curses.h
+resizeterm.po: ncurses_def.h
+resizeterm.po: term.h
+resizeterm.po: unctrl.h
+safe_sprintf.So: curses.h
+safe_sprintf.So: ncurses_def.h
+safe_sprintf.So: term.h
+safe_sprintf.So: unctrl.h
+safe_sprintf.o: curses.h
+safe_sprintf.o: ncurses_def.h
+safe_sprintf.o: term.h
+safe_sprintf.o: unctrl.h
+safe_sprintf.po: curses.h
+safe_sprintf.po: ncurses_def.h
+safe_sprintf.po: term.h
+safe_sprintf.po: unctrl.h
+strings.So: curses.h
+strings.So: ncurses_def.h
+strings.So: term.h
+strings.So: unctrl.h
+strings.o: curses.h
+strings.o: ncurses_def.h
+strings.o: term.h
+strings.o: unctrl.h
+strings.po: curses.h
+strings.po: ncurses_def.h
+strings.po: term.h
+strings.po: unctrl.h
+termcap.So: curses.h
+termcap.So: ncurses_def.h
+termcap.So: term.h
+termcap.So: unctrl.h
+termcap.o: curses.h
+termcap.o: ncurses_def.h
+termcap.o: term.h
+termcap.o: unctrl.h
+termcap.po: curses.h
+termcap.po: ncurses_def.h
+termcap.po: term.h
+termcap.po: unctrl.h
+tries.So: curses.h
+tries.So: ncurses_def.h
+tries.So: term.h
+tries.So: unctrl.h
+tries.o: curses.h
+tries.o: ncurses_def.h
+tries.o: term.h
+tries.o: unctrl.h
+tries.po: curses.h
+tries.po: ncurses_def.h
+tries.po: term.h
+tries.po: unctrl.h
+trim_sgr0.So: curses.h
+trim_sgr0.So: ncurses_def.h
+trim_sgr0.So: term.h
+trim_sgr0.So: unctrl.h
+trim_sgr0.o: curses.h
+trim_sgr0.o: ncurses_def.h
+trim_sgr0.o: term.h
+trim_sgr0.o: unctrl.h
+trim_sgr0.po: curses.h
+trim_sgr0.po: ncurses_def.h
+trim_sgr0.po: term.h
+trim_sgr0.po: unctrl.h
+tty_update.So: curses.h
+tty_update.So: ncurses_def.h
+tty_update.So: term.h
+tty_update.So: unctrl.h
+tty_update.o: curses.h
+tty_update.o: ncurses_def.h
+tty_update.o: term.h
+tty_update.o: unctrl.h
+tty_update.po: curses.h
+tty_update.po: ncurses_def.h
+tty_update.po: term.h
+tty_update.po: unctrl.h
+unctrl.So: curses.h
+unctrl.So: ncurses_def.h
+unctrl.So: term.h
+unctrl.So: unctrl.c
+unctrl.So: unctrl.h
+unctrl.o: curses.h
+unctrl.o: ncurses_def.h
+unctrl.o: term.h
+unctrl.o: unctrl.c
+unctrl.o: unctrl.h
+unctrl.po: curses.h
+unctrl.po: ncurses_def.h
+unctrl.po: term.h
+unctrl.po: unctrl.c
+unctrl.po: unctrl.h
+version.So: curses.h
+version.So: ncurses_def.h
+version.So: term.h
+version.So: unctrl.h
+version.o: curses.h
+version.o: ncurses_def.h
+version.o: term.h
+version.o: unctrl.h
+version.po: curses.h
+version.po: ncurses_def.h
+version.po: term.h
+version.po: unctrl.h
+visbuf.So: curses.h
+visbuf.So: ncurses_def.h
+visbuf.So: term.h
+visbuf.So: unctrl.h
+visbuf.o: curses.h
+visbuf.o: ncurses_def.h
+visbuf.o: term.h
+visbuf.o: unctrl.h
+visbuf.po: curses.h
+visbuf.po: ncurses_def.h
+visbuf.po: term.h
+visbuf.po: unctrl.h
+vsscanf.So: curses.h
+vsscanf.So: ncurses_def.h
+vsscanf.So: term.h
+vsscanf.So: unctrl.h
+vsscanf.o: curses.h
+vsscanf.o: ncurses_def.h
+vsscanf.o: term.h
+vsscanf.o: unctrl.h
+vsscanf.po: curses.h
+vsscanf.po: ncurses_def.h
+vsscanf.po: term.h
+vsscanf.po: unctrl.h
+wresize.So: curses.h
+wresize.So: ncurses_def.h
+wresize.So: term.h
+wresize.So: unctrl.h
+wresize.o: curses.h
+wresize.o: ncurses_def.h
+wresize.o: term.h
+wresize.o: unctrl.h
+wresize.po: curses.h
+wresize.po: ncurses_def.h
+wresize.po: term.h
+wresize.po: unctrl.h
+write_entry.So: curses.h
+write_entry.So: ncurses_def.h
+write_entry.So: term.h
+write_entry.So: unctrl.h
+write_entry.o: curses.h
+write_entry.o: ncurses_def.h
+write_entry.o: term.h
+write_entry.o: unctrl.h
+write_entry.po: curses.h
+write_entry.po: ncurses_def.h
+write_entry.po: term.h
+write_entry.po: unctrl.h
+.endif
diff --git a/lib/ncurses/ncursesw/Makefile.depend b/lib/ncurses/ncursesw/Makefile.depend
new file mode 100644
index 0000000..8990db9
--- /dev/null
+++ b/lib/ncurses/ncursesw/Makefile.depend
@@ -0,0 +1,2532 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+access.So: curses.h
+access.So: ncurses_def.h
+access.So: ncurses_dll.h
+access.So: term.h
+access.So: unctrl.h
+access.o: curses.h
+access.o: ncurses_def.h
+access.o: ncurses_dll.h
+access.o: term.h
+access.o: unctrl.h
+access.po: curses.h
+access.po: ncurses_def.h
+access.po: ncurses_dll.h
+access.po: term.h
+access.po: unctrl.h
+add_tries.So: curses.h
+add_tries.So: ncurses_def.h
+add_tries.So: ncurses_dll.h
+add_tries.So: term.h
+add_tries.So: unctrl.h
+add_tries.o: curses.h
+add_tries.o: ncurses_def.h
+add_tries.o: ncurses_dll.h
+add_tries.o: term.h
+add_tries.o: unctrl.h
+add_tries.po: curses.h
+add_tries.po: ncurses_def.h
+add_tries.po: ncurses_dll.h
+add_tries.po: term.h
+add_tries.po: unctrl.h
+alloc_entry.So: curses.h
+alloc_entry.So: ncurses_def.h
+alloc_entry.So: ncurses_dll.h
+alloc_entry.So: term.h
+alloc_entry.So: unctrl.h
+alloc_entry.o: curses.h
+alloc_entry.o: ncurses_def.h
+alloc_entry.o: ncurses_dll.h
+alloc_entry.o: term.h
+alloc_entry.o: unctrl.h
+alloc_entry.po: curses.h
+alloc_entry.po: ncurses_def.h
+alloc_entry.po: ncurses_dll.h
+alloc_entry.po: term.h
+alloc_entry.po: unctrl.h
+alloc_ttype.So: curses.h
+alloc_ttype.So: ncurses_def.h
+alloc_ttype.So: ncurses_dll.h
+alloc_ttype.So: term.h
+alloc_ttype.So: unctrl.h
+alloc_ttype.o: curses.h
+alloc_ttype.o: ncurses_def.h
+alloc_ttype.o: ncurses_dll.h
+alloc_ttype.o: term.h
+alloc_ttype.o: unctrl.h
+alloc_ttype.po: curses.h
+alloc_ttype.po: ncurses_def.h
+alloc_ttype.po: ncurses_dll.h
+alloc_ttype.po: term.h
+alloc_ttype.po: unctrl.h
+captoinfo.So: curses.h
+captoinfo.So: ncurses_def.h
+captoinfo.So: ncurses_dll.h
+captoinfo.So: term.h
+captoinfo.So: unctrl.h
+captoinfo.o: curses.h
+captoinfo.o: ncurses_def.h
+captoinfo.o: ncurses_dll.h
+captoinfo.o: term.h
+captoinfo.o: unctrl.h
+captoinfo.po: curses.h
+captoinfo.po: ncurses_def.h
+captoinfo.po: ncurses_dll.h
+captoinfo.po: term.h
+captoinfo.po: unctrl.h
+charable.So: curses.h
+charable.So: ncurses_def.h
+charable.So: ncurses_dll.h
+charable.So: term.h
+charable.So: unctrl.h
+charable.o: curses.h
+charable.o: ncurses_def.h
+charable.o: ncurses_dll.h
+charable.o: term.h
+charable.o: unctrl.h
+charable.po: curses.h
+charable.po: ncurses_def.h
+charable.po: ncurses_dll.h
+charable.po: term.h
+charable.po: unctrl.h
+codes.So: codes.c
+codes.So: curses.h
+codes.So: ncurses_def.h
+codes.So: ncurses_dll.h
+codes.So: term.h
+codes.So: unctrl.h
+codes.o: codes.c
+codes.o: curses.h
+codes.o: ncurses_def.h
+codes.o: ncurses_dll.h
+codes.o: term.h
+codes.o: unctrl.h
+codes.po: codes.c
+codes.po: curses.h
+codes.po: ncurses_def.h
+codes.po: ncurses_dll.h
+codes.po: term.h
+codes.po: unctrl.h
+comp_captab.So: comp_captab.c
+comp_captab.So: curses.h
+comp_captab.So: hashsize.h
+comp_captab.So: ncurses_def.h
+comp_captab.So: ncurses_dll.h
+comp_captab.So: term.h
+comp_captab.So: unctrl.h
+comp_captab.o: comp_captab.c
+comp_captab.o: curses.h
+comp_captab.o: hashsize.h
+comp_captab.o: ncurses_def.h
+comp_captab.o: ncurses_dll.h
+comp_captab.o: term.h
+comp_captab.o: unctrl.h
+comp_captab.po: comp_captab.c
+comp_captab.po: curses.h
+comp_captab.po: hashsize.h
+comp_captab.po: ncurses_def.h
+comp_captab.po: ncurses_dll.h
+comp_captab.po: term.h
+comp_captab.po: unctrl.h
+comp_error.So: curses.h
+comp_error.So: ncurses_def.h
+comp_error.So: ncurses_dll.h
+comp_error.So: term.h
+comp_error.So: unctrl.h
+comp_error.o: curses.h
+comp_error.o: ncurses_def.h
+comp_error.o: ncurses_dll.h
+comp_error.o: term.h
+comp_error.o: unctrl.h
+comp_error.po: curses.h
+comp_error.po: ncurses_def.h
+comp_error.po: ncurses_dll.h
+comp_error.po: term.h
+comp_error.po: unctrl.h
+comp_expand.So: curses.h
+comp_expand.So: ncurses_def.h
+comp_expand.So: ncurses_dll.h
+comp_expand.So: term.h
+comp_expand.So: unctrl.h
+comp_expand.o: curses.h
+comp_expand.o: ncurses_def.h
+comp_expand.o: ncurses_dll.h
+comp_expand.o: term.h
+comp_expand.o: unctrl.h
+comp_expand.po: curses.h
+comp_expand.po: ncurses_def.h
+comp_expand.po: ncurses_dll.h
+comp_expand.po: term.h
+comp_expand.po: unctrl.h
+comp_hash.So: curses.h
+comp_hash.So: hashsize.h
+comp_hash.So: ncurses_def.h
+comp_hash.So: ncurses_dll.h
+comp_hash.So: term.h
+comp_hash.So: unctrl.h
+comp_hash.o: curses.h
+comp_hash.o: hashsize.h
+comp_hash.o: ncurses_def.h
+comp_hash.o: ncurses_dll.h
+comp_hash.o: term.h
+comp_hash.o: unctrl.h
+comp_hash.po: curses.h
+comp_hash.po: hashsize.h
+comp_hash.po: ncurses_def.h
+comp_hash.po: ncurses_dll.h
+comp_hash.po: term.h
+comp_hash.po: unctrl.h
+comp_parse.So: curses.h
+comp_parse.So: ncurses_def.h
+comp_parse.So: ncurses_dll.h
+comp_parse.So: term.h
+comp_parse.So: unctrl.h
+comp_parse.o: curses.h
+comp_parse.o: ncurses_def.h
+comp_parse.o: ncurses_dll.h
+comp_parse.o: term.h
+comp_parse.o: unctrl.h
+comp_parse.po: curses.h
+comp_parse.po: ncurses_def.h
+comp_parse.po: ncurses_dll.h
+comp_parse.po: term.h
+comp_parse.po: unctrl.h
+comp_scan.So: curses.h
+comp_scan.So: ncurses_def.h
+comp_scan.So: ncurses_dll.h
+comp_scan.So: term.h
+comp_scan.So: unctrl.h
+comp_scan.o: curses.h
+comp_scan.o: ncurses_def.h
+comp_scan.o: ncurses_dll.h
+comp_scan.o: term.h
+comp_scan.o: unctrl.h
+comp_scan.po: curses.h
+comp_scan.po: ncurses_def.h
+comp_scan.po: ncurses_dll.h
+comp_scan.po: term.h
+comp_scan.po: unctrl.h
+db_iterator.So: curses.h
+db_iterator.So: ncurses_def.h
+db_iterator.So: ncurses_dll.h
+db_iterator.So: term.h
+db_iterator.So: unctrl.h
+db_iterator.o: curses.h
+db_iterator.o: ncurses_def.h
+db_iterator.o: ncurses_dll.h
+db_iterator.o: term.h
+db_iterator.o: unctrl.h
+db_iterator.po: curses.h
+db_iterator.po: ncurses_def.h
+db_iterator.po: ncurses_dll.h
+db_iterator.po: term.h
+db_iterator.po: unctrl.h
+define_key.So: curses.h
+define_key.So: ncurses_def.h
+define_key.So: ncurses_dll.h
+define_key.So: term.h
+define_key.So: unctrl.h
+define_key.o: curses.h
+define_key.o: ncurses_def.h
+define_key.o: ncurses_dll.h
+define_key.o: term.h
+define_key.o: unctrl.h
+define_key.po: curses.h
+define_key.po: ncurses_def.h
+define_key.po: ncurses_dll.h
+define_key.po: term.h
+define_key.po: unctrl.h
+doalloc.So: curses.h
+doalloc.So: ncurses_def.h
+doalloc.So: ncurses_dll.h
+doalloc.So: term.h
+doalloc.So: unctrl.h
+doalloc.o: curses.h
+doalloc.o: ncurses_def.h
+doalloc.o: ncurses_dll.h
+doalloc.o: term.h
+doalloc.o: unctrl.h
+doalloc.po: curses.h
+doalloc.po: ncurses_def.h
+doalloc.po: ncurses_dll.h
+doalloc.po: term.h
+doalloc.po: unctrl.h
+entries.So: curses.h
+entries.So: ncurses_def.h
+entries.So: ncurses_dll.h
+entries.So: term.h
+entries.So: unctrl.h
+entries.o: curses.h
+entries.o: ncurses_def.h
+entries.o: ncurses_dll.h
+entries.o: term.h
+entries.o: unctrl.h
+entries.po: curses.h
+entries.po: ncurses_def.h
+entries.po: ncurses_dll.h
+entries.po: term.h
+entries.po: unctrl.h
+expanded.So: curses.h
+expanded.So: expanded.c
+expanded.So: ncurses_def.h
+expanded.So: ncurses_dll.h
+expanded.So: term.h
+expanded.So: unctrl.h
+expanded.o: curses.h
+expanded.o: expanded.c
+expanded.o: ncurses_def.h
+expanded.o: ncurses_dll.h
+expanded.o: term.h
+expanded.o: unctrl.h
+expanded.po: curses.h
+expanded.po: expanded.c
+expanded.po: ncurses_def.h
+expanded.po: ncurses_dll.h
+expanded.po: term.h
+expanded.po: unctrl.h
+fallback.So: curses.h
+fallback.So: fallback.c
+fallback.So: ncurses_def.h
+fallback.So: ncurses_dll.h
+fallback.So: term.h
+fallback.So: unctrl.h
+fallback.o: curses.h
+fallback.o: fallback.c
+fallback.o: ncurses_def.h
+fallback.o: ncurses_dll.h
+fallback.o: term.h
+fallback.o: unctrl.h
+fallback.po: curses.h
+fallback.po: fallback.c
+fallback.po: ncurses_def.h
+fallback.po: ncurses_dll.h
+fallback.po: term.h
+fallback.po: unctrl.h
+free_ttype.So: curses.h
+free_ttype.So: ncurses_def.h
+free_ttype.So: ncurses_dll.h
+free_ttype.So: term.h
+free_ttype.So: unctrl.h
+free_ttype.o: curses.h
+free_ttype.o: ncurses_def.h
+free_ttype.o: ncurses_dll.h
+free_ttype.o: term.h
+free_ttype.o: unctrl.h
+free_ttype.po: curses.h
+free_ttype.po: ncurses_def.h
+free_ttype.po: ncurses_dll.h
+free_ttype.po: term.h
+free_ttype.po: unctrl.h
+getenv_num.So: curses.h
+getenv_num.So: ncurses_def.h
+getenv_num.So: ncurses_dll.h
+getenv_num.So: term.h
+getenv_num.So: unctrl.h
+getenv_num.o: curses.h
+getenv_num.o: ncurses_def.h
+getenv_num.o: ncurses_dll.h
+getenv_num.o: term.h
+getenv_num.o: unctrl.h
+getenv_num.po: curses.h
+getenv_num.po: ncurses_def.h
+getenv_num.po: ncurses_dll.h
+getenv_num.po: term.h
+getenv_num.po: unctrl.h
+hardscroll.So: curses.h
+hardscroll.So: ncurses_def.h
+hardscroll.So: ncurses_dll.h
+hardscroll.So: term.h
+hardscroll.So: unctrl.h
+hardscroll.o: curses.h
+hardscroll.o: ncurses_def.h
+hardscroll.o: ncurses_dll.h
+hardscroll.o: term.h
+hardscroll.o: unctrl.h
+hardscroll.po: curses.h
+hardscroll.po: ncurses_def.h
+hardscroll.po: ncurses_dll.h
+hardscroll.po: term.h
+hardscroll.po: unctrl.h
+hashed_db.So: curses.h
+hashed_db.So: ncurses_def.h
+hashed_db.So: ncurses_dll.h
+hashed_db.So: term.h
+hashed_db.So: unctrl.h
+hashed_db.o: curses.h
+hashed_db.o: ncurses_def.h
+hashed_db.o: ncurses_dll.h
+hashed_db.o: term.h
+hashed_db.o: unctrl.h
+hashed_db.po: curses.h
+hashed_db.po: ncurses_def.h
+hashed_db.po: ncurses_dll.h
+hashed_db.po: term.h
+hashed_db.po: unctrl.h
+hashmap.So: curses.h
+hashmap.So: ncurses_def.h
+hashmap.So: ncurses_dll.h
+hashmap.So: term.h
+hashmap.So: unctrl.h
+hashmap.o: curses.h
+hashmap.o: ncurses_def.h
+hashmap.o: ncurses_dll.h
+hashmap.o: term.h
+hashmap.o: unctrl.h
+hashmap.po: curses.h
+hashmap.po: ncurses_def.h
+hashmap.po: ncurses_dll.h
+hashmap.po: term.h
+hashmap.po: unctrl.h
+home_terminfo.So: curses.h
+home_terminfo.So: ncurses_def.h
+home_terminfo.So: ncurses_dll.h
+home_terminfo.So: term.h
+home_terminfo.So: unctrl.h
+home_terminfo.o: curses.h
+home_terminfo.o: ncurses_def.h
+home_terminfo.o: ncurses_dll.h
+home_terminfo.o: term.h
+home_terminfo.o: unctrl.h
+home_terminfo.po: curses.h
+home_terminfo.po: ncurses_def.h
+home_terminfo.po: ncurses_dll.h
+home_terminfo.po: term.h
+home_terminfo.po: unctrl.h
+init_keytry.So: curses.h
+init_keytry.So: init_keytry.h
+init_keytry.So: ncurses_def.h
+init_keytry.So: ncurses_dll.h
+init_keytry.So: term.h
+init_keytry.So: unctrl.h
+init_keytry.o: curses.h
+init_keytry.o: init_keytry.h
+init_keytry.o: ncurses_def.h
+init_keytry.o: ncurses_dll.h
+init_keytry.o: term.h
+init_keytry.o: unctrl.h
+init_keytry.po: curses.h
+init_keytry.po: init_keytry.h
+init_keytry.po: ncurses_def.h
+init_keytry.po: ncurses_dll.h
+init_keytry.po: term.h
+init_keytry.po: unctrl.h
+key_defined.So: curses.h
+key_defined.So: ncurses_def.h
+key_defined.So: ncurses_dll.h
+key_defined.So: term.h
+key_defined.So: unctrl.h
+key_defined.o: curses.h
+key_defined.o: ncurses_def.h
+key_defined.o: ncurses_dll.h
+key_defined.o: term.h
+key_defined.o: unctrl.h
+key_defined.po: curses.h
+key_defined.po: ncurses_def.h
+key_defined.po: ncurses_dll.h
+key_defined.po: term.h
+key_defined.po: unctrl.h
+keybound.So: curses.h
+keybound.So: ncurses_def.h
+keybound.So: ncurses_dll.h
+keybound.So: term.h
+keybound.So: unctrl.h
+keybound.o: curses.h
+keybound.o: ncurses_def.h
+keybound.o: ncurses_dll.h
+keybound.o: term.h
+keybound.o: unctrl.h
+keybound.po: curses.h
+keybound.po: ncurses_def.h
+keybound.po: ncurses_dll.h
+keybound.po: term.h
+keybound.po: unctrl.h
+keyok.So: curses.h
+keyok.So: ncurses_def.h
+keyok.So: ncurses_dll.h
+keyok.So: term.h
+keyok.So: unctrl.h
+keyok.o: curses.h
+keyok.o: ncurses_def.h
+keyok.o: ncurses_dll.h
+keyok.o: term.h
+keyok.o: unctrl.h
+keyok.po: curses.h
+keyok.po: ncurses_def.h
+keyok.po: ncurses_dll.h
+keyok.po: term.h
+keyok.po: unctrl.h
+legacy_coding.So: curses.h
+legacy_coding.So: ncurses_def.h
+legacy_coding.So: ncurses_dll.h
+legacy_coding.So: term.h
+legacy_coding.So: unctrl.h
+legacy_coding.o: curses.h
+legacy_coding.o: ncurses_def.h
+legacy_coding.o: ncurses_dll.h
+legacy_coding.o: term.h
+legacy_coding.o: unctrl.h
+legacy_coding.po: curses.h
+legacy_coding.po: ncurses_def.h
+legacy_coding.po: ncurses_dll.h
+legacy_coding.po: term.h
+legacy_coding.po: unctrl.h
+lib_acs.So: curses.h
+lib_acs.So: ncurses_def.h
+lib_acs.So: ncurses_dll.h
+lib_acs.So: term.h
+lib_acs.So: unctrl.h
+lib_acs.o: curses.h
+lib_acs.o: ncurses_def.h
+lib_acs.o: ncurses_dll.h
+lib_acs.o: term.h
+lib_acs.o: unctrl.h
+lib_acs.po: curses.h
+lib_acs.po: ncurses_def.h
+lib_acs.po: ncurses_dll.h
+lib_acs.po: term.h
+lib_acs.po: unctrl.h
+lib_add_wch.So: curses.h
+lib_add_wch.So: ncurses_def.h
+lib_add_wch.So: ncurses_dll.h
+lib_add_wch.So: term.h
+lib_add_wch.So: unctrl.h
+lib_add_wch.o: curses.h
+lib_add_wch.o: ncurses_def.h
+lib_add_wch.o: ncurses_dll.h
+lib_add_wch.o: term.h
+lib_add_wch.o: unctrl.h
+lib_add_wch.po: curses.h
+lib_add_wch.po: ncurses_def.h
+lib_add_wch.po: ncurses_dll.h
+lib_add_wch.po: term.h
+lib_add_wch.po: unctrl.h
+lib_addch.So: curses.h
+lib_addch.So: ncurses_def.h
+lib_addch.So: ncurses_dll.h
+lib_addch.So: term.h
+lib_addch.So: unctrl.h
+lib_addch.o: curses.h
+lib_addch.o: ncurses_def.h
+lib_addch.o: ncurses_dll.h
+lib_addch.o: term.h
+lib_addch.o: unctrl.h
+lib_addch.po: curses.h
+lib_addch.po: ncurses_def.h
+lib_addch.po: ncurses_dll.h
+lib_addch.po: term.h
+lib_addch.po: unctrl.h
+lib_addstr.So: curses.h
+lib_addstr.So: ncurses_def.h
+lib_addstr.So: ncurses_dll.h
+lib_addstr.So: term.h
+lib_addstr.So: unctrl.h
+lib_addstr.o: curses.h
+lib_addstr.o: ncurses_def.h
+lib_addstr.o: ncurses_dll.h
+lib_addstr.o: term.h
+lib_addstr.o: unctrl.h
+lib_addstr.po: curses.h
+lib_addstr.po: ncurses_def.h
+lib_addstr.po: ncurses_dll.h
+lib_addstr.po: term.h
+lib_addstr.po: unctrl.h
+lib_baudrate.So: curses.h
+lib_baudrate.So: ncurses_def.h
+lib_baudrate.So: ncurses_dll.h
+lib_baudrate.So: term.h
+lib_baudrate.So: termcap.h
+lib_baudrate.So: unctrl.h
+lib_baudrate.o: curses.h
+lib_baudrate.o: ncurses_def.h
+lib_baudrate.o: ncurses_dll.h
+lib_baudrate.o: term.h
+lib_baudrate.o: termcap.h
+lib_baudrate.o: unctrl.h
+lib_baudrate.po: curses.h
+lib_baudrate.po: ncurses_def.h
+lib_baudrate.po: ncurses_dll.h
+lib_baudrate.po: term.h
+lib_baudrate.po: termcap.h
+lib_baudrate.po: unctrl.h
+lib_beep.So: curses.h
+lib_beep.So: ncurses_def.h
+lib_beep.So: ncurses_dll.h
+lib_beep.So: term.h
+lib_beep.So: unctrl.h
+lib_beep.o: curses.h
+lib_beep.o: ncurses_def.h
+lib_beep.o: ncurses_dll.h
+lib_beep.o: term.h
+lib_beep.o: unctrl.h
+lib_beep.po: curses.h
+lib_beep.po: ncurses_def.h
+lib_beep.po: ncurses_dll.h
+lib_beep.po: term.h
+lib_beep.po: unctrl.h
+lib_bkgd.So: curses.h
+lib_bkgd.So: ncurses_def.h
+lib_bkgd.So: ncurses_dll.h
+lib_bkgd.So: term.h
+lib_bkgd.So: unctrl.h
+lib_bkgd.o: curses.h
+lib_bkgd.o: ncurses_def.h
+lib_bkgd.o: ncurses_dll.h
+lib_bkgd.o: term.h
+lib_bkgd.o: unctrl.h
+lib_bkgd.po: curses.h
+lib_bkgd.po: ncurses_def.h
+lib_bkgd.po: ncurses_dll.h
+lib_bkgd.po: term.h
+lib_bkgd.po: unctrl.h
+lib_box.So: curses.h
+lib_box.So: ncurses_def.h
+lib_box.So: ncurses_dll.h
+lib_box.So: term.h
+lib_box.So: unctrl.h
+lib_box.o: curses.h
+lib_box.o: ncurses_def.h
+lib_box.o: ncurses_dll.h
+lib_box.o: term.h
+lib_box.o: unctrl.h
+lib_box.po: curses.h
+lib_box.po: ncurses_def.h
+lib_box.po: ncurses_dll.h
+lib_box.po: term.h
+lib_box.po: unctrl.h
+lib_box_set.So: curses.h
+lib_box_set.So: ncurses_def.h
+lib_box_set.So: ncurses_dll.h
+lib_box_set.So: term.h
+lib_box_set.So: unctrl.h
+lib_box_set.o: curses.h
+lib_box_set.o: ncurses_def.h
+lib_box_set.o: ncurses_dll.h
+lib_box_set.o: term.h
+lib_box_set.o: unctrl.h
+lib_box_set.po: curses.h
+lib_box_set.po: ncurses_def.h
+lib_box_set.po: ncurses_dll.h
+lib_box_set.po: term.h
+lib_box_set.po: unctrl.h
+lib_cchar.So: curses.h
+lib_cchar.So: ncurses_def.h
+lib_cchar.So: ncurses_dll.h
+lib_cchar.So: term.h
+lib_cchar.So: unctrl.h
+lib_cchar.o: curses.h
+lib_cchar.o: ncurses_def.h
+lib_cchar.o: ncurses_dll.h
+lib_cchar.o: term.h
+lib_cchar.o: unctrl.h
+lib_cchar.po: curses.h
+lib_cchar.po: ncurses_def.h
+lib_cchar.po: ncurses_dll.h
+lib_cchar.po: term.h
+lib_cchar.po: unctrl.h
+lib_chgat.So: curses.h
+lib_chgat.So: ncurses_def.h
+lib_chgat.So: ncurses_dll.h
+lib_chgat.So: term.h
+lib_chgat.So: unctrl.h
+lib_chgat.o: curses.h
+lib_chgat.o: ncurses_def.h
+lib_chgat.o: ncurses_dll.h
+lib_chgat.o: term.h
+lib_chgat.o: unctrl.h
+lib_chgat.po: curses.h
+lib_chgat.po: ncurses_def.h
+lib_chgat.po: ncurses_dll.h
+lib_chgat.po: term.h
+lib_chgat.po: unctrl.h
+lib_clear.So: curses.h
+lib_clear.So: ncurses_def.h
+lib_clear.So: ncurses_dll.h
+lib_clear.So: term.h
+lib_clear.So: unctrl.h
+lib_clear.o: curses.h
+lib_clear.o: ncurses_def.h
+lib_clear.o: ncurses_dll.h
+lib_clear.o: term.h
+lib_clear.o: unctrl.h
+lib_clear.po: curses.h
+lib_clear.po: ncurses_def.h
+lib_clear.po: ncurses_dll.h
+lib_clear.po: term.h
+lib_clear.po: unctrl.h
+lib_clearok.So: curses.h
+lib_clearok.So: ncurses_def.h
+lib_clearok.So: ncurses_dll.h
+lib_clearok.So: term.h
+lib_clearok.So: unctrl.h
+lib_clearok.o: curses.h
+lib_clearok.o: ncurses_def.h
+lib_clearok.o: ncurses_dll.h
+lib_clearok.o: term.h
+lib_clearok.o: unctrl.h
+lib_clearok.po: curses.h
+lib_clearok.po: ncurses_def.h
+lib_clearok.po: ncurses_dll.h
+lib_clearok.po: term.h
+lib_clearok.po: unctrl.h
+lib_clrbot.So: curses.h
+lib_clrbot.So: ncurses_def.h
+lib_clrbot.So: ncurses_dll.h
+lib_clrbot.So: term.h
+lib_clrbot.So: unctrl.h
+lib_clrbot.o: curses.h
+lib_clrbot.o: ncurses_def.h
+lib_clrbot.o: ncurses_dll.h
+lib_clrbot.o: term.h
+lib_clrbot.o: unctrl.h
+lib_clrbot.po: curses.h
+lib_clrbot.po: ncurses_def.h
+lib_clrbot.po: ncurses_dll.h
+lib_clrbot.po: term.h
+lib_clrbot.po: unctrl.h
+lib_clreol.So: curses.h
+lib_clreol.So: ncurses_def.h
+lib_clreol.So: ncurses_dll.h
+lib_clreol.So: term.h
+lib_clreol.So: unctrl.h
+lib_clreol.o: curses.h
+lib_clreol.o: ncurses_def.h
+lib_clreol.o: ncurses_dll.h
+lib_clreol.o: term.h
+lib_clreol.o: unctrl.h
+lib_clreol.po: curses.h
+lib_clreol.po: ncurses_def.h
+lib_clreol.po: ncurses_dll.h
+lib_clreol.po: term.h
+lib_clreol.po: unctrl.h
+lib_color.So: curses.h
+lib_color.So: ncurses_def.h
+lib_color.So: ncurses_dll.h
+lib_color.So: term.h
+lib_color.So: unctrl.h
+lib_color.o: curses.h
+lib_color.o: ncurses_def.h
+lib_color.o: ncurses_dll.h
+lib_color.o: term.h
+lib_color.o: unctrl.h
+lib_color.po: curses.h
+lib_color.po: ncurses_def.h
+lib_color.po: ncurses_dll.h
+lib_color.po: term.h
+lib_color.po: unctrl.h
+lib_colorset.So: curses.h
+lib_colorset.So: ncurses_def.h
+lib_colorset.So: ncurses_dll.h
+lib_colorset.So: term.h
+lib_colorset.So: unctrl.h
+lib_colorset.o: curses.h
+lib_colorset.o: ncurses_def.h
+lib_colorset.o: ncurses_dll.h
+lib_colorset.o: term.h
+lib_colorset.o: unctrl.h
+lib_colorset.po: curses.h
+lib_colorset.po: ncurses_def.h
+lib_colorset.po: ncurses_dll.h
+lib_colorset.po: term.h
+lib_colorset.po: unctrl.h
+lib_cur_term.So: curses.h
+lib_cur_term.So: ncurses_def.h
+lib_cur_term.So: ncurses_dll.h
+lib_cur_term.So: term.h
+lib_cur_term.So: termcap.h
+lib_cur_term.So: unctrl.h
+lib_cur_term.o: curses.h
+lib_cur_term.o: ncurses_def.h
+lib_cur_term.o: ncurses_dll.h
+lib_cur_term.o: term.h
+lib_cur_term.o: termcap.h
+lib_cur_term.o: unctrl.h
+lib_cur_term.po: curses.h
+lib_cur_term.po: ncurses_def.h
+lib_cur_term.po: ncurses_dll.h
+lib_cur_term.po: term.h
+lib_cur_term.po: termcap.h
+lib_cur_term.po: unctrl.h
+lib_data.So: curses.h
+lib_data.So: ncurses_def.h
+lib_data.So: ncurses_dll.h
+lib_data.So: term.h
+lib_data.So: unctrl.h
+lib_data.o: curses.h
+lib_data.o: ncurses_def.h
+lib_data.o: ncurses_dll.h
+lib_data.o: term.h
+lib_data.o: unctrl.h
+lib_data.po: curses.h
+lib_data.po: ncurses_def.h
+lib_data.po: ncurses_dll.h
+lib_data.po: term.h
+lib_data.po: unctrl.h
+lib_delch.So: curses.h
+lib_delch.So: ncurses_def.h
+lib_delch.So: ncurses_dll.h
+lib_delch.So: term.h
+lib_delch.So: unctrl.h
+lib_delch.o: curses.h
+lib_delch.o: ncurses_def.h
+lib_delch.o: ncurses_dll.h
+lib_delch.o: term.h
+lib_delch.o: unctrl.h
+lib_delch.po: curses.h
+lib_delch.po: ncurses_def.h
+lib_delch.po: ncurses_dll.h
+lib_delch.po: term.h
+lib_delch.po: unctrl.h
+lib_delwin.So: curses.h
+lib_delwin.So: ncurses_def.h
+lib_delwin.So: ncurses_dll.h
+lib_delwin.So: term.h
+lib_delwin.So: unctrl.h
+lib_delwin.o: curses.h
+lib_delwin.o: ncurses_def.h
+lib_delwin.o: ncurses_dll.h
+lib_delwin.o: term.h
+lib_delwin.o: unctrl.h
+lib_delwin.po: curses.h
+lib_delwin.po: ncurses_def.h
+lib_delwin.po: ncurses_dll.h
+lib_delwin.po: term.h
+lib_delwin.po: unctrl.h
+lib_dft_fgbg.So: curses.h
+lib_dft_fgbg.So: ncurses_def.h
+lib_dft_fgbg.So: ncurses_dll.h
+lib_dft_fgbg.So: term.h
+lib_dft_fgbg.So: unctrl.h
+lib_dft_fgbg.o: curses.h
+lib_dft_fgbg.o: ncurses_def.h
+lib_dft_fgbg.o: ncurses_dll.h
+lib_dft_fgbg.o: term.h
+lib_dft_fgbg.o: unctrl.h
+lib_dft_fgbg.po: curses.h
+lib_dft_fgbg.po: ncurses_def.h
+lib_dft_fgbg.po: ncurses_dll.h
+lib_dft_fgbg.po: term.h
+lib_dft_fgbg.po: unctrl.h
+lib_echo.So: curses.h
+lib_echo.So: ncurses_def.h
+lib_echo.So: ncurses_dll.h
+lib_echo.So: term.h
+lib_echo.So: unctrl.h
+lib_echo.o: curses.h
+lib_echo.o: ncurses_def.h
+lib_echo.o: ncurses_dll.h
+lib_echo.o: term.h
+lib_echo.o: unctrl.h
+lib_echo.po: curses.h
+lib_echo.po: ncurses_def.h
+lib_echo.po: ncurses_dll.h
+lib_echo.po: term.h
+lib_echo.po: unctrl.h
+lib_endwin.So: curses.h
+lib_endwin.So: ncurses_def.h
+lib_endwin.So: ncurses_dll.h
+lib_endwin.So: term.h
+lib_endwin.So: unctrl.h
+lib_endwin.o: curses.h
+lib_endwin.o: ncurses_def.h
+lib_endwin.o: ncurses_dll.h
+lib_endwin.o: term.h
+lib_endwin.o: unctrl.h
+lib_endwin.po: curses.h
+lib_endwin.po: ncurses_def.h
+lib_endwin.po: ncurses_dll.h
+lib_endwin.po: term.h
+lib_endwin.po: unctrl.h
+lib_erase.So: curses.h
+lib_erase.So: ncurses_def.h
+lib_erase.So: ncurses_dll.h
+lib_erase.So: term.h
+lib_erase.So: unctrl.h
+lib_erase.o: curses.h
+lib_erase.o: ncurses_def.h
+lib_erase.o: ncurses_dll.h
+lib_erase.o: term.h
+lib_erase.o: unctrl.h
+lib_erase.po: curses.h
+lib_erase.po: ncurses_def.h
+lib_erase.po: ncurses_dll.h
+lib_erase.po: term.h
+lib_erase.po: unctrl.h
+lib_erasewchar.So: curses.h
+lib_erasewchar.So: ncurses_def.h
+lib_erasewchar.So: ncurses_dll.h
+lib_erasewchar.So: term.h
+lib_erasewchar.So: unctrl.h
+lib_erasewchar.o: curses.h
+lib_erasewchar.o: ncurses_def.h
+lib_erasewchar.o: ncurses_dll.h
+lib_erasewchar.o: term.h
+lib_erasewchar.o: unctrl.h
+lib_erasewchar.po: curses.h
+lib_erasewchar.po: ncurses_def.h
+lib_erasewchar.po: ncurses_dll.h
+lib_erasewchar.po: term.h
+lib_erasewchar.po: unctrl.h
+lib_flash.So: curses.h
+lib_flash.So: ncurses_def.h
+lib_flash.So: ncurses_dll.h
+lib_flash.So: term.h
+lib_flash.So: unctrl.h
+lib_flash.o: curses.h
+lib_flash.o: ncurses_def.h
+lib_flash.o: ncurses_dll.h
+lib_flash.o: term.h
+lib_flash.o: unctrl.h
+lib_flash.po: curses.h
+lib_flash.po: ncurses_def.h
+lib_flash.po: ncurses_dll.h
+lib_flash.po: term.h
+lib_flash.po: unctrl.h
+lib_freeall.So: curses.h
+lib_freeall.So: ncurses_def.h
+lib_freeall.So: ncurses_dll.h
+lib_freeall.So: term.h
+lib_freeall.So: unctrl.h
+lib_freeall.o: curses.h
+lib_freeall.o: ncurses_def.h
+lib_freeall.o: ncurses_dll.h
+lib_freeall.o: term.h
+lib_freeall.o: unctrl.h
+lib_freeall.po: curses.h
+lib_freeall.po: ncurses_def.h
+lib_freeall.po: ncurses_dll.h
+lib_freeall.po: term.h
+lib_freeall.po: unctrl.h
+lib_gen.So: curses.h
+lib_gen.So: lib_gen.c
+lib_gen.So: ncurses_def.h
+lib_gen.So: ncurses_dll.h
+lib_gen.So: term.h
+lib_gen.So: unctrl.h
+lib_gen.o: curses.h
+lib_gen.o: lib_gen.c
+lib_gen.o: ncurses_def.h
+lib_gen.o: ncurses_dll.h
+lib_gen.o: term.h
+lib_gen.o: unctrl.h
+lib_gen.po: curses.h
+lib_gen.po: lib_gen.c
+lib_gen.po: ncurses_def.h
+lib_gen.po: ncurses_dll.h
+lib_gen.po: term.h
+lib_gen.po: unctrl.h
+lib_get_wch.So: curses.h
+lib_get_wch.So: ncurses_def.h
+lib_get_wch.So: ncurses_dll.h
+lib_get_wch.So: term.h
+lib_get_wch.So: unctrl.h
+lib_get_wch.o: curses.h
+lib_get_wch.o: ncurses_def.h
+lib_get_wch.o: ncurses_dll.h
+lib_get_wch.o: term.h
+lib_get_wch.o: unctrl.h
+lib_get_wch.po: curses.h
+lib_get_wch.po: ncurses_def.h
+lib_get_wch.po: ncurses_dll.h
+lib_get_wch.po: term.h
+lib_get_wch.po: unctrl.h
+lib_get_wstr.So: curses.h
+lib_get_wstr.So: ncurses_def.h
+lib_get_wstr.So: ncurses_dll.h
+lib_get_wstr.So: term.h
+lib_get_wstr.So: unctrl.h
+lib_get_wstr.o: curses.h
+lib_get_wstr.o: ncurses_def.h
+lib_get_wstr.o: ncurses_dll.h
+lib_get_wstr.o: term.h
+lib_get_wstr.o: unctrl.h
+lib_get_wstr.po: curses.h
+lib_get_wstr.po: ncurses_def.h
+lib_get_wstr.po: ncurses_dll.h
+lib_get_wstr.po: term.h
+lib_get_wstr.po: unctrl.h
+lib_getch.So: curses.h
+lib_getch.So: ncurses_def.h
+lib_getch.So: ncurses_dll.h
+lib_getch.So: term.h
+lib_getch.So: unctrl.h
+lib_getch.o: curses.h
+lib_getch.o: ncurses_def.h
+lib_getch.o: ncurses_dll.h
+lib_getch.o: term.h
+lib_getch.o: unctrl.h
+lib_getch.po: curses.h
+lib_getch.po: ncurses_def.h
+lib_getch.po: ncurses_dll.h
+lib_getch.po: term.h
+lib_getch.po: unctrl.h
+lib_getstr.So: curses.h
+lib_getstr.So: ncurses_def.h
+lib_getstr.So: ncurses_dll.h
+lib_getstr.So: term.h
+lib_getstr.So: unctrl.h
+lib_getstr.o: curses.h
+lib_getstr.o: ncurses_def.h
+lib_getstr.o: ncurses_dll.h
+lib_getstr.o: term.h
+lib_getstr.o: unctrl.h
+lib_getstr.po: curses.h
+lib_getstr.po: ncurses_def.h
+lib_getstr.po: ncurses_dll.h
+lib_getstr.po: term.h
+lib_getstr.po: unctrl.h
+lib_has_cap.So: curses.h
+lib_has_cap.So: ncurses_def.h
+lib_has_cap.So: ncurses_dll.h
+lib_has_cap.So: term.h
+lib_has_cap.So: unctrl.h
+lib_has_cap.o: curses.h
+lib_has_cap.o: ncurses_def.h
+lib_has_cap.o: ncurses_dll.h
+lib_has_cap.o: term.h
+lib_has_cap.o: unctrl.h
+lib_has_cap.po: curses.h
+lib_has_cap.po: ncurses_def.h
+lib_has_cap.po: ncurses_dll.h
+lib_has_cap.po: term.h
+lib_has_cap.po: unctrl.h
+lib_hline.So: curses.h
+lib_hline.So: ncurses_def.h
+lib_hline.So: ncurses_dll.h
+lib_hline.So: term.h
+lib_hline.So: unctrl.h
+lib_hline.o: curses.h
+lib_hline.o: ncurses_def.h
+lib_hline.o: ncurses_dll.h
+lib_hline.o: term.h
+lib_hline.o: unctrl.h
+lib_hline.po: curses.h
+lib_hline.po: ncurses_def.h
+lib_hline.po: ncurses_dll.h
+lib_hline.po: term.h
+lib_hline.po: unctrl.h
+lib_hline_set.So: curses.h
+lib_hline_set.So: ncurses_def.h
+lib_hline_set.So: ncurses_dll.h
+lib_hline_set.So: term.h
+lib_hline_set.So: unctrl.h
+lib_hline_set.o: curses.h
+lib_hline_set.o: ncurses_def.h
+lib_hline_set.o: ncurses_dll.h
+lib_hline_set.o: term.h
+lib_hline_set.o: unctrl.h
+lib_hline_set.po: curses.h
+lib_hline_set.po: ncurses_def.h
+lib_hline_set.po: ncurses_dll.h
+lib_hline_set.po: term.h
+lib_hline_set.po: unctrl.h
+lib_immedok.So: curses.h
+lib_immedok.So: ncurses_def.h
+lib_immedok.So: ncurses_dll.h
+lib_immedok.So: term.h
+lib_immedok.So: unctrl.h
+lib_immedok.o: curses.h
+lib_immedok.o: ncurses_def.h
+lib_immedok.o: ncurses_dll.h
+lib_immedok.o: term.h
+lib_immedok.o: unctrl.h
+lib_immedok.po: curses.h
+lib_immedok.po: ncurses_def.h
+lib_immedok.po: ncurses_dll.h
+lib_immedok.po: term.h
+lib_immedok.po: unctrl.h
+lib_in_wch.So: curses.h
+lib_in_wch.So: ncurses_def.h
+lib_in_wch.So: ncurses_dll.h
+lib_in_wch.So: term.h
+lib_in_wch.So: unctrl.h
+lib_in_wch.o: curses.h
+lib_in_wch.o: ncurses_def.h
+lib_in_wch.o: ncurses_dll.h
+lib_in_wch.o: term.h
+lib_in_wch.o: unctrl.h
+lib_in_wch.po: curses.h
+lib_in_wch.po: ncurses_def.h
+lib_in_wch.po: ncurses_dll.h
+lib_in_wch.po: term.h
+lib_in_wch.po: unctrl.h
+lib_in_wchnstr.So: curses.h
+lib_in_wchnstr.So: ncurses_def.h
+lib_in_wchnstr.So: ncurses_dll.h
+lib_in_wchnstr.So: term.h
+lib_in_wchnstr.So: unctrl.h
+lib_in_wchnstr.o: curses.h
+lib_in_wchnstr.o: ncurses_def.h
+lib_in_wchnstr.o: ncurses_dll.h
+lib_in_wchnstr.o: term.h
+lib_in_wchnstr.o: unctrl.h
+lib_in_wchnstr.po: curses.h
+lib_in_wchnstr.po: ncurses_def.h
+lib_in_wchnstr.po: ncurses_dll.h
+lib_in_wchnstr.po: term.h
+lib_in_wchnstr.po: unctrl.h
+lib_inchstr.So: curses.h
+lib_inchstr.So: ncurses_def.h
+lib_inchstr.So: ncurses_dll.h
+lib_inchstr.So: term.h
+lib_inchstr.So: unctrl.h
+lib_inchstr.o: curses.h
+lib_inchstr.o: ncurses_def.h
+lib_inchstr.o: ncurses_dll.h
+lib_inchstr.o: term.h
+lib_inchstr.o: unctrl.h
+lib_inchstr.po: curses.h
+lib_inchstr.po: ncurses_def.h
+lib_inchstr.po: ncurses_dll.h
+lib_inchstr.po: term.h
+lib_inchstr.po: unctrl.h
+lib_initscr.So: curses.h
+lib_initscr.So: ncurses_def.h
+lib_initscr.So: ncurses_dll.h
+lib_initscr.So: term.h
+lib_initscr.So: unctrl.h
+lib_initscr.o: curses.h
+lib_initscr.o: ncurses_def.h
+lib_initscr.o: ncurses_dll.h
+lib_initscr.o: term.h
+lib_initscr.o: unctrl.h
+lib_initscr.po: curses.h
+lib_initscr.po: ncurses_def.h
+lib_initscr.po: ncurses_dll.h
+lib_initscr.po: term.h
+lib_initscr.po: unctrl.h
+lib_ins_wch.So: curses.h
+lib_ins_wch.So: ncurses_def.h
+lib_ins_wch.So: ncurses_dll.h
+lib_ins_wch.So: term.h
+lib_ins_wch.So: unctrl.h
+lib_ins_wch.o: curses.h
+lib_ins_wch.o: ncurses_def.h
+lib_ins_wch.o: ncurses_dll.h
+lib_ins_wch.o: term.h
+lib_ins_wch.o: unctrl.h
+lib_ins_wch.po: curses.h
+lib_ins_wch.po: ncurses_def.h
+lib_ins_wch.po: ncurses_dll.h
+lib_ins_wch.po: term.h
+lib_ins_wch.po: unctrl.h
+lib_insch.So: curses.h
+lib_insch.So: ncurses_def.h
+lib_insch.So: ncurses_dll.h
+lib_insch.So: term.h
+lib_insch.So: unctrl.h
+lib_insch.o: curses.h
+lib_insch.o: ncurses_def.h
+lib_insch.o: ncurses_dll.h
+lib_insch.o: term.h
+lib_insch.o: unctrl.h
+lib_insch.po: curses.h
+lib_insch.po: ncurses_def.h
+lib_insch.po: ncurses_dll.h
+lib_insch.po: term.h
+lib_insch.po: unctrl.h
+lib_insdel.So: curses.h
+lib_insdel.So: ncurses_def.h
+lib_insdel.So: ncurses_dll.h
+lib_insdel.So: term.h
+lib_insdel.So: unctrl.h
+lib_insdel.o: curses.h
+lib_insdel.o: ncurses_def.h
+lib_insdel.o: ncurses_dll.h
+lib_insdel.o: term.h
+lib_insdel.o: unctrl.h
+lib_insdel.po: curses.h
+lib_insdel.po: ncurses_def.h
+lib_insdel.po: ncurses_dll.h
+lib_insdel.po: term.h
+lib_insdel.po: unctrl.h
+lib_insnstr.So: curses.h
+lib_insnstr.So: ncurses_def.h
+lib_insnstr.So: ncurses_dll.h
+lib_insnstr.So: term.h
+lib_insnstr.So: unctrl.h
+lib_insnstr.o: curses.h
+lib_insnstr.o: ncurses_def.h
+lib_insnstr.o: ncurses_dll.h
+lib_insnstr.o: term.h
+lib_insnstr.o: unctrl.h
+lib_insnstr.po: curses.h
+lib_insnstr.po: ncurses_def.h
+lib_insnstr.po: ncurses_dll.h
+lib_insnstr.po: term.h
+lib_insnstr.po: unctrl.h
+lib_instr.So: curses.h
+lib_instr.So: ncurses_def.h
+lib_instr.So: ncurses_dll.h
+lib_instr.So: term.h
+lib_instr.So: unctrl.h
+lib_instr.o: curses.h
+lib_instr.o: ncurses_def.h
+lib_instr.o: ncurses_dll.h
+lib_instr.o: term.h
+lib_instr.o: unctrl.h
+lib_instr.po: curses.h
+lib_instr.po: ncurses_def.h
+lib_instr.po: ncurses_dll.h
+lib_instr.po: term.h
+lib_instr.po: unctrl.h
+lib_inwstr.So: curses.h
+lib_inwstr.So: ncurses_def.h
+lib_inwstr.So: ncurses_dll.h
+lib_inwstr.So: term.h
+lib_inwstr.So: unctrl.h
+lib_inwstr.o: curses.h
+lib_inwstr.o: ncurses_def.h
+lib_inwstr.o: ncurses_dll.h
+lib_inwstr.o: term.h
+lib_inwstr.o: unctrl.h
+lib_inwstr.po: curses.h
+lib_inwstr.po: ncurses_def.h
+lib_inwstr.po: ncurses_dll.h
+lib_inwstr.po: term.h
+lib_inwstr.po: unctrl.h
+lib_isendwin.So: curses.h
+lib_isendwin.So: ncurses_def.h
+lib_isendwin.So: ncurses_dll.h
+lib_isendwin.So: term.h
+lib_isendwin.So: unctrl.h
+lib_isendwin.o: curses.h
+lib_isendwin.o: ncurses_def.h
+lib_isendwin.o: ncurses_dll.h
+lib_isendwin.o: term.h
+lib_isendwin.o: unctrl.h
+lib_isendwin.po: curses.h
+lib_isendwin.po: ncurses_def.h
+lib_isendwin.po: ncurses_dll.h
+lib_isendwin.po: term.h
+lib_isendwin.po: unctrl.h
+lib_kernel.So: curses.h
+lib_kernel.So: ncurses_def.h
+lib_kernel.So: ncurses_dll.h
+lib_kernel.So: term.h
+lib_kernel.So: unctrl.h
+lib_kernel.o: curses.h
+lib_kernel.o: ncurses_def.h
+lib_kernel.o: ncurses_dll.h
+lib_kernel.o: term.h
+lib_kernel.o: unctrl.h
+lib_kernel.po: curses.h
+lib_kernel.po: ncurses_def.h
+lib_kernel.po: ncurses_dll.h
+lib_kernel.po: term.h
+lib_kernel.po: unctrl.h
+lib_key_name.So: curses.h
+lib_key_name.So: ncurses_def.h
+lib_key_name.So: ncurses_dll.h
+lib_key_name.So: term.h
+lib_key_name.So: unctrl.h
+lib_key_name.o: curses.h
+lib_key_name.o: ncurses_def.h
+lib_key_name.o: ncurses_dll.h
+lib_key_name.o: term.h
+lib_key_name.o: unctrl.h
+lib_key_name.po: curses.h
+lib_key_name.po: ncurses_def.h
+lib_key_name.po: ncurses_dll.h
+lib_key_name.po: term.h
+lib_key_name.po: unctrl.h
+lib_keyname.So: curses.h
+lib_keyname.So: lib_keyname.c
+lib_keyname.So: ncurses_def.h
+lib_keyname.So: ncurses_dll.h
+lib_keyname.So: term.h
+lib_keyname.So: unctrl.h
+lib_keyname.o: curses.h
+lib_keyname.o: lib_keyname.c
+lib_keyname.o: ncurses_def.h
+lib_keyname.o: ncurses_dll.h
+lib_keyname.o: term.h
+lib_keyname.o: unctrl.h
+lib_keyname.po: curses.h
+lib_keyname.po: lib_keyname.c
+lib_keyname.po: ncurses_def.h
+lib_keyname.po: ncurses_dll.h
+lib_keyname.po: term.h
+lib_keyname.po: unctrl.h
+lib_leaveok.So: curses.h
+lib_leaveok.So: ncurses_def.h
+lib_leaveok.So: ncurses_dll.h
+lib_leaveok.So: term.h
+lib_leaveok.So: unctrl.h
+lib_leaveok.o: curses.h
+lib_leaveok.o: ncurses_def.h
+lib_leaveok.o: ncurses_dll.h
+lib_leaveok.o: term.h
+lib_leaveok.o: unctrl.h
+lib_leaveok.po: curses.h
+lib_leaveok.po: ncurses_def.h
+lib_leaveok.po: ncurses_dll.h
+lib_leaveok.po: term.h
+lib_leaveok.po: unctrl.h
+lib_longname.So: curses.h
+lib_longname.So: ncurses_def.h
+lib_longname.So: ncurses_dll.h
+lib_longname.So: term.h
+lib_longname.So: unctrl.h
+lib_longname.o: curses.h
+lib_longname.o: ncurses_def.h
+lib_longname.o: ncurses_dll.h
+lib_longname.o: term.h
+lib_longname.o: unctrl.h
+lib_longname.po: curses.h
+lib_longname.po: ncurses_def.h
+lib_longname.po: ncurses_dll.h
+lib_longname.po: term.h
+lib_longname.po: unctrl.h
+lib_mouse.So: curses.h
+lib_mouse.So: ncurses_def.h
+lib_mouse.So: ncurses_dll.h
+lib_mouse.So: term.h
+lib_mouse.So: unctrl.h
+lib_mouse.o: curses.h
+lib_mouse.o: ncurses_def.h
+lib_mouse.o: ncurses_dll.h
+lib_mouse.o: term.h
+lib_mouse.o: unctrl.h
+lib_mouse.po: curses.h
+lib_mouse.po: ncurses_def.h
+lib_mouse.po: ncurses_dll.h
+lib_mouse.po: term.h
+lib_mouse.po: unctrl.h
+lib_move.So: curses.h
+lib_move.So: ncurses_def.h
+lib_move.So: ncurses_dll.h
+lib_move.So: term.h
+lib_move.So: unctrl.h
+lib_move.o: curses.h
+lib_move.o: ncurses_def.h
+lib_move.o: ncurses_dll.h
+lib_move.o: term.h
+lib_move.o: unctrl.h
+lib_move.po: curses.h
+lib_move.po: ncurses_def.h
+lib_move.po: ncurses_dll.h
+lib_move.po: term.h
+lib_move.po: unctrl.h
+lib_mvcur.So: curses.h
+lib_mvcur.So: ncurses_def.h
+lib_mvcur.So: ncurses_dll.h
+lib_mvcur.So: term.h
+lib_mvcur.So: unctrl.h
+lib_mvcur.o: curses.h
+lib_mvcur.o: ncurses_def.h
+lib_mvcur.o: ncurses_dll.h
+lib_mvcur.o: term.h
+lib_mvcur.o: unctrl.h
+lib_mvcur.po: curses.h
+lib_mvcur.po: ncurses_def.h
+lib_mvcur.po: ncurses_dll.h
+lib_mvcur.po: term.h
+lib_mvcur.po: unctrl.h
+lib_mvwin.So: curses.h
+lib_mvwin.So: ncurses_def.h
+lib_mvwin.So: ncurses_dll.h
+lib_mvwin.So: term.h
+lib_mvwin.So: unctrl.h
+lib_mvwin.o: curses.h
+lib_mvwin.o: ncurses_def.h
+lib_mvwin.o: ncurses_dll.h
+lib_mvwin.o: term.h
+lib_mvwin.o: unctrl.h
+lib_mvwin.po: curses.h
+lib_mvwin.po: ncurses_def.h
+lib_mvwin.po: ncurses_dll.h
+lib_mvwin.po: term.h
+lib_mvwin.po: unctrl.h
+lib_napms.So: curses.h
+lib_napms.So: ncurses_def.h
+lib_napms.So: ncurses_dll.h
+lib_napms.So: term.h
+lib_napms.So: unctrl.h
+lib_napms.o: curses.h
+lib_napms.o: ncurses_def.h
+lib_napms.o: ncurses_dll.h
+lib_napms.o: term.h
+lib_napms.o: unctrl.h
+lib_napms.po: curses.h
+lib_napms.po: ncurses_def.h
+lib_napms.po: ncurses_dll.h
+lib_napms.po: term.h
+lib_napms.po: unctrl.h
+lib_newterm.So: curses.h
+lib_newterm.So: ncurses_def.h
+lib_newterm.So: ncurses_dll.h
+lib_newterm.So: term.h
+lib_newterm.So: unctrl.h
+lib_newterm.o: curses.h
+lib_newterm.o: ncurses_def.h
+lib_newterm.o: ncurses_dll.h
+lib_newterm.o: term.h
+lib_newterm.o: unctrl.h
+lib_newterm.po: curses.h
+lib_newterm.po: ncurses_def.h
+lib_newterm.po: ncurses_dll.h
+lib_newterm.po: term.h
+lib_newterm.po: unctrl.h
+lib_newwin.So: curses.h
+lib_newwin.So: ncurses_def.h
+lib_newwin.So: ncurses_dll.h
+lib_newwin.So: term.h
+lib_newwin.So: unctrl.h
+lib_newwin.o: curses.h
+lib_newwin.o: ncurses_def.h
+lib_newwin.o: ncurses_dll.h
+lib_newwin.o: term.h
+lib_newwin.o: unctrl.h
+lib_newwin.po: curses.h
+lib_newwin.po: ncurses_def.h
+lib_newwin.po: ncurses_dll.h
+lib_newwin.po: term.h
+lib_newwin.po: unctrl.h
+lib_nl.So: curses.h
+lib_nl.So: ncurses_def.h
+lib_nl.So: ncurses_dll.h
+lib_nl.So: term.h
+lib_nl.So: unctrl.h
+lib_nl.o: curses.h
+lib_nl.o: ncurses_def.h
+lib_nl.o: ncurses_dll.h
+lib_nl.o: term.h
+lib_nl.o: unctrl.h
+lib_nl.po: curses.h
+lib_nl.po: ncurses_def.h
+lib_nl.po: ncurses_dll.h
+lib_nl.po: term.h
+lib_nl.po: unctrl.h
+lib_options.So: curses.h
+lib_options.So: ncurses_def.h
+lib_options.So: ncurses_dll.h
+lib_options.So: term.h
+lib_options.So: unctrl.h
+lib_options.o: curses.h
+lib_options.o: ncurses_def.h
+lib_options.o: ncurses_dll.h
+lib_options.o: term.h
+lib_options.o: unctrl.h
+lib_options.po: curses.h
+lib_options.po: ncurses_def.h
+lib_options.po: ncurses_dll.h
+lib_options.po: term.h
+lib_options.po: unctrl.h
+lib_overlay.So: curses.h
+lib_overlay.So: ncurses_def.h
+lib_overlay.So: ncurses_dll.h
+lib_overlay.So: term.h
+lib_overlay.So: unctrl.h
+lib_overlay.o: curses.h
+lib_overlay.o: ncurses_def.h
+lib_overlay.o: ncurses_dll.h
+lib_overlay.o: term.h
+lib_overlay.o: unctrl.h
+lib_overlay.po: curses.h
+lib_overlay.po: ncurses_def.h
+lib_overlay.po: ncurses_dll.h
+lib_overlay.po: term.h
+lib_overlay.po: unctrl.h
+lib_pad.So: curses.h
+lib_pad.So: ncurses_def.h
+lib_pad.So: ncurses_dll.h
+lib_pad.So: term.h
+lib_pad.So: unctrl.h
+lib_pad.o: curses.h
+lib_pad.o: ncurses_def.h
+lib_pad.o: ncurses_dll.h
+lib_pad.o: term.h
+lib_pad.o: unctrl.h
+lib_pad.po: curses.h
+lib_pad.po: ncurses_def.h
+lib_pad.po: ncurses_dll.h
+lib_pad.po: term.h
+lib_pad.po: unctrl.h
+lib_pecho_wchar.So: curses.h
+lib_pecho_wchar.So: ncurses_def.h
+lib_pecho_wchar.So: ncurses_dll.h
+lib_pecho_wchar.So: term.h
+lib_pecho_wchar.So: unctrl.h
+lib_pecho_wchar.o: curses.h
+lib_pecho_wchar.o: ncurses_def.h
+lib_pecho_wchar.o: ncurses_dll.h
+lib_pecho_wchar.o: term.h
+lib_pecho_wchar.o: unctrl.h
+lib_pecho_wchar.po: curses.h
+lib_pecho_wchar.po: ncurses_def.h
+lib_pecho_wchar.po: ncurses_dll.h
+lib_pecho_wchar.po: term.h
+lib_pecho_wchar.po: unctrl.h
+lib_print.So: curses.h
+lib_print.So: ncurses_def.h
+lib_print.So: ncurses_dll.h
+lib_print.So: term.h
+lib_print.So: unctrl.h
+lib_print.o: curses.h
+lib_print.o: ncurses_def.h
+lib_print.o: ncurses_dll.h
+lib_print.o: term.h
+lib_print.o: unctrl.h
+lib_print.po: curses.h
+lib_print.po: ncurses_def.h
+lib_print.po: ncurses_dll.h
+lib_print.po: term.h
+lib_print.po: unctrl.h
+lib_printw.So: curses.h
+lib_printw.So: ncurses_def.h
+lib_printw.So: ncurses_dll.h
+lib_printw.So: term.h
+lib_printw.So: unctrl.h
+lib_printw.o: curses.h
+lib_printw.o: ncurses_def.h
+lib_printw.o: ncurses_dll.h
+lib_printw.o: term.h
+lib_printw.o: unctrl.h
+lib_printw.po: curses.h
+lib_printw.po: ncurses_def.h
+lib_printw.po: ncurses_dll.h
+lib_printw.po: term.h
+lib_printw.po: unctrl.h
+lib_raw.So: curses.h
+lib_raw.So: ncurses_def.h
+lib_raw.So: ncurses_dll.h
+lib_raw.So: term.h
+lib_raw.So: unctrl.h
+lib_raw.o: curses.h
+lib_raw.o: ncurses_def.h
+lib_raw.o: ncurses_dll.h
+lib_raw.o: term.h
+lib_raw.o: unctrl.h
+lib_raw.po: curses.h
+lib_raw.po: ncurses_def.h
+lib_raw.po: ncurses_dll.h
+lib_raw.po: term.h
+lib_raw.po: unctrl.h
+lib_redrawln.So: curses.h
+lib_redrawln.So: ncurses_def.h
+lib_redrawln.So: ncurses_dll.h
+lib_redrawln.So: term.h
+lib_redrawln.So: unctrl.h
+lib_redrawln.o: curses.h
+lib_redrawln.o: ncurses_def.h
+lib_redrawln.o: ncurses_dll.h
+lib_redrawln.o: term.h
+lib_redrawln.o: unctrl.h
+lib_redrawln.po: curses.h
+lib_redrawln.po: ncurses_def.h
+lib_redrawln.po: ncurses_dll.h
+lib_redrawln.po: term.h
+lib_redrawln.po: unctrl.h
+lib_refresh.So: curses.h
+lib_refresh.So: ncurses_def.h
+lib_refresh.So: ncurses_dll.h
+lib_refresh.So: term.h
+lib_refresh.So: unctrl.h
+lib_refresh.o: curses.h
+lib_refresh.o: ncurses_def.h
+lib_refresh.o: ncurses_dll.h
+lib_refresh.o: term.h
+lib_refresh.o: unctrl.h
+lib_refresh.po: curses.h
+lib_refresh.po: ncurses_def.h
+lib_refresh.po: ncurses_dll.h
+lib_refresh.po: term.h
+lib_refresh.po: unctrl.h
+lib_restart.So: curses.h
+lib_restart.So: ncurses_def.h
+lib_restart.So: ncurses_dll.h
+lib_restart.So: term.h
+lib_restart.So: unctrl.h
+lib_restart.o: curses.h
+lib_restart.o: ncurses_def.h
+lib_restart.o: ncurses_dll.h
+lib_restart.o: term.h
+lib_restart.o: unctrl.h
+lib_restart.po: curses.h
+lib_restart.po: ncurses_def.h
+lib_restart.po: ncurses_dll.h
+lib_restart.po: term.h
+lib_restart.po: unctrl.h
+lib_scanw.So: curses.h
+lib_scanw.So: ncurses_def.h
+lib_scanw.So: ncurses_dll.h
+lib_scanw.So: term.h
+lib_scanw.So: unctrl.h
+lib_scanw.o: curses.h
+lib_scanw.o: ncurses_def.h
+lib_scanw.o: ncurses_dll.h
+lib_scanw.o: term.h
+lib_scanw.o: unctrl.h
+lib_scanw.po: curses.h
+lib_scanw.po: ncurses_def.h
+lib_scanw.po: ncurses_dll.h
+lib_scanw.po: term.h
+lib_scanw.po: unctrl.h
+lib_screen.So: curses.h
+lib_screen.So: ncurses_def.h
+lib_screen.So: ncurses_dll.h
+lib_screen.So: term.h
+lib_screen.So: unctrl.h
+lib_screen.o: curses.h
+lib_screen.o: ncurses_def.h
+lib_screen.o: ncurses_dll.h
+lib_screen.o: term.h
+lib_screen.o: unctrl.h
+lib_screen.po: curses.h
+lib_screen.po: ncurses_def.h
+lib_screen.po: ncurses_dll.h
+lib_screen.po: term.h
+lib_screen.po: unctrl.h
+lib_scroll.So: curses.h
+lib_scroll.So: ncurses_def.h
+lib_scroll.So: ncurses_dll.h
+lib_scroll.So: term.h
+lib_scroll.So: unctrl.h
+lib_scroll.o: curses.h
+lib_scroll.o: ncurses_def.h
+lib_scroll.o: ncurses_dll.h
+lib_scroll.o: term.h
+lib_scroll.o: unctrl.h
+lib_scroll.po: curses.h
+lib_scroll.po: ncurses_def.h
+lib_scroll.po: ncurses_dll.h
+lib_scroll.po: term.h
+lib_scroll.po: unctrl.h
+lib_scrollok.So: curses.h
+lib_scrollok.So: ncurses_def.h
+lib_scrollok.So: ncurses_dll.h
+lib_scrollok.So: term.h
+lib_scrollok.So: unctrl.h
+lib_scrollok.o: curses.h
+lib_scrollok.o: ncurses_def.h
+lib_scrollok.o: ncurses_dll.h
+lib_scrollok.o: term.h
+lib_scrollok.o: unctrl.h
+lib_scrollok.po: curses.h
+lib_scrollok.po: ncurses_def.h
+lib_scrollok.po: ncurses_dll.h
+lib_scrollok.po: term.h
+lib_scrollok.po: unctrl.h
+lib_scrreg.So: curses.h
+lib_scrreg.So: ncurses_def.h
+lib_scrreg.So: ncurses_dll.h
+lib_scrreg.So: term.h
+lib_scrreg.So: unctrl.h
+lib_scrreg.o: curses.h
+lib_scrreg.o: ncurses_def.h
+lib_scrreg.o: ncurses_dll.h
+lib_scrreg.o: term.h
+lib_scrreg.o: unctrl.h
+lib_scrreg.po: curses.h
+lib_scrreg.po: ncurses_def.h
+lib_scrreg.po: ncurses_dll.h
+lib_scrreg.po: term.h
+lib_scrreg.po: unctrl.h
+lib_set_term.So: curses.h
+lib_set_term.So: ncurses_def.h
+lib_set_term.So: ncurses_dll.h
+lib_set_term.So: term.h
+lib_set_term.So: unctrl.h
+lib_set_term.o: curses.h
+lib_set_term.o: ncurses_def.h
+lib_set_term.o: ncurses_dll.h
+lib_set_term.o: term.h
+lib_set_term.o: unctrl.h
+lib_set_term.po: curses.h
+lib_set_term.po: ncurses_def.h
+lib_set_term.po: ncurses_dll.h
+lib_set_term.po: term.h
+lib_set_term.po: unctrl.h
+lib_setup.So: curses.h
+lib_setup.So: ncurses_def.h
+lib_setup.So: ncurses_dll.h
+lib_setup.So: term.h
+lib_setup.So: unctrl.h
+lib_setup.o: curses.h
+lib_setup.o: ncurses_def.h
+lib_setup.o: ncurses_dll.h
+lib_setup.o: term.h
+lib_setup.o: unctrl.h
+lib_setup.po: curses.h
+lib_setup.po: ncurses_def.h
+lib_setup.po: ncurses_dll.h
+lib_setup.po: term.h
+lib_setup.po: unctrl.h
+lib_slk.So: curses.h
+lib_slk.So: ncurses_def.h
+lib_slk.So: ncurses_dll.h
+lib_slk.So: term.h
+lib_slk.So: unctrl.h
+lib_slk.o: curses.h
+lib_slk.o: ncurses_def.h
+lib_slk.o: ncurses_dll.h
+lib_slk.o: term.h
+lib_slk.o: unctrl.h
+lib_slk.po: curses.h
+lib_slk.po: ncurses_def.h
+lib_slk.po: ncurses_dll.h
+lib_slk.po: term.h
+lib_slk.po: unctrl.h
+lib_slk_wset.So: curses.h
+lib_slk_wset.So: ncurses_def.h
+lib_slk_wset.So: ncurses_dll.h
+lib_slk_wset.So: term.h
+lib_slk_wset.So: unctrl.h
+lib_slk_wset.o: curses.h
+lib_slk_wset.o: ncurses_def.h
+lib_slk_wset.o: ncurses_dll.h
+lib_slk_wset.o: term.h
+lib_slk_wset.o: unctrl.h
+lib_slk_wset.po: curses.h
+lib_slk_wset.po: ncurses_def.h
+lib_slk_wset.po: ncurses_dll.h
+lib_slk_wset.po: term.h
+lib_slk_wset.po: unctrl.h
+lib_slkatr_set.So: curses.h
+lib_slkatr_set.So: ncurses_def.h
+lib_slkatr_set.So: ncurses_dll.h
+lib_slkatr_set.So: term.h
+lib_slkatr_set.So: unctrl.h
+lib_slkatr_set.o: curses.h
+lib_slkatr_set.o: ncurses_def.h
+lib_slkatr_set.o: ncurses_dll.h
+lib_slkatr_set.o: term.h
+lib_slkatr_set.o: unctrl.h
+lib_slkatr_set.po: curses.h
+lib_slkatr_set.po: ncurses_def.h
+lib_slkatr_set.po: ncurses_dll.h
+lib_slkatr_set.po: term.h
+lib_slkatr_set.po: unctrl.h
+lib_slkatrof.So: curses.h
+lib_slkatrof.So: ncurses_def.h
+lib_slkatrof.So: ncurses_dll.h
+lib_slkatrof.So: term.h
+lib_slkatrof.So: unctrl.h
+lib_slkatrof.o: curses.h
+lib_slkatrof.o: ncurses_def.h
+lib_slkatrof.o: ncurses_dll.h
+lib_slkatrof.o: term.h
+lib_slkatrof.o: unctrl.h
+lib_slkatrof.po: curses.h
+lib_slkatrof.po: ncurses_def.h
+lib_slkatrof.po: ncurses_dll.h
+lib_slkatrof.po: term.h
+lib_slkatrof.po: unctrl.h
+lib_slkatron.So: curses.h
+lib_slkatron.So: ncurses_def.h
+lib_slkatron.So: ncurses_dll.h
+lib_slkatron.So: term.h
+lib_slkatron.So: unctrl.h
+lib_slkatron.o: curses.h
+lib_slkatron.o: ncurses_def.h
+lib_slkatron.o: ncurses_dll.h
+lib_slkatron.o: term.h
+lib_slkatron.o: unctrl.h
+lib_slkatron.po: curses.h
+lib_slkatron.po: ncurses_def.h
+lib_slkatron.po: ncurses_dll.h
+lib_slkatron.po: term.h
+lib_slkatron.po: unctrl.h
+lib_slkatrset.So: curses.h
+lib_slkatrset.So: ncurses_def.h
+lib_slkatrset.So: ncurses_dll.h
+lib_slkatrset.So: term.h
+lib_slkatrset.So: unctrl.h
+lib_slkatrset.o: curses.h
+lib_slkatrset.o: ncurses_def.h
+lib_slkatrset.o: ncurses_dll.h
+lib_slkatrset.o: term.h
+lib_slkatrset.o: unctrl.h
+lib_slkatrset.po: curses.h
+lib_slkatrset.po: ncurses_def.h
+lib_slkatrset.po: ncurses_dll.h
+lib_slkatrset.po: term.h
+lib_slkatrset.po: unctrl.h
+lib_slkattr.So: curses.h
+lib_slkattr.So: ncurses_def.h
+lib_slkattr.So: ncurses_dll.h
+lib_slkattr.So: term.h
+lib_slkattr.So: unctrl.h
+lib_slkattr.o: curses.h
+lib_slkattr.o: ncurses_def.h
+lib_slkattr.o: ncurses_dll.h
+lib_slkattr.o: term.h
+lib_slkattr.o: unctrl.h
+lib_slkattr.po: curses.h
+lib_slkattr.po: ncurses_def.h
+lib_slkattr.po: ncurses_dll.h
+lib_slkattr.po: term.h
+lib_slkattr.po: unctrl.h
+lib_slkclear.So: curses.h
+lib_slkclear.So: ncurses_def.h
+lib_slkclear.So: ncurses_dll.h
+lib_slkclear.So: term.h
+lib_slkclear.So: unctrl.h
+lib_slkclear.o: curses.h
+lib_slkclear.o: ncurses_def.h
+lib_slkclear.o: ncurses_dll.h
+lib_slkclear.o: term.h
+lib_slkclear.o: unctrl.h
+lib_slkclear.po: curses.h
+lib_slkclear.po: ncurses_def.h
+lib_slkclear.po: ncurses_dll.h
+lib_slkclear.po: term.h
+lib_slkclear.po: unctrl.h
+lib_slkcolor.So: curses.h
+lib_slkcolor.So: ncurses_def.h
+lib_slkcolor.So: ncurses_dll.h
+lib_slkcolor.So: term.h
+lib_slkcolor.So: unctrl.h
+lib_slkcolor.o: curses.h
+lib_slkcolor.o: ncurses_def.h
+lib_slkcolor.o: ncurses_dll.h
+lib_slkcolor.o: term.h
+lib_slkcolor.o: unctrl.h
+lib_slkcolor.po: curses.h
+lib_slkcolor.po: ncurses_def.h
+lib_slkcolor.po: ncurses_dll.h
+lib_slkcolor.po: term.h
+lib_slkcolor.po: unctrl.h
+lib_slkinit.So: curses.h
+lib_slkinit.So: ncurses_def.h
+lib_slkinit.So: ncurses_dll.h
+lib_slkinit.So: term.h
+lib_slkinit.So: unctrl.h
+lib_slkinit.o: curses.h
+lib_slkinit.o: ncurses_def.h
+lib_slkinit.o: ncurses_dll.h
+lib_slkinit.o: term.h
+lib_slkinit.o: unctrl.h
+lib_slkinit.po: curses.h
+lib_slkinit.po: ncurses_def.h
+lib_slkinit.po: ncurses_dll.h
+lib_slkinit.po: term.h
+lib_slkinit.po: unctrl.h
+lib_slklab.So: curses.h
+lib_slklab.So: ncurses_def.h
+lib_slklab.So: ncurses_dll.h
+lib_slklab.So: term.h
+lib_slklab.So: unctrl.h
+lib_slklab.o: curses.h
+lib_slklab.o: ncurses_def.h
+lib_slklab.o: ncurses_dll.h
+lib_slklab.o: term.h
+lib_slklab.o: unctrl.h
+lib_slklab.po: curses.h
+lib_slklab.po: ncurses_def.h
+lib_slklab.po: ncurses_dll.h
+lib_slklab.po: term.h
+lib_slklab.po: unctrl.h
+lib_slkrefr.So: curses.h
+lib_slkrefr.So: ncurses_def.h
+lib_slkrefr.So: ncurses_dll.h
+lib_slkrefr.So: term.h
+lib_slkrefr.So: unctrl.h
+lib_slkrefr.o: curses.h
+lib_slkrefr.o: ncurses_def.h
+lib_slkrefr.o: ncurses_dll.h
+lib_slkrefr.o: term.h
+lib_slkrefr.o: unctrl.h
+lib_slkrefr.po: curses.h
+lib_slkrefr.po: ncurses_def.h
+lib_slkrefr.po: ncurses_dll.h
+lib_slkrefr.po: term.h
+lib_slkrefr.po: unctrl.h
+lib_slkset.So: curses.h
+lib_slkset.So: ncurses_def.h
+lib_slkset.So: ncurses_dll.h
+lib_slkset.So: term.h
+lib_slkset.So: unctrl.h
+lib_slkset.o: curses.h
+lib_slkset.o: ncurses_def.h
+lib_slkset.o: ncurses_dll.h
+lib_slkset.o: term.h
+lib_slkset.o: unctrl.h
+lib_slkset.po: curses.h
+lib_slkset.po: ncurses_def.h
+lib_slkset.po: ncurses_dll.h
+lib_slkset.po: term.h
+lib_slkset.po: unctrl.h
+lib_slktouch.So: curses.h
+lib_slktouch.So: ncurses_def.h
+lib_slktouch.So: ncurses_dll.h
+lib_slktouch.So: term.h
+lib_slktouch.So: unctrl.h
+lib_slktouch.o: curses.h
+lib_slktouch.o: ncurses_def.h
+lib_slktouch.o: ncurses_dll.h
+lib_slktouch.o: term.h
+lib_slktouch.o: unctrl.h
+lib_slktouch.po: curses.h
+lib_slktouch.po: ncurses_def.h
+lib_slktouch.po: ncurses_dll.h
+lib_slktouch.po: term.h
+lib_slktouch.po: unctrl.h
+lib_termcap.So: curses.h
+lib_termcap.So: ncurses_def.h
+lib_termcap.So: ncurses_dll.h
+lib_termcap.So: term.h
+lib_termcap.So: termcap.h
+lib_termcap.So: unctrl.h
+lib_termcap.o: curses.h
+lib_termcap.o: ncurses_def.h
+lib_termcap.o: ncurses_dll.h
+lib_termcap.o: term.h
+lib_termcap.o: termcap.h
+lib_termcap.o: unctrl.h
+lib_termcap.po: curses.h
+lib_termcap.po: ncurses_def.h
+lib_termcap.po: ncurses_dll.h
+lib_termcap.po: term.h
+lib_termcap.po: termcap.h
+lib_termcap.po: unctrl.h
+lib_termname.So: curses.h
+lib_termname.So: ncurses_def.h
+lib_termname.So: ncurses_dll.h
+lib_termname.So: term.h
+lib_termname.So: unctrl.h
+lib_termname.o: curses.h
+lib_termname.o: ncurses_def.h
+lib_termname.o: ncurses_dll.h
+lib_termname.o: term.h
+lib_termname.o: unctrl.h
+lib_termname.po: curses.h
+lib_termname.po: ncurses_def.h
+lib_termname.po: ncurses_dll.h
+lib_termname.po: term.h
+lib_termname.po: unctrl.h
+lib_tgoto.So: curses.h
+lib_tgoto.So: ncurses_def.h
+lib_tgoto.So: ncurses_dll.h
+lib_tgoto.So: term.h
+lib_tgoto.So: termcap.h
+lib_tgoto.So: unctrl.h
+lib_tgoto.o: curses.h
+lib_tgoto.o: ncurses_def.h
+lib_tgoto.o: ncurses_dll.h
+lib_tgoto.o: term.h
+lib_tgoto.o: termcap.h
+lib_tgoto.o: unctrl.h
+lib_tgoto.po: curses.h
+lib_tgoto.po: ncurses_def.h
+lib_tgoto.po: ncurses_dll.h
+lib_tgoto.po: term.h
+lib_tgoto.po: termcap.h
+lib_tgoto.po: unctrl.h
+lib_ti.So: curses.h
+lib_ti.So: ncurses_def.h
+lib_ti.So: ncurses_dll.h
+lib_ti.So: term.h
+lib_ti.So: unctrl.h
+lib_ti.o: curses.h
+lib_ti.o: ncurses_def.h
+lib_ti.o: ncurses_dll.h
+lib_ti.o: term.h
+lib_ti.o: unctrl.h
+lib_ti.po: curses.h
+lib_ti.po: ncurses_def.h
+lib_ti.po: ncurses_dll.h
+lib_ti.po: term.h
+lib_ti.po: unctrl.h
+lib_touch.So: curses.h
+lib_touch.So: ncurses_def.h
+lib_touch.So: ncurses_dll.h
+lib_touch.So: term.h
+lib_touch.So: unctrl.h
+lib_touch.o: curses.h
+lib_touch.o: ncurses_def.h
+lib_touch.o: ncurses_dll.h
+lib_touch.o: term.h
+lib_touch.o: unctrl.h
+lib_touch.po: curses.h
+lib_touch.po: ncurses_def.h
+lib_touch.po: ncurses_dll.h
+lib_touch.po: term.h
+lib_touch.po: unctrl.h
+lib_tparm.So: curses.h
+lib_tparm.So: ncurses_def.h
+lib_tparm.So: ncurses_dll.h
+lib_tparm.So: term.h
+lib_tparm.So: unctrl.h
+lib_tparm.o: curses.h
+lib_tparm.o: ncurses_def.h
+lib_tparm.o: ncurses_dll.h
+lib_tparm.o: term.h
+lib_tparm.o: unctrl.h
+lib_tparm.po: curses.h
+lib_tparm.po: ncurses_def.h
+lib_tparm.po: ncurses_dll.h
+lib_tparm.po: term.h
+lib_tparm.po: unctrl.h
+lib_tputs.So: curses.h
+lib_tputs.So: ncurses_def.h
+lib_tputs.So: ncurses_dll.h
+lib_tputs.So: term.h
+lib_tputs.So: termcap.h
+lib_tputs.So: unctrl.h
+lib_tputs.o: curses.h
+lib_tputs.o: ncurses_def.h
+lib_tputs.o: ncurses_dll.h
+lib_tputs.o: term.h
+lib_tputs.o: termcap.h
+lib_tputs.o: unctrl.h
+lib_tputs.po: curses.h
+lib_tputs.po: ncurses_def.h
+lib_tputs.po: ncurses_dll.h
+lib_tputs.po: term.h
+lib_tputs.po: termcap.h
+lib_tputs.po: unctrl.h
+lib_trace.So: curses.h
+lib_trace.So: ncurses_def.h
+lib_trace.So: ncurses_dll.h
+lib_trace.So: term.h
+lib_trace.So: unctrl.h
+lib_trace.o: curses.h
+lib_trace.o: ncurses_def.h
+lib_trace.o: ncurses_dll.h
+lib_trace.o: term.h
+lib_trace.o: unctrl.h
+lib_trace.po: curses.h
+lib_trace.po: ncurses_def.h
+lib_trace.po: ncurses_dll.h
+lib_trace.po: term.h
+lib_trace.po: unctrl.h
+lib_tstp.So: curses.h
+lib_tstp.So: ncurses_def.h
+lib_tstp.So: ncurses_dll.h
+lib_tstp.So: term.h
+lib_tstp.So: unctrl.h
+lib_tstp.o: curses.h
+lib_tstp.o: ncurses_def.h
+lib_tstp.o: ncurses_dll.h
+lib_tstp.o: term.h
+lib_tstp.o: unctrl.h
+lib_tstp.po: curses.h
+lib_tstp.po: ncurses_def.h
+lib_tstp.po: ncurses_dll.h
+lib_tstp.po: term.h
+lib_tstp.po: unctrl.h
+lib_ttyflags.So: curses.h
+lib_ttyflags.So: ncurses_def.h
+lib_ttyflags.So: ncurses_dll.h
+lib_ttyflags.So: term.h
+lib_ttyflags.So: unctrl.h
+lib_ttyflags.o: curses.h
+lib_ttyflags.o: ncurses_def.h
+lib_ttyflags.o: ncurses_dll.h
+lib_ttyflags.o: term.h
+lib_ttyflags.o: unctrl.h
+lib_ttyflags.po: curses.h
+lib_ttyflags.po: ncurses_def.h
+lib_ttyflags.po: ncurses_dll.h
+lib_ttyflags.po: term.h
+lib_ttyflags.po: unctrl.h
+lib_twait.So: curses.h
+lib_twait.So: ncurses_def.h
+lib_twait.So: ncurses_dll.h
+lib_twait.So: term.h
+lib_twait.So: unctrl.h
+lib_twait.o: curses.h
+lib_twait.o: ncurses_def.h
+lib_twait.o: ncurses_dll.h
+lib_twait.o: term.h
+lib_twait.o: unctrl.h
+lib_twait.po: curses.h
+lib_twait.po: ncurses_def.h
+lib_twait.po: ncurses_dll.h
+lib_twait.po: term.h
+lib_twait.po: unctrl.h
+lib_unget_wch.So: curses.h
+lib_unget_wch.So: ncurses_def.h
+lib_unget_wch.So: ncurses_dll.h
+lib_unget_wch.So: term.h
+lib_unget_wch.So: unctrl.h
+lib_unget_wch.o: curses.h
+lib_unget_wch.o: ncurses_def.h
+lib_unget_wch.o: ncurses_dll.h
+lib_unget_wch.o: term.h
+lib_unget_wch.o: unctrl.h
+lib_unget_wch.po: curses.h
+lib_unget_wch.po: ncurses_def.h
+lib_unget_wch.po: ncurses_dll.h
+lib_unget_wch.po: term.h
+lib_unget_wch.po: unctrl.h
+lib_ungetch.So: curses.h
+lib_ungetch.So: ncurses_def.h
+lib_ungetch.So: ncurses_dll.h
+lib_ungetch.So: term.h
+lib_ungetch.So: unctrl.h
+lib_ungetch.o: curses.h
+lib_ungetch.o: ncurses_def.h
+lib_ungetch.o: ncurses_dll.h
+lib_ungetch.o: term.h
+lib_ungetch.o: unctrl.h
+lib_ungetch.po: curses.h
+lib_ungetch.po: ncurses_def.h
+lib_ungetch.po: ncurses_dll.h
+lib_ungetch.po: term.h
+lib_ungetch.po: unctrl.h
+lib_vid_attr.So: curses.h
+lib_vid_attr.So: ncurses_def.h
+lib_vid_attr.So: ncurses_dll.h
+lib_vid_attr.So: term.h
+lib_vid_attr.So: unctrl.h
+lib_vid_attr.o: curses.h
+lib_vid_attr.o: ncurses_def.h
+lib_vid_attr.o: ncurses_dll.h
+lib_vid_attr.o: term.h
+lib_vid_attr.o: unctrl.h
+lib_vid_attr.po: curses.h
+lib_vid_attr.po: ncurses_def.h
+lib_vid_attr.po: ncurses_dll.h
+lib_vid_attr.po: term.h
+lib_vid_attr.po: unctrl.h
+lib_vidattr.So: curses.h
+lib_vidattr.So: ncurses_def.h
+lib_vidattr.So: ncurses_dll.h
+lib_vidattr.So: term.h
+lib_vidattr.So: unctrl.h
+lib_vidattr.o: curses.h
+lib_vidattr.o: ncurses_def.h
+lib_vidattr.o: ncurses_dll.h
+lib_vidattr.o: term.h
+lib_vidattr.o: unctrl.h
+lib_vidattr.po: curses.h
+lib_vidattr.po: ncurses_def.h
+lib_vidattr.po: ncurses_dll.h
+lib_vidattr.po: term.h
+lib_vidattr.po: unctrl.h
+lib_vline.So: curses.h
+lib_vline.So: ncurses_def.h
+lib_vline.So: ncurses_dll.h
+lib_vline.So: term.h
+lib_vline.So: unctrl.h
+lib_vline.o: curses.h
+lib_vline.o: ncurses_def.h
+lib_vline.o: ncurses_dll.h
+lib_vline.o: term.h
+lib_vline.o: unctrl.h
+lib_vline.po: curses.h
+lib_vline.po: ncurses_def.h
+lib_vline.po: ncurses_dll.h
+lib_vline.po: term.h
+lib_vline.po: unctrl.h
+lib_vline_set.So: curses.h
+lib_vline_set.So: ncurses_def.h
+lib_vline_set.So: ncurses_dll.h
+lib_vline_set.So: term.h
+lib_vline_set.So: unctrl.h
+lib_vline_set.o: curses.h
+lib_vline_set.o: ncurses_def.h
+lib_vline_set.o: ncurses_dll.h
+lib_vline_set.o: term.h
+lib_vline_set.o: unctrl.h
+lib_vline_set.po: curses.h
+lib_vline_set.po: ncurses_def.h
+lib_vline_set.po: ncurses_dll.h
+lib_vline_set.po: term.h
+lib_vline_set.po: unctrl.h
+lib_wacs.So: curses.h
+lib_wacs.So: ncurses_def.h
+lib_wacs.So: ncurses_dll.h
+lib_wacs.So: term.h
+lib_wacs.So: unctrl.h
+lib_wacs.o: curses.h
+lib_wacs.o: ncurses_def.h
+lib_wacs.o: ncurses_dll.h
+lib_wacs.o: term.h
+lib_wacs.o: unctrl.h
+lib_wacs.po: curses.h
+lib_wacs.po: ncurses_def.h
+lib_wacs.po: ncurses_dll.h
+lib_wacs.po: term.h
+lib_wacs.po: unctrl.h
+lib_wattroff.So: curses.h
+lib_wattroff.So: ncurses_def.h
+lib_wattroff.So: ncurses_dll.h
+lib_wattroff.So: term.h
+lib_wattroff.So: unctrl.h
+lib_wattroff.o: curses.h
+lib_wattroff.o: ncurses_def.h
+lib_wattroff.o: ncurses_dll.h
+lib_wattroff.o: term.h
+lib_wattroff.o: unctrl.h
+lib_wattroff.po: curses.h
+lib_wattroff.po: ncurses_def.h
+lib_wattroff.po: ncurses_dll.h
+lib_wattroff.po: term.h
+lib_wattroff.po: unctrl.h
+lib_wattron.So: curses.h
+lib_wattron.So: ncurses_def.h
+lib_wattron.So: ncurses_dll.h
+lib_wattron.So: term.h
+lib_wattron.So: unctrl.h
+lib_wattron.o: curses.h
+lib_wattron.o: ncurses_def.h
+lib_wattron.o: ncurses_dll.h
+lib_wattron.o: term.h
+lib_wattron.o: unctrl.h
+lib_wattron.po: curses.h
+lib_wattron.po: ncurses_def.h
+lib_wattron.po: ncurses_dll.h
+lib_wattron.po: term.h
+lib_wattron.po: unctrl.h
+lib_winch.So: curses.h
+lib_winch.So: ncurses_def.h
+lib_winch.So: ncurses_dll.h
+lib_winch.So: term.h
+lib_winch.So: unctrl.h
+lib_winch.o: curses.h
+lib_winch.o: ncurses_def.h
+lib_winch.o: ncurses_dll.h
+lib_winch.o: term.h
+lib_winch.o: unctrl.h
+lib_winch.po: curses.h
+lib_winch.po: ncurses_def.h
+lib_winch.po: ncurses_dll.h
+lib_winch.po: term.h
+lib_winch.po: unctrl.h
+lib_window.So: curses.h
+lib_window.So: ncurses_def.h
+lib_window.So: ncurses_dll.h
+lib_window.So: term.h
+lib_window.So: unctrl.h
+lib_window.o: curses.h
+lib_window.o: ncurses_def.h
+lib_window.o: ncurses_dll.h
+lib_window.o: term.h
+lib_window.o: unctrl.h
+lib_window.po: curses.h
+lib_window.po: ncurses_def.h
+lib_window.po: ncurses_dll.h
+lib_window.po: term.h
+lib_window.po: unctrl.h
+lib_wunctrl.So: curses.h
+lib_wunctrl.So: ncurses_def.h
+lib_wunctrl.So: ncurses_dll.h
+lib_wunctrl.So: term.h
+lib_wunctrl.So: unctrl.h
+lib_wunctrl.o: curses.h
+lib_wunctrl.o: ncurses_def.h
+lib_wunctrl.o: ncurses_dll.h
+lib_wunctrl.o: term.h
+lib_wunctrl.o: unctrl.h
+lib_wunctrl.po: curses.h
+lib_wunctrl.po: ncurses_def.h
+lib_wunctrl.po: ncurses_dll.h
+lib_wunctrl.po: term.h
+lib_wunctrl.po: unctrl.h
+name_match.So: curses.h
+name_match.So: ncurses_def.h
+name_match.So: ncurses_dll.h
+name_match.So: term.h
+name_match.So: unctrl.h
+name_match.o: curses.h
+name_match.o: ncurses_def.h
+name_match.o: ncurses_dll.h
+name_match.o: term.h
+name_match.o: unctrl.h
+name_match.po: curses.h
+name_match.po: ncurses_def.h
+name_match.po: ncurses_dll.h
+name_match.po: term.h
+name_match.po: unctrl.h
+names.So: curses.h
+names.So: names.c
+names.So: ncurses_def.h
+names.So: ncurses_dll.h
+names.So: term.h
+names.So: unctrl.h
+names.o: curses.h
+names.o: names.c
+names.o: ncurses_def.h
+names.o: ncurses_dll.h
+names.o: term.h
+names.o: unctrl.h
+names.po: curses.h
+names.po: names.c
+names.po: ncurses_def.h
+names.po: ncurses_dll.h
+names.po: term.h
+names.po: unctrl.h
+nc_panel.So: curses.h
+nc_panel.So: ncurses_def.h
+nc_panel.So: ncurses_dll.h
+nc_panel.So: term.h
+nc_panel.So: unctrl.h
+nc_panel.o: curses.h
+nc_panel.o: ncurses_def.h
+nc_panel.o: ncurses_dll.h
+nc_panel.o: term.h
+nc_panel.o: unctrl.h
+nc_panel.po: curses.h
+nc_panel.po: ncurses_def.h
+nc_panel.po: ncurses_dll.h
+nc_panel.po: term.h
+nc_panel.po: unctrl.h
+obsolete.So: curses.h
+obsolete.So: ncurses_def.h
+obsolete.So: ncurses_dll.h
+obsolete.So: term.h
+obsolete.So: unctrl.h
+obsolete.o: curses.h
+obsolete.o: ncurses_def.h
+obsolete.o: ncurses_dll.h
+obsolete.o: term.h
+obsolete.o: unctrl.h
+obsolete.po: curses.h
+obsolete.po: ncurses_def.h
+obsolete.po: ncurses_dll.h
+obsolete.po: term.h
+obsolete.po: unctrl.h
+parse_entry.So: curses.h
+parse_entry.So: ncurses_def.h
+parse_entry.So: ncurses_dll.h
+parse_entry.So: parametrized.h
+parse_entry.So: term.h
+parse_entry.So: unctrl.h
+parse_entry.o: curses.h
+parse_entry.o: ncurses_def.h
+parse_entry.o: ncurses_dll.h
+parse_entry.o: parametrized.h
+parse_entry.o: term.h
+parse_entry.o: unctrl.h
+parse_entry.po: curses.h
+parse_entry.po: ncurses_def.h
+parse_entry.po: ncurses_dll.h
+parse_entry.po: parametrized.h
+parse_entry.po: term.h
+parse_entry.po: unctrl.h
+read_entry.So: curses.h
+read_entry.So: ncurses_def.h
+read_entry.So: ncurses_dll.h
+read_entry.So: term.h
+read_entry.So: unctrl.h
+read_entry.o: curses.h
+read_entry.o: ncurses_def.h
+read_entry.o: ncurses_dll.h
+read_entry.o: term.h
+read_entry.o: unctrl.h
+read_entry.po: curses.h
+read_entry.po: ncurses_def.h
+read_entry.po: ncurses_dll.h
+read_entry.po: term.h
+read_entry.po: unctrl.h
+resizeterm.So: curses.h
+resizeterm.So: ncurses_def.h
+resizeterm.So: ncurses_dll.h
+resizeterm.So: term.h
+resizeterm.So: unctrl.h
+resizeterm.o: curses.h
+resizeterm.o: ncurses_def.h
+resizeterm.o: ncurses_dll.h
+resizeterm.o: term.h
+resizeterm.o: unctrl.h
+resizeterm.po: curses.h
+resizeterm.po: ncurses_def.h
+resizeterm.po: ncurses_dll.h
+resizeterm.po: term.h
+resizeterm.po: unctrl.h
+safe_sprintf.So: curses.h
+safe_sprintf.So: ncurses_def.h
+safe_sprintf.So: ncurses_dll.h
+safe_sprintf.So: term.h
+safe_sprintf.So: unctrl.h
+safe_sprintf.o: curses.h
+safe_sprintf.o: ncurses_def.h
+safe_sprintf.o: ncurses_dll.h
+safe_sprintf.o: term.h
+safe_sprintf.o: unctrl.h
+safe_sprintf.po: curses.h
+safe_sprintf.po: ncurses_def.h
+safe_sprintf.po: ncurses_dll.h
+safe_sprintf.po: term.h
+safe_sprintf.po: unctrl.h
+strings.So: curses.h
+strings.So: ncurses_def.h
+strings.So: ncurses_dll.h
+strings.So: term.h
+strings.So: unctrl.h
+strings.o: curses.h
+strings.o: ncurses_def.h
+strings.o: ncurses_dll.h
+strings.o: term.h
+strings.o: unctrl.h
+strings.po: curses.h
+strings.po: ncurses_def.h
+strings.po: ncurses_dll.h
+strings.po: term.h
+strings.po: unctrl.h
+termcap.So: curses.h
+termcap.So: ncurses_def.h
+termcap.So: ncurses_dll.h
+termcap.So: term.h
+termcap.So: unctrl.h
+termcap.o: curses.h
+termcap.o: ncurses_def.h
+termcap.o: ncurses_dll.h
+termcap.o: term.h
+termcap.o: unctrl.h
+termcap.po: curses.h
+termcap.po: ncurses_def.h
+termcap.po: ncurses_dll.h
+termcap.po: term.h
+termcap.po: unctrl.h
+tries.So: curses.h
+tries.So: ncurses_def.h
+tries.So: ncurses_dll.h
+tries.So: term.h
+tries.So: unctrl.h
+tries.o: curses.h
+tries.o: ncurses_def.h
+tries.o: ncurses_dll.h
+tries.o: term.h
+tries.o: unctrl.h
+tries.po: curses.h
+tries.po: ncurses_def.h
+tries.po: ncurses_dll.h
+tries.po: term.h
+tries.po: unctrl.h
+trim_sgr0.So: curses.h
+trim_sgr0.So: ncurses_def.h
+trim_sgr0.So: ncurses_dll.h
+trim_sgr0.So: term.h
+trim_sgr0.So: unctrl.h
+trim_sgr0.o: curses.h
+trim_sgr0.o: ncurses_def.h
+trim_sgr0.o: ncurses_dll.h
+trim_sgr0.o: term.h
+trim_sgr0.o: unctrl.h
+trim_sgr0.po: curses.h
+trim_sgr0.po: ncurses_def.h
+trim_sgr0.po: ncurses_dll.h
+trim_sgr0.po: term.h
+trim_sgr0.po: unctrl.h
+tty_update.So: curses.h
+tty_update.So: ncurses_def.h
+tty_update.So: ncurses_dll.h
+tty_update.So: term.h
+tty_update.So: unctrl.h
+tty_update.o: curses.h
+tty_update.o: ncurses_def.h
+tty_update.o: ncurses_dll.h
+tty_update.o: term.h
+tty_update.o: unctrl.h
+tty_update.po: curses.h
+tty_update.po: ncurses_def.h
+tty_update.po: ncurses_dll.h
+tty_update.po: term.h
+tty_update.po: unctrl.h
+unctrl.So: curses.h
+unctrl.So: ncurses_def.h
+unctrl.So: ncurses_dll.h
+unctrl.So: term.h
+unctrl.So: unctrl.c
+unctrl.So: unctrl.h
+unctrl.o: curses.h
+unctrl.o: ncurses_def.h
+unctrl.o: ncurses_dll.h
+unctrl.o: term.h
+unctrl.o: unctrl.c
+unctrl.o: unctrl.h
+unctrl.po: curses.h
+unctrl.po: ncurses_def.h
+unctrl.po: ncurses_dll.h
+unctrl.po: term.h
+unctrl.po: unctrl.c
+unctrl.po: unctrl.h
+version.So: curses.h
+version.So: ncurses_def.h
+version.So: ncurses_dll.h
+version.So: term.h
+version.So: unctrl.h
+version.o: curses.h
+version.o: ncurses_def.h
+version.o: ncurses_dll.h
+version.o: term.h
+version.o: unctrl.h
+version.po: curses.h
+version.po: ncurses_def.h
+version.po: ncurses_dll.h
+version.po: term.h
+version.po: unctrl.h
+visbuf.So: curses.h
+visbuf.So: ncurses_def.h
+visbuf.So: ncurses_dll.h
+visbuf.So: term.h
+visbuf.So: unctrl.h
+visbuf.o: curses.h
+visbuf.o: ncurses_def.h
+visbuf.o: ncurses_dll.h
+visbuf.o: term.h
+visbuf.o: unctrl.h
+visbuf.po: curses.h
+visbuf.po: ncurses_def.h
+visbuf.po: ncurses_dll.h
+visbuf.po: term.h
+visbuf.po: unctrl.h
+vsscanf.So: curses.h
+vsscanf.So: ncurses_def.h
+vsscanf.So: ncurses_dll.h
+vsscanf.So: term.h
+vsscanf.So: unctrl.h
+vsscanf.o: curses.h
+vsscanf.o: ncurses_def.h
+vsscanf.o: ncurses_dll.h
+vsscanf.o: term.h
+vsscanf.o: unctrl.h
+vsscanf.po: curses.h
+vsscanf.po: ncurses_def.h
+vsscanf.po: ncurses_dll.h
+vsscanf.po: term.h
+vsscanf.po: unctrl.h
+wresize.So: curses.h
+wresize.So: ncurses_def.h
+wresize.So: ncurses_dll.h
+wresize.So: term.h
+wresize.So: unctrl.h
+wresize.o: curses.h
+wresize.o: ncurses_def.h
+wresize.o: ncurses_dll.h
+wresize.o: term.h
+wresize.o: unctrl.h
+wresize.po: curses.h
+wresize.po: ncurses_def.h
+wresize.po: ncurses_dll.h
+wresize.po: term.h
+wresize.po: unctrl.h
+write_entry.So: curses.h
+write_entry.So: ncurses_def.h
+write_entry.So: ncurses_dll.h
+write_entry.So: term.h
+write_entry.So: unctrl.h
+write_entry.o: curses.h
+write_entry.o: ncurses_def.h
+write_entry.o: ncurses_dll.h
+write_entry.o: term.h
+write_entry.o: unctrl.h
+write_entry.po: curses.h
+write_entry.po: ncurses_def.h
+write_entry.po: ncurses_dll.h
+write_entry.po: term.h
+write_entry.po: unctrl.h
+.endif
diff --git a/lib/ncurses/panel/Makefile b/lib/ncurses/panel/Makefile
index b075bcf..7929aed 100644
--- a/lib/ncurses/panel/Makefile
+++ b/lib/ncurses/panel/Makefile
@@ -29,7 +29,8 @@ CLEANFILES= ncurses_def.h
CFLAGS+= -I${SRCDIR}
-LIBADD+= ncurses${LIB_SUFFIX}
+DPADD= ${LIBNCURSES${LIB_SUFFIX:tu}}
+LDADD= -lncurses${LIB_SUFFIX}
.if defined(ENABLE_WIDEC)
INCS= panel.h
diff --git a/lib/ncurses/panel/Makefile.depend b/lib/ncurses/panel/Makefile.depend
new file mode 100644
index 0000000..4e0baeb
--- /dev/null
+++ b/lib/ncurses/panel/Makefile.depend
@@ -0,0 +1,68 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/ncurses/ncurses \
+ lib/ncurses/ncursesw \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+p_above.So: ncurses_def.h
+p_above.o: ncurses_def.h
+p_above.po: ncurses_def.h
+p_below.So: ncurses_def.h
+p_below.o: ncurses_def.h
+p_below.po: ncurses_def.h
+p_bottom.So: ncurses_def.h
+p_bottom.o: ncurses_def.h
+p_bottom.po: ncurses_def.h
+p_delete.So: ncurses_def.h
+p_delete.o: ncurses_def.h
+p_delete.po: ncurses_def.h
+p_hidden.So: ncurses_def.h
+p_hidden.o: ncurses_def.h
+p_hidden.po: ncurses_def.h
+p_hide.So: ncurses_def.h
+p_hide.o: ncurses_def.h
+p_hide.po: ncurses_def.h
+p_move.So: ncurses_def.h
+p_move.o: ncurses_def.h
+p_move.po: ncurses_def.h
+p_new.So: ncurses_def.h
+p_new.o: ncurses_def.h
+p_new.po: ncurses_def.h
+p_replace.So: ncurses_def.h
+p_replace.o: ncurses_def.h
+p_replace.po: ncurses_def.h
+p_show.So: ncurses_def.h
+p_show.o: ncurses_def.h
+p_show.po: ncurses_def.h
+p_top.So: ncurses_def.h
+p_top.o: ncurses_def.h
+p_top.po: ncurses_def.h
+p_update.So: ncurses_def.h
+p_update.o: ncurses_def.h
+p_update.po: ncurses_def.h
+p_user.So: ncurses_def.h
+p_user.o: ncurses_def.h
+p_user.po: ncurses_def.h
+p_win.So: ncurses_def.h
+p_win.o: ncurses_def.h
+p_win.po: ncurses_def.h
+panel.So: ncurses_def.h
+panel.o: ncurses_def.h
+panel.po: ncurses_def.h
+.endif
diff --git a/lib/ncurses/panelw/Makefile.depend b/lib/ncurses/panelw/Makefile.depend
new file mode 100644
index 0000000..fa11519
--- /dev/null
+++ b/lib/ncurses/panelw/Makefile.depend
@@ -0,0 +1,67 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ bin/cat.host \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/ncurses/ncursesw \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+p_above.So: ncurses_def.h
+p_above.o: ncurses_def.h
+p_above.po: ncurses_def.h
+p_below.So: ncurses_def.h
+p_below.o: ncurses_def.h
+p_below.po: ncurses_def.h
+p_bottom.So: ncurses_def.h
+p_bottom.o: ncurses_def.h
+p_bottom.po: ncurses_def.h
+p_delete.So: ncurses_def.h
+p_delete.o: ncurses_def.h
+p_delete.po: ncurses_def.h
+p_hidden.So: ncurses_def.h
+p_hidden.o: ncurses_def.h
+p_hidden.po: ncurses_def.h
+p_hide.So: ncurses_def.h
+p_hide.o: ncurses_def.h
+p_hide.po: ncurses_def.h
+p_move.So: ncurses_def.h
+p_move.o: ncurses_def.h
+p_move.po: ncurses_def.h
+p_new.So: ncurses_def.h
+p_new.o: ncurses_def.h
+p_new.po: ncurses_def.h
+p_replace.So: ncurses_def.h
+p_replace.o: ncurses_def.h
+p_replace.po: ncurses_def.h
+p_show.So: ncurses_def.h
+p_show.o: ncurses_def.h
+p_show.po: ncurses_def.h
+p_top.So: ncurses_def.h
+p_top.o: ncurses_def.h
+p_top.po: ncurses_def.h
+p_update.So: ncurses_def.h
+p_update.o: ncurses_def.h
+p_update.po: ncurses_def.h
+p_user.So: ncurses_def.h
+p_user.o: ncurses_def.h
+p_user.po: ncurses_def.h
+p_win.So: ncurses_def.h
+p_win.o: ncurses_def.h
+p_win.po: ncurses_def.h
+panel.So: ncurses_def.h
+panel.o: ncurses_def.h
+panel.po: ncurses_def.h
+.endif
OpenPOWER on IntegriCloud