diff --git a/Makefile.inc1 b/Makefile.inc1 index c9a90a5c9e32..ad1f11b9d9c8 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1425,6 +1425,14 @@ _kgzip= usr.sbin/kgzip # If we're given an XAS, don't build binutils. .if ${XAS:M/*} == "" && ${MK_BINUTILS_BOOTSTRAP} != "no" _binutils= gnu/usr.bin/binutils +.if ${MK_ELFTOOLCHAIN_TOOLS} != "no" +_elftctools= lib/libelftc \ + usr.bin/addr2line \ + usr.bin/elfcopy \ + usr.bin/nm \ + usr.bin/size \ + usr.bin/strings +.endif .endif # If an full path to an external cross compiler is given, don't build @@ -1444,6 +1452,7 @@ cross-tools: .MAKE ${_clang_libs} \ ${_clang} \ ${_binutils} \ + ${_elftctools} \ ${_cc} \ usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ ${_btxld} \ @@ -1501,6 +1510,7 @@ native-xtools: .MAKE ${_clang_tblgen} \ usr.bin/ar \ ${_binutils} \ + ${_elftctools} \ ${_cc} \ ${_gcc_tools} \ ${_clang_libs} \ @@ -2059,6 +2069,7 @@ _xb-build-tools: _xb-cross-tools: .for _tool in \ ${_binutils} \ + ${_elftctools} \ usr.bin/ar \ ${_clang_libs} \ ${_clang} \ @@ -2091,6 +2102,7 @@ _xi-cross-tools: @echo "_xi-cross-tools" .for _tool in \ ${_binutils} \ + ${_elftctools} \ usr.bin/ar \ ${_clang_libs} \ ${_clang} \ diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 5eeb6a1373d9..71d2cc04b49e 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20141202: update to mandoc CVS 20141201 +OLD_FILES+=usr.bin/preconv +OLD_FILES+=share/man/man1/preconv.1.gz # 20141129: mrouted rc.d scripts removed from base OLD_FILES+=etc/rc.d/mrouted # 20141126: convert sbin/mdconfig/tests to ATF format tests diff --git a/bin/sh/eval.c b/bin/sh/eval.c index c1a9cdbfcd93..d0460a024e3d 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -774,15 +774,7 @@ xtracecommand(struct arglist *varlist, struct arglist *arglist) for (sp = arglist->list ; sp ; sp = sp->next) { if (sep != 0) out2c(' '); - /* Disambiguate command looking like assignment. */ - if (sp == arglist->list && - strchr(sp->text, '=') != NULL && - strchr(sp->text, '\'') == NULL) { - out2c('\''); - out2str(sp->text); - out2c('\''); - } else - out2qstr(sp->text); + out2qstr(sp->text); sep = ' '; } out2c('\n'); diff --git a/bin/sh/output.c b/bin/sh/output.c index bf8e17d97ece..c6d118f11535 100644 --- a/bin/sh/output.c +++ b/bin/sh/output.c @@ -122,8 +122,7 @@ outqstr(const char *p, struct output *file) outstr("''", file); return; } - /* Caller will handle '=' if necessary */ - if (p[strcspn(p, "|&;<>()$`\\\"' \t\n*?[~#")] == '\0' || + if (p[strcspn(p, "|&;<>()$`\\\"' \t\n*?[~#=")] == '\0' || strcmp(p, "[") == 0) { outstr(p, file); return; diff --git a/contrib/binutils/bfd/elf32-arm.c b/contrib/binutils/bfd/elf32-arm.c index 83acfe564714..47b6566c2e2b 100644 --- a/contrib/binutils/bfd/elf32-arm.c +++ b/contrib/binutils/bfd/elf32-arm.c @@ -4960,7 +4960,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, + input_section->output_offset + rel->r_offset); - value = abs (relocation); + value = llabs (relocation); if (value >= 0x1000) return bfd_reloc_overflow; @@ -4998,7 +4998,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, + input_section->output_offset + rel->r_offset); - value = abs (relocation); + value = llabs (relocation); if (value >= 0x1000) return bfd_reloc_overflow; @@ -5984,7 +5984,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, /* Calculate the value of the relevant G_n, in encoded constant-with-rotation format. */ - g_n = calculate_group_reloc_mask (abs (signed_value), group, + g_n = calculate_group_reloc_mask (llabs (signed_value), group, &residual); /* Check for overflow if required. */ @@ -5998,7 +5998,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } @@ -6077,7 +6077,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, /* Calculate the value of the relevant G_{n-1} to obtain the residual at that stage. */ - calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + calculate_group_reloc_mask (llabs (signed_value), group - 1, &residual); /* Check for overflow. */ if (residual >= 0x1000) @@ -6085,7 +6085,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } @@ -6160,7 +6160,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, /* Calculate the value of the relevant G_{n-1} to obtain the residual at that stage. */ - calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + calculate_group_reloc_mask (llabs (signed_value), group - 1, &residual); /* Check for overflow. */ if (residual >= 0x100) @@ -6168,7 +6168,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } @@ -6243,7 +6243,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, /* Calculate the value of the relevant G_{n-1} to obtain the residual at that stage. */ - calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + calculate_group_reloc_mask (llabs (signed_value), group - 1, &residual); /* Check for overflow. (The absolute value to go in the place must be divisible by four and, after having been divided by four, must @@ -6253,7 +6253,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } diff --git a/contrib/binutils/bfd/elflink.c b/contrib/binutils/bfd/elflink.c index e80f8ee3f22e..f1e50def8b52 100644 --- a/contrib/binutils/bfd/elflink.c +++ b/contrib/binutils/bfd/elflink.c @@ -4356,9 +4356,38 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) --no-add-needed is used. */ if ((elf_dyn_lib_class (abfd) & DYN_NO_NEEDED) != 0) { + bfd_boolean looks_soish; + const char *print_name; + int print_len; + size_t len, lend = 0; + + looks_soish = FALSE; + print_name = soname; + print_len = strlen(soname); + if (strncmp(soname, "lib", 3) == 0) + { + len = print_len; + if (len > 5 && strcmp(soname + len - 2, ".a") == 0) + lend = len - 5; + else + { + while (len > 6 && (ISDIGIT(soname[len - 1]) || + soname[len - 1] == '.')) + len--; + if (strncmp(soname + len - 3, ".so", 3) == 0) + lend = len - 6; + } + if (lend != 0) + { + print_name = soname + 3; + print_len = lend; + looks_soish = TRUE; + } + } + (*_bfd_error_handler) - (_("%B: invalid DSO for symbol `%s' definition"), - abfd, name); + (_("undefined reference to symbol `%s' (try adding -l%s%.*s)"), + name, looks_soish? "" : ":", print_len, print_name); bfd_set_error (bfd_error_bad_value); goto error_free_vers; } diff --git a/contrib/binutils/bfd/po/bfd.pot b/contrib/binutils/bfd/po/bfd.pot index e5282389a1ab..e436b184f31a 100644 --- a/contrib/binutils/bfd/po/bfd.pot +++ b/contrib/binutils/bfd/po/bfd.pot @@ -2438,9 +2438,9 @@ msgstr "" msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B" msgstr "" -#: elflink.c:4309 +#: elflink.c:4389 #, c-format -msgid "%B: invalid DSO for symbol `%s' definition" +msgid "undefined reference to symbol `%s' (try adding -l%s%.*s)" msgstr "" #: elflink.c:5535 diff --git a/contrib/binutils/gas/config/tc-arm.c b/contrib/binutils/gas/config/tc-arm.c index 37c2a9075013..184c8a900262 100644 --- a/contrib/binutils/gas/config/tc-arm.c +++ b/contrib/binutils/gas/config/tc-arm.c @@ -15055,7 +15055,7 @@ static const struct asm_opcode insns[] = TCE(stc, c000000, ec000000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TC3(stcl, c400000, ec400000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TCE(mcr, e000010, ee000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), - TCE(mrc, e100010, ee100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), + TCE(mrc, e100010, ee100010, 6, (RCP, I7b, APSR_RR, RCN, RCN, oI7b), co_reg, co_reg), #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v2s /* ARM 3 - swp instructions. */ @@ -15114,7 +15114,7 @@ static const struct asm_opcode insns[] = TUF(stc2l, c400000, fc400000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TUF(cdp2, e000000, fe000000, 6, (RCP, I15b, RCN, RCN, RCN, oI7b), cdp, cdp), TUF(mcr2, e000010, fe000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), - TUF(mrc2, e100010, fe100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), + TUF(mrc2, e100010, fe100010, 6, (RCP, I7b, APSR_RR, RCN, RCN, oI7b), co_reg, co_reg), #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v5exp /* ARM Architecture 5TExP. */ diff --git a/contrib/elftoolchain/elfcopy/archive.c b/contrib/elftoolchain/elfcopy/archive.c index a4f8017989ba..3fd2e857d3d0 100644 --- a/contrib/elftoolchain/elfcopy/archive.c +++ b/contrib/elftoolchain/elfcopy/archive.c @@ -350,12 +350,12 @@ ac_detect_ar(int ifd) r = -1; if ((a = archive_read_new()) == NULL) return (0); - archive_read_support_compression_none(a); + archive_read_support_filter_none(a); archive_read_support_format_ar(a); if (archive_read_open_fd(a, ifd, 10240) == ARCHIVE_OK) r = archive_read_next_header(a, &entry); archive_read_close(a); - archive_read_finish(a); + archive_read_free(a); return (r == ARCHIVE_OK); } @@ -386,7 +386,7 @@ ac_read_objs(struct elfcopy *ecp, int ifd) err(EXIT_FAILURE, "lseek failed"); if ((a = archive_read_new()) == NULL) errx(EXIT_FAILURE, "%s", archive_error_string(a)); - archive_read_support_compression_none(a); + archive_read_support_filter_none(a); archive_read_support_format_ar(a); AC(archive_read_open_fd(a, ifd, 10240)); for(;;) { @@ -435,7 +435,7 @@ ac_read_objs(struct elfcopy *ecp, int ifd) } } AC(archive_read_close(a)); - ACV(archive_read_finish(a)); + ACV(archive_read_free(a)); } static void @@ -449,7 +449,7 @@ ac_write_objs(struct elfcopy *ecp, int ofd) if ((a = archive_write_new()) == NULL) errx(EXIT_FAILURE, "%s", archive_error_string(a)); archive_write_set_format_ar_svr4(a); - archive_write_set_compression_none(a); + archive_write_add_filter_none(a); AC(archive_write_open_fd(a, ofd)); /* Write the archive symbol table, even if it's empty. */ @@ -491,7 +491,7 @@ ac_write_objs(struct elfcopy *ecp, int ofd) } AC(archive_write_close(a)); - ACV(archive_write_finish(a)); + ACV(archive_write_free(a)); } static void diff --git a/contrib/elftoolchain/elfcopy/ascii.c b/contrib/elftoolchain/elfcopy/ascii.c index 968e5c667f63..261180eb67d2 100644 --- a/contrib/elftoolchain/elfcopy/ascii.c +++ b/contrib/elftoolchain/elfcopy/ascii.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/contrib/elftoolchain/elfcopy/segments.c b/contrib/elftoolchain/elfcopy/segments.c index c54cbfcbb07a..853c728e8f37 100644 --- a/contrib/elftoolchain/elfcopy/segments.c +++ b/contrib/elftoolchain/elfcopy/segments.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/contrib/elftoolchain/libelf/libelf_convert.m4 b/contrib/elftoolchain/libelf/libelf_convert.m4 index fda9392a4d8f..2121b6e894e4 100644 --- a/contrib/elftoolchain/libelf/libelf_convert.m4 +++ b/contrib/elftoolchain/libelf/libelf_convert.m4 @@ -947,11 +947,6 @@ _libelf_cvt_NOTE_tom(char *dst, size_t dsz, char *src, size_t count, READ_WORD(src, descsz); READ_WORD(src, type); - sz = namesz; - ROUNDUP2(sz, 4); - sz += descsz; - ROUNDUP2(sz, 4); - /* Translate. */ SWAP_WORD(namesz); SWAP_WORD(descsz); @@ -967,6 +962,11 @@ _libelf_cvt_NOTE_tom(char *dst, size_t dsz, char *src, size_t count, dst += sizeof(Elf_Note); count -= hdrsz; + ROUNDUP2(namesz, 4); + ROUNDUP2(descsz, 4); + + sz = namesz + descsz; + if (count < sz || dsz < sz) /* Buffers are too small. */ return (0); @@ -1005,6 +1005,11 @@ _libelf_cvt_NOTE_tof(char *dst, size_t dsz, char *src, size_t count, descsz = en->n_descsz; type = en->n_type; + sz = namesz; + ROUNDUP2(sz, 4); + sz += descsz; + ROUNDUP2(sz, 4); + SWAP_WORD(namesz); SWAP_WORD(descsz); SWAP_WORD(type); @@ -1015,11 +1020,6 @@ _libelf_cvt_NOTE_tof(char *dst, size_t dsz, char *src, size_t count, src += sizeof(Elf_Note); - ROUNDUP2(namesz, 4); - ROUNDUP2(descsz, 4); - - sz = namesz + descsz; - if (count < sz) sz = count; diff --git a/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c b/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c index bd54f549ddb8..0179890d264d 100644 --- a/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c +++ b/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c @@ -156,7 +156,7 @@ static int vector_type_qualifier_init(struct vector_type_qualifier *); static int vector_type_qualifier_push(struct vector_type_qualifier *, enum type_qualifier); -int cpp_demangle_gnu3_push_head; +static int cpp_demangle_gnu3_push_head; /** * @brief Decode the input string by IA-64 C++ ABI style. diff --git a/contrib/elftoolchain/nm/nm.c b/contrib/elftoolchain/nm/nm.c index 6c10e0dbf586..906a50c309f1 100644 --- a/contrib/elftoolchain/nm/nm.c +++ b/contrib/elftoolchain/nm/nm.c @@ -65,7 +65,7 @@ typedef void (*fn_sym_print)(const GElf_Sym *); typedef int (*fn_filter)(char, const GElf_Sym *, const char *); /* output filter list */ -SLIST_HEAD(filter_head, filter_entry) nm_out_filter = +static SLIST_HEAD(filter_head, filter_entry) nm_out_filter = SLIST_HEAD_INITIALIZER(nm_out_filter); struct filter_entry { diff --git a/contrib/elftoolchain/size/size.c b/contrib/elftoolchain/size/size.c index c5c5b64cb0d0..0d4de422b65d 100644 --- a/contrib/elftoolchain/size/size.c +++ b/contrib/elftoolchain/size/size.c @@ -269,7 +269,7 @@ handle_core_note(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phdr *phdr, static pid_t pid; uintptr_t ver; Elf32_Nhdr *nhdr, nhdr_l; - static int reg_pseudo = 0, reg2_pseudo = 0, regxfp_pseudo = 0; + static int reg_pseudo = 0, reg2_pseudo = 0 /*, regxfp_pseudo = 0*/; char buf[BUF_SIZE], *data, *name; if (elf == NULL || elfhdr == NULL || phdr == NULL) @@ -360,6 +360,7 @@ handle_core_note(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phdr *phdr, text_size_total += nhdr_l.n_descsz; } break; +#if 0 case NT_AUXV: if (style == STYLE_SYSV) { tbl_append(); @@ -390,6 +391,7 @@ handle_core_note(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phdr *phdr, } break; case NT_PSINFO: +#endif case NT_PRPSINFO: { /* FreeBSD 64-bit */ if (nhdr_l.n_descsz == 0x78 && @@ -415,8 +417,10 @@ handle_core_note(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phdr *phdr, } break; } +#if 0 case NT_PSTATUS: case NT_LWPSTATUS: +#endif default: break; } diff --git a/contrib/elftoolchain/strings/strings.c b/contrib/elftoolchain/strings/strings.c index c936d5c5374f..e8972e7b5ab4 100644 --- a/contrib/elftoolchain/strings/strings.c +++ b/contrib/elftoolchain/strings/strings.c @@ -75,9 +75,9 @@ enum encoding_style { (encoding == ENCODING_8BIT && (c) > 127))) -int encoding_size, entire_file, min_len, show_filename, show_loc; -enum encoding_style encoding; -enum radix_style radix; +static int encoding_size, entire_file, min_len, show_filename, show_loc; +static enum encoding_style encoding; +static enum radix_style radix; static struct option strings_longopts[] = { { "all", no_argument, NULL, 'a'}, diff --git a/contrib/gcc/config/arm/lib1funcs.asm b/contrib/gcc/config/arm/lib1funcs.asm index 9245b3ca0c0d..c29f89496cf2 100644 --- a/contrib/gcc/config/arm/lib1funcs.asm +++ b/contrib/gcc/config/arm/lib1funcs.asm @@ -980,8 +980,6 @@ LSYM(Lover12): RET - FUNC_END aeabi_ldiv0 - FUNC_END aeabi_idiv0 FUNC_END div0 #endif /* L_divmodsi_tools */ diff --git a/contrib/gcc/config/arm/libunwind.S b/contrib/gcc/config/arm/libunwind.S index 81e4236f6970..8b1e2f3722e4 100644 --- a/contrib/gcc/config/arm/libunwind.S +++ b/contrib/gcc/config/arm/libunwind.S @@ -26,6 +26,13 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + +/* Allow the use of VFP instructions */ +#if __ARM_ARCH >= 7 +.fpu vfp +#endif + #ifndef __symbian__ #include "lib1funcs.asm" @@ -66,14 +73,22 @@ ARM_FUNC_START restore_core_regs ARM_FUNC_START gnu_Unwind_Restore_VFP /* Use the generic coprocessor form so that gas doesn't complain on soft-float targets. */ +#if __ARM_ARCH >= 7 + fldmiax r0, {d0-d15} +#else ldc p11,cr0,[r0],{0x21} /* fldmiax r0, {d0-d15} */ +#endif RET /* Store VFR regsters d0-d15 to the address in r0. */ ARM_FUNC_START gnu_Unwind_Save_VFP /* Use the generic coprocessor form so that gas doesn't complain on soft-float targets. */ +#if __ARM_ARCH >= 7 + fstmiax r0, {d0-d15} +#else stc p11,cr0,[r0],{0x21} /* fstmiax r0, {d0-d15} */ +#endif RET /* Wrappers to save core registers, then call the real routine. */ diff --git a/contrib/gcc/cp/name-lookup.c b/contrib/gcc/cp/name-lookup.c index fa7ae5c88f91..be708b7ca252 100644 --- a/contrib/gcc/cp/name-lookup.c +++ b/contrib/gcc/cp/name-lookup.c @@ -319,35 +319,11 @@ new_class_binding (tree name, tree value, tree type, cxx_scope *scope) cp_class_binding *cb; cxx_binding *binding; - if (VEC_length (cp_class_binding, scope->class_shadowed)) - { - cp_class_binding *old_base; - old_base = VEC_index (cp_class_binding, scope->class_shadowed, 0); - if (VEC_reserve (cp_class_binding, gc, scope->class_shadowed, 1)) - { - /* Fixup the current bindings, as they might have moved. */ - size_t i; - - for (i = 0; - VEC_iterate (cp_class_binding, scope->class_shadowed, i, cb); - i++) - { - cxx_binding **b; - b = &IDENTIFIER_BINDING (cb->identifier); - while (*b != &old_base[i].base) - b = &((*b)->previous); - *b = &cb->base; - } - } - cb = VEC_quick_push (cp_class_binding, scope->class_shadowed, NULL); - } - else cb = VEC_safe_push (cp_class_binding, gc, scope->class_shadowed, NULL); cb->identifier = name; - binding = &cb->base; + cb->base = binding = cxx_binding_make (value, type); binding->scope = scope; - cxx_binding_init (binding, value, type); return binding; } @@ -2501,7 +2477,10 @@ poplevel_class (void) for (i = 0; VEC_iterate (cp_class_binding, level->class_shadowed, i, cb); ++i) - IDENTIFIER_BINDING (cb->identifier) = cb->base.previous; + { + IDENTIFIER_BINDING (cb->identifier) = cb->base->previous; + cxx_binding_free (cb->base); + } ggc_free (level->class_shadowed); level->class_shadowed = NULL; } diff --git a/contrib/gcc/cp/name-lookup.h b/contrib/gcc/cp/name-lookup.h index f604f874a08d..430674720784 100644 --- a/contrib/gcc/cp/name-lookup.h +++ b/contrib/gcc/cp/name-lookup.h @@ -144,7 +144,7 @@ typedef enum tag_scope { typedef struct cp_class_binding GTY(()) { - cxx_binding base; + cxx_binding *base; /* The bound name. */ tree identifier; } cp_class_binding; diff --git a/contrib/libc++/include/type_traits b/contrib/libc++/include/type_traits index 00492b1e87c2..0f31e9371c25 100644 --- a/contrib/libc++/include/type_traits +++ b/contrib/libc++/include/type_traits @@ -439,8 +439,26 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_function // is_member_function_pointer -template struct __libcpp_is_member_function_pointer : public false_type {}; -template struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; +// template struct __libcpp_is_member_function_pointer : public false_type {}; +// template struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; +// + +template +struct __member_pointer_traits_imp +{ // forward declaration; specializations later +}; + + +namespace __libcpp_is_member_function_pointer_imp { + template + char __test(typename std::__member_pointer_traits_imp<_Tp, true, false>::_FnType *); + + template + std::__two __test(...); +}; + +template struct __libcpp_is_member_function_pointer + : public integral_constant(nullptr)) == 1> {}; template struct _LIBCPP_TYPE_VIS_ONLY is_member_function_pointer : public __libcpp_is_member_function_pointer::type> {}; @@ -1593,11 +1611,6 @@ __decay_copy(const _Tp& __t) #endif -template -struct __member_pointer_traits_imp -{ -}; - #ifndef _LIBCPP_HAS_NO_VARIADICS template @@ -1605,6 +1618,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false> { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1612,6 +1626,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const, true, false { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1619,6 +1634,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile, true, fa { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1626,6 +1642,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile, tr { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; #if __has_feature(cxx_reference_qualified_functions) @@ -1635,6 +1652,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &, true, false> { typedef _Class& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1642,6 +1660,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&, true, fals { typedef _Class const& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1649,6 +1668,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&, true, f { typedef _Class volatile& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1656,6 +1676,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&, t { typedef _Class const volatile& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1663,6 +1684,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &&, true, false> { typedef _Class&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1670,6 +1692,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&&, true, fal { typedef _Class const&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1677,6 +1700,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&&, true, { typedef _Class volatile&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1684,6 +1708,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&&, { typedef _Class const volatile&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; #endif // __has_feature(cxx_reference_qualified_functions) @@ -1695,6 +1720,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(), true, false> { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1702,6 +1728,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0), true, false> { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1709,6 +1736,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1), true, false> { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1716,6 +1744,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2), true, false> { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; template @@ -1723,6 +1752,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)() const, true, false> { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1730,6 +1760,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const, true, false> { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1737,6 +1768,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const, true, false> { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1744,6 +1776,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const, true, f { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; template @@ -1751,6 +1784,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)() volatile, true, false> { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1758,6 +1792,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) volatile, true, false> { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1765,6 +1800,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) volatile, true, fal { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1772,6 +1808,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) volatile, true { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; template @@ -1779,6 +1816,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)() const volatile, true, false { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1786,6 +1824,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const volatile, true, fa { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1793,6 +1832,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const volatile, tru { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1800,6 +1840,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const volatile { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; #endif // _LIBCPP_HAS_NO_VARIADICS @@ -1819,6 +1860,7 @@ struct __member_pointer_traits { // typedef ... _ClassType; // typedef ... _ReturnType; +// typedef ... _FnType; }; // result_of @@ -2526,6 +2568,15 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible // is_nothrow_constructible +#if 0 +template +struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible + : public integral_constant +{ +}; + +#else + #ifndef _LIBCPP_HAS_NO_VARIADICS #if __has_feature(cxx_noexcept) @@ -2664,6 +2715,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&, }; #endif // _LIBCPP_HAS_NO_VARIADICS +#endif // __has_feature(is_nothrow_constructible) // is_nothrow_default_constructible diff --git a/contrib/mdocml/INSTALL b/contrib/mdocml/INSTALL index da8eeab9dd4e..31ffaf00c008 100644 --- a/contrib/mdocml/INSTALL +++ b/contrib/mdocml/INSTALL @@ -1,4 +1,4 @@ -$Id: INSTALL,v 1.2 2014/08/10 17:22:26 schwarze Exp $ +$Id: INSTALL,v 1.5 2014/08/18 13:27:47 kristaps Exp $ About mdocml, the portable mandoc distribution ---------------------------------------------- @@ -34,19 +34,52 @@ latest bundled and ported versions of mandoc for various operating systems is maintained at . If mandoc is installed, you can check the version by running "mandoc -V". -The version contained in this distribution tarball is listed near -the beginning of the file "Makefile". +You can find the version contained in this distribution tarball +by running "./configure". Regarding how packages and ports are maintained for your operating system, please consult your operating system documentation. To install mandoc manually, the following steps are needed: -1. Decide whether you want to build the base tools mandoc(1), -preconv(1) and demandoc(1) only or whether you also want to build the -database tools apropos(1) and makewhatis(8). For the latter, -the following dependencies are required: +1. If you want to build the CGI program, man.cgi(8), too, run the +command "echo BUILD_CGI=1 > configure.local". Then run "cp +cgi.h.examples cgi.h" and edit cgi.h as desired. -1.1. The SQLite database system, see . +2. Run "./configure". +This script attempts autoconfiguration of mandoc for your system. +Read both its standard output and the file "Makefile.local" it +generates. If anything looks wrong or different from what you +wish, read the file "configure.local.example", create and edit +a file "configure.local", and re-run "./configure" until the +result seems right to you. + +3. Run "make". +Any POSIX-compatible make, in particular both BSD make and GNU make, +should work. If the build fails, look at "configure.local.example" +and go back to step 2. + +4. Run "make -n install" and check whether everything will be +installed to the intended places. Otherwise, put some *DIR variables +into "configure.local" and go back to step 2. + +5. Run "sudo make install". If you intend to build a binary +package using some kind of fake root mechanism, you may need a +command like "make DESTDIR=... install". Read the *-install targets +in the "Makefile" to understand how DESTDIR is used. + +6. To set up a man.cgi(8) server, read its manual page. + +7. To use mandoc(1) as your man(1) formatter, read the "Deployment" +section below. + + +Understanding mandoc dependencies +--------------------------------- +The mandoc(1), preconv(1), and demandoc(1) utilities have no external +dependencies. However, makewhatis(8) and apropos(1) depend on the +following software: + +1. The SQLite database system, see . The recommended version of SQLite is 3.8.4.3 or newer. The mandoc toolset is known to work with version 3.7.5 or newer. Versions older than 3.8.3 may not achieve full performance due to the @@ -57,47 +90,16 @@ problems, apropos(1) is fully usable with SQLite 3.7.5. Versions older than 3.7.5 may or may not work, they have not been tested. 1.2. The fts(3) directory traversion functions. -A compatibility version will be bundled for 1.13.2 but is not available -yet. If you want apropos(1) and makewhatis(8) but do not have fts(3), -please stay with mandoc 1.12.3 for now and upgrade first to 1.12.4, -then to 1.13.2 when these versionns are released. Be careful: the +If your system does not have them, the bundled compatibility version +will be used, so you need not worry in that case. But be careful: the glibc version of fts(3) is known to be broken on 32bit platforms, see . +If you run into that problem, set "HAVE_FTS=0" in configure.local. 1.3. Marc Espie's ohash(3) library. If your system does not have it, the bundled compatibility version will be used, so you probably need not worry about it. -2. If you choose to build the database tools, too, decide whether -you also want to build the CGI program, man.cgi(8). - -3. Read the beginning of the file "Makefile" from "USER SETTINGS" -to "END OF USER SETTINGS" and edit it as required. In particular, -disable "BUILD_TARGETS += db-build" if you do not want database -support or enable "BUILD_TARGETS += cgi-build" if you do want -the CGI program. - -4. Run "make". No separate "./configure" or "make depend" steps -are needed. The former is run automatically by "make". The latter -is a maintainer target. If you merely want to build the released -version as opposed to doing active development, there is no need -to regenerate the dependency specifications. Any POSIX-compatible -make, in particular both BSD make and GNU make, should work. - -5. Run "make -n install" and check whether everything will be -installed to the intended places. Otherwise, edit the *DIR variables -in the Makefile until it is. - -6. Run "sudo make install". If you intend to build a binary -package using some kind of fake root mechanism, you may need a -command like "make DESTDIR=... install". Read the *-install targets -in the "Makefile" to understand how DESTDIR is used. - -7. To set up a man.cgi(8) server, read its manual page. - -8. To use mandoc(1) as your man(1) formatter, read the "Deployment" -section below. - Checking autoconfiguration quality ---------------------------------- @@ -130,9 +132,9 @@ please report whatever is missing on your platform. The following steps can be used to manually check the automatic configuration on your platform: -1. Run "make clean". +1. Run "make distclean". -2. Run "make config.h" +2. Run "./configure" 3. Read the file "config.log". It shows the compiler commands used to test the libraries installed on your system and the standard @@ -140,8 +142,7 @@ output and standard error output these commands produce. Watch out for unexpected failures. Those are most likely to happen if headers or libraries are installed in unusual places or interfaces defined in unusual headers. You can also look at the file "config.h" and -check that no expected "#define HAVE_*" lines are missing. The -list of tests run can be found in the file "configure". +check that no "#define HAVE_*" differ from your expectations. Deployment diff --git a/contrib/mdocml/LICENSE b/contrib/mdocml/LICENSE index 35072fb2d1ba..db26171c9de9 100644 --- a/contrib/mdocml/LICENSE +++ b/contrib/mdocml/LICENSE @@ -1,4 +1,4 @@ -$Id: LICENSE,v 1.2 2014/04/23 21:06:41 schwarze Exp $ +$Id: LICENSE,v 1.4 2014/08/21 00:42:38 schwarze Exp $ With the exceptions noted below, all code and documentation contained in the mdocml toolkit is protected by the Copyright @@ -37,8 +37,10 @@ The following files included from outside sources are protected by other people's Copyright and are distributed under a 3-clause BSD license; see these individual files for details. -compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c: -Copyright (c) 1990, 1993 The Regents of the University of California +compat_fts.c, compat_fts.h, +compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c, +man.1: +Copyright (c) 1989,1990,1993,1994 The Regents of the University of California compat_fgetln.c: Copyright (c) 1998 The NetBSD Foundation, Inc. diff --git a/contrib/mdocml/Makefile b/contrib/mdocml/Makefile index 47f37a7dffc9..a8255fecc824 100644 --- a/contrib/mdocml/Makefile +++ b/contrib/mdocml/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.435 2014/08/10 02:45:04 schwarze Exp $ +# $Id: Makefile,v 1.448 2014/11/28 18:57:31 schwarze Exp $ # # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons # Copyright (c) 2011, 2013, 2014 Ingo Schwarze @@ -15,126 +15,31 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -VERSION = 1.13.1 - -# === USER SETTINGS ==================================================== - -# --- user settings relevant for all builds ---------------------------- - -# Specify this if you want to hard-code the operating system to appear -# in the lower-left hand corner of -mdoc manuals. -# -# CFLAGS += -DOSNAME="\"OpenBSD 5.5\"" - -# IFF your system supports multi-byte functions (setlocale(), wcwidth(), -# putwchar()) AND has __STDC_ISO_10646__ (that is, wchar_t is simply a -# UCS-4 value) should you define USE_WCHAR. If you define it and your -# system DOESN'T support this, -Tlocale will produce garbage. -# If you don't define it, -Tlocale is a synonym for -Tacsii. -# -CFLAGS += -DUSE_WCHAR - -CFLAGS += -g -DHAVE_CONFIG_H -CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings -PREFIX = /usr/local -BINDIR = $(PREFIX)/bin -INCLUDEDIR = $(PREFIX)/include/mandoc -LIBDIR = $(PREFIX)/lib/mandoc -MANDIR = $(PREFIX)/man -EXAMPLEDIR = $(PREFIX)/share/examples/mandoc - -INSTALL = install -INSTALL_PROGRAM = $(INSTALL) -m 0555 -INSTALL_DATA = $(INSTALL) -m 0444 -INSTALL_LIB = $(INSTALL) -m 0444 -INSTALL_SOURCE = $(INSTALL) -m 0644 -INSTALL_MAN = $(INSTALL_DATA) - -# --- user settings related to database support ------------------------ - -# Building apropos(1) and makewhatis(8) requires both SQLite3 and fts(3). -# To avoid those dependencies, comment the following line. -# Be careful: the fts(3) implementation in glibc is broken on 32bit -# machines, see: https://sourceware.org/bugzilla/show_bug.cgi?id=15838 -# -BUILD_TARGETS += db-build - -# The remaining settings in this section -# are only relevant if db-build is enabled. -# Otherwise, they have no effect either way. - -# If your system has manpath(1), uncomment this. This is most any -# system that's not OpenBSD or NetBSD. If uncommented, apropos(1) -# and makewhatis(8) will use manpath(1) to get the MANPATH variable. -# -#CFLAGS += -DUSE_MANPATH - -# On some systems, SQLite3 may be installed below /usr/local. -# In that case, uncomment the following two lines. -# -#CFLAGS += -I/usr/local/include -#DBLIB += -L/usr/local/lib - -# OpenBSD has the ohash functions in libutil. -# Comment the following line if your system doesn't. -# -DBLIB += -lutil - -SBINDIR = $(PREFIX)/sbin - -# --- user settings related to man.cgi --------------------------------- - -# To build man.cgi, copy cgi.h.example to cgi.h, edit it, -# and enable the following line. -# Obviously, this requires that db-build is enabled, too. -# -#BUILD_TARGETS += cgi-build - -# The remaining settings in this section -# are only relevant if cgi-build is enabled. -# Otherwise, they have no effect either way. - -# If your system does not support static binaries, comment this, -# for example on Mac OS X. -# -STATIC = -static - -# Linux requires -pthread for statical linking. -# -#STATIC += -pthread - -WWWPREFIX = /var/www -HTDOCDIR = $(WWWPREFIX)/htdocs -CGIBINDIR = $(WWWPREFIX)/cgi-bin - -# === END OF USER SETTINGS ============================================= - -INSTALL_TARGETS = $(BUILD_TARGETS:-build=-install) - -BASEBIN = mandoc preconv demandoc -DBBIN = apropos makewhatis +BASEBIN = mandoc demandoc +DBBIN = makewhatis CGIBIN = man.cgi -DBLIB += -lsqlite3 - -TESTSRCS = test-fgetln.c \ +TESTSRCS = test-dirent-namlen.c \ + test-fgetln.c \ + test-fts.c \ test-getsubopt.c \ test-mmap.c \ test-ohash.c \ test-reallocarray.c \ + test-sqlite3.c \ test-sqlite3_errstr.c \ test-strcasestr.c \ test-strlcat.c \ test-strlcpy.c \ test-strptime.c \ - test-strsep.c + test-strsep.c \ + test-wchar.c -SRCS = apropos.c \ - arch.c \ - att.c \ +SRCS = att.c \ cgi.c \ chars.c \ compat_fgetln.c \ + compat_fts.c \ compat_getsubopt.c \ compat_ohash.c \ compat_reallocarray.c \ @@ -187,7 +92,6 @@ SRCS = apropos.c \ term_ascii.c \ term_ps.c \ tree.c \ - vol.c \ $(TESTSRCS) DISTFILES = INSTALL \ @@ -197,14 +101,12 @@ DISTFILES = INSTALL \ NEWS \ TODO \ apropos.1 \ - arch.in \ - att.in \ cgi.h.example \ chars.in \ + compat_fts.h \ compat_ohash.h \ - config.h.post \ - config.h.pre \ configure \ + configure.local.example \ demandoc.1 \ eqn.7 \ example.style.css \ @@ -218,6 +120,7 @@ DISTFILES = INSTALL \ main.h \ makewhatis.8 \ man-cgi.css \ + man.1 \ man.7 \ man.cgi.8 \ man.h \ @@ -238,7 +141,6 @@ DISTFILES = INSTALL \ mdoc.h \ msec.in \ out.h \ - preconv.1 \ predefs.in \ roff.7 \ st.in \ @@ -246,7 +148,6 @@ DISTFILES = INSTALL \ tbl.3 \ tbl.7 \ term.h \ - vol.in \ $(SRCS) LIBMAN_OBJS = man.o \ @@ -254,16 +155,14 @@ LIBMAN_OBJS = man.o \ man_macro.o \ man_validate.o -LIBMDOC_OBJS = arch.o \ - att.o \ +LIBMDOC_OBJS = att.o \ lib.o \ mdoc.o \ mdoc_argv.o \ mdoc_hash.o \ mdoc_macro.o \ mdoc_validate.o \ - st.o \ - vol.o + st.o LIBROFF_OBJS = eqn.o \ roff.o \ @@ -279,9 +178,11 @@ LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ mandoc.o \ mandoc_aux.o \ msec.o \ + preconv.o \ read.o COMPAT_OBJS = compat_fgetln.o \ + compat_fts.o \ compat_getsubopt.o \ compat_ohash.o \ compat_reallocarray.o \ @@ -314,11 +215,11 @@ MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ out.o \ tree.o +MAN_OBJS = $(MANDOC_OBJS) + MAKEWHATIS_OBJS = mandocdb.o mansearch_const.o manpath.o -PRECONV_OBJS = preconv.o - -APROPOS_OBJS = apropos.o mansearch.o mansearch_const.o manpath.o +APROPOS_OBJS = mansearch.o mansearch_const.o manpath.o CGI_OBJS = $(MANDOC_HTML_OBJS) \ cgi.o \ @@ -332,8 +233,8 @@ DEMANDOC_OBJS = demandoc.o WWW_MANS = apropos.1.html \ demandoc.1.html \ + man.1.html \ mandoc.1.html \ - preconv.1.html \ mandoc.3.html \ mandoc_escape.3.html \ mandoc_html.3.html \ @@ -360,9 +261,13 @@ WWW_MANS = apropos.1.html \ WWW_OBJS = mdocml.tar.gz \ mdocml.sha256 +include Makefile.local + +INSTALL_TARGETS = $(BUILD_TARGETS:-build=-install) + # === DEPENDENCY HANDLING ============================================== -all: base-build $(BUILD_TARGETS) +all: base-build $(BUILD_TARGETS) Makefile.local base-build: $(BASEBIN) @@ -374,20 +279,22 @@ install: base-install $(INSTALL_TARGETS) www: $(WWW_OBJS) $(WWW_MANS) +$(WWW_MANS): mandoc + include Makefile.depend # === TARGETS CONTAINING SHELL COMMANDS ================================ +distclean: clean + rm -f Makefile.local config.h config.h.old config.log config.log.old + clean: - rm -f libmandoc.a $(LIBMANDOC_OBJS) - rm -f apropos $(APROPOS_OBJS) + rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS) + rm -f mandoc $(MANDOC_OBJS) $(APROPOS_OBJS) rm -f makewhatis $(MAKEWHATIS_OBJS) - rm -f preconv $(PRECONV_OBJS) rm -f man.cgi $(CGI_OBJS) rm -f manpage $(MANPAGE_OBJS) rm -f demandoc $(DEMANDOC_OBJS) - rm -f mandoc $(MANDOC_OBJS) - rm -f config.h config.log $(COMPAT_OBJS) rm -f $(WWW_MANS) $(WWW_OBJS) rm -rf *.dSYM @@ -403,7 +310,8 @@ base-install: base-build $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h \ $(DESTDIR)$(INCLUDEDIR) - $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) man.1 mandoc.1 demandoc.1 \ + $(DESTDIR)$(MANDIR)/man1 $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 \ @@ -417,8 +325,8 @@ db-install: db-build mkdir -p $(DESTDIR)$(MANDIR)/man3 mkdir -p $(DESTDIR)$(MANDIR)/man5 mkdir -p $(DESTDIR)$(MANDIR)/man8 - $(INSTALL_PROGRAM) apropos $(DESTDIR)$(BINDIR) - ln -f $(DESTDIR)$(BINDIR)/apropos $(DESTDIR)$(BINDIR)/whatis + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/apropos + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/whatis $(INSTALL_PROGRAM) makewhatis $(DESTDIR)$(SBINDIR) $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1 ln -f $(DESTDIR)$(MANDIR)/man1/apropos.1 \ @@ -447,30 +355,29 @@ www-install: www $(INSTALL_DATA) mdocml.sha256 \ $(DESTDIR)$(HTDOCDIR)/snapshots/mdocml-$(VERSION).sha256 +Makefile.local config.h: configure ${TESTSRCS} + @echo "$@ is out of date; please run ./configure" + @exit 1 + depend: config.h mkdep -f Makefile.depend $(CFLAGS) $(SRCS) perl -e 'undef $$/; $$_ = <>; s|/usr/include/\S+||g; \ - s|\\\n||g; s| +| |g; print;' Makefile.depend > Makefile.tmp + s|\\\n||g; s| +| |g; s| $$||mg; print;' \ + Makefile.depend > Makefile.tmp mv Makefile.tmp Makefile.depend libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) -mandoc: $(MANDOC_OBJS) libmandoc.a - $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a +mandoc: $(MAN_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MAN_OBJS) libmandoc.a $(DBLIB) makewhatis: $(MAKEWHATIS_OBJS) libmandoc.a $(CC) $(LDFLAGS) -o $@ $(MAKEWHATIS_OBJS) libmandoc.a $(DBLIB) -preconv: $(PRECONV_OBJS) - $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS) - manpage: $(MANPAGE_OBJS) libmandoc.a $(CC) $(LDFLAGS) -o $@ $(MANPAGE_OBJS) libmandoc.a $(DBLIB) -apropos: $(APROPOS_OBJS) libmandoc.a - $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) - man.cgi: $(CGI_OBJS) libmandoc.a $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) @@ -482,18 +389,13 @@ mdocml.sha256: mdocml.tar.gz mdocml.tar.gz: $(DISTFILES) mkdir -p .dist/mdocml-$(VERSION)/ - $(INSTALL_SOURCE) $(DISTFILES) .dist/mdocml-$(VERSION) + $(INSTALL) -m 0644 $(DISTFILES) .dist/mdocml-$(VERSION) chmod 755 .dist/mdocml-$(VERSION)/configure ( cd .dist/ && tar zcf ../$@ mdocml-$(VERSION) ) rm -rf .dist/ -config.h: configure config.h.pre config.h.post $(TESTSRCS) - rm -f config.log - CC="$(CC)" CFLAGS="$(CFLAGS)" DBLIB="$(DBLIB)" \ - VERSION="$(VERSION)" ./configure - .PHONY: base-install cgi-install db-install install www-install -.PHONY: clean depend +.PHONY: clean distclean depend .SUFFIXES: .1 .3 .5 .7 .8 .h .SUFFIXES: .1.html .3.html .5.html .7.html .8.html .h.html diff --git a/contrib/mdocml/Makefile.depend b/contrib/mdocml/Makefile.depend index dc49310e5222..d3c13e09cf5e 100644 --- a/contrib/mdocml/Makefile.depend +++ b/contrib/mdocml/Makefile.depend @@ -1,24 +1,23 @@ -apropos.o: apropos.c config.h manpath.h mansearch.h -arch.o: arch.c config.h mdoc.h libmdoc.h arch.in -att.o: att.c config.h mdoc.h libmdoc.h att.in +att.o: att.c config.h mdoc.h libmdoc.h cgi.o: cgi.c config.h mandoc.h mandoc_aux.h main.h manpath.h mansearch.h cgi.h chars.o: chars.c config.h mandoc.h mandoc_aux.h libmandoc.h chars.in -compat_fgetln.o: compat_fgetln.c config.h -compat_getsubopt.o: compat_getsubopt.c config.h -compat_ohash.o: compat_ohash.c config.h -compat_reallocarray.o: compat_reallocarray.c config.h -compat_sqlite3_errstr.o: compat_sqlite3_errstr.c config.h -compat_strcasestr.o: compat_strcasestr.c config.h -compat_strlcat.o: compat_strlcat.c config.h -compat_strlcpy.o: compat_strlcpy.c config.h -compat_strsep.o: compat_strsep.c config.h +compat_fgetln.o: compat_fgetln.c config.h +compat_fts.o: compat_fts.c config.h compat_fts.h +compat_getsubopt.o: compat_getsubopt.c config.h +compat_ohash.o: compat_ohash.c config.h compat_ohash.h +compat_reallocarray.o: compat_reallocarray.c config.h +compat_sqlite3_errstr.o: compat_sqlite3_errstr.c config.h +compat_strcasestr.o: compat_strcasestr.c config.h +compat_strlcat.o: compat_strlcat.c config.h +compat_strlcpy.o: compat_strlcpy.c config.h +compat_strsep.o: compat_strsep.c config.h demandoc.o: demandoc.c config.h man.h mdoc.h mandoc.h eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h eqn_term.o: eqn_term.c config.h mandoc.h out.h term.h html.o: html.c config.h mandoc.h mandoc_aux.h libmandoc.h out.h html.h main.h lib.o: lib.c config.h mdoc.h libmdoc.h lib.in -main.o: main.c config.h mandoc.h mandoc_aux.h main.h mdoc.h man.h +main.o: main.c config.h mandoc.h mandoc_aux.h main.h mdoc.h man.h manpath.h mansearch.h man.o: man.c config.h man.h mandoc.h mandoc_aux.h libman.h libmandoc.h man_hash.o: man_hash.c config.h man.h mandoc.h libman.h man_html.o: man_html.c config.h mandoc.h mandoc_aux.h out.h html.h man.h main.h @@ -27,10 +26,10 @@ man_term.o: man_term.c config.h mandoc.h mandoc_aux.h out.h man.h term.h main.h man_validate.o: man_validate.c config.h man.h mandoc.h mandoc_aux.h libman.h libmandoc.h mandoc.o: mandoc.c config.h mandoc.h mandoc_aux.h libmandoc.h mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h -mandocdb.o: mandocdb.c config.h mdoc.h man.h mandoc.h mandoc_aux.h manpath.h mansearch.h +mandocdb.o: mandocdb.c config.h compat_fts.h compat_ohash.h mdoc.h man.h mandoc.h mandoc_aux.h manpath.h mansearch.h manpage.o: manpage.c config.h manpath.h mansearch.h manpath.o: manpath.c config.h mandoc_aux.h manpath.h -mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h manpath.h mansearch.h +mansearch.o: mansearch.c config.h compat_ohash.h mandoc.h mandoc_aux.h manpath.h mansearch.h mansearch_const.o: mansearch_const.c config.h manpath.h mansearch.h mdoc.o: mdoc.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h mdoc_argv.o: mdoc_argv.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h @@ -42,9 +41,9 @@ mdoc_term.o: mdoc_term.c config.h mandoc.h mandoc_aux.h out.h term.h mdoc.h main mdoc_validate.o: mdoc_validate.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h msec.o: msec.c config.h mandoc.h libmandoc.h msec.in out.o: out.c config.h mandoc_aux.h mandoc.h out.h -preconv.o: preconv.c config.h +preconv.o: preconv.c config.h mandoc.h libmandoc.h read.o: read.c config.h mandoc.h mandoc_aux.h libmandoc.h mdoc.h man.h main.h -roff.o: roff.c config.h mandoc.h mandoc_aux.h libroff.h libmandoc.h predefs.in +roff.o: roff.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h predefs.in st.o: st.c config.h mdoc.h libmdoc.h st.in tbl.o: tbl.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h tbl_data.o: tbl_data.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h @@ -56,15 +55,18 @@ term.o: term.c config.h mandoc.h mandoc_aux.h out.h term.h main.h term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h main.h term_ps.o: term_ps.c config.h mandoc.h mandoc_aux.h out.h main.h term.h tree.o: tree.c config.h mandoc.h mdoc.h man.h main.h -vol.o: vol.c config.h mdoc.h libmdoc.h vol.in -test-fgetln.o: test-fgetln.c -test-getsubopt.o: test-getsubopt.c -test-mmap.o: test-mmap.c -test-ohash.o: test-ohash.c -test-reallocarray.o: test-reallocarray.c -test-sqlite3_errstr.o: test-sqlite3_errstr.c -test-strcasestr.o: test-strcasestr.c -test-strlcat.o: test-strlcat.c -test-strlcpy.o: test-strlcpy.c -test-strptime.o: test-strptime.c -test-strsep.o: test-strsep.c +test-dirent-namlen.o: test-dirent-namlen.c +test-fgetln.o: test-fgetln.c +test-fts.o: test-fts.c +test-getsubopt.o: test-getsubopt.c +test-mmap.o: test-mmap.c +test-ohash.o: test-ohash.c +test-reallocarray.o: test-reallocarray.c +test-sqlite3.o: test-sqlite3.c +test-sqlite3_errstr.o: test-sqlite3_errstr.c +test-strcasestr.o: test-strcasestr.c +test-strlcat.o: test-strlcat.c +test-strlcpy.o: test-strlcpy.c +test-strptime.o: test-strptime.c +test-strsep.o: test-strsep.c +test-wchar.o: test-wchar.c diff --git a/contrib/mdocml/NEWS b/contrib/mdocml/NEWS index 61006b5ee117..f47a807dadc5 100644 --- a/contrib/mdocml/NEWS +++ b/contrib/mdocml/NEWS @@ -1,4 +1,4 @@ -$Id: NEWS,v 1.5 2014/08/10 16:32:57 schwarze Exp $ +$Id: NEWS,v 1.6 2014/08/11 01:39:00 schwarze Exp $ This file lists the most important changes in the mdocml.bsd.lv distribution. @@ -7,9 +7,6 @@ Changes in version 1.13.1, released on August 10, 2014 --- MAJOR NEW FEATURES --- * A complete apropos(1)/makewhatis(8)/man.cgi(8) suite based on SQLite3 is now included. - CAVEAT: This also requires a working fts(3) implementation. - If your system lacks that *and* you want apropos(1)/makewhatis(8), - stay with 1.12.3 for now, then go to 1.12.4 and 1.13.2. * The roff(7) parser now provides an almost complete implementation of numerical expressions. * Warning and error messages have been improved in many ways. diff --git a/contrib/mdocml/TODO b/contrib/mdocml/TODO index a41df2988270..98cb687eaa2b 100644 --- a/contrib/mdocml/TODO +++ b/contrib/mdocml/TODO @@ -1,8 +1,37 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.176 2014/08/09 14:24:53 schwarze Exp $ +* $Id: TODO,v 1.189 2014/11/26 21:40:17 schwarze Exp $ ************************************************************************ +Many issues are annotated for difficulty as follows: + + - loc = locality of the issue + * single file issue, affects file only, or very few + ** single module issue, affects several files of one module + *** cross-module issue, significantly impacts multiple modules + and may require substantial changes to internal interfaces + - exist = difficulty of the existing code in this area + * affected code is straightforward and easy to read and change + ** affected code is somewhat complex, but once you understand + the design, not particularly difficult to understand + *** affected code uses a special, exceptionally tricky design + - algo = difficulty of the new algorithm to be written + * the required logic and code is straightforward + ** the required logic is somewhat complex and needs a careful design + *** the required logic is exceptionally tricky, + maybe an approach to solve that is not even known yet + - size = the amount of code to be written or changed + * a small number of lines (at most 100, usually much less) + ** a considerable amount of code (several dozen to a few hundred) + *** a large amount of code (many hundreds, maybe thousands) + - imp = importance of the issue + * mostly for completeness + ** would be nice to have + *** issue causes considerable inconvenience + +Obviously, as the issues have not been solved yet, these annotations +are mere guesses, and some may be wrong. + ************************************************************************ * crashes ************************************************************************ @@ -10,6 +39,7 @@ - The abort() in bufcat(), html.c, can be triggered via buffmt_includes() by running -Thtml -Oincludes on a file containing a long .In argument. Fixing this will probably require reworking the whole bufcat() concept. + loc ** exist * algo * size ** imp ** ************************************************************************ * missing features @@ -25,49 +55,62 @@ .na -- temporarily disable adjustment without changing the mode .ad -- re-enable adjustment without changing the mode Adjustment mode is ignored while in no-fill mode (.nf). + loc *** exist *** algo ** size ** imp ** (parser reorg would help) - .fc (field control) found by naddy@ in xloadimage(1) + loc ** exist *** algo * size * imp * - .nr third argument (auto-increment step size, requires \n+) found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 + loc * exist * algo * size * imp ** - .ns (no-space mode) occurs in xine-config(1) reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + loc *** exist *** algo *** size ** imp * - .ta (tab settings) occurs in ircbug(1) and probably gnats(1) reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 also Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 + loc ** exist *** algo ** size ** imp ** - .ti (temporary indent) found by naddy@ in xloadimage(1) found by bentley@ in nmh(1) Mon, 23 Apr 2012 13:38:28 -0600 + loc ** exist ** algo ** size * imp ** (parser reorg helps a lot) - .while and .shift found by jca@ in ratpoison(1) Sun, 30 Jun 2013 12:01:09 +0200 + loc * exist ** algo ** size ** imp ** - \c (interrupted text) should prevent the line break even inside .Bd literal; that occurs in chat(8) also found in cclive(1) - DocBook output + loc ** exist *** algo ** size * imp * - \h horizontal move found in cclive(1) DocBook output Anthony J. Bentley on discuss@ Sat, 21 Sep 2013 22:29:34 -0600 + loc ** exist ** algo ** size * imp ** (parser reorg helps a lot) - \n+ and \n- numerical register increment and decrement found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 + loc * exist * algo * size * imp ** -- \w'' width measurements +- \w'' improve width measurements would not be very useful without an expression parser, see below needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 + loc ** exist *** algo *** size * imp *** - using undefined strings or macros defines them to be empty wl@ Mon, 14 Nov 2011 14:37:01 +0000 + loc * exist * algo * size * imp * --- missing mdoc features ---------------------------------------------- - fix bad block nesting involving multiple identical explicit blocks see the OpenBSD mdoc_macro.c 1.47 commit message + loc * exist *** algo *** size * imp ** - .Bl -column .Xo support is missing ultimate goal: @@ -75,10 +118,12 @@ lib/libc/compat-43/sigvec.3 lib/libc/gen/signal.3 lib/libc/sys/sigaction.2 + loc * exist *** algo *** size * imp ** - edge case: decide how to deal with blk_full bad nesting, e.g. .Sh .Nm .Bk .Nm .Ek .Sh found by jmc@ in ssh-keygen(1) from jmc@ Wed, 14 Jul 2010 18:10:32 +0100 + loc * exist *** algo *** size ** imp ** - \\ is now implemented correctly * when defining strings and macros using .ds and .de @@ -92,18 +137,22 @@ we don't have either. Besides, groff has bug causing text right *before* .Bd -centered to be centered as well. + loc *** exist *** algo ** size ** imp ** (parser reorg would help) - .Bd -filled should not be the same as .Bd -ragged, but align both the left and right margin. In groff, it is implemented in terms of .ad b, which we don't have either. Found in cksum(1). + loc *** exist *** algo ** size ** imp ** (parser reorg would help) - implement blank `Bl -column', such as .Bl -column .It foo Ta bar .El + loc * exist *** algo *** size * imp * - explicitly disallow nested `Bl -column', which would clobber internal flags defined for struct mdoc_macro + loc * exist * algo * size * imp ** - In .Bl -column .It, the end of the line probably has to be regarded as an implicit .Ta, if there could be one, see the following mildly @@ -114,6 +163,7 @@ Default search path. reported by Michal Mazurek via jmc@ Thu, 7 Apr 2011 16:00:53 +0059 + loc * exist *** algo ** size * imp ** - inside `.Bl -column' phrases, punctuation is handled like normal text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -." @@ -123,11 +173,14 @@ but should give "ab ." - set a meaningful default if no `Bl' list type is assigned + loc * exist * algo * size * imp ** (already done?) - have a blank `It' head for `Bl -tag' not puke + loc * exist * algo * size * imp ** (already done?) - check whether it is correct that `D1' uses INDENT+1; does it need its own constant? + loc * exist ** algo ** size * imp ** - prohibit `Nm' from having non-text HEAD children (e.g., NetBSD mDNSShared/dns-sd.1) @@ -138,6 +191,7 @@ that one uses NOMBRE because it is spanish... deraadt tends to think that section-dependent macro behaviour is a bad idea in the first place, so this may be irrelevant + loc ** exist ** algo ** size * imp ** - When there is free text in the SYNOPSIS and that free text contains the .Nm macro, groff somehow understands to treat the .Nm as an in-line @@ -146,6 +200,7 @@ should be, needs investigation. uqs@ Thu, 2 Jun 2011 11:03:51 +0200 uqs@ Thu, 2 Jun 2011 11:33:35 +0200 + loc * exist ** algo *** size * imp ** --- missing man features ----------------------------------------------- @@ -155,18 +210,36 @@ - look at the POSIX manuals in the books/man-pages-posix port, they use some unsupported tbl(7) features. + loc * exist ** algo ** size ** imp *** -- investigate tbl(1) errors in sox(1) - see also naddy@ Sat, 16 Oct 2010 23:51:57 +0200 +- use Unicode U+2500 to U+256C for table borders + in tbl(7) -Tutf-8 output + suggested by bentley@ Tue, 14 Oct 2014 04:10:55 -0600 + loc * exist ** algo * size * imp ** - allow standalone `.' to be interpreted as an end-of-layout delimiter instead of being thrown away as a no-op roff line reported by Yuri Pankov, Wed 18 May 2011 11:34:59 CEST + loc ** exist ** algo ** size * imp ** + +--- missing eqn features ----------------------------------------------- + +- The "size" keyword is parsed, but ignored by the formatter. + loc * exist * algo * size * imp * + +- The spacing characters `~', `^', and tab are currently ignored, + see User's Guide (Second Edition) page 2 section 4. + loc * exist * algo ** size * imp ** + +- Mark and lineup are parsed and ignored, + see User's Guide (Second Edition) page 5 section 15. + loc ** exist ** algo ** size ** imp ** --- missing misc features ---------------------------------------------- - italic correction (\/) in PostScript mode Werner LEMBERG on groff at gnu dot org Sun, 10 Nov 2013 12:47:46 + loc ** exist ** algo * size * imp * - When makewhatis(8) encounters a FATAL parse error, it silently treats the file as formatted, which makes no sense @@ -174,13 +247,16 @@ what the manual says at the end of the description. The end result will be ENOENT for file names returned by mansearch() in manpage.file. + loc * exist * algo * size * imp ** - makewhatis(8) for preformatted pages: parse the section number from the header line and compare to the section number from the directory name + loc * exist * algo * size * imp ** - Does makewhatis(8) detect missing NAME sections, missing names, and missing descriptions in all the file formats? + loc * exist * algo * size * imp *** - clean up escape sequence handling, creating three classes: (1) fully implemented, or parsed and ignored without loss of content @@ -188,8 +264,10 @@ or serious mangling of formatting (e.g. \n) -> ERROR see textproc/mgdiff(1) for nice examples (3) undefined, just output the character -> perhaps WARNING + loc *** exist ** algo ** size ** imp *** (parser reorg helps) - kettenis wants base roff, ms, and me Fri, 1 Jan 2010 22:13:15 +0100 (CET) + loc ** exist ** algo ** size *** imp * --- compatibility checks ----------------------------------------------- @@ -199,6 +277,10 @@ - compare output to Heirloom roff, Solaris roff, and http://repo.or.cz/w/neatroff.git http://litcave.rudi.ir/ +- look at AT&T DWB http://www2.research.att.com/sw/download + Carsten Kunze has patches + Mon, 4 Aug 2014 17:01:28 +0200 + - look at pages generated from reStructeredText, e.g. devel/mercurial hg(1) These are a weird mixture of man(7) and custom autogenerated low-level roff stuff. Figure out to what extent we can cope. @@ -224,6 +306,11 @@ - check compatibility with the man(7) formatter https://raw.githubusercontent.com/rofl0r/hardcore-utils/master/man.c +- check compatibility with + http://ikiwiki.info/plugins/contrib/mandoc/ + https://github.com/schmonz/ikiwiki/compare/mandoc + Amitai Schlair Mon, 19 May 2014 14:05:53 -0400 + ************************************************************************ * formatting issues: ugly output ************************************************************************ @@ -236,10 +323,12 @@ ought to render "Key Length" with emphasis, too, see OpenBSD iked.conf(5). reported again Nicolas Joly via wiz@ Wed, 12 Oct 2011 00:20:00 +0200 + loc * exist *** algo *** size ** imp *** - empty phrases in .Bl column produce too few blanks try e.g. .Bl -column It Ta Ta reported by millert Fri, 02 Apr 2010 16:13:46 -0400 + loc * exist *** algo *** size * imp ** - .%T can have trailing punctuation. Currently, it puts the trailing punctuation into a trailing MDOC_TEXT element inside its own scope. @@ -249,11 +338,13 @@ slurp all arguments into one single text element - and one feature of in_line() - put trailing punctuation out of scope. Found in mount_nfs(8) and exports(5), search for "Appendix". + loc ** exist ** algo *** size * imp ** - Trailing punctuation after .%T triggers EOS spacing, at least outside .Rs (eek!). Simply setting ARGSFL_DELIM for .%T is not the right solution, it sends mandoc into an endless loop. reported by Nicolas Joly Sat, 17 Nov 2012 11:49:54 +0100 + loc * exist ** algo ** size * imp ** - global variables in the SYNOPSIS of section 3 pages .Vt vs .Vt/.Va vs .Ft/.Va vs .Ft/.Fa ... @@ -261,6 +352,7 @@ - in enclosures, mandoc sometimes fancies a bogus end of sentence reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059 + loc * exist ** algo *** size * imp *** - formatting /usr/local/man/man1/latex2man.1 with groff and mandoc reveals lots of bugs both in groff and mandoc... @@ -273,6 +365,10 @@ Search the text "Routing tables". Also check what PostScript mode does when fixing this. reported by juanfra@ Wed, 04 Jun 2014 21:44:58 +0200 + instructions from juanfra@ Wed, 11 Jun 2014 02:21:01 +0200 + add a new <> block to the PDF files with /BaseFont /Courier + and change the /Name from /F0 to the new font (/F5 (?)). + loc * exist ** algo ** size * imp ** --- HTML issues -------------------------------------------------------- @@ -280,6 +376,20 @@ hints are easy to find on the web, e.g. http://stackoverflow.com/questions/1713048/ see also matthew@ Fri, 18 Jul 2014 19:25:12 -0700 + loc * exist * algo ** size * imp *** + +- jsg on icb, Nov 3, 2014: + try to guess Xr in man(7) for hyperlinking + +- The tables used to render the three-part page headers actually force + the width of the to the max-width given for . + Not yet sure how to fix that... + Observed by an Anonymous Coward on undeadly.org: + http://undeadly.org/cgi?action=article&sid=20140925064244&pid=1 + loc * exist * algo ** size * imp *** + +- consider whether can be used for Ar Dv Er Ev Fa Va. + from bentley@ Wed, 13 Aug 2014 09:17:55 -0600 - check https://github.com/trentm/mdocml @@ -287,42 +397,57 @@ * formatting issues: gratuitous differences ************************************************************************ +- .Fn reopens a new scope after punctuation in mandoc, + but closes its scope for good in groff. + Do we want to change mandoc or groff? + Steffen Nurpmeso Sat, 08 Nov 2014 13:34:59 +0100 + loc * exist ** algo ** size * imp ** + - .Rv (and probably .Ex) print different text if an `Nm' has been named or not (run a manual without `Nm blah' to see this). I'm not sure that this exists in the wild, but it's still an error. + loc * exist * algo * size * imp * (already done?) - In .Bl -bullet, the groff bullet is "+\b+\bo\bo", the mandoc bullet - is just "o\bo". + is just "o\bo". The problem is to not break ps/pdf when fixing. see for example OpenBSD ksh(1) + loc ** exist ** algo ** size * imp ** - In .Bl -enum -width 0n, groff continues one the same line after the number, mandoc breaks the line. mail to kristaps@ Mon, 20 Jul 2009 02:21:39 +0200 + loc * exist ** algo ** size * imp ** - .Pp between two .It in .Bl -column should produce one, not two blank lines, see e.g. login.conf(5). reported by jmc@ Sun, 17 Apr 2011 14:04:58 +0059 reported again by sthen@ Wed, 18 Jan 2012 02:09:39 +0000 (UTC) + loc * exist *** algo ** size * imp ** - If the *first* line after .It is .Pp, break the line right after the tag, do not pad with space characters before breaking. See the description of the a, c, and i commands in sed(1). + loc * exist ** algo ** size * imp ** - If the first line after .It is .D1, do not assert a blank line in between, see for example tmux(1). reported by nicm@ 13 Jan 2011 00:18:57 +0000 + loc * exist ** algo ** size * imp ** - Trailing punctuation after .It should trigger EOS spacing. reported by Nicolas Joly Sat, 17 Nov 2012 11:49:54 +0100 Probably, this should be fixed somewhere in termp_it_pre(), not sure. + loc * exist ** algo ** size * imp ** - .Nx 1.0a should be "NetBSD 1.0A", not "NetBSD 1.0a", see OpenBSD ccdconfig(8). + loc * exist * algo * size * imp ** - In .Bl -tag, if a tag exceeds the right margin and must be continued on the next line, it must be indented by -width, not width+1; see "rule block|pass" in OpenBSD ifconfig(8). + loc * exist *** algo ** size * imp ** - When the -width string contains macros, the macros must be rendered before measuring the width, for example @@ -332,17 +457,21 @@ The same applies to .Bl -column column widths; reported again by Nicolas Joly Thu, 1 Mar 2012 13:41:26 +0100 via wiz@ 5 Mar reported again by Franco Fichtner Fri, 27 Sep 2013 21:02:28 +0200 + loc *** exist *** algo *** size ** imp *** An easy partial fix would be to just skip the first word if it starts with a dot, including any following white space, when measuring. + loc * exist * algo * size * imp *** - The \& zero-width character counts as output. That is, when it is alone on a line between two .Pp, we want three blank lines, not two as in mandoc. + loc ** exist ** algo ** size * imp ** - Header lines of excessive length: Port OpenBSD man_term.c rev. 1.25 to mdoc_term.c and document it in mdoc(7) and man(7) COMPATIBILITY found while talking to Chris Bennett + loc * exist * algo * size * imp * - trailing whitespace must be ignored even when followed by a font escape, see for example @@ -350,6 +479,7 @@ \fBdig \fR operate in batch mode in dig(1). + loc ** exist ** algo ** size * imp ** ************************************************************************ * warning issues @@ -361,17 +491,29 @@ to refer to fill mode, not literal mode See the mail from Werner LEMBERG on the groff list, Fri, 14 Feb 2014 18:54:42 +0100 (CET) + loc * exist ** algo ** size * imp ** + +- warn about attempts to call non-callable macros + Steffen Nurpmeso Tue, 11 Nov 2014 22:55:16 +0100 + Note that formatting is inconsistent in groff. + .Fn Po prints "Po()", .Ar Sh prints "file ..." and no "Sh". + Relatively hard because the relevant code is scattered + all over mdoc_macro.c and all subtly different. + loc ** exist ** algo ** size ** imp ** - warn about "new sentence, new line" + loc ** exist ** algo *** size * imp ** - mandoc_special does not really check the escape sequence, but just the overall format + loc ** exist ** algo *** size ** imp ** - integrate mdoclint into mandoc ("end-of-line whitespace" thread) from jmc@ Mon, 13 Jul 2009 17:12:09 +0100 from kristaps@ Mon, 13 Jul 2009 18:34:53 +0200 from jmc@ Mon, 13 Jul 2009 17:45:37 +0059 from kristaps@ Mon, 13 Jul 2009 19:02:03 +0200 + (mostly done, check what remains) - -Tlint parser errors and warnings to stdout to tech@mdocml, naddy@ Wed, 28 Sep 2011 11:21:46 +0200 @@ -395,6 +537,9 @@ - mention /usr/share/misc/mdoc.template in mdoc(7)? +- Is all the content from http://www.std.com/obi/BSD/doc/usd/28.tbl/tbl + covered in tbl(7)? + ************************************************************************ * performance issues ************************************************************************ @@ -413,11 +558,15 @@ Several areas can be cleaned up to make mandoc even faster. These are - instead of re-initialising the roff predefined-strings set before each parse, create a read-only version the first time and copy it + loc * exist ** algo ** size * imp ** ************************************************************************ * structural issues ************************************************************************ +- Use libz directly instead of forking gunzip(1). + Suggested by bapt at FreeBSD among others. + - We use the input line number at several places to distinguish same-line from different-line input. That plainly doesn't work with user-defined macros, leading to random breakage. @@ -430,8 +579,25 @@ Several areas can be cleaned up to make mandoc even faster. These are Update both mdoc(7) and man(7) documentation. Triggered by Tim van der Molen Tue, 22 Feb 2011 20:30:45 +0100 +- struct mparse refactoring + Steffen Nurpmeso Thu, 04 Sep 2014 12:50:00 +0200 + - Consider creating some views that will make the database more readable from the sqlite3 shell. Consider using them to abstract from the database structure, too. suggested by espie@ Sat, 19 Apr 2014 14:52:57 +0200 +************************************************************************ +* CGI issues +************************************************************************ + + - Enable HTTP compression by detecting gzip encoding and filtering + output through libz. + - Sandbox (see OpenSSH). + - Enable caching support via HTTP 304 and If-Modified-Since. + - Allow for cgi.h to be overridden by CGI environment variables. + Otherwise, binary distributions will inherit the compile-time + behaviour, which is not optimal. + - Have Mac OSX systems automatically disable -static compilation of the + CGI: -static isn't supported. + diff --git a/contrib/mdocml/apropos.1 b/contrib/mdocml/apropos.1 index 14682420ff00..e2075349f553 100644 --- a/contrib/mdocml/apropos.1 +++ b/contrib/mdocml/apropos.1 @@ -1,4 +1,4 @@ -.\" $Id: apropos.1,v 1.29 2014/04/24 00:28:19 schwarze Exp $ +.\" $Id: apropos.1,v 1.36 2014/10/25 01:03:52 schwarze Exp $ .\" .\" Copyright (c) 2011, 2012 Kristaps Dzonsons .\" Copyright (c) 2011, 2012, 2014 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: April 24 2014 $ +.Dd $Mdocdate: October 25 2014 $ .Dt APROPOS 1 .Os .Sh NAME @@ -24,6 +24,7 @@ .Nd search manual page databases .Sh SYNOPSIS .Nm +.Op Fl acfhklVw .Op Fl C Ar file .Op Fl M Ar path .Op Fl m Ar path @@ -41,7 +42,7 @@ utilities query manual page databases generated by evaluating .Ar expression for each file in each database. -By default, it displays the names, section numbers, and description lines +By default, they display the names, section numbers, and description lines of all matching manuals. .Pp By default, @@ -56,17 +57,82 @@ over manual names and descriptions .Pq the Li \&Nm No and Li \&Nd No macro keys . Multiple terms imply pairwise .Fl o . -.Nm whatis -maps terms only to case-sensitive manual names. .Pp -Its arguments are as follows: +.Nm whatis +is a synonym for +.Nm +.Fl f . +.Pp +The options are as follows: .Bl -tag -width Ds +.It Fl a +Instead of showing only the title lines, show the complete manual pages, +just like +.Xr man 1 +.Fl a +would. +If the standard output is a terminal device and +.Fl c +is not specified, use +.Xr more 1 +to paginate them. +In +.Fl a +mode, the options +.Fl IKOTW +described in the +.Xr mandoc 1 +manual are also available. .It Fl C Ar file Specify an alternative configuration .Ar file in .Xr man.conf 5 format. +.It Fl c +In +.Fl a +mode, copy the formatted manual pages to the standard output without using +.Xr more 1 +to paginate them. +.It Fl f +Search for all words in +.Ar expression +in manual page names only. +The search is case insensitive and matches whole words only. +In this mode, macro keys, comparison operators, and logical operators +are not available. +This overrides any earlier +.Fl k +and +.Fl l +options. +.It Fl h +Instead of showing the title lines, show the SYNOPSIS sections, just like +.Xr man 1 +.Fl h +would. +.It Fl k +Support the full +.Ar expression +syntax. +This overrides any earlier +.Fl f +and +.Fl l +options. +It is the default for +.Nm . +.It Fl l +An alias for +.Xr mandoc 1 +.Fl a . +This overrides any earlier +.Fl f , +.Fl k , +and +.Fl w +options. .It Fl M Ar path Use the colon-separated path instead of the default list of paths searched for @@ -96,6 +162,14 @@ By default, pages from all sections are shown. See .Xr man 1 for a listing of sections. +.It Fl V +Print version and exit. +.It Fl w +Instead of showing title lines, show the pathnames of the matching +manual pages, just like +.Xr man 1 +.Fl w +would. .El .Pp An @@ -165,11 +239,6 @@ is evaluated case-insensitively. Has no effect on substring terms. .El .Pp -.Nm whatis -considers an -.Ar expression -to consist of an opaque keyword. -.Pp Results are sorted by manual sections and names, with output formatted as .Pp .D1 name[, name...](sec) \- description @@ -270,7 +339,12 @@ Text production: .It Li \&Dx Ta Dx No version reference .El .Sh ENVIRONMENT -.Bl -tag -width MANPATH +.Bl -tag -width MANPAGER +.It Ev MANPAGER +Any non-empty value of the environment variable +.Ev MANPAGER +will be used instead of the standard pagination program, +.Xr more 1 . .It Ev MANPATH The standard search path used by .Xr man 1 @@ -288,6 +362,13 @@ or if it contains two adjacent colons, the standard search path is inserted between the colons. If none of these conditions are met, it overrides the standard search path. +.It Ev PAGER +Specifies the pagination program to use when +.Ev MANPAGER +is not defined. +If neither PAGER nor MANPAGER is defined, +.Pa /usr/bin/more Fl s +will be used. .El .Sh FILES .Bl -tag -width "/etc/man.conf" -compact @@ -349,11 +430,19 @@ The following two invocations are equivalent: .Xr re_format 7 , .Xr makewhatis 8 .Sh HISTORY -An +Part of the functionality of +.Nm whatis +was already provided by the former +.Nm manwhere +utility in +.Bx 1 . +The .Nm -utility first appeared in +and +.Nm whatis +utilities first appeared in .Bx 2 . -It was rewritten from scratch for +They were rewritten from scratch for .Ox 5.6 . .Pp The @@ -373,13 +462,23 @@ and and .Fl s in -.Ox 4.5 . +.Ox 4.5 +for +.Nm +and in +.Ox 5.6 +for +.Nm whatis . .Sh AUTHORS .An -nosplit .An Bill Joy -wrote the original +wrote +.Nm manwhere +in 1977 and the original .Bx .Nm +and +.Nm whatis in February 1979. The current version was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv diff --git a/contrib/mdocml/apropos.c b/contrib/mdocml/apropos.c deleted file mode 100644 index 80b6bc6d036e..000000000000 --- a/contrib/mdocml/apropos.c +++ /dev/null @@ -1,123 +0,0 @@ -/* $Id: apropos.c,v 1.39 2014/04/20 16:46:04 schwarze Exp $ */ -/* - * Copyright (c) 2012 Kristaps Dzonsons - * Copyright (c) 2013 Ingo Schwarze - * - * 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. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "manpath.h" -#include "mansearch.h" - - -int -main(int argc, char *argv[]) -{ - int ch, whatis; - struct mansearch search; - size_t i, sz; - struct manpage *res; - struct manpaths paths; - char *defpaths, *auxpaths; - char *conf_file; - char *progname; - const char *outkey; - extern char *optarg; - extern int optind; - - progname = strrchr(argv[0], '/'); - if (progname == NULL) - progname = argv[0]; - else - ++progname; - - whatis = (0 == strncmp(progname, "whatis", 6)); - - memset(&paths, 0, sizeof(struct manpaths)); - memset(&search, 0, sizeof(struct mansearch)); - - auxpaths = defpaths = NULL; - conf_file = NULL; - outkey = "Nd"; - - while (-1 != (ch = getopt(argc, argv, "C:M:m:O:S:s:"))) - switch (ch) { - case 'C': - conf_file = optarg; - break; - case 'M': - defpaths = optarg; - break; - case 'm': - auxpaths = optarg; - break; - case 'O': - outkey = optarg; - break; - case 'S': - search.arch = optarg; - break; - case 's': - search.sec = optarg; - break; - default: - goto usage; - } - - argc -= optind; - argv += optind; - - if (0 == argc) - goto usage; - - search.deftype = whatis ? TYPE_Nm : TYPE_Nm | TYPE_Nd; - search.flags = whatis ? MANSEARCH_WHATIS : 0; - - manpath_parse(&paths, conf_file, defpaths, auxpaths); - mansearch_setup(1); - ch = mansearch(&search, &paths, argc, argv, outkey, &res, &sz); - manpath_free(&paths); - - if (0 == ch) - goto usage; - - for (i = 0; i < sz; i++) { - printf("%s - %s\n", res[i].names, - NULL == res[i].output ? "" : res[i].output); - free(res[i].file); - free(res[i].names); - free(res[i].output); - } - - free(res); - mansearch_setup(0); - return(sz ? EXIT_SUCCESS : EXIT_FAILURE); -usage: - fprintf(stderr, "usage: %s [-C file] [-M path] [-m path] " - "[-O outkey] " - "[-S arch] [-s section]%s ...\n", progname, - whatis ? " name" : "\n expression"); - return(EXIT_FAILURE); -} diff --git a/contrib/mdocml/arch.in b/contrib/mdocml/arch.in deleted file mode 100644 index a22ffd58ba7b..000000000000 --- a/contrib/mdocml/arch.in +++ /dev/null @@ -1,112 +0,0 @@ -/* $Id: arch.in,v 1.15 2014/04/27 22:42:15 schwarze Exp $ */ -/* - * Copyright (c) 2009 Kristaps Dzonsons - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file defines the architecture token of the .Dt prologue macro. - * All architectures that your system supports (or the manuals of your - * system) should be included here. The right-hand-side is the - * formatted output. - * - * Be sure to escape strings. - * - * REMEMBER TO ADD NEW ARCHITECTURES TO MDOC.7! - */ - -LINE("acorn26", "Acorn26") -LINE("acorn32", "Acorn32") -LINE("algor", "Algor") -LINE("alpha", "Alpha") -LINE("amd64", "AMD64") -LINE("amiga", "Amiga") -LINE("amigappc", "AmigaPPC") -LINE("arc", "ARC") -LINE("arm", "ARM") -LINE("arm26", "ARM26") -LINE("arm32", "ARM32") -LINE("armish", "ARMISH") -LINE("armv7", "ARMv7") -LINE("aviion", "AViiON") -LINE("atari", "ATARI") -LINE("bebox", "BeBox") -LINE("cats", "cats") -LINE("cesfic", "CESFIC") -LINE("cobalt", "Cobalt") -LINE("dreamcast", "Dreamcast") -LINE("emips", "EMIPS") -LINE("evbarm", "evbARM") -LINE("evbmips", "evbMIPS") -LINE("evbppc", "evbPPC") -LINE("evbsh3", "evbSH3") -LINE("ews4800mips", "EWS4800MIPS") -LINE("hp300", "HP300") -LINE("hp700", "HP700") -LINE("hpcarm", "HPCARM") -LINE("hpcmips", "HPCMIPS") -LINE("hpcsh", "HPCSH") -LINE("hppa", "HPPA") -LINE("hppa64", "HPPA64") -LINE("ia64", "ia64") -LINE("i386", "i386") -LINE("ibmnws", "IBMNWS") -LINE("iyonix", "Iyonix") -LINE("landisk", "LANDISK") -LINE("loongson", "Loongson") -LINE("luna68k", "LUNA68K") -LINE("luna88k", "LUNA88K") -LINE("m68k", "m68k") -LINE("mac68k", "Mac68k") -LINE("macppc", "MacPPC") -LINE("mips", "MIPS") -LINE("mips64", "MIPS64") -LINE("mipsco", "MIPSCo") -LINE("mmeye", "mmEye") -LINE("mvme68k", "MVME68k") -LINE("mvme88k", "MVME88k") -LINE("mvmeppc", "MVMEPPC") -LINE("netwinder", "NetWinder") -LINE("news68k", "NeWS68k") -LINE("newsmips", "NeWSMIPS") -LINE("next68k", "NeXT68k") -LINE("octeon", "OCTEON") -LINE("ofppc", "OFPPC") -LINE("palm", "Palm") -LINE("pc532", "PC532") -LINE("playstation2", "PlayStation2") -LINE("pmax", "PMAX") -LINE("pmppc", "pmPPC") -LINE("powerpc", "PowerPC") -LINE("prep", "PReP") -LINE("rs6000", "RS6000") -LINE("sandpoint", "Sandpoint") -LINE("sbmips", "SBMIPS") -LINE("sgi", "SGI") -LINE("sgimips", "SGIMIPS") -LINE("sh3", "SH3") -LINE("shark", "Shark") -LINE("socppc", "SOCPPC") -LINE("solbourne", "Solbourne") -LINE("sparc", "SPARC") -LINE("sparc64", "SPARC64") -LINE("sun2", "Sun2") -LINE("sun3", "Sun3") -LINE("tahoe", "Tahoe") -LINE("vax", "VAX") -LINE("x68k", "X68k") -LINE("x86", "x86") -LINE("x86_64", "x86_64") -LINE("xen", "Xen") -LINE("zaurus", "Zaurus") diff --git a/contrib/mdocml/att.c b/contrib/mdocml/att.c index 059639af37aa..a1703ebcc662 100644 --- a/contrib/mdocml/att.c +++ b/contrib/mdocml/att.c @@ -1,4 +1,4 @@ -/* $Id: att.c,v 1.11 2014/04/20 16:46:04 schwarze Exp $ */ +/* $Id: att.c,v 1.13 2014/11/28 18:57:31 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -14,24 +14,36 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif +#include #include #include "mdoc.h" #include "libmdoc.h" #define LINE(x, y) \ - if (0 == strcmp(p, x)) return(y); + if (0 == strcmp(p, x)) return(y) const char * mdoc_a2att(const char *p) { -#include "att.in" + LINE("v1", "Version\\~1 AT&T UNIX"); + LINE("v2", "Version\\~2 AT&T UNIX"); + LINE("v3", "Version\\~3 AT&T UNIX"); + LINE("v4", "Version\\~4 AT&T UNIX"); + LINE("v5", "Version\\~5 AT&T UNIX"); + LINE("v6", "Version\\~6 AT&T UNIX"); + LINE("v7", "Version\\~7 AT&T UNIX"); + LINE("32v", "Version\\~32V AT&T UNIX"); + LINE("III", "AT&T System\\~III UNIX"); + LINE("V", "AT&T System\\~V UNIX"); + LINE("V.1", "AT&T System\\~V Release\\~1 UNIX"); + LINE("V.2", "AT&T System\\~V Release\\~2 UNIX"); + LINE("V.3", "AT&T System\\~V Release\\~3 UNIX"); + LINE("V.4", "AT&T System\\~V Release\\~4 UNIX"); return(NULL); } diff --git a/contrib/mdocml/att.in b/contrib/mdocml/att.in deleted file mode 100644 index b4ef822158f8..000000000000 --- a/contrib/mdocml/att.in +++ /dev/null @@ -1,40 +0,0 @@ -/* $Id: att.in,v 1.8 2011/07/31 17:30:33 schwarze Exp $ */ -/* - * Copyright (c) 2009 Kristaps Dzonsons - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file defines the AT&T versions of the .At macro. This probably - * isn't going to change. The right-hand side is the formatted string. - * - * Be sure to escape strings. - * The non-breaking blanks prevent ending an output line right before - * a number. Groff prevent line breaks at the same places. - */ - -LINE("v1", "Version\\~1 AT&T UNIX") -LINE("v2", "Version\\~2 AT&T UNIX") -LINE("v3", "Version\\~3 AT&T UNIX") -LINE("v4", "Version\\~4 AT&T UNIX") -LINE("v5", "Version\\~5 AT&T UNIX") -LINE("v6", "Version\\~6 AT&T UNIX") -LINE("v7", "Version\\~7 AT&T UNIX") -LINE("32v", "Version\\~32V AT&T UNIX") -LINE("III", "AT&T System\\~III UNIX") -LINE("V", "AT&T System\\~V UNIX") -LINE("V.1", "AT&T System\\~V Release\\~1 UNIX") -LINE("V.2", "AT&T System\\~V Release\\~2 UNIX") -LINE("V.3", "AT&T System\\~V Release\\~3 UNIX") -LINE("V.4", "AT&T System\\~V Release\\~4 UNIX") diff --git a/contrib/mdocml/cgi.c b/contrib/mdocml/cgi.c index 1e38e3d872a5..65064ab2ad6c 100644 --- a/contrib/mdocml/cgi.c +++ b/contrib/mdocml/cgi.c @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.92 2014/08/05 15:29:30 schwarze Exp $ */ +/* $Id: cgi.c,v 1.102 2014/11/26 17:55:27 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -15,9 +15,10 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif + +#include +#include #include #include @@ -91,14 +92,14 @@ static const char *const sec_names[] = { "All Sections", "1 - General Commands", "2 - System Calls", - "3 - Subroutines", - "3p - Perl Subroutines", - "4 - Special Files", + "3 - Library Functions", + "3p - Perl Library", + "4 - Device Drivers", "5 - File Formats", "6 - Games", - "7 - Macros and Conventions", - "8 - Maintenance Commands", - "9 - Kernel Interface" + "7 - Miscellaneous Information", + "8 - System Manager\'s Manual", + "9 - Kernel Developer\'s Manual" }; static const int sec_MAX = sizeof(sec_names) / sizeof(char *); @@ -162,8 +163,7 @@ http_printquery(const struct req *req, const char *sep) printf("%sarch=", sep); http_print(req->q.arch); } - if (NULL != req->q.manpath && - strcmp(req->q.manpath, req->p[0])) { + if (strcmp(req->q.manpath, req->p[0])) { printf("%smanpath=", sep); http_print(req->q.manpath); } @@ -297,11 +297,6 @@ http_parse(struct req *req, const char *qs) if (*qs != '\0') qs++; } - - /* Fall back to the default manpath. */ - - if (req->q.manpath == NULL) - req->q.manpath = mandoc_strdup(req->p[0]); } static void @@ -375,13 +370,10 @@ resp_begin_html(int code, const char *msg) resp_begin_http(code, msg); - printf("\n" + printf("\n" "\n" "\n" - "\n" + "\n" "\n" ""); for (i = 0; i < (int)req->psz; i++) { printf("