From owner-svn-soc-all@FreeBSD.ORG Sun May 27 04:03:06 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id E8582106566B for ; Sun, 27 May 2012 04:03:04 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Sun, 27 May 2012 04:03:04 +0000 Date: Sun, 27 May 2012 04:03:04 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120527040304.E8582106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236539 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 May 2012 04:03:06 -0000 Author: jhagewood Date: Sun May 27 04:03:04 2012 New Revision: 236539 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236539 Log: Deleted: soc2012/jhagewood/mdocml/svn-commit.tmp From owner-svn-soc-all@FreeBSD.ORG Sun May 27 04:04:56 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 313E6106566B for ; Sun, 27 May 2012 04:04:55 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Sun, 27 May 2012 04:04:55 +0000 Date: Sun, 27 May 2012 04:04:55 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120527040455.313E6106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236540 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 May 2012 04:04:56 -0000 Author: jhagewood Date: Sun May 27 04:04:54 2012 New Revision: 236540 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236540 Log: Deleted: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Sun May 27 04:06:11 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 7AE801065686 for ; Sun, 27 May 2012 04:06:09 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Sun, 27 May 2012 04:06:09 +0000 Date: Sun, 27 May 2012 04:06:09 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120527040609.7AE801065686@hub.freebsd.org> Cc: Subject: socsvn commit: r236541 - in soc2012/jhagewood: . mdocml-1.12.1 mdocml-1.12.1-orig mdocml_patches X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 May 2012 04:06:11 -0000 Author: jhagewood Date: Sun May 27 04:06:09 2012 New Revision: 236541 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236541 Log: Added: soc2012/jhagewood/hagewood-mdocml.patch soc2012/jhagewood/mdocml-1.12.1/ soc2012/jhagewood/mdocml-1.12.1-orig/ soc2012/jhagewood/mdocml-1.12.1-orig/Makefile soc2012/jhagewood/mdocml-1.12.1-orig/TODO soc2012/jhagewood/mdocml-1.12.1-orig/apropos.1 soc2012/jhagewood/mdocml-1.12.1-orig/apropos.c soc2012/jhagewood/mdocml-1.12.1-orig/apropos_db.c soc2012/jhagewood/mdocml-1.12.1-orig/apropos_db.h soc2012/jhagewood/mdocml-1.12.1-orig/arch.c soc2012/jhagewood/mdocml-1.12.1-orig/arch.in soc2012/jhagewood/mdocml-1.12.1-orig/att.c soc2012/jhagewood/mdocml-1.12.1-orig/att.in soc2012/jhagewood/mdocml-1.12.1-orig/catman.8 soc2012/jhagewood/mdocml-1.12.1-orig/catman.c soc2012/jhagewood/mdocml-1.12.1-orig/cgi.c soc2012/jhagewood/mdocml-1.12.1-orig/chars.c soc2012/jhagewood/mdocml-1.12.1-orig/chars.in soc2012/jhagewood/mdocml-1.12.1-orig/compat_fgetln.c soc2012/jhagewood/mdocml-1.12.1-orig/compat_getsubopt.c soc2012/jhagewood/mdocml-1.12.1-orig/compat_strlcat.c soc2012/jhagewood/mdocml-1.12.1-orig/compat_strlcpy.c soc2012/jhagewood/mdocml-1.12.1-orig/config.h.post soc2012/jhagewood/mdocml-1.12.1-orig/config.h.pre soc2012/jhagewood/mdocml-1.12.1-orig/demandoc.1 soc2012/jhagewood/mdocml-1.12.1-orig/demandoc.c soc2012/jhagewood/mdocml-1.12.1-orig/eqn.7 soc2012/jhagewood/mdocml-1.12.1-orig/eqn.c soc2012/jhagewood/mdocml-1.12.1-orig/eqn_html.c soc2012/jhagewood/mdocml-1.12.1-orig/eqn_term.c soc2012/jhagewood/mdocml-1.12.1-orig/example.style.css soc2012/jhagewood/mdocml-1.12.1-orig/external.png (contents, props changed) soc2012/jhagewood/mdocml-1.12.1-orig/html.c soc2012/jhagewood/mdocml-1.12.1-orig/html.h soc2012/jhagewood/mdocml-1.12.1-orig/index.css soc2012/jhagewood/mdocml-1.12.1-orig/index.sgml soc2012/jhagewood/mdocml-1.12.1-orig/lib.c soc2012/jhagewood/mdocml-1.12.1-orig/lib.in soc2012/jhagewood/mdocml-1.12.1-orig/libman.h soc2012/jhagewood/mdocml-1.12.1-orig/libmandoc.h soc2012/jhagewood/mdocml-1.12.1-orig/libmdoc.h soc2012/jhagewood/mdocml-1.12.1-orig/libroff.h soc2012/jhagewood/mdocml-1.12.1-orig/main.c soc2012/jhagewood/mdocml-1.12.1-orig/main.h soc2012/jhagewood/mdocml-1.12.1-orig/man-cgi.css soc2012/jhagewood/mdocml-1.12.1-orig/man.7 soc2012/jhagewood/mdocml-1.12.1-orig/man.c soc2012/jhagewood/mdocml-1.12.1-orig/man.cgi.7 soc2012/jhagewood/mdocml-1.12.1-orig/man.h soc2012/jhagewood/mdocml-1.12.1-orig/man_hash.c soc2012/jhagewood/mdocml-1.12.1-orig/man_html.c soc2012/jhagewood/mdocml-1.12.1-orig/man_macro.c soc2012/jhagewood/mdocml-1.12.1-orig/man_term.c soc2012/jhagewood/mdocml-1.12.1-orig/man_validate.c soc2012/jhagewood/mdocml-1.12.1-orig/mandoc.1 soc2012/jhagewood/mdocml-1.12.1-orig/mandoc.3 soc2012/jhagewood/mdocml-1.12.1-orig/mandoc.c soc2012/jhagewood/mdocml-1.12.1-orig/mandoc.h soc2012/jhagewood/mdocml-1.12.1-orig/mandoc_char.7 soc2012/jhagewood/mdocml-1.12.1-orig/mandocdb.8 soc2012/jhagewood/mdocml-1.12.1-orig/mandocdb.c soc2012/jhagewood/mdocml-1.12.1-orig/mandocdb.h soc2012/jhagewood/mdocml-1.12.1-orig/manpath.c soc2012/jhagewood/mdocml-1.12.1-orig/manpath.h soc2012/jhagewood/mdocml-1.12.1-orig/mdoc.7 soc2012/jhagewood/mdocml-1.12.1-orig/mdoc.c soc2012/jhagewood/mdocml-1.12.1-orig/mdoc.h soc2012/jhagewood/mdocml-1.12.1-orig/mdoc_argv.c soc2012/jhagewood/mdocml-1.12.1-orig/mdoc_hash.c soc2012/jhagewood/mdocml-1.12.1-orig/mdoc_html.c soc2012/jhagewood/mdocml-1.12.1-orig/mdoc_macro.c soc2012/jhagewood/mdocml-1.12.1-orig/mdoc_man.c soc2012/jhagewood/mdocml-1.12.1-orig/mdoc_term.c soc2012/jhagewood/mdocml-1.12.1-orig/mdoc_validate.c soc2012/jhagewood/mdocml-1.12.1-orig/msec.c soc2012/jhagewood/mdocml-1.12.1-orig/msec.in soc2012/jhagewood/mdocml-1.12.1-orig/out.c soc2012/jhagewood/mdocml-1.12.1-orig/out.h soc2012/jhagewood/mdocml-1.12.1-orig/preconv.1 soc2012/jhagewood/mdocml-1.12.1-orig/preconv.c soc2012/jhagewood/mdocml-1.12.1-orig/predefs.in soc2012/jhagewood/mdocml-1.12.1-orig/read.c soc2012/jhagewood/mdocml-1.12.1-orig/roff.7 soc2012/jhagewood/mdocml-1.12.1-orig/roff.c soc2012/jhagewood/mdocml-1.12.1-orig/st.c soc2012/jhagewood/mdocml-1.12.1-orig/st.in soc2012/jhagewood/mdocml-1.12.1-orig/style.css soc2012/jhagewood/mdocml-1.12.1-orig/tbl.7 soc2012/jhagewood/mdocml-1.12.1-orig/tbl.c soc2012/jhagewood/mdocml-1.12.1-orig/tbl_data.c soc2012/jhagewood/mdocml-1.12.1-orig/tbl_html.c soc2012/jhagewood/mdocml-1.12.1-orig/tbl_layout.c soc2012/jhagewood/mdocml-1.12.1-orig/tbl_opts.c soc2012/jhagewood/mdocml-1.12.1-orig/tbl_term.c soc2012/jhagewood/mdocml-1.12.1-orig/term.c soc2012/jhagewood/mdocml-1.12.1-orig/term.h soc2012/jhagewood/mdocml-1.12.1-orig/term_ascii.c soc2012/jhagewood/mdocml-1.12.1-orig/term_ps.c soc2012/jhagewood/mdocml-1.12.1-orig/test-fgetln.c soc2012/jhagewood/mdocml-1.12.1-orig/test-getsubopt.c soc2012/jhagewood/mdocml-1.12.1-orig/test-mmap.c soc2012/jhagewood/mdocml-1.12.1-orig/test-strlcat.c soc2012/jhagewood/mdocml-1.12.1-orig/test-strlcpy.c soc2012/jhagewood/mdocml-1.12.1-orig/test-strptime.c soc2012/jhagewood/mdocml-1.12.1-orig/tree.c soc2012/jhagewood/mdocml-1.12.1-orig/vol.c soc2012/jhagewood/mdocml-1.12.1-orig/vol.in soc2012/jhagewood/mdocml-1.12.1-orig/whatis.1 soc2012/jhagewood/mdocml-1.12.1/Makefile soc2012/jhagewood/mdocml-1.12.1/TODO soc2012/jhagewood/mdocml-1.12.1/apropos.1 soc2012/jhagewood/mdocml-1.12.1/apropos.c soc2012/jhagewood/mdocml-1.12.1/apropos_db.c soc2012/jhagewood/mdocml-1.12.1/apropos_db.h soc2012/jhagewood/mdocml-1.12.1/arch.c soc2012/jhagewood/mdocml-1.12.1/arch.in soc2012/jhagewood/mdocml-1.12.1/att.c soc2012/jhagewood/mdocml-1.12.1/att.in soc2012/jhagewood/mdocml-1.12.1/catman.8 soc2012/jhagewood/mdocml-1.12.1/catman.c soc2012/jhagewood/mdocml-1.12.1/cgi.c soc2012/jhagewood/mdocml-1.12.1/chars.c soc2012/jhagewood/mdocml-1.12.1/chars.in soc2012/jhagewood/mdocml-1.12.1/compat_fgetln.c soc2012/jhagewood/mdocml-1.12.1/compat_getsubopt.c soc2012/jhagewood/mdocml-1.12.1/compat_strlcat.c soc2012/jhagewood/mdocml-1.12.1/compat_strlcpy.c soc2012/jhagewood/mdocml-1.12.1/config.h.post soc2012/jhagewood/mdocml-1.12.1/config.h.pre soc2012/jhagewood/mdocml-1.12.1/demandoc.1 soc2012/jhagewood/mdocml-1.12.1/demandoc.c soc2012/jhagewood/mdocml-1.12.1/eqn.7 soc2012/jhagewood/mdocml-1.12.1/eqn.c soc2012/jhagewood/mdocml-1.12.1/eqn_html.c soc2012/jhagewood/mdocml-1.12.1/eqn_term.c soc2012/jhagewood/mdocml-1.12.1/example.style.css soc2012/jhagewood/mdocml-1.12.1/external.png (contents, props changed) soc2012/jhagewood/mdocml-1.12.1/html.c soc2012/jhagewood/mdocml-1.12.1/html.h soc2012/jhagewood/mdocml-1.12.1/index.css soc2012/jhagewood/mdocml-1.12.1/index.sgml soc2012/jhagewood/mdocml-1.12.1/lib.c soc2012/jhagewood/mdocml-1.12.1/lib.in soc2012/jhagewood/mdocml-1.12.1/libman.h soc2012/jhagewood/mdocml-1.12.1/libmandoc.h soc2012/jhagewood/mdocml-1.12.1/libmdoc.h soc2012/jhagewood/mdocml-1.12.1/libroff.h soc2012/jhagewood/mdocml-1.12.1/main.c soc2012/jhagewood/mdocml-1.12.1/main.h soc2012/jhagewood/mdocml-1.12.1/man-cgi.css soc2012/jhagewood/mdocml-1.12.1/man.7 soc2012/jhagewood/mdocml-1.12.1/man.c soc2012/jhagewood/mdocml-1.12.1/man.cgi.7 soc2012/jhagewood/mdocml-1.12.1/man.h soc2012/jhagewood/mdocml-1.12.1/man_hash.c soc2012/jhagewood/mdocml-1.12.1/man_html.c soc2012/jhagewood/mdocml-1.12.1/man_macro.c soc2012/jhagewood/mdocml-1.12.1/man_term.c soc2012/jhagewood/mdocml-1.12.1/man_validate.c soc2012/jhagewood/mdocml-1.12.1/mandoc.1 soc2012/jhagewood/mdocml-1.12.1/mandoc.3 soc2012/jhagewood/mdocml-1.12.1/mandoc.c soc2012/jhagewood/mdocml-1.12.1/mandoc.h soc2012/jhagewood/mdocml-1.12.1/mandoc_char.7 soc2012/jhagewood/mdocml-1.12.1/mandocdb.8 soc2012/jhagewood/mdocml-1.12.1/mandocdb.c soc2012/jhagewood/mdocml-1.12.1/mandocdb.h soc2012/jhagewood/mdocml-1.12.1/manpath.c soc2012/jhagewood/mdocml-1.12.1/manpath.h soc2012/jhagewood/mdocml-1.12.1/mdoc.7 soc2012/jhagewood/mdocml-1.12.1/mdoc.c soc2012/jhagewood/mdocml-1.12.1/mdoc.h soc2012/jhagewood/mdocml-1.12.1/mdoc_argv.c soc2012/jhagewood/mdocml-1.12.1/mdoc_hash.c soc2012/jhagewood/mdocml-1.12.1/mdoc_html.c soc2012/jhagewood/mdocml-1.12.1/mdoc_macro.c soc2012/jhagewood/mdocml-1.12.1/mdoc_man.c soc2012/jhagewood/mdocml-1.12.1/mdoc_term.c soc2012/jhagewood/mdocml-1.12.1/mdoc_validate.c soc2012/jhagewood/mdocml-1.12.1/msec.c soc2012/jhagewood/mdocml-1.12.1/msec.in soc2012/jhagewood/mdocml-1.12.1/out.c soc2012/jhagewood/mdocml-1.12.1/out.h soc2012/jhagewood/mdocml-1.12.1/preconv.1 soc2012/jhagewood/mdocml-1.12.1/preconv.c soc2012/jhagewood/mdocml-1.12.1/predefs.in soc2012/jhagewood/mdocml-1.12.1/read.c soc2012/jhagewood/mdocml-1.12.1/roff.7 soc2012/jhagewood/mdocml-1.12.1/roff.c soc2012/jhagewood/mdocml-1.12.1/st.c soc2012/jhagewood/mdocml-1.12.1/st.in soc2012/jhagewood/mdocml-1.12.1/style.css soc2012/jhagewood/mdocml-1.12.1/tbl.7 soc2012/jhagewood/mdocml-1.12.1/tbl.c soc2012/jhagewood/mdocml-1.12.1/tbl_data.c soc2012/jhagewood/mdocml-1.12.1/tbl_html.c soc2012/jhagewood/mdocml-1.12.1/tbl_layout.c soc2012/jhagewood/mdocml-1.12.1/tbl_opts.c soc2012/jhagewood/mdocml-1.12.1/tbl_term.c soc2012/jhagewood/mdocml-1.12.1/term.c soc2012/jhagewood/mdocml-1.12.1/term.h soc2012/jhagewood/mdocml-1.12.1/term_ascii.c soc2012/jhagewood/mdocml-1.12.1/term_ps.c soc2012/jhagewood/mdocml-1.12.1/test-fgetln.c soc2012/jhagewood/mdocml-1.12.1/test-getsubopt.c soc2012/jhagewood/mdocml-1.12.1/test-mmap.c soc2012/jhagewood/mdocml-1.12.1/test-strlcat.c soc2012/jhagewood/mdocml-1.12.1/test-strlcpy.c soc2012/jhagewood/mdocml-1.12.1/test-strptime.c soc2012/jhagewood/mdocml-1.12.1/tree.c soc2012/jhagewood/mdocml-1.12.1/vol.c soc2012/jhagewood/mdocml-1.12.1/vol.in soc2012/jhagewood/mdocml-1.12.1/whatis.1 soc2012/jhagewood/mdocml_patches/ soc2012/jhagewood/mdocml_patches/patch-config.txt soc2012/jhagewood/mdocml_patches/patch-lib.in.txt soc2012/jhagewood/mdocml_patches/patch-mdoc_validate.c soc2012/jhagewood/mdocml_patches/patch-msec.in.txt soc2012/jhagewood/mdocml_test.sh (contents, props changed) soc2012/jhagewood/svn-commit.tmp Added: soc2012/jhagewood/hagewood-mdocml.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/hagewood-mdocml.patch Sun May 27 04:06:09 2012 (r236541) @@ -0,0 +1,215 @@ +diff -rupN mdocml-1.12.1-orig/lib.in mdocml-1.12.1/lib.in +--- mdocml-1.12.1-orig/lib.in 2012-05-24 02:19:02.000000000 -0400 ++++ mdocml-1.12.1/lib.in 2012-05-24 02:19:03.000000000 -0400 +@@ -23,10 +23,10 @@ + * Be sure to escape strings. + */ + +-LINE("libarchive", "Reading and Writing Streaming Archives Library (libarchive, \\-larchive)") ++LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)") + LINE("libarm", "ARM Architecture Library (libarm, \\-larm)") + LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)") +-LINE("libbluetooth", "Bluetooth Library (libbluetooth, \\-lbluetooth)") ++LINE("libbluetooth", "Bluetooth User Library (libbluetooth, \\-lbluetooth)") + LINE("libbsm", "Basic Security Module User Library (libbsm, \\-lbsm)") + LINE("libc", "Standard C Library (libc, \\-lc)") + LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)") +@@ -41,10 +41,11 @@ LINE("libdevinfo", "Device and Resource + LINE("libdevstat", "Device Statistics Library (libdevstat, \\-ldevstat)") + LINE("libdisk", "Interface to Slice and Partition Labels Library (libdisk, \\-ldisk)") + LINE("libdwarf", "DWARF Access Library (libdwarf, \\-ldwarf)") +-LINE("libedit", "Command Line Editor Library (libedit, \\-ledit)") ++LINE("libedit", "Line Editor and History Library (libedit, \\-ledit)") ++LINE("libefi", "EFI Runtime Services Library (libefi, \\-lefi)") + LINE("libelf", "ELF Access Library (libelf, \\-lelf)") + LINE("libevent", "Event Notification Library (libevent, \\-levent)") +-LINE("libfetch", "File Transfer Library for URLs (libfetch, \\-lfetch)") ++LINE("libfetch", "File Transfer Library (libfetch, \\-lfetch)") + LINE("libform", "Curses Form Library (libform, \\-lform)") + LINE("libgeom", "Userland API Library for kernel GEOM subsystem (libgeom, \\-lgeom)") + LINE("libgpib", "General-Purpose Instrument Bus (GPIB) library (libgpib, \\-lgpib)") +@@ -70,7 +71,7 @@ LINE("libossaudio", "OSS Audio Emulation + LINE("libpam", "Pluggable Authentication Module Library (libpam, \\-lpam)") + LINE("libpcap", "Capture Library (libpcap, \\-lpcap)") + LINE("libpci", "PCI Bus Access Library (libpci, \\-lpci)") +-LINE("libpmc", "Performance Counters Library (libpmc, \\-lpmc)") ++LINE("libpmc", "Performance Monitoring Counters Interface Library (libpmc, \\-lpmc)") + LINE("libposix", "POSIX Compatibility Library (libposix, \\-lposix)") + LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)") + LINE("libprop", "Property Container Object Library (libprop, \\-lprop)") +diff -rupN mdocml-1.12.1-orig/mdoc_validate.c mdocml-1.12.1/mdoc_validate.c +--- mdocml-1.12.1-orig/mdoc_validate.c 2012-05-24 02:19:02.000000000 -0400 ++++ mdocml-1.12.1/mdoc_validate.c 2012-05-24 02:19:03.000000000 -0400 +@@ -2234,6 +2234,8 @@ post_os(POST_ARGS) + mdoc_nmsg(mdoc, n, MANDOCERR_MEM); + return(0); + } ++ if (strncmp(utsname.sysname, "FreeBSD", sizeof("FreeBSD")) == 0) ++ strtok(utsname.release, "-"); + if (strlcat(buf, utsname.release, BUFSIZ) >= BUFSIZ) { + mdoc_nmsg(mdoc, n, MANDOCERR_MEM); + return(0); +diff -rupN mdocml-1.12.1-orig/msec.in mdocml-1.12.1/msec.in +--- mdocml-1.12.1-orig/msec.in 2012-05-24 02:19:02.000000000 -0400 ++++ mdocml-1.12.1/msec.in 2012-05-24 02:19:03.000000000 -0400 +@@ -22,16 +22,16 @@ + * Be sure to escape strings. + */ + +-LINE("1", "General Commands Manual") +-LINE("2", "System Calls Manual") +-LINE("3", "Library Functions Manual") ++LINE("1", "FreeBSD General Commands Manual") ++LINE("2", "FreeBSD System Calls Manual") ++LINE("3", "FreeBSD Library Functions Manual") + LINE("3p", "Perl Library Functions Manual") +-LINE("4", "Kernel Interfaces Manual") +-LINE("5", "File Formats Manual") +-LINE("6", "Games Manual") +-LINE("7", "Miscellaneous Information Manual") +-LINE("8", "System Manager\'s Manual") +-LINE("9", "Kernel Developer\'s Manual") ++LINE("4", "FreeBSD Kernel Interfaces Manual") ++LINE("5", "FreeBSD File Formats Manual") ++LINE("6", "FreeBSD Games Manual") ++LINE("7", "FreeBSD Miscellaneous Information Manual") ++LINE("8", "FreeBSD System Manager\'s Manual") ++LINE("9", "FreeBSD Kernel Developer\'s Manual") + LINE("X11", "X11 Developer\'s Manual") + LINE("X11R6", "X11 Developer\'s Manual") + LINE("unass", "Unassociated") +diff -rupN mdocml-1.12.1-orig/roff.c mdocml-1.12.1/roff.c +--- mdocml-1.12.1-orig/roff.c 2012-05-24 02:19:02.000000000 -0400 ++++ mdocml-1.12.1/roff.c 2012-05-27 04:00:02.000000000 -0400 +@@ -49,14 +49,17 @@ enum rofft { + ROFF_if, + ROFF_ig, + ROFF_it, ++ ROFF_na, + ROFF_ne, + ROFF_nh, ++ ROFF_ni, + ROFF_nr, + ROFF_ns, + ROFF_ps, + ROFF_rm, + ROFF_so, + ROFF_ta, ++ ROFF_ti, + ROFF_tr, + ROFF_TS, + ROFF_TE, +@@ -225,14 +228,17 @@ static struct roffmac roffs[ROFF_MAX] = + { "if", roff_cond, roff_cond_text, roff_cond_sub, ROFFMAC_STRUCT, NULL }, + { "ig", roff_block, roff_block_text, roff_block_sub, 0, NULL }, + { "it", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "na", roff_line_ignore, NULL, NULL, 0, NULL }, + { "ne", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nh", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ni", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nr", roff_nr, NULL, NULL, 0, NULL }, + { "ns", roff_line_ignore, NULL, NULL, 0, NULL }, + { "ps", roff_line_ignore, NULL, NULL, 0, NULL }, + { "rm", roff_rm, NULL, NULL, 0, NULL }, + { "so", roff_so, NULL, NULL, 0, NULL }, + { "ta", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ti", roff_line_ignore, NULL, NULL, 0, NULL }, + { "tr", roff_tr, NULL, NULL, 0, NULL }, + { "TS", roff_TS, NULL, NULL, 0, NULL }, + { "TE", roff_TE, NULL, NULL, 0, NULL }, +@@ -407,6 +413,12 @@ roff_free(struct roff *r) + free(r); + } + ++/* TODO */ ++static enum rofferr ++roff_ad(ROFF_ARGS) ++{ ++ ++} + + struct roff * + roff_alloc(struct mparse *parse) +@@ -1234,6 +1246,20 @@ roff_regunset(struct roff *r, enum regs + r->regs[(int)reg].set = 0; + } + ++/* TODO */ ++static enum rofferr ++roff_na(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_it(ROFF_ARGS) ++{ ++ ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_nr(ROFF_ARGS) +@@ -1256,6 +1282,61 @@ roff_nr(ROFF_ARGS) + return(ROFF_IGN); + } + ++/* TODO */ ++static enum rofferr ++roff_ns(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ti(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ta(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_hy(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ne(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_nh(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ni(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ps(ROFF_ARGS) ++{ ++ ++} + /* ARGSUSED */ + static enum rofferr + roff_rm(ROFF_ARGS) Added: soc2012/jhagewood/mdocml-1.12.1-orig/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml-1.12.1-orig/Makefile Sun May 27 04:06:09 2012 (r236541) @@ -0,0 +1,645 @@ +.PHONY: clean install installwww +.SUFFIXES: .sgml .html .md5 .h .h.html +.SUFFIXES: .1 .3 .7 .8 +.SUFFIXES: .1.txt .3.txt .7.txt .8.txt +.SUFFIXES: .1.pdf .3.pdf .7.pdf .8.pdf +.SUFFIXES: .1.ps .3.ps .7.ps .8.ps +.SUFFIXES: .1.html .3.html .7.html .8.html +.SUFFIXES: .1.xhtml .3.xhtml .7.xhtml .8.xhtml + +# 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 4.5\"" + +VERSION = 1.12.1 +VDATE = 23 March 2012 + +# 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 + +# If your system has manpath(1), uncomment this. This is most any +# system that's not OpenBSD or NetBSD. If uncommented, apropos(1), +# mandocdb(8), and man.cgi will popen(3) manpath(1) to get the MANPATH +# variable. +#CFLAGS += -DUSE_MANPATH + +# If your system supports static binaries only, uncomment this. This +# appears only to be BSD UNIX systems (Mac OS X has no support and Linux +# requires -pthreads for static libdb). +STATIC = -static + +CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\"" +CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings +PREFIX = /usr/local +WWWPREFIX = /var/www +HTDOCDIR = $(WWWPREFIX)/htdocs +CGIBINDIR = $(WWWPREFIX)/cgi-bin +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 0755 +INSTALL_DATA = $(INSTALL) -m 0444 +INSTALL_LIB = $(INSTALL) -m 0644 +INSTALL_SOURCE = $(INSTALL) -m 0644 +INSTALL_MAN = $(INSTALL_DATA) + +# Non-BSD systems (Linux, etc.) need -ldb to compile mandocdb and +# apropos. +# However, if you don't have -ldb at all (or it's not native), then +# comment out apropos and mandocdb. +# +#DBLIB = -ldb +DBBIN = apropos mandocdb man.cgi catman whatis +DBLN = llib-lapropos.ln llib-lmandocdb.ln llib-lman.cgi.ln llib-lcatman.ln + +all: mandoc preconv demandoc $(DBBIN) + +SRCS = Makefile \ + TODO \ + apropos.1 \ + apropos.c \ + apropos_db.c \ + apropos_db.h \ + arch.c \ + arch.in \ + att.c \ + att.in \ + catman.8 \ + catman.c \ + cgi.c \ + chars.c \ + chars.in \ + compat_fgetln.c \ + compat_getsubopt.c \ + compat_strlcat.c \ + compat_strlcpy.c \ + config.h.post \ + config.h.pre \ + demandoc.1 \ + demandoc.c \ + eqn.7 \ + eqn.c \ + eqn_html.c \ + eqn_term.c \ + example.style.css \ + external.png \ + html.c \ + html.h \ + index.css \ + index.sgml \ + lib.c \ + lib.in \ + libman.h \ + libmandoc.h \ + libmdoc.h \ + libroff.h \ + main.c \ + main.h \ + man.7 \ + man.c \ + man.cgi.7 \ + man-cgi.css \ + man.h \ + man_hash.c \ + man_html.c \ + man_macro.c \ + man_term.c \ + man_validate.c \ + mandoc.1 \ + mandoc.3 \ + mandoc.c \ + mandoc.h \ + mandoc_char.7 \ + mandocdb.8 \ + mandocdb.c \ + mandocdb.h \ + manpath.c \ + manpath.h \ + mdoc.7 \ + mdoc.c \ + mdoc.h \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_html.c \ + mdoc_macro.c \ + mdoc_man.c \ + mdoc_term.c \ + mdoc_validate.c \ + msec.c \ + msec.in \ + out.c \ + out.h \ + preconv.1 \ + preconv.c \ + predefs.in \ + read.c \ + roff.7 \ + roff.c \ + st.c \ + st.in \ + style.css \ + tbl.7 \ + tbl.c \ + tbl_data.c \ + tbl_html.c \ + tbl_layout.c \ + tbl_opts.c \ + tbl_term.c \ + term.c \ + term.h \ + term_ascii.c \ + term_ps.c \ + test-fgetln.c \ + test-getsubopt.c \ + test-mmap.c \ + test-strlcat.c \ + test-strlcpy.c \ + test-strptime.c \ + tree.c \ + vol.c \ + vol.in \ + whatis.1 + +LIBMAN_OBJS = man.o \ + man_hash.o \ + man_macro.o \ + man_validate.o +LIBMAN_LNS = man.ln \ + man_hash.ln \ + man_macro.ln \ + man_validate.ln + +LIBMDOC_OBJS = arch.o \ + att.o \ + lib.o \ + mdoc.o \ + mdoc_argv.o \ + mdoc_hash.o \ + mdoc_macro.o \ + mdoc_validate.o \ + st.o \ + vol.o +LIBMDOC_LNS = arch.ln \ + att.ln \ + lib.ln \ + mdoc.ln \ + mdoc_argv.ln \ + mdoc_hash.ln \ + mdoc_macro.ln \ + mdoc_validate.ln \ + st.ln \ + vol.ln + +LIBROFF_OBJS = eqn.o \ + roff.o \ + tbl.o \ + tbl_data.o \ + tbl_layout.o \ + tbl_opts.o +LIBROFF_LNS = eqn.ln \ + roff.ln \ + tbl.ln \ + tbl_data.ln \ + tbl_layout.ln \ + tbl_opts.ln + +LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ + $(LIBMDOC_OBJS) \ + $(LIBROFF_OBJS) \ + chars.o \ + mandoc.o \ + msec.o \ + read.o +LIBMANDOC_LNS = $(LIBMAN_LNS) \ + $(LIBMDOC_LNS) \ + $(LIBROFF_LNS) \ + chars.ln \ + mandoc.ln \ + msec.ln \ + read.ln + +COMPAT_OBJS = compat_fgetln.o \ + compat_getsubopt.o \ + compat_strlcat.o \ + compat_strlcpy.o +COMPAT_LNS = compat_fgetln.ln \ + compat_getsubopt.ln \ + compat_strlcat.ln \ + compat_strlcpy.ln + +arch.o arch.ln: arch.in +att.o att.ln: att.in +chars.o chars.ln: chars.in +lib.o lib.ln: lib.in +msec.o msec.ln: msec.in +roff.o roff.ln: predefs.in +st.o st.ln: st.in +vol.o vol.ln: vol.in + +$(LIBMAN_OBJS) $(LIBMAN_LNS): libman.h +$(LIBMDOC_OBJS) $(LIBMDOC_LNS): libmdoc.h +$(LIBROFF_OBJS) $(LIBROFF_LNS): libroff.h +$(LIBMANDOC_OBJS) $(LIBMANDOC_LNS): mandoc.h mdoc.h man.h libmandoc.h config.h + +$(COMPAT_OBJS) $(COMPAT_LNS): config.h + +MANDOC_HTML_OBJS = eqn_html.o \ + html.o \ + man_html.o \ + mdoc_html.o \ + tbl_html.o +MANDOC_HTML_LNS = eqn_html.ln \ + html.ln \ + man_html.ln \ + mdoc_html.ln \ + tbl_html.ln + +MANDOC_MAN_OBJS = mdoc_man.o +MANDOC_MAN_LNS = mdoc_man.ln + +MANDOC_TERM_OBJS = eqn_term.o \ + man_term.o \ + mdoc_term.o \ + term.o \ + term_ascii.o \ + term_ps.o \ + tbl_term.o +MANDOC_TERM_LNS = eqn_term.ln \ + man_term.ln \ + mdoc_term.ln \ + term.ln \ + term_ascii.ln \ + term_ps.ln \ + tbl_term.ln + +MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + main.o \ + out.o \ + tree.o +MANDOC_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + main.ln \ + out.ln \ + tree.ln + +$(MANDOC_HTML_OBJS) $(MANDOC_HTML_LNS): html.h +$(MANDOC_TERM_OBJS) $(MANDOC_TERM_LNS): term.h +$(MANDOC_OBJS) $(MANDOC_LNS): main.h mandoc.h mdoc.h man.h config.h out.h + +MANDOCDB_OBJS = mandocdb.o manpath.o +MANDOCDB_LNS = mandocdb.ln manpath.ln + +$(MANDOCDB_OBJS) $(MANDOCDB_LNS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h + +PRECONV_OBJS = preconv.o +PRECONV_LNS = preconv.ln + +$(PRECONV_OBJS) $(PRECONV_LNS): config.h + +APROPOS_OBJS = apropos.o apropos_db.o manpath.o +APROPOS_LNS = apropos.ln apropos_db.ln manpath.ln + +$(APROPOS_OBJS) $(APROPOS_LNS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + cgi.o \ + apropos_db.o \ + manpath.o \ + out.o \ + tree.o + +CGI_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + cgi.ln \ + apropos_db.ln \ + manpath.ln \ + out.ln \ + tree.ln + +$(CGI_OBJS) $(CGI_LNS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CATMAN_OBJS = catman.o manpath.o +CATMAN_LNS = catman.ln manpath.ln + +$(CATMAN_OBJS) $(CATMAN_LNS): config.h mandoc.h manpath.h mandocdb.h + +DEMANDOC_OBJS = demandoc.o +DEMANDOC_LNS = demandoc.ln + +$(DEMANDOC_OBJS) $(DEMANDOC_LNS): config.h + +INDEX_MANS = apropos.1.html \ + apropos.1.xhtml \ + apropos.1.ps \ + apropos.1.pdf \ + apropos.1.txt \ + catman.8.html \ + catman.8.xhtml \ + catman.8.ps \ + catman.8.pdf \ + catman.8.txt \ + demandoc.1.html \ + demandoc.1.xhtml \ + demandoc.1.ps \ + demandoc.1.pdf \ + demandoc.1.txt \ + mandoc.1.html \ + mandoc.1.xhtml \ + mandoc.1.ps \ + mandoc.1.pdf \ + mandoc.1.txt \ + whatis.1.html \ + whatis.1.xhtml \ + whatis.1.ps \ + whatis.1.pdf \ + whatis.1.txt \ + mandoc.3.html \ + mandoc.3.xhtml \ + mandoc.3.ps \ + mandoc.3.pdf \ + mandoc.3.txt \ + eqn.7.html \ + eqn.7.xhtml \ + eqn.7.ps \ + eqn.7.pdf \ + eqn.7.txt \ + man.7.html \ + man.7.xhtml \ + man.7.ps \ + man.7.pdf \ + man.7.txt \ + man.cgi.7.html \ + man.cgi.7.xhtml \ + man.cgi.7.ps \ + man.cgi.7.pdf \ + man.cgi.7.txt \ + mandoc_char.7.html \ + mandoc_char.7.xhtml \ + mandoc_char.7.ps \ + mandoc_char.7.pdf \ + mandoc_char.7.txt \ + mdoc.7.html \ + mdoc.7.xhtml \ + mdoc.7.ps \ + mdoc.7.pdf \ + mdoc.7.txt \ + preconv.1.html \ + preconv.1.xhtml \ + preconv.1.ps \ + preconv.1.pdf \ + preconv.1.txt \ + roff.7.html \ + roff.7.xhtml \ + roff.7.ps \ + roff.7.pdf \ + roff.7.txt \ + tbl.7.html \ + tbl.7.xhtml \ + tbl.7.ps \ + tbl.7.pdf \ + tbl.7.txt \ + mandocdb.8.html \ + mandocdb.8.xhtml \ + mandocdb.8.ps \ + mandocdb.8.pdf \ + mandocdb.8.txt + +$(INDEX_MANS): mandoc + +INDEX_OBJS = $(INDEX_MANS) \ + man.h.html \ + mandoc.h.html \ + mdoc.h.html \ + mdocml.tar.gz \ + mdocml.md5 + +www: index.html + +lint: llib-lmandoc.ln llib-lpreconv.ln llib-ldemandoc.ln $(DBLN) + +clean: + rm -f libmandoc.a $(LIBMANDOC_OBJS) + rm -f llib-llibmandoc.ln $(LIBMANDOC_LNS) + rm -f mandocdb $(MANDOCDB_OBJS) + rm -f llib-lmandocdb.ln $(MANDOCDB_LNS) + rm -f preconv $(PRECONV_OBJS) + rm -f llib-lpreconv.ln $(PRECONV_LNS) + rm -f apropos whatis $(APROPOS_OBJS) + rm -f llib-lapropos.ln $(APROPOS_LNS) + rm -f man.cgi $(CGI_OBJS) + rm -f llib-lman.cgi.ln $(CGI_LNS) + rm -f catman $(CATMAN_OBJS) + rm -f llib-lcatman.ln $(CATMAN_LNS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f llib-ldemandoc.ln $(DEMANDOC_LNS) + rm -f mandoc $(MANDOC_OBJS) + rm -f llib-lmandoc.ln $(MANDOC_LNS) + rm -f config.h config.log $(COMPAT_OBJS) $(COMPAT_LNS) + rm -f mdocml.tar.gz mdocml-win32.zip mdocml-win64.zip mdocml-macosx.zip + rm -f index.html $(INDEX_OBJS) + rm -rf test-fgetln.dSYM + rm -rf test-strlcpy.dSYM + rm -rf test-strlcat.dSYM + rm -rf test-strptime.dSYM + rm -rf test-mmap.dSYM + rm -rf test-getsubopt.dSYM + rm -rf apropos.dSYM + rm -rf catman.dSYM + rm -rf mandocdb.dSYM + rm -rf whatis.dSYM + +install: all + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(EXAMPLEDIR) + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_PROGRAM) mandoc preconv demandoc $(DESTDIR)$(BINDIR) + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) mandoc.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) + +installcgi: all + mkdir -p $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(HTDOCDIR) + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css + $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR) + +installwww: www + mkdir -p $(PREFIX)/snapshots + mkdir -p $(PREFIX)/binaries + $(INSTALL_DATA) index.html external.png index.css $(PREFIX) + $(INSTALL_DATA) $(INDEX_MANS) style.css $(PREFIX) + $(INSTALL_DATA) mandoc.h.html man.h.html mdoc.h.html $(PREFIX) + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots/mdocml-$(VERSION).tar.gz + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots/mdocml-$(VERSION).md5 + +libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + +llib-llibmandoc.ln: $(COMPAT_LNS) $(LIBMANDOC_LNS) + $(LINT) $(LINTFLAGS) -Clibmandoc $(COMPAT_LNS) $(LIBMANDOC_LNS) + +mandoc: $(MANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a + +llib-lmandoc.ln: $(MANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandoc $(MANDOC_LNS) llib-llibmandoc.ln + +mandocdb: $(MANDOCDB_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB) + +llib-lmandocdb.ln: $(MANDOCDB_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandocdb $(MANDOCDB_LNS) llib-llibmandoc.ln + +preconv: $(PRECONV_OBJS) + $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS) + +llib-lpreconv.ln: $(PRECONV_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS) llib-llibmandoc.ln + +whatis: apropos + cp -f apropos whatis + +apropos: $(APROPOS_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) + +llib-lapropos.ln: $(APROPOS_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Capropos $(APROPOS_LNS) llib-llibmandoc.ln + +catman: $(CATMAN_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(CATMAN_OBJS) libmandoc.a $(DBLIB) + +llib-lcatman.ln: $(CATMAN_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Ccatman $(CATMAN_LNS) llib-llibmandoc.ln + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) + +llib-lman.cgi.ln: $(CGI_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cman.cgi $(CGI_LNS) llib-llibmandoc.ln + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a + +llib-ldemandoc.ln: $(DEMANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cdemandoc $(DEMANDOC_LNS) llib-llibmandoc.ln + +mdocml.md5: mdocml.tar.gz + md5 mdocml.tar.gz >$@ + +mdocml.tar.gz: $(SRCS) + mkdir -p .dist/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .dist/mdocml-$(VERSION) + ( cd .dist/ && tar zcf ../$@ ./ ) + rm -rf .dist/ + +mdocml-win32.zip: $(SRCS) + mkdir -p .win32/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win32 + cp .win32/Makefile .win32/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win32/Makefile.old >.win32/Makefile + ( cd .win32; \ + CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win32 + +mdocml-win64.zip: $(SRCS) + mkdir -p .win64/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win64 + cp .win64/Makefile .win64/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win64/Makefile.old >.win64/Makefile + ( cd .win64; \ + CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win64 + +mdocml-macosx.zip: $(SRCS) + mkdir -p .macosx/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .macosx + ( cd .macosx; \ + CFLAGS="-arch i386 -arch x86_64 -arch ppc" LDFLAGS="-arch i386 -arch x86_64 -arch ppc" make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .macosx + +index.html: $(INDEX_OBJS) + +config.h: config.h.pre config.h.post + rm -f config.log + ( cat config.h.pre; \ + echo; \ + if $(CC) $(CFLAGS) -Werror -o test-fgetln test-fgetln.c >> config.log 2>&1; then \ + echo '#define HAVE_FGETLN'; \ + rm test-fgetln; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strptime test-strptime.c >> config.log 2>&1; then \ + echo '#define HAVE_STRPTIME'; \ + rm test-strptime; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-getsubopt test-getsubopt.c >> config.log 2>&1; then \ + echo '#define HAVE_GETSUBOPT'; \ + rm test-getsubopt; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcat test-strlcat.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCAT'; \ + rm test-strlcat; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-mmap test-mmap.c >> config.log 2>&1; then \ + echo '#define HAVE_MMAP'; \ + rm test-mmap; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcpy test-strlcpy.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCPY'; \ + rm test-strlcpy; \ + fi; \ + echo; \ + cat config.h.post \ + ) > $@ + +.h.h.html: + highlight -I $< >$@ + +.1.1.txt .3.3.txt .7.7.txt .8.8.txt: + ./mandoc -Tascii -Wall,stop $< | col -b >$@ + +.1.1.html .3.3.html .7.7.html .8.8.html: + ./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@ + +.1.1.ps .3.3.ps .7.7.ps .8.8.ps: + ./mandoc -Tps -Wall,stop $< >$@ + +.1.1.xhtml .3.3.xhtml .7.7.xhtml .8.8.xhtml: + ./mandoc -Txhtml -Wall,stop -Ostyle=style.css,man=%N.%S.xhtml,includes=%I.html $< >$@ + +.1.1.pdf .3.3.pdf .7.7.pdf .8.8.pdf: + ./mandoc -Tpdf -Wall,stop $< >$@ + +.sgml.html: + validate --warn $< + sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@ Added: soc2012/jhagewood/mdocml-1.12.1-orig/TODO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml-1.12.1-orig/TODO Sun May 27 04:06:09 2012 (r236541) @@ -0,0 +1,372 @@ +************************************************************************ +* Official mandoc TODO. +* $Id: TODO,v 1.129 2012/03/04 23:53:37 schwarze Exp $ +************************************************************************ + +************************************************************************ +* parser bugs +************************************************************************ + +- ".\}" on its own line gets translated to bare ".\&" + which forces pset() into man(7) + and then triggers an unknown macro error + reported by naddy@ Sun, 3 Jul 2011 21:52:24 +0200 + +************************************************************************ +* formatter bugs +************************************************************************ + +- tbl(7): Horizontal and vertical lines are formatted badly: + With the box option, there is too much white space at the end of cells. + Horizontal lines from "=" lines are a bit too long. + yuri dot pankov at gmail dot com Thu, 14 Apr 2011 05:45:26 +0400 + +************************************************************************ +* missing features +************************************************************************ + +--- missing roff features ---------------------------------------------- + +- The pod2man preamble wants \h'...' with quoted numerical arguments, + see for example AUTHORS in MooseX::Getopt.3p, p5-MooseX-Getopt. + reported by Andreas Voegele + Tue, 22 Nov 2011 15:34:47 +0100 on ports@ + +- .if n \{ + .br\} + should cause an extra space to be raised. + +- .ad (adjust margins) + .ad l -- adjust left margin only (flush left) + .ad r -- adjust right margin only (flush right) + .ad c -- center text on line + .ad b -- adjust both margins (alias: .ad n) + .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). + +- .it (line traps) occur in mysql(1), yasm_arch(7) + generated by DocBook XSL Stylesheets v1.71.1 + reported by brad@ Sat, 15 Jan 2011 15:48:18 -0500 + +- .ns (no-space mode) occurs in xine-config(1) + reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + +- xloadimage(1) wants .ti (temporary indent), rep by naddy@ + +- .ta (tab settings) occurs in ircbug(1) and probably gnats(1) + reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 + +- \c (interrupted text) occurs in chat(8) + +- using undefined strings or macros defines them to be empty + wl@ Mon, 14 Nov 2011 14:37:01 +0000 + +--- missing mdoc features ---------------------------------------------- + +- fix bad block nesting involving multiple identical explicit blocks + see the OpenBSD mdoc_macro.c 1.47 commit message + +- .Bl -column .Xo support is missing + ultimate goal: + restore .Xr and .Dv to + lib/libc/compat-43/sigvec.3 + lib/libc/gen/signal.3 + lib/libc/sys/sigaction.2 + +- 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 + +- \\ is now implemented correctly + * when defining strings and macros using .ds and .de + * when parsing roff(7) and man(7) macro arguments + It does not yet work in mdoc(7) macro arguments + because libmdoc does not yet use mandoc_getarg(). + Also check what happens in plain text, it must be identical to \e. + +- .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). + +- implement blank `Bl -column', such as + .Bl -column + .It foo Ta bar + .El + +- explicitly disallow nested `Bl -column', which would clobber internal + flags defined for struct mdoc_macro + +- 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 + ugly code from login.conf(5): + .Bl -column minpasswordlen program xetcxmotd + .It path Ta path Ta value of Dv _PATH_DEFPATH + .br + Default search path. + reported by Michal Mazurek + via jmc@ Thu, 7 Apr 2011 16:00:53 +0059 + +- inside `.Bl -column' phrases, punctuation is handled like normal + text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -." + +- inside `.Bl -column' phrases, TERMP_IGNDELIM handling by `Pf' + is not safe, e.g. `.Bl -column .It Pf a b .' gives "ab." + but should give "ab ." + +- set a meaningful default if no `Bl' list type is assigned + +- have a blank `It' head for `Bl -tag' not puke + +- prohibit `Nm' from having non-text HEAD children + (e.g., NetBSD mDNSShared/dns-sd.1) + (mdoc_html.c and mdoc_term.c `Nm' handlers can be slightly simplified) + +- 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 + macro, while mandoc treats it as a block macro and breaks the line. + No idea how the logic for distinguishing in-line and block instances + should be, needs investigation. + uqs@ Thu, 2 Jun 2011 11:03:51 +0200 + uqs@ Thu, 2 Jun 2011 11:33:35 +0200 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Sun May 27 04:07:35 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 5768B1065670 for ; Sun, 27 May 2012 04:07:34 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Sun, 27 May 2012 04:07:34 +0000 Date: Sun, 27 May 2012 04:07:34 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120527040734.5768B1065670@hub.freebsd.org> Cc: Subject: socsvn commit: r236542 - soc2012/jhagewood X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 May 2012 04:07:35 -0000 Author: jhagewood Date: Sun May 27 04:07:34 2012 New Revision: 236542 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236542 Log: Deleted: soc2012/jhagewood/ From owner-svn-soc-all@FreeBSD.ORG Sun May 27 04:08:00 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 1EE52106564A for ; Sun, 27 May 2012 04:07:59 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Sun, 27 May 2012 04:07:59 +0000 Date: Sun, 27 May 2012 04:07:59 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120527040759.1EE52106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r236543 - soc2012/jhagewood X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 May 2012 04:08:00 -0000 Author: jhagewood Date: Sun May 27 04:07:58 2012 New Revision: 236543 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236543 Log: Added: soc2012/jhagewood/ From owner-svn-soc-all@FreeBSD.ORG Sun May 27 04:09:13 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id DDE9C106566B for ; Sun, 27 May 2012 04:09:10 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Sun, 27 May 2012 04:09:10 +0000 Date: Sun, 27 May 2012 04:09:10 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120527040910.DDE9C106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236544 - in soc2012/jhagewood: . diff diff3 gabor_diff mdocml mdocml/mdocml-1.12.1 mdocml/mdocml-1.12.1-orig mdocml/mdocml_patches sdiff X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 May 2012 04:09:13 -0000 Author: jhagewood Date: Sun May 27 04:09:10 2012 New Revision: 236544 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236544 Log: Added: soc2012/jhagewood/Milestones soc2012/jhagewood/diff/ soc2012/jhagewood/diff/Makefile soc2012/jhagewood/diff/diff (contents, props changed) soc2012/jhagewood/diff/diff.1 soc2012/jhagewood/diff/diff.1.gz (contents, props changed) soc2012/jhagewood/diff/diff.c soc2012/jhagewood/diff/diff.h soc2012/jhagewood/diff/diffdir.c soc2012/jhagewood/diff/diffreg.c soc2012/jhagewood/diff/pathnames.h soc2012/jhagewood/diff3/ soc2012/jhagewood/diff3/Makefile soc2012/jhagewood/diff3/diff3.1 soc2012/jhagewood/diff3/diff3.ksh soc2012/jhagewood/diff3/diff3.sh soc2012/jhagewood/diff3/diff3prog.c soc2012/jhagewood/gabor_diff/ soc2012/jhagewood/gabor_diff/Makefile soc2012/jhagewood/gabor_diff/diff.1 soc2012/jhagewood/gabor_diff/diff.c soc2012/jhagewood/gabor_diff/diff.h soc2012/jhagewood/gabor_diff/diffdir.c soc2012/jhagewood/gabor_diff/diffreg.c soc2012/jhagewood/gabor_diff/pathnames.h soc2012/jhagewood/mdocml/ soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/whatis.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1/whatis.1 soc2012/jhagewood/mdocml/mdocml_patches/ soc2012/jhagewood/mdocml/mdocml_patches/patch-config.txt soc2012/jhagewood/mdocml/mdocml_patches/patch-lib.in.txt soc2012/jhagewood/mdocml/mdocml_patches/patch-mdoc_validate.c soc2012/jhagewood/mdocml/mdocml_patches/patch-msec.in.txt soc2012/jhagewood/mdocml/mdocml_test.sh (contents, props changed) soc2012/jhagewood/mdocml/svn-commit.tmp soc2012/jhagewood/sdiff/ soc2012/jhagewood/sdiff/Makefile soc2012/jhagewood/sdiff/common.c soc2012/jhagewood/sdiff/common.h soc2012/jhagewood/sdiff/edit.c soc2012/jhagewood/sdiff/extern.h soc2012/jhagewood/sdiff/sdiff.1 soc2012/jhagewood/sdiff/sdiff.c Added: soc2012/jhagewood/Milestones ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/Milestones Sun May 27 04:09:10 2012 (r236544) @@ -0,0 +1,30 @@ +May 21 - June 17 + + Implement all missing features of mdocml, including legacy features. + Testing of mdocml. + +June 18 - July 1 + + Complete diff + Debugging and testing of diff + +July 2 - July 18 + + Mid-term evaluations. + Complete sdiff + Debugging and testing of sdiff + +July 19 - August 5 + + Complete diff3 + Debugging and testing of diff3 + +August 6 – August 12 + + Thouroughly test and benchmark all utilities. + +August 13 - August 20 + + "Pencils down" period. + Finish cleaning up code and do any testing that might be left. + Write documentation. Added: soc2012/jhagewood/diff/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/diff/Makefile Sun May 27 04:09:10 2012 (r236544) @@ -0,0 +1,10 @@ +# $FreeBSD$ +# $OpenBSD: Makefile,v 1.2 2003/06/25 02:42:50 deraadt Exp $ + +DEBUG_FLAGS+= -g + +PROG= diff +SRCS= diff.c diffdir.c diffreg.c +CFLAGS+= -std=c99 -Wall -pedantic + +.include Added: soc2012/jhagewood/diff/diff ============================================================================== Binary file. No diff available. Added: soc2012/jhagewood/diff/diff.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/diff/diff.1 Sun May 27 04:09:10 2012 (r236544) @@ -0,0 +1,511 @@ +.\" $FreeBSD$ +.\" $OpenBSD: diff.1,v 1.33 2007/05/31 19:20:09 jmc Exp $ +.\" +.\" Copyright (c) 1980, 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)diff.1 8.1 (Berkeley) 6/30/93 +.\" +.Dd Apr 7, 2008 +.Dt DIFF 1 +.Os +.Sh NAME +.Nm diff +.Nd differential file and directory comparator +.Sh SYNOPSIS +.Nm diff +.Op Fl abdilpqTtw +.Op Fl I Ar pattern +.Oo +.Fl c | e | f | +.Fl n | u +.Oc +.Op Fl L Ar label +.Ar file1 file2 +.Nm diff +.Op Fl abdilpqTtw +.Op Fl I Ar pattern +.Op Fl L Ar label +.Fl C Op Ar number +.Ar file1 file2 +.Nm diff +.Op Fl abdilqtw +.Op Fl I Ar pattern +.Fl D Ar string +.Ar file1 file2 +.Nm diff +.Op Fl abdilpqTtw +.Op Fl I Ar pattern +.Op Fl L Ar label +.Fl U Ar number +.Ar file1 file2 +.Nm diff +.Op Fl abdilNPpqrsTtw +.Op Fl I Ar pattern +.Oo +.Fl c | e | f | +.Fl n | u +.Oc +.Bk -words +.Op Fl L Ar label +.Op Fl S Ar name +.Op Fl X Ar file +.Op Fl x Ar pattern +.Ek +.Ar dir1 dir2 +.Nm diff +.Op Fl v +.Sh DESCRIPTION +The +.Nm +utility compares the contents of +.Ar file1 +and +.Ar file2 +and writes to the standard output the list of changes necessary to +convert one file into the other. +No output is produced if the files are identical. +.Pp +Output options (mutually exclusive): +.Bl -tag -width Ds +.It Fl C Op Ar number , Fl Fl context Ns = Ns Op Ar number +Like +.Fl c +but produces a diff with +.Ar number +lines of context. +.It Fl c +Produces a diff with 3 lines of context. +With +.Fl c +the output format is modified slightly: +the output begins with identification of the files involved and +their creation dates and then each change is separated +by a line with fifteen +.Li * Ns 's . +The lines removed from +.Ar file1 +are marked with +.Sq \&-\ \& ; +those added to +.Ar file2 +are marked +.Sq \+\ \& . +Lines which are changed from one file to the other are marked in +both files with +.Sq !\ \& . +Changes which lie within 3 lines of each other are grouped together on +output. +.It Fl D Ar string , Fl Fl ifdef Ns = Ns Ar string +Creates a merged version of +.Ar file1 +and +.Ar file2 +on the standard output, with C preprocessor controls included so that +a compilation of the result without defining +.Ar string +is equivalent to compiling +.Ar file1 , +while defining +.Ar string +will yield +.Ar file2 . +.It Fl e , Fl Fl ed +Produces output in a form suitable as input for the editor utility, +.Xr ed 1 , +which can then be used to convert file1 into file2. +.Pp +Extra commands are added to the output when comparing directories with +.Fl e , +so that the result is a +.Xr sh 1 +script for converting text files which are common to the two directories +from their state in +.Ar dir1 +to their state in +.Ar dir2 . +.It Fl f +Identical output to that of the +.Fl e +flag, but in reverse order. +It cannot be digested by +.Xr ed 1 . +.It Fl n , Fl Fl rcs +Produces a script similar to that of +.Fl e , +but in the opposite order and with a count of changed lines on each +insert or delete command. +This is the form used by +.Xr rcsdiff 1 . +.It Fl q , Fl Fl brief +Just print a line when the files differ. +Does not output a list of changes. +.It Fl U Op Ar number , Fl Fl unified Ns = Ns Op Ar number +Like +.Fl u +but produces a diff with +.Ar number +lines of context. +.It Fl u +Produces a +.Em unified +diff with 3 lines of context. +A unified diff is similar to the context diff produced by the +.Fl c +option. +However, unlike with +.Fl c , +all lines to be changed (added and/or removed) are present in +a single section. +.El +.Pp +Comparison options: +.Bl -tag -width Ds +.It Fl a , Fl Fl text +Treat all files as +.Tn ASCII +text. +Normally +.Nm +will simply print +.Dq Binary files ... differ +if files contain binary characters. +Use of this option forces +.Nm +to produce a diff. +.It Fl b , Fl Fl ignore-space-change +Causes trailing blanks (spaces and tabs) to be ignored, and other +strings of blanks to compare equal. +.It Fl d , Fl Fl minimal +Try very hard to produce a diff as small as possible. +This may consume a lot of processing power and memory when processing +large files with many changes. +.It Fl I Ar pattern , Fl Fl ignore-matching-lines Ns = Ns Ar pattern +Ignores changes, insertions, and deletions whose lines match the +extended regular expression +.Ar pattern . +Multiple +.Fl I +patterns may be specified. +All lines in the change must match some pattern for the change to be +ignored. +See +.Xr re_format 7 +for more information on regular expression patterns. +.It Fl i , Fl Fl ignore-case +Ignores the case of letters. +E.g., +.Dq A +will compare equal to +.Dq a . +.It Fl L Ar label +Print +.Ar label +instead of the first (and second, if this option is specified twice) +file name and time in the context or unified diff header. +.It Fl l , Fl Fl paginate +Long output format; each text file +.Nm diff Ns \'d +is piped through +.Xr pr 1 +to paginate it; +other differences are remembered and summarized +after all text file differences are reported. +.It Fl p , Fl Fl show-c-function +With unified and context diffs, show with each change +the first 40 characters of the last line before the context beginning +with a letter, an underscore or a dollar sign. +For C source code following standard layout conventions, this will +show the prototype of the function the change applies to. +.It Fl T , Fl Fl initial-tab +Print a tab rather than a space before the rest of the line for the +normal, context or unified output formats. +This makes the alignment of tabs in the line consistent. +.It Fl t , Fl Fl expand-tabs +Will expand tabs in output lines. +Normal or +.Fl c +output adds character(s) to the front of each line which may screw up +the indentation of the original source lines and make the output listing +difficult to interpret. +This option will preserve the original source's indentation. +.It Fl w , Fl Fl ignore-all-space +Is similar to +.Fl b +but causes whitespace (blanks and tabs) to be totally ignored. +E.g., +.Dq if (\ \&a == b \&) +will compare equal to +.Dq if(a==b) . +.El +.Pp +Directory comparison options: +.Bl -tag -width Ds +.It Fl N , Fl Fl new-file +If a file is found in only one directory, act as if it was found in the +other directory too but was of zero size. +.It Fl P +If a file is found only in +.Ar dir2 , +act as if it was found in +.Ar dir1 +too but was of zero size. +.It Fl r , Fl Fl recursive +Causes application of +.Nm +recursively to common sub7 directories encountered. +.It Fl S Ar name , Fl starting-file Ns = Ns Ar name +Re-starts a directory +.Nm +in the middle, beginning with file +.Ar name . +.It Fl s , Fl Fl report-identical-files +Causes +.Nm +to report files which are the same, which are otherwise not mentioned. +.It Fl X Ar file , Fl Fl exclude-from Ns = Ns Ar file +Exclude files and subdirectories from comparison whose basenames match +lines in +.Ar file . +Multiple +.Fl X +options may be specified. +.It Fl x Ar pattern , Fl Fl exclude Ns = Ns Ar pattern +Exclude files and subdirectories from comparison whose basenames match +.Ar pattern . +Patterns are matched using shell-style globbing via +.Xr fnmatch 3 . +Multiple +.Fl x +options may be specified. +.It Fl v , Fl Fl version +Print version ino. +.El +.Pp +If both arguments are directories, +.Nm +sorts the contents of the directories by name, and then runs the +regular file +.Nm +algorithm, producing a change list, +on text files which are different. +Binary files which differ, +common subdirectories, and files which appear in only one directory +are described as such. +In directory mode only regular files and directories are compared. +If a non-regular file such as a device special file or +.Tn FIFO +is encountered, a diagnostic message is printed. +.Pp +If only one of +.Ar file1 +and +.Ar file2 +is a directory, +.Nm +is applied to the non-directory file and the file contained in +the directory file with a filename that is the same as the +last component of the non-directory file. +.Pp +If either +.Ar file1 +or +.Ar file2 +is +.Sq Fl , +the standard input is +used in its place. +.Ss Output Style +The default (without +.Fl e , +.Fl c , +or +.Fl n +.\" -C +options) +output contains lines of these forms, where +.Va XX , YY , ZZ , QQ +are line numbers respective of file order. +.Pp +.Bl -tag -width "XX,YYcZZ,QQ" -compact +.It Li XX Ns Ic a Ns Li YY +At (the end of) line +.Va XX +of +.Ar file1 , +append the contents +of line +.Va YY +of +.Ar file2 +to make them equal. +.It Li XX Ns Ic a Ns Li YY,ZZ +Same as above, but append the range of lines, +.Va YY +through +.Va ZZ +of +.Ar file2 +to line +.Va XX +of file1. +.It Li XX Ns Ic d Ns Li YY +At line +.Va XX +delete +the line. +The value +.Va YY +tells to which line the change would bring +.Ar file1 +in line with +.Ar file1 . +.It Li XX,YY Ns Ic d Ns Li ZZ +Delete the range of lines +.Va XX +through +.Va YY +in +.Ar file1 . +.It Li XX Ns Ic c Ns Li YY +Change the line +.Va XX +in +.Ar file1 +to the line +.Va YY +in +.Ar file2 . +.It Li XX,YY Ns Ic c Ns Li ZZ +Replace the range of specified lines with the line +.Va ZZ . +.It Li XX,YY Ns Ic c Ns Li ZZ,QQ +Replace the range +.Va XX , Ns Va YY +from +.Ar file1 +with the range +.Va ZZ , Ns Va QQ +from +.Ar file2 . +.El +.Pp +These lines resemble +.Xr ed 1 +subcommands to convert +.Ar file1 +into +.Ar file2 . +The line numbers before the action letters pertain to +.Ar file1 ; +those after pertain to +.Ar file2 . +Thus, by exchanging +.Ic a +for +.Ic d +and reading the line in reverse order, one can also +determine how to convert +.Ar file2 +into +.Ar file1 . +As in +.Xr ed 1 , +identical +pairs (where num1 = num2) are abbreviated as a single +number. +.Sh ENVIRONMENT +.Bl -tag -width TMPDIR +.It Ev TMPDIR +If the environment variable +.Ev TMPDIR +exists, +.Nm +will use the directory specified by +.Ev TMPDIR +as the temporary directory. +.El +.Sh FILES +.Bl -tag -width /tmp/diff.XXXXXXXX -compact +.It Pa /tmp/diff. Ns Ar XXXXXXXX +Temporary file used when comparing a device or the standard input. +Note that the temporary file is unlinked as soon as it is created +so it will not show up in a directory listing. +.El +.Sh DIAGNOSTICS +The +.Nm +utility exits with one of the following values: +.Pp +.Bl -tag -width Ds -compact -offset indent +.It 0 +No differences were found. +.It 1 +Differences were found. +.It \*(Gt1 +An error occurred. +.El +.Sh SEE ALSO +.Xr cmp 1 , +.Xr comm 1 , +.Xr diff3 1 , +.Xr ed 1 , +.Xr pr 1 , +.Xr sdiff 1 , +.Xr fnmatch 3 , +.Xr re_format 7 +.Sh STANDARDS +The +.Nm +utility is compliant with the +St -p1003.1-2004 +specification. +.Pp +The flags +.Op Fl aDdIiLlNnPpqSsTtUuwXx +are extensions to that specification. +.Sh HISTORY +A +.Nm +command appeared in +.At v6 . +.Sh BUGS +When comparing directories with the +.Fl b , +.Fl w +or +.Fl i +options specified, +.Nm +first compares the files ala +.Xr cmp 1 , +and then decides to run the +.Nm +algorithm if they are not equal. +This may cause a small amount of spurious output if the files +then turn out to be identical because the only differences are +insignificant whitespace or case differences. Added: soc2012/jhagewood/diff/diff.1.gz ============================================================================== Binary file. No diff available. Added: soc2012/jhagewood/diff/diff.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/diff/diff.c Sun May 27 04:09:10 2012 (r236544) @@ -0,0 +1,599 @@ +/*- + * Copyright (c) 2003 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. + */ + +#include + +#ifndef lint +#if 0 +__RCSID("$OpenBSD: diff.c,v 1.50 2007/05/29 18:24:56 ray Exp $"); +#else +__FBSDID("$FreeBSD$"); +#endif +#endif /* not lint */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "diff.h" +#include "pathnames.h" + +int aflag, bflag, dflag, iflag, lflag, Nflag, Pflag, pflag, rflag; +int sflag, tflag, Tflag, wflag; +int Bflag, yflag; +int strip_cr, tabsize=8; +char ignore_file_case = 0; +int format, context, status; +char *start, *ifdefname, *diffargs, *label[2], *ignore_pats; +struct stat stb1, stb2; +struct excludes *excludes_list; +regex_t ignore_re; + +int flag_opts = 0; + +#define OPTIONS "0123456789aBbC:cdD:efhI:iL:lnNPpqrS:sTtU:uvwXy:x" + + +/* Options which exceed manageable alphanumeric assignments */ +enum +{ + OPT_IGN_FN_CASE = CHAR_MAX + 1, + OPT_NIGN_FN_CASE, + OPT_STRIPCR, + OPT_NORMAL, + OPT_LEFTC, + OT_SUPCL, + OPT_GTYPE, + OPT_LF, + OPT_LLF, + OPT_TSIZE, + OPT_UNINF, + OPT_FFILE, + OPT_TOFILE, + OPT_HLINES, + OPT_LFILES, + OPT_HELP, +}; + + +static struct option longopts[] = { +/* XXX: UNIMPLEMENTED + { "normal", no_argument, NULL, OPT_NORMAL }, + { "left-column", no_argument, NULL, OPT_LEFTC }, + { "suppress-common-lines", no_argument, NULL, OT_SUPCL }, + { "GTYPE-group-format", required_argument, NULL, OPT_GTYPE }, + { "line-format", required_argument, NULL, OPT_LF }, + { "LTYPE-line-format", required_argument, NULL, OPT_LLF }, + { "unidirectional-new-file", no_argument, NULL, OPT_UNINF }, + { "from-file", required_argument, NULL, OPT_FFILE }, + { "to-file", required_argument, NULL, OPT_TOFILE }, + { "horizon-lines", required_argument, NULL, OPT_HLINES }, + { "speed-large-files", no_argument, NULL, OPT_LFILES }, */ + { "tabsize", optional_argument, NULL, OPT_TSIZE }, + { "strip-trailing-cr", no_argument, NULL, OPT_STRIPCR }, + { "help", no_argument, NULL, OPT_HELP }, + { "ignore-file-name-case", no_argument, NULL, OPT_IGN_FN_CASE }, + { "no-ignore-file-name-case", no_argument, NULL, OPT_NIGN_FN_CASE }, + { "text", no_argument, NULL, 'a' }, +/* XXX: UNIMPLEMENTED */ + { "ignore-blank-lines", no_argument, NULL, 'B' }, + { "ignore-space-change", no_argument, NULL, 'b' }, +/* XXX: -c is incompatible with GNU version */ + { "context", optional_argument, NULL, 'C' }, + { "ifdef", required_argument, NULL, 'D' }, + { "minimal", no_argument, NULL, 'd' }, +/* XXX: UNIMPLEMENTED + { "ignore-tab-expansion", no_argument, NULL, 'E' }, */ + { "ed", no_argument, NULL, 'e' }, +/* XXX: UNIMPLEMENTED + { "show-function-line", required_argument, NULL, 'F' }, */ + { "forward-ed", no_argument, NULL, 'f' }, + { "ignore-matching-lines", required_argument, NULL, 'I' }, + { "ignore-case", no_argument, NULL, 'i' }, + { "label", required_argument, NULL, 'L' }, + { "paginate", no_argument, NULL, 'l' }, + { "new-file", no_argument, NULL, 'N' }, + { "rcs", no_argument, NULL, 'n' }, + { "unidirectional-new-file", no_argument, NULL, 'P' }, + { "show-c-function", no_argument, NULL, 'p' }, + { "brief", no_argument, NULL, 'q' }, + { "recursive", no_argument, NULL, 'r' }, + { "starting-file", required_argument, NULL, 'S' }, + { "report-identical-files", no_argument, NULL, 's' }, + { "initial-tab", no_argument, NULL, 'T' }, + { "expand-tabs", no_argument, NULL, 't' }, +/* XXX: -u is incompatible with GNU version */ + { "unified", optional_argument, NULL, 'U' }, + { "version", no_argument, NULL, 'v' }, +/* XXX: UNIMPLEMENTED + { "width", optional_argument, NULL, 'W' }, */ + { "ignore-all-space", no_argument, NULL, 'w' }, + { "exclude-from", required_argument, NULL, 'X' }, + { "exclude", required_argument, NULL, 'x' }, + { "side-by-side", no_argument, NULL, 'y' }, + { NULL, 0, NULL, '\0'} +}; + +static const char *help_msg[] = { +"-a --text treat files as ASCII text", +"-B --ignore-blank-lines Ignore blank newlines in the comparison", +"-b --ignore-space-change Ignore all changes due to whitespace", +"-C NUM --context=[NUM] Show NUM lines before and after change (default 3)", +"-D --ifdef=NAME", +NULL, +}; +char **help_strs = (char **)help_msg; + +void set_argstr(char **, char **); + + +void usage(void); +void push_excludes(char *); +void push_ignore_pats(char *); +void read_excludes_file(char *); + +int +main(int argc, char **argv) +{ + char *ep, **oargv; + long l; + int ch, lastch, gotstdin, prevoptind, newarg; + int oargc; + + oargv = argv; + oargc = argc; + gotstdin = 0; + + lastch = '\0'; + prevoptind = 1; + newarg = 1; + while ((ch = getopt_long(argc, argv, OPTIONS, longopts, NULL)) != -1) { + switch (ch) { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + if (newarg) + usage(); /* disallow -[0-9]+ */ + else if (lastch == 'c' || lastch == 'u') + context = 0; + else if (!isdigit(lastch) || context > INT_MAX / 10) + usage(); + context = (context * 10) + (ch - '0'); + break; + case 'a': + aflag = 1; + break; + case 'b': + bflag = 1; + break; + case 'B': + Bflag = 1; + break; + case 'C': + case 'c': + format = D_CONTEXT; + if (optarg != NULL) { + l = strtol(optarg, &ep, 10); + if (*ep != '\0' || l < 0 || l >= INT_MAX) + usage(); + context = (int)l; + } else + context = 3; + break; + case 'D': + format = D_IFDEF; + ifdefname = optarg; + break; + case 'd': + dflag = 1; + break; + case 'e': + format = D_EDIT; + break; + case 'f': + format = D_REVERSE; + break; + case 'h': + /* silently ignore for backwards compatibility */ + break; + case 'I': + push_ignore_pats(optarg); + break; + case 'i': + iflag = 1; + break; + case 'L': + if (label[0] == NULL) + label[0] = optarg; + else if (label[1] == NULL) + label[1] = optarg; + else + usage(); + break; + case 'l': + lflag = 1; + signal(SIGPIPE, SIG_IGN); + break; + case 'N': + Nflag = 1; + break; + case 'n': + format = D_NREVERSE; + break; + case 'P': + Pflag = 1; + break; + case 'p': + pflag = 1; + break; + case 'r': + rflag = 1; + break; + case 'q': + format = D_BRIEF; + break; + case 'S': + start = optarg; + break; + case 's': + sflag = 1; + break; + case 'T': + Tflag = 1; + break; + case 't': + tflag = 1; + break; + case 'U': + case 'u': + format = D_UNIFIED; + if (optarg != NULL) { + l = strtol(optarg, &ep, 10); + if (*ep != '\0' || l < 0 || l >= INT_MAX) + usage(); + context = (int)l; + } else + context = 3; + break; + case 'v': + printf("FreeBSD diff 2.8.7\n"); + exit(0); + case 'w': + wflag = 1; + break; + case 'X': + read_excludes_file(optarg); + break; + case 'x': + push_excludes(optarg); + break; + case 'y': + yflag = 1; + break; + case OPT_TSIZE: + if (optarg != NULL) { + l = strtol(optarg, &ep, 10); + if (*ep != '\0' || l < 1 || l >= INT_MAX) + usage(); + tabsize = (int)l; + } else + tabsize = 8; + break; + case OPT_STRIPCR: + strip_cr=1; + break; + case OPT_IGN_FN_CASE: + ignore_file_case = 1; + break; + case OPT_NIGN_FN_CASE: + ignore_file_case = 0; + break; + case OPT_HELP: + for(;*help_strs;help_strs++) + { + printf("%s\n", *help_strs); + } + exit(2); + break; + default: + usage(); + break; + } + lastch = ch; + newarg = optind != prevoptind; + prevoptind = optind; + } + argc -= optind; + argv += optind; + + if(yflag) { + /* remove y flag from args and call sdiff */ + for(argv=oargv; argv && strcmp(*argv, "-y") != 0; argv++); + while(argv != &oargv[oargc]){ + *argv=*(argv+1); + argv++; + } + oargv[0] = _PATH_SDIFF; + *argv= "\0"; + + execv(_PATH_SDIFF, oargv); + _exit(127); + } + + /* + * Do sanity checks, fill in stb1 and stb2 and call the appropriate + * driver routine. Both drivers use the contents of stb1 and stb2. + */ + if (argc != 2) + usage(); + if (ignore_pats != NULL) { + char buf[BUFSIZ]; + int error; + + if ((error = regcomp(&ignore_re, ignore_pats, + REG_NEWLINE | REG_EXTENDED)) != 0) { + regerror(error, &ignore_re, buf, sizeof(buf)); + if (*ignore_pats != '\0') + errx(2, "%s: %s", ignore_pats, buf); + else + errx(2, "%s", buf); + } + } + if (strcmp(argv[0], "-") == 0) { + fstat(STDIN_FILENO, &stb1); + gotstdin = 1; + } else if (stat(argv[0], &stb1) != 0) + err(2, "%s", argv[0]); + if (strcmp(argv[1], "-") == 0) { + fstat(STDIN_FILENO, &stb2); + gotstdin = 1; + } else if (stat(argv[1], &stb2) != 0) + err(2, "%s", argv[1]); + if (gotstdin && (S_ISDIR(stb1.st_mode) || S_ISDIR(stb2.st_mode))) + errx(2, "can't compare - to a directory"); + set_argstr(oargv, argv); + if (S_ISDIR(stb1.st_mode) && S_ISDIR(stb2.st_mode)) { + if (format == D_IFDEF) + errx(2, "-D option not supported with directories"); + diffdir(argv[0], argv[1]); + } else { + if (S_ISDIR(stb1.st_mode)) { + argv[0] = splice(argv[0], argv[1]); + if (stat(argv[0], &stb1) < 0) + err(2, "%s", argv[0]); + } + if (S_ISDIR(stb2.st_mode)) { + argv[1] = splice(argv[1], argv[0]); + if (stat(argv[1], &stb2) < 0) + err(2, "%s", argv[1]); + } + print_status(diffreg(argv[0], argv[1], 0), argv[0], argv[1], + NULL); + } + exit(status); +} + +void * +emalloc(size_t n) +{ + void *p; + + if (n == 0) + errx(2, NULL); + + if ((p = malloc(n)) == NULL) + errx(2, NULL); + return (p); +} + +void * +erealloc(void *p, size_t n) +{ + void *q; + + if (n == 0) + errx(2, NULL); + if (p == NULL) + q = malloc(n); + else + q = realloc(p, n); + if (q == NULL) + errx(2, NULL); + return (q); +} + +int +easprintf(char **ret, const char *fmt, ...) +{ + int len; + va_list ap; + + va_start(ap, fmt); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Mon May 28 10:49:45 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 0490D106564A for ; Mon, 28 May 2012 10:49:43 +0000 (UTC) (envelope-from scher@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 28 May 2012 10:49:43 +0000 Date: Mon, 28 May 2012 10:49:43 +0000 From: scher@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120528104943.0490D106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r236583 - soc2012/scher/par_ports/head/Mk X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 10:49:45 -0000 Author: scher Date: Mon May 28 10:49:42 2012 New Revision: 236583 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236583 Log: [new_feature] _parv_${_lock_dir}_LOCK_LOOP - main scripts to lock a directory _parv_CHECK_LOCK - script to check if $${dir} is locked. [doc] Submitted by: Alexander Pronin M bsd.parallel.mk M bsd.port.mk Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk soc2012/scher/par_ports/head/Mk/bsd.port.mk Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Mon May 28 09:51:10 2012 (r236582) +++ soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Mon May 28 10:49:42 2012 (r236583) @@ -11,11 +11,15 @@ _parv_= ##################################################### # Debugging specific tools and variable declarations -_dparv_START_OUTPUT_MESSAGE= "=================_PAR_PORTS_SPECIFIC_OUTPUT_==============" -_dparv_END_OUTPUT_MESSAGE= "==============_END_OF_PAR_PORTS_SPECIFIC_OUTPUT_==============" +_dparv_START_OUTPUT_MESSAGE= =================_PAR_PORTS_SPECIFIC_OUTPUT_============== +_dparv_END_OUTPUT_MESSAGE= ==============_END_OF_PAR_PORTS_SPECIFIC_OUTPUT_============== _dparv_START_OUTPUT= ${ECHO_CMD} ${_dparv_START_OUTPUT_MESSAGE} _dparv_END_OUTPUT= ${ECHO_CMD} ${_dparv_END_OUTPUT_MESSAGE} + +# Delay for feedback message if the directory is locked. +# Just not to annoy a user with feedback message on each attempt to lock a directory. +_parv_ON_LOCK_FEEDBACK_TIMEOUT?= 2 # End of Debugging specific tools and variable declarations section ##################################################### ##################################################### @@ -28,8 +32,6 @@ .if !${.TARGETS} _parv_IS_DEFAULT_TARGET= 1 .else -_dparv_TARGETS:=${.TARGETS} - .for _called_target in ${.TARGETS} _tmp_called_target= ${_called_target} . for _def_target in ${_parv_DEFAULT_TARGETS} @@ -44,6 +46,8 @@ # Commands _parv_KILL= /bin/kill _parv_KILL_FLAGS= -- +_parv_PKILL= /bin/pkill +_parv_PKILL_FLAGS= -P DO_NADA?= ${TRUE} # End of Commands section @@ -56,6 +60,13 @@ _parv_WAIT_FOR_LOCK_TIME= 5 _parv_WAIT_FOR_UNLOCK_TIME= 15 +# Delay in seconds between attempts to lock a directory in lock loops +_parv_LOCK_ATTEMPT_TIMEOUT=2 + +# exit status of lock script in case the directory is locked +_parv_ON_LOCK_EXIT_STATUS= 2 +_parv_LOCKF_EX_TEMPFAIL= 75 + # Senquence of commands to lock a directory using ${_parv_LOCK_FILE}. # During evaluation of the following commands lockf(1) is holding lock on ${_parv_LOCK_FILE} file. # Hence NO other process is able to evaluate any commands using lockf(1) @@ -63,13 +74,7 @@ # # Stalled locks cheking enabled. # -# If the directory is locked then make process will be terminated with 143 exit code. -# If ${_parv_LOCK_FILE} is locked then make process will be terminated with 143 exit code. -# -# For loop produces two varuables: -# _parv_PKG_DBDIR_LOCK_SEQ -# _parv_.CURDIR_LOCK_SEQ -# as sequencies of commands to provide locking of ${PKG_DBDIR} and ${.CURDIR} accordingly. +# If the directory is locked this script returns ${_parv_ON_LOCK_EXIT_STATUS}. # # ${${_lock_dir}} == ${PKG_DBDIR} OR ${.CURDIR} # @@ -81,60 +86,145 @@ ${CHMOD} 777 ${${_lock_dir}}/${_parv_LOCK_FILE}; \ pid=$$(${CAT} ${${_lock_dir}}/${_parv_LOCK_FILE}); \ if [ $${pid} ]; then \ - ps -p $${pid} > /dev/null; \ - status=$$(${ECHO_CMD} $$?); \ + ps -p $${pid} > /dev/null && status=$$? || status=$$?; \ if [ $${status} -eq 0 ]; then \ - ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} Unable to lock ${${_lock_dir}}; \ - ${ECHO_CMD} Dir: ${${_lock_dir}} is already locked by another working process PID=$${pid}...; \ - ${_dparv_END_OUTPUT}; \ - ${_parv_KILL} ${_parv_KILL_FLAGS} -${.MAKE.PID}; \ + exit ${_parv_ON_LOCK_EXIT_STATUS}; \ else \ ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} Dir: ${${_lock_dir}} Stalled lock Detected!; \ - ${ECHO_CMD} Deleting stalled lock. PID=$${pid}; \ - ${ECHO_CMD} Locking: ${${_lock_dir}}; \ + ${ECHO_CMD} "Dir: ${${_lock_dir}} Stalled lock Detected!"; \ + ${ECHO_CMD} "Deleting stalled lock. PID=$${pid}"; \ + ${ECHO_CMD} "Locking: ${${_lock_dir}}"; \ ${_dparv_END_OUTPUT}; \ ${ECHO_CMD} ${.MAKE.PID} > ${${_lock_dir}}/${_parv_LOCK_FILE}; \ fi; \ else \ ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} Locking: ${${_lock_dir}}; \ + ${ECHO_CMD} "Locking: ${${_lock_dir}}"; \ ${_dparv_END_OUTPUT}; \ ${ECHO_CMD} ${.MAKE.PID} > ${${_lock_dir}}/${_parv_LOCK_FILE}; \ fi +##################################################### + # _parv_PKG_DBDIR_DO_LOCK # _parv_.CURDIR_DO_LOCK +# This scripts handles exit status of lockf(1) call. +# It substitutes exit status 75 of lockf(1) for ${_parv_ON_LOCK_EXIT_STATUS} and pushes it. # _parv_${_lock_dir}_DO_LOCK= \ - lockf -k -t ${_parv_WAIT_FOR_LOCK_TIME} ${${_lock_dir}}/${_parv_LOCK_FILE} ${SH} -c '${_parv_${_lock_dir}_LOCK_SEQ}' || ( \ - ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} "Unable to lock ${${_lock_dir}}"; \ - ${ECHO_CMD} "Lock file: ${${_lock_dir}}/${_parv_LOCK_FILE} is alredy locked by another working process ..."; \ - ${_dparv_END_OUTPUT}; \ - ${_parv_KILL} ${_parv_KILL_FLAGS} -${.MAKE.PID}; \ - ) + lockf -k -t ${_parv_WAIT_FOR_LOCK_TIME} ${${_lock_dir}}/${_parv_LOCK_FILE} ${SH} -c '${_parv_${_lock_dir}_LOCK_SEQ}' || { \ + status=$$?; \ + if [ $${status} -eq ${_parv_LOCKF_EX_TEMPFAIL} ] || \ + [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ + exit ${_parv_ON_LOCK_EXIT_STATUS}; \ + else \ + ${_dparv_START_OUTPUT}; \ + ${ECHO_CMD} "Unhandled EXIT STATUS = $${status}. Terminating"; \ + ${_dparv_END_OUTPUT}; \ + exit $${status}; \ + fi; \ + } + +##################################################### + +# Loops to lock directory +# _parv_PKG_DBDIR_LOCK_LOOP +# _parv_.CURDIR_LOCK_LOOP +# $${attempts} - Number of attempts to lock a directory. Exetranl variable. +# Default value = 1, if this var is not set. +# Set this variable to -1 for infinity loop. +# e.g. ( attempts=10; ${_parv_.CURDIR_LOCK_LOOP} ) && ..... || .... +# +_parv_${_lock_dir}_LOCK_LOOP= \ + enable_feedback=${_parv_ON_LOCK_FEEDBACK_TIMEOUT}; \ + if [ ! $${attempts} ]; then attempts=1; fi; \ + while [ $${attempts} -ne 0 ]; do \ + attempts=$$(( $${attempts} - 1 )); \ + ( ${_parv_${_lock_dir}_DO_LOCK} ) && status=$$? || status=$$?; \ + if [ $${status} -eq 0 ]; then \ + exit 0; \ + elif [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ + if [ $$(( $${enable_feedback} % ${_parv_ON_LOCK_FEEDBACK_TIMEOUT} )) -eq 0 ]; then \ + ${_dparv_START_OUTPUT}; \ + ${ECHO_CMD} "Unable to lock ${${_lock_dir}}"; \ + ${ECHO_CMD} "Dir: ${${_lock_dir}} is already locked by another working process ..."; \ + ${ECHO_CMD} "Waiting for unlock ........................................................."; \ + ${_dparv_END_OUTPUT}; \ + enable_feedback=0; \ + fi; \ + enable_feedback=$$(( $${enable_feedback} + 1 )); \ + sleep ${_parv_LOCK_ATTEMPT_TIMEOUT}; \ + continue; \ + else \ + exit 1; \ + fi; \ + done; \ + exit ${_parv_ON_LOCK_EXIT_STATUS} + +##################################################### # _parv_PKG_DBDIR_DO_UNLOCK # _parv_.CURDIR_DO_UNLOCK # -_parv_${_lock_dir}_DO_UNLOCK= ( \ - lockf -k -t ${_parv_WAIT_FOR_UNLOCK_TIME} ${${_lock_dir}}/${_parv_LOCK_FILE} ${RM} ${${_lock_dir}}/${_parv_LOCK_FILE} || \ - ( \ - ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} Unable to unlock ${${_lock_dir}}; \ - ${_dparv_END_OUTPUT}; \ - ${_parv_KILL} ${_parv_KILL_FLAGS} -${.MAKE.PID}; \ - ) \ -) && ( \ - ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} "Dir: ${${_lock_dir}} is unloked"; \ - ${_dparv_END_OUTPUT}; \ -) +_parv_${_lock_dir}_DO_UNLOCK= \ + lockf -k -t ${_parv_WAIT_FOR_UNLOCK_TIME} ${${_lock_dir}}/${_parv_LOCK_FILE} \ + ${RM} ${${_lock_dir}}/${_parv_LOCK_FILE} && { \ + ${_dparv_START_OUTPUT}; \ + ${ECHO_CMD} "Dir: ${${_lock_dir}} is unlocked"; \ + ${_dparv_END_OUTPUT}; \ + } || { \ + ${_dparv_START_OUTPUT}; \ + ${ECHO_CMD} "Hard unlock!"; \ + ${RM} -rf ${${_lock_dir}}/${_parv_LOCK_FILE}; \ + ${_dparv_END_OUTPUT}; \ + } + .endfor # _lock_dir in PKG_DBDIR .CURDIR +##################################################### + +# _parv_CHECK_SEQ +# _parv_CHECK_LOCK +# The former variables Implement check for lock utility +# $${dir} - dir to check. External variable for script. Assign this variable +# appropriate value before executing this script e.g. ( dir=/some/dir/to/check; ${_parv_CHECK_LOCK} ) || ... +# Script exits with status ${_parv_ON_LOCK_EXIT_STATUS} if $${dir} is locked +# +_parv_CHECK_SEQ= \ + ${CHMOD} 777 $${dir}/${_parv_LOCK_FILE}; \ + pid=\$$(${CAT} $${dir}/${_parv_LOCK_FILE}); \ + if [ \$${pid} ]; then \ + ps -p \$${pid} > /dev/null && status=\$$? || status=\$$?; \ + if [ \$${status} -eq 0 ]; then \ + ${_dparv_START_OUTPUT}; \ + ${ECHO_CMD} Unable to lock $${dir}; \ + ${ECHO_CMD} Dir: $${dir} is already locked by another working process ...; \ + ${_dparv_START_OUTPUT}; \ + exit ${_parv_ON_LOCK_EXIT_STATUS}; \ + else \ + ${_dparv_START_OUTPUT}; \ + ${ECHO_CMD} Dir: $${dir} Stalled lock Detected!; \ + ${ECHO_CMD} Deleting stalled lock. PID=\$${pid}; \ + ${_dparv_END_OUTPUT}; \ + fi; \ + fi; \ + ${RM} -rf $${dir}/${_parv_LOCK_FILE} + +_parv_CHECK_LOCK= \ + lockf -k -t ${_parv_WAIT_FOR_LOCK_TIME} $${dir}/${_parv_LOCK_FILE} ${SH} -c "${_parv_CHECK_SEQ}" || { \ + status=$$?; \ + if [ $${status} -eq ${_parv_LOCKF_EX_TEMPFAIL} ] || \ + [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ + exit ${_parv_ON_LOCK_EXIT_STATUS}; \ + else \ + ${_dparv_START_OUTPUT}; \ + ${ECHO_CMD} "Unhandled EXIT STATUS = $${status}. Terminating"; \ + ${_dparv_END_OUTPUT}; \ + exit $${status}; \ + fi; \ + } + # End of Locking variables and tools section ##################################################### @@ -142,5 +232,4 @@ @${DO_NADA} do-unlock: - @${DO_NADA} - + @${DO_NADA} \ No newline at end of file Modified: soc2012/scher/par_ports/head/Mk/bsd.port.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.port.mk Mon May 28 09:51:10 2012 (r236582) +++ soc2012/scher/par_ports/head/Mk/bsd.port.mk Mon May 28 10:49:42 2012 (r236583) @@ -1531,7 +1531,7 @@ .BEGIN: . if defined(WANT_PARALLEL_BUILD) . if ${_parv_IS_DEFAULT_TARGET} - @${_parv_.CURDIR_DO_LOCK} + @attempts=-1; ${_parv_.CURDIR_LOCK_LOOP} . endif . endif # You can force skipping these test by defining IGNORE_PATH_CHECKS From owner-svn-soc-all@FreeBSD.ORG Mon May 28 12:01:39 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 234951065672 for ; Mon, 28 May 2012 12:01:36 +0000 (UTC) (envelope-from scher@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 28 May 2012 12:01:36 +0000 Date: Mon, 28 May 2012 12:01:36 +0000 From: scher@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120528120136.234951065672@hub.freebsd.org> Cc: Subject: socsvn commit: r236587 - soc2012/scher/par_ports/head/Mk X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 12:01:39 -0000 Author: scher Date: Mon May 28 12:01:35 2012 New Revision: 236587 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236587 Log: [new_feature] ${PKG_DBDIR} locking for port's registration phase. new debugging barrier variable (some king of readln() ) [fixed] WANT_PARALLEL_BUILD variable renamed to _parv_WANT_PARALLEL_BUILD to suit parallel specific variables' names. Submitted by: Alexander Pronin Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk soc2012/scher/par_ports/head/Mk/bsd.port.mk Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Mon May 28 10:45:51 2012 (r236586) +++ soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Mon May 28 12:01:35 2012 (r236587) @@ -17,6 +17,11 @@ _dparv_START_OUTPUT= ${ECHO_CMD} ${_dparv_START_OUTPUT_MESSAGE} _dparv_END_OUTPUT= ${ECHO_CMD} ${_dparv_END_OUTPUT_MESSAGE} +# Use it when you need a barrier +_dparv_DEBUGGING_BREAKPOINT= ${ECHO_CMD} Debugging breakpoint here...; \ + ${ECHO_CMD} Press any key when you are ready to continue; \ + read non_existed_var + # Delay for feedback message if the directory is locked. # Just not to annoy a user with feedback message on each attempt to lock a directory. _parv_ON_LOCK_FEEDBACK_TIMEOUT?= 2 Modified: soc2012/scher/par_ports/head/Mk/bsd.port.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.port.mk Mon May 28 10:45:51 2012 (r236586) +++ soc2012/scher/par_ports/head/Mk/bsd.port.mk Mon May 28 12:01:35 2012 (r236587) @@ -1133,7 +1133,7 @@ # parallel build/install features # -.if defined(WANT_PARALLEL_BUILD) +.if defined(_parv_WANT_PARALLEL_BUILD) .include "${PORTSDIR}/Mk/bsd.parallel.mk" .endif @@ -1527,9 +1527,9 @@ ############### PAR_PORTS SPECIFIC COMMENT LINE ############### # -.if defined(WANT_PARALLEL_BUILD) || !defined(IGNORE_PATH_CHECKS) +.if defined(_parv_WANT_PARALLEL_BUILD) || !defined(IGNORE_PATH_CHECKS) .BEGIN: -. if defined(WANT_PARALLEL_BUILD) +. if defined(_parv_WANT_PARALLEL_BUILD) . if ${_parv_IS_DEFAULT_TARGET} @attempts=-1; ${_parv_.CURDIR_LOCK_LOOP} . endif @@ -1542,9 +1542,9 @@ @${FALSE} . endif . endif -.endif #defined(WANT_PARALLEL_BUILD) || !defined(IGNORE_PATH_CHECKS) +.endif #defined(_parv_WANT_PARALLEL_BUILD) || !defined(IGNORE_PATH_CHECKS) -.if defined(WANT_PARALLEL_BUILD) +.if defined(_parv_WANT_PARALLEL_BUILD) .END: . if ${_parv_IS_DEFAULT_TARGET} @${_parv_.CURDIR_DO_UNLOCK} @@ -5919,6 +5919,17 @@ .if !target(fake-pkg) fake-pkg: .if !defined(NO_PKG_REGISTER) +############### PAR_PORTS SPECIFIC COMMENT LINE ############### +.if defined(_parv_WANT_PARALLEL_BUILD) + @( attempts=-1; ${_parv_PKG_DBDIR_LOCK_LOOP} ) || { \ + status=$$?; \ + ${_dparv_START_OUTPUT}; \ + ${ECHO_CMD} Unable to lock ${PKG_DBDIR}. Exit status $${status}; \ + ${_dparv_END_OUTPUT}; \ + exit 1; \ + } +.endif +############### END OF PAR_PORTS SPECIFIC COMMENT LINE ############### @if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} ${PKG_DBDIR}; fi @${RM} -f /tmp/${PKGNAME}-required-by .if defined(FORCE_PKG_REGISTER) @@ -5964,6 +5975,17 @@ ${CAT} /tmp/${PKGNAME}-required-by >> ${PKG_DBDIR}/${PKGNAME}/+REQUIRED_BY; \ ${RM} -f /tmp/${PKGNAME}-required-by; \ fi +############### PAR_PORTS SPECIFIC COMMENT LINE ############### +.if defined(_parv_WANT_PARALLEL_BUILD) + @( ${_parv_PKG_DBDIR_DO_UNLOCK} ) || { \ + status=$$?; \ + ${_dparv_START_OUTPUT}; \ + ${ECHO_CMD} Unable to unlock ${PKG_DBDIR}. Exit status $${status}; \ + ${_dparv_END_OUTPUT}; \ + exit 1; \ + } +.endif +############### END OF PAR_PORTS SPECIFIC COMMENT LINE ############### .else @${DO_NADA} .endif From owner-svn-soc-all@FreeBSD.ORG Mon May 28 12:11:57 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 3298A106564A for ; Mon, 28 May 2012 12:11:55 +0000 (UTC) (envelope-from vbotton@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 28 May 2012 12:11:55 +0000 Date: Mon, 28 May 2012 12:11:55 +0000 From: vbotton@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120528121155.3298A106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r236588 - soc2012/vbotton/ntfs_apple X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 12:11:57 -0000 Author: vbotton Date: Mon May 28 12:11:54 2012 New Revision: 236588 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236588 Log: Delete useless includes, try to use ino_t instead of ino64_t Modified: soc2012/vbotton/ntfs_apple/ntfs_bitmap.c soc2012/vbotton/ntfs_apple/ntfs_collate.c soc2012/vbotton/ntfs_apple/ntfs_hash.c soc2012/vbotton/ntfs_apple/ntfs_inode.h soc2012/vbotton/ntfs_apple/ntfs_runlist.h soc2012/vbotton/ntfs_apple/ntfs_types.h soc2012/vbotton/ntfs_apple/ntfs_vfsops.c soc2012/vbotton/ntfs_apple/ntfs_vnops.c soc2012/vbotton/ntfs_apple/ntfs_volume.h Modified: soc2012/vbotton/ntfs_apple/ntfs_bitmap.c ============================================================================== --- soc2012/vbotton/ntfs_apple/ntfs_bitmap.c Mon May 28 12:01:35 2012 (r236587) +++ soc2012/vbotton/ntfs_apple/ntfs_bitmap.c Mon May 28 12:11:54 2012 (r236588) @@ -35,12 +35,9 @@ * http://developer.apple.com/opensource/licenses/gpl-2.txt. */ +#include #include -#include - -#include - #include "ntfs_bitmap.h" #include "ntfs_debug.h" #include "ntfs_inode.h" Modified: soc2012/vbotton/ntfs_apple/ntfs_collate.c ============================================================================== --- soc2012/vbotton/ntfs_apple/ntfs_collate.c Mon May 28 12:01:35 2012 (r236587) +++ soc2012/vbotton/ntfs_apple/ntfs_collate.c Mon May 28 12:11:54 2012 (r236588) @@ -35,9 +35,6 @@ * http://developer.apple.com/opensource/licenses/gpl-2.txt. */ -#include - -#include #include "ntfs_collate.h" #include "ntfs_debug.h" Modified: soc2012/vbotton/ntfs_apple/ntfs_hash.c ============================================================================== --- soc2012/vbotton/ntfs_apple/ntfs_hash.c Mon May 28 12:01:35 2012 (r236587) +++ soc2012/vbotton/ntfs_apple/ntfs_hash.c Mon May 28 12:11:54 2012 (r236588) @@ -35,10 +35,10 @@ * http://developer.apple.com/opensource/licenses/gpl-2.txt. */ +#include #include #include -#include #include #include #include @@ -46,10 +46,6 @@ #include #include -#include -#include - -#include #include "ntfs.h" #include "ntfs_debug.h" Modified: soc2012/vbotton/ntfs_apple/ntfs_inode.h ============================================================================== --- soc2012/vbotton/ntfs_apple/ntfs_inode.h Mon May 28 12:01:35 2012 (r236587) +++ soc2012/vbotton/ntfs_apple/ntfs_inode.h Mon May 28 12:11:54 2012 (r236588) @@ -80,7 +80,7 @@ inodes and is incremented/decremented in the base inode for attribute/raw inode opens/closes, too. */ - struct mutex lock; /* Lock serializing changes to the inode such + struct mtx lock; /* Lock serializing changes to the inode such as inode truncation and directory content modification (both take the lock exclusive) and calls like readdir and file read (these @@ -91,13 +91,14 @@ this is the size of an mst protected ntfs record. */ u8 block_size_shift; /* Log2 of the above. */ - lck_spin_t size_lock; /* Lock serializing access to inode sizes. */ + struct mtx size_lock; /* Lock serializing access to inode sizes. */ s64 allocated_size; /* Copy from the attribute record. */ s64 data_size; /* Copy from the attribute record. */ s64 initialized_size; /* Copy from the attribute record. */ u32 flags; /* NTFS specific flags describing this inode. See ntfs_inode_flags_shift below. */ - ino64_t mft_no; /* Number of the mft record / inode. */ + /*ino64_t mft_no;*/ + ino_t mft_no; /* Number of the mft record / inode. */ u16 seq_no; /* Sequence number of the inode. */ unsigned link_count; /* Number of hard links to this inode. Note we make this field an integer, i.e. at least @@ -187,7 +188,7 @@ * inodes. */ ntfs_inode *mft_ni; /* Pointer to the ntfs inode of $MFT. */ - buf_t m_buf; /* Buffer containing the mft record of the + struct buf m_buf; /* Buffer containing the mft record of the inode. This should only be touched by the ntfs_*mft_record_(un)map() functions. */ MFT_RECORD *m; /* Address of the buffer data and thus address @@ -400,7 +401,7 @@ static inline u32 NInoTestClear##flag(ntfs_inode *ni) \ { \ ni->flags &= ~((u32)1 << NI_##flag); \ - return (u32)((ni->flags >> NI_##flag) & 1) \ + return (u32)((ni->flags >> NI_##flag) & 1); \ } /* Emit the ntfs inode bitops functions. */ @@ -481,7 +482,8 @@ * possible on all architectures. */ struct _ntfs_attr { - ino64_t mft_no; + //ino64_t mft_no; + ino_t mft_no; ntfschar *name; u32 name_len; ATTR_TYPE type; Modified: soc2012/vbotton/ntfs_apple/ntfs_runlist.h ============================================================================== --- soc2012/vbotton/ntfs_apple/ntfs_runlist.h Mon May 28 12:01:35 2012 (r236587) +++ soc2012/vbotton/ntfs_apple/ntfs_runlist.h Mon May 28 12:11:54 2012 (r236588) @@ -114,12 +114,14 @@ { rl->rl = NULL; rl->alloc = rl->elements = 0; - lck_rw_init(&rl->lock, ntfs_lock_grp, ntfs_lock_attr); + //lck_rw_init(&rl->lock, ntfs_lock_grp, ntfs_lock_attr); + rw_init(&rl->lock, "runlist lock"); } static inline void ntfs_rl_deinit(ntfs_runlist *rl) { - lck_rw_destroy(&rl->lock, ntfs_lock_grp); + //lck_rw_destroy(&rl->lock, ntfs_lock_grp); + rw_destroy(&rl->lock); } /** Modified: soc2012/vbotton/ntfs_apple/ntfs_types.h ============================================================================== --- soc2012/vbotton/ntfs_apple/ntfs_types.h Mon May 28 12:01:35 2012 (r236587) +++ soc2012/vbotton/ntfs_apple/ntfs_types.h Mon May 28 12:11:54 2012 (r236588) @@ -108,5 +108,9 @@ /* Our boolean type. */ typedef int BOOL; +#define FALSE 0 +#define TRUE 1 + +typedef int errno_t; #endif /* !_OSX_NTFS_TYPES_H */ Modified: soc2012/vbotton/ntfs_apple/ntfs_vfsops.c ============================================================================== --- soc2012/vbotton/ntfs_apple/ntfs_vfsops.c Mon May 28 12:01:35 2012 (r236587) +++ soc2012/vbotton/ntfs_apple/ntfs_vfsops.c Mon May 28 12:11:54 2012 (r236588) @@ -35,28 +35,18 @@ * http://developer.apple.com/opensource/licenses/gpl-2.txt. */ +#include #include -#include #include #include #include -#include -#include #include #include #include #include -#include #include #include - -#include -#include -#include - -#include - -#include +#include #include "ntfs.h" #include "ntfs_attr.h" Modified: soc2012/vbotton/ntfs_apple/ntfs_vnops.c ============================================================================== --- soc2012/vbotton/ntfs_apple/ntfs_vnops.c Mon May 28 12:01:35 2012 (r236587) +++ soc2012/vbotton/ntfs_apple/ntfs_vnops.c Mon May 28 12:11:54 2012 (r236588) @@ -35,6 +35,7 @@ * http://developer.apple.com/opensource/licenses/gpl-2.txt. */ +#include #include #include #include @@ -46,8 +47,6 @@ #include #include -#include - #include "ntfs.h" #include "ntfs_attr.h" Modified: soc2012/vbotton/ntfs_apple/ntfs_volume.h ============================================================================== --- soc2012/vbotton/ntfs_apple/ntfs_volume.h Mon May 28 12:01:35 2012 (r236587) +++ soc2012/vbotton/ntfs_apple/ntfs_volume.h Mon May 28 12:11:54 2012 (r236588) @@ -172,7 +172,7 @@ initialized. */ le32 default_file_security_id; /* The security_id to use when creating files or 0 if not initialized. */ - lck_spin_t security_id_lock; /* Lock for serializing accesses to the + struct mtx security_id_lock; /* Lock for serializing accesses to the security_id related variables. */ /* * $Extend system directory is located in the root directory with inode From owner-svn-soc-all@FreeBSD.ORG Mon May 28 15:55:50 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 4159310656DD for ; Mon, 28 May 2012 15:55:49 +0000 (UTC) (envelope-from exxo@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 28 May 2012 15:55:49 +0000 Date: Mon, 28 May 2012 15:55:49 +0000 From: exxo@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120528155549.4159310656DD@hub.freebsd.org> Cc: Subject: socsvn commit: r236599 - soc2012/exxo/head X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 15:55:50 -0000 Author: exxo Date: Mon May 28 15:55:48 2012 New Revision: 236599 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236599 Log: Clone FreeBSD head Added: soc2012/exxo/head/ (props changed) - copied from r236598, mirror/FreeBSD/head/ From owner-svn-soc-all@FreeBSD.ORG Mon May 28 16:56:40 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 09495106566B for ; Mon, 28 May 2012 16:56:38 +0000 (UTC) (envelope-from exxo@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 28 May 2012 16:56:38 +0000 Date: Mon, 28 May 2012 16:56:38 +0000 From: exxo@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120528165638.09495106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236601 - in soc2012/exxo: . head/contrib/cvs/src patches regress X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 16:56:40 -0000 Author: exxo Date: Mon May 28 16:56:37 2012 New Revision: 236601 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236601 Log: Modify tree and provide software notes Added: soc2012/exxo/patches/ soc2012/exxo/patches/cvs-inet6.patch soc2012/exxo/regress/ soc2012/exxo/softnotes.txt Modified: soc2012/exxo/ (props changed) soc2012/exxo/head/contrib/cvs/src/client.c Modified: soc2012/exxo/head/contrib/cvs/src/client.c ============================================================================== --- soc2012/exxo/head/contrib/cvs/src/client.c Mon May 28 15:34:55 2012 (r236600) +++ soc2012/exxo/head/contrib/cvs/src/client.c Mon May 28 16:56:37 2012 (r236601) @@ -85,7 +85,7 @@ /* This is needed for GSSAPI encryption. */ static gss_ctx_id_t gcontext; -static int connect_to_gserver PROTO((cvsroot_t *, int, struct hostent *)); +static int connect_to_gserver PROTO((cvsroot_t *, int, const char *)); # endif /* HAVE_GSSAPI */ @@ -149,7 +149,7 @@ static size_t try_read_from_server PROTO ((char *, size_t)); static void auth_server PROTO ((cvsroot_t *, struct buffer *, struct buffer *, - int, int, struct hostent *)); + int, int, const char *)); /* We need to keep track of the list of directories we've sent to the server. This list, along with the current CVSROOT, will help us @@ -3605,6 +3605,28 @@ return hostinfo; } +static void +_inet_ntop(int af, struct sockaddr *sa, char *addr, socklen_t len) +{ + struct sockaddr_in *sin; + struct sockaddr_in6 *sin6; + + addr[0] = '\0'; + assert(af == sa->sa_family); + switch (af) + { + case AF_INET6: + sin6 = (struct sockaddr_in6 *)sa; + inet_ntop(af, &sin6->sin6_addr, addr, len); + break; + case AF_INET: + sin = (struct sockaddr_in *)sa; + inet_ntop(af, &sin->sin_addr, addr, len); + break; + default: + break; + } +} /* Generic function to do port number lookup tasks. @@ -3779,33 +3801,75 @@ { int sock; int port_number; - struct sockaddr_in client_sai; - struct hostent *hostinfo; struct buffer *to_server, *from_server; + struct addrinfo hints, *res, *res0, *ress; + int err, cause; + char ports[7], addr[INET6_ADDRSTRLEN]; - sock = socket (AF_INET, SOCK_STREAM, 0); - if (sock == -1) - { - error (1, 0, "cannot create socket: %s", SOCK_STRERROR (SOCK_ERRNO)); - } port_number = get_cvs_port_number (root); - hostinfo = init_sockaddr (&client_sai, root->hostname, port_number); - if (trace) + snprintf(ports, sizeof(ports), "%d", port_number); + + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_CANONNAME; + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + err = getaddrinfo(root->hostname, ports, &hints, &res0); + if (err) { - fprintf (stderr, " -> Connecting to %s(%s):%d\n", - root->hostname, - inet_ntoa (client_sai.sin_addr), port_number); + error(1, 0, "%s", gai_strerror(err)); + } + sock = -1; + cause = 0; + for (res = res0; res; res = res->ai_next) { + sock = socket(res->ai_family, res->ai_socktype, + res->ai_protocol); + if (sock < 0) { + cause = 1; + err = SOCK_ERRNO; + ress = res; + continue; + } + + if (trace) + { + _inet_ntop(res->ai_family, res->ai_addr, addr, sizeof(addr)); + fprintf (stderr, " -> Connecting to %s(%s):%d\n", + root->hostname, addr, port_number); + } + + if (connect(sock, res->ai_addr, res->ai_addrlen) < 0) { + cause = 2; + err = SOCK_ERRNO; + ress = res; + close(sock); + sock = -1; + continue; + } + + break; /* okay we got one */ + } + if (sock < 0) { + switch (cause) + { + case 1: + freeaddrinfo(res0); + error (1, 0, "cannot create socket: %s", SOCK_STRERROR (SOCK_ERRNO)); + case 2: + _inet_ntop(ress->ai_family, ress->ai_addr, addr, sizeof(addr)); + freeaddrinfo(res0); + error (1, 0, "connect to %s(%s):%d failed: %s", + root->hostname, addr, port_number, + SOCK_STRERROR (err)); + default: + freeaddrinfo(res0); + error (1, 0, "%s: unknown error", __func__); + } } - if (connect (sock, (struct sockaddr *) &client_sai, sizeof (client_sai)) - < 0) - error (1, 0, "connect to %s(%s):%d failed: %s", - root->hostname, - inet_ntoa (client_sai.sin_addr), - port_number, SOCK_STRERROR (SOCK_ERRNO)); make_bufs_from_fds (sock, sock, 0, &to_server, &from_server, 1); - auth_server (root, to_server, from_server, verify_only, do_gssapi, hostinfo); + auth_server (root, to_server, from_server, verify_only, do_gssapi, res->ai_canonname); + freeaddrinfo(res0); if (verify_only) { @@ -3839,13 +3903,13 @@ static void -auth_server (root, lto_server, lfrom_server, verify_only, do_gssapi, hostinfo) +auth_server (root, lto_server, lfrom_server, verify_only, do_gssapi, hostname) cvsroot_t *root; struct buffer *lto_server; struct buffer *lfrom_server; int verify_only; int do_gssapi; - struct hostent *hostinfo; + const char *hostname; { char *username = ""; /* the username we use to connect */ char no_passwd = 0; /* gets set if no password found */ @@ -3875,7 +3939,7 @@ error (1, 0, "gserver currently only enabled for socket connections"); } - if (! connect_to_gserver (root, fd, hostinfo)) + if (! connect_to_gserver (root, fd, hostname)) { error (1, 0, "authorization failed: server %s rejected access to %s", @@ -4076,6 +4140,7 @@ struct sockaddr_in sin; char *hname; + /* XXX Not IPv6 ready, but MIT Kerberos 4 code thou shall not touch. */ s = socket (AF_INET, SOCK_STREAM, 0); if (s < 0) error (1, 0, "cannot create socket: %s", SOCK_STRERROR (SOCK_ERRNO)); @@ -4176,10 +4241,10 @@ */ #define BUFSIZE 1024 static int -connect_to_gserver (root, sock, hostinfo) +connect_to_gserver (root, sock, hostname) cvsroot_t *root; int sock; - struct hostent *hostinfo; + const char *hostname; { char *str; char buf[BUFSIZE]; @@ -4192,9 +4257,9 @@ if (send (sock, str, strlen (str), 0) < 0) error (1, 0, "cannot send: %s", SOCK_STRERROR (SOCK_ERRNO)); - if (strlen (hostinfo->h_name) > BUFSIZE - 5) + if (strlen (hostname) > BUFSIZE - 5) error (1, 0, "Internal error: hostname exceeds length of buffer"); - sprintf (buf, "cvs@%s", hostinfo->h_name); + sprintf (buf, "cvs@%s", hostname); tok_in.length = strlen (buf); tok_in.value = buf; gss_import_name (&stat_min, &tok_in, GSS_C_NT_HOSTBASED_SERVICE, Added: soc2012/exxo/patches/cvs-inet6.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/exxo/patches/cvs-inet6.patch Mon May 28 16:56:37 2012 (r236601) @@ -0,0 +1,207 @@ +Index: src/client.c +=================================================================== +RCS file: /home/ncvs/src/contrib/cvs/src/client.c,v +retrieving revision 1.14 +diff -p -u -r1.14 client.c +--- src/client.c 19 Mar 2008 14:49:14 -0000 1.14 ++++ src/client.c 15 May 2012 01:47:06 -0000 +@@ -85,7 +85,7 @@ static Key_schedule sched; + /* This is needed for GSSAPI encryption. */ + static gss_ctx_id_t gcontext; + +-static int connect_to_gserver PROTO((cvsroot_t *, int, struct hostent *)); ++static int connect_to_gserver PROTO((cvsroot_t *, int, const char *)); + + # endif /* HAVE_GSSAPI */ + +@@ -149,7 +149,7 @@ static void handle_notified PROTO((char + static size_t try_read_from_server PROTO ((char *, size_t)); + + static void auth_server PROTO ((cvsroot_t *, struct buffer *, struct buffer *, +- int, int, struct hostent *)); ++ int, int, const char *)); + + /* We need to keep track of the list of directories we've sent to the + server. This list, along with the current CVSROOT, will help us +@@ -3605,6 +3605,28 @@ init_sockaddr (name, hostname, port) + return hostinfo; + } + ++static void ++_inet_ntop(int af, struct sockaddr *sa, char *addr, socklen_t len) ++{ ++ struct sockaddr_in *sin; ++ struct sockaddr_in6 *sin6; ++ ++ addr[0] = '\0'; ++ assert(af == sa->sa_family); ++ switch (af) ++ { ++ case AF_INET6: ++ sin6 = (struct sockaddr_in6 *)sa; ++ inet_ntop(af, &sin6->sin6_addr, addr, len); ++ break; ++ case AF_INET: ++ sin = (struct sockaddr_in *)sa; ++ inet_ntop(af, &sin->sin_addr, addr, len); ++ break; ++ default: ++ break; ++ } ++} + + + /* Generic function to do port number lookup tasks. +@@ -3779,33 +3801,75 @@ connect_to_pserver (root, to_server_p, f + { + int sock; + int port_number; +- struct sockaddr_in client_sai; +- struct hostent *hostinfo; + struct buffer *to_server, *from_server; ++ struct addrinfo hints, *res, *res0, *ress; ++ int err, cause; ++ char ports[7], addr[INET6_ADDRSTRLEN]; + +- sock = socket (AF_INET, SOCK_STREAM, 0); +- if (sock == -1) +- { +- error (1, 0, "cannot create socket: %s", SOCK_STRERROR (SOCK_ERRNO)); +- } + port_number = get_cvs_port_number (root); +- hostinfo = init_sockaddr (&client_sai, root->hostname, port_number); +- if (trace) ++ snprintf(ports, sizeof(ports), "%d", port_number); ++ ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_flags = AI_CANONNAME; ++ hints.ai_family = PF_UNSPEC; ++ hints.ai_socktype = SOCK_STREAM; ++ err = getaddrinfo(root->hostname, ports, &hints, &res0); ++ if (err) + { +- fprintf (stderr, " -> Connecting to %s(%s):%d\n", +- root->hostname, +- inet_ntoa (client_sai.sin_addr), port_number); ++ error(1, 0, "%s", gai_strerror(err)); ++ } ++ sock = -1; ++ cause = 0; ++ for (res = res0; res; res = res->ai_next) { ++ sock = socket(res->ai_family, res->ai_socktype, ++ res->ai_protocol); ++ if (sock < 0) { ++ cause = 1; ++ err = SOCK_ERRNO; ++ ress = res; ++ continue; ++ } ++ ++ if (trace) ++ { ++ _inet_ntop(res->ai_family, res->ai_addr, addr, sizeof(addr)); ++ fprintf (stderr, " -> Connecting to %s(%s):%d\n", ++ root->hostname, addr, port_number); ++ } ++ ++ if (connect(sock, res->ai_addr, res->ai_addrlen) < 0) { ++ cause = 2; ++ err = SOCK_ERRNO; ++ ress = res; ++ close(sock); ++ sock = -1; ++ continue; ++ } ++ ++ break; /* okay we got one */ ++ } ++ if (sock < 0) { ++ switch (cause) ++ { ++ case 1: ++ freeaddrinfo(res0); ++ error (1, 0, "cannot create socket: %s", SOCK_STRERROR (SOCK_ERRNO)); ++ case 2: ++ _inet_ntop(ress->ai_family, ress->ai_addr, addr, sizeof(addr)); ++ freeaddrinfo(res0); ++ error (1, 0, "connect to %s(%s):%d failed: %s", ++ root->hostname, addr, port_number, ++ SOCK_STRERROR (err)); ++ default: ++ freeaddrinfo(res0); ++ error (1, 0, "%s: unknown error", __func__); ++ } + } +- if (connect (sock, (struct sockaddr *) &client_sai, sizeof (client_sai)) +- < 0) +- error (1, 0, "connect to %s(%s):%d failed: %s", +- root->hostname, +- inet_ntoa (client_sai.sin_addr), +- port_number, SOCK_STRERROR (SOCK_ERRNO)); + + make_bufs_from_fds (sock, sock, 0, &to_server, &from_server, 1); + +- auth_server (root, to_server, from_server, verify_only, do_gssapi, hostinfo); ++ auth_server (root, to_server, from_server, verify_only, do_gssapi, res->ai_canonname); ++ freeaddrinfo(res0); + + if (verify_only) + { +@@ -3839,13 +3903,13 @@ connect_to_pserver (root, to_server_p, f + + + static void +-auth_server (root, lto_server, lfrom_server, verify_only, do_gssapi, hostinfo) ++auth_server (root, lto_server, lfrom_server, verify_only, do_gssapi, hostname) + cvsroot_t *root; + struct buffer *lto_server; + struct buffer *lfrom_server; + int verify_only; + int do_gssapi; +- struct hostent *hostinfo; ++ const char *hostname; + { + char *username = ""; /* the username we use to connect */ + char no_passwd = 0; /* gets set if no password found */ +@@ -3875,7 +3939,7 @@ auth_server (root, lto_server, lfrom_ser + error (1, 0, "gserver currently only enabled for socket connections"); + } + +- if (! connect_to_gserver (root, fd, hostinfo)) ++ if (! connect_to_gserver (root, fd, hostname)) + { + error (1, 0, + "authorization failed: server %s rejected access to %s", +@@ -4076,6 +4140,7 @@ start_tcp_server (root, to_server, from_ + struct sockaddr_in sin; + char *hname; + ++ /* XXX Not IPv6 ready, but MIT Kerberos 4 code thou shall not touch. */ + s = socket (AF_INET, SOCK_STREAM, 0); + if (s < 0) + error (1, 0, "cannot create socket: %s", SOCK_STRERROR (SOCK_ERRNO)); +@@ -4176,10 +4241,10 @@ recv_bytes (sock, buf, need) + */ + #define BUFSIZE 1024 + static int +-connect_to_gserver (root, sock, hostinfo) ++connect_to_gserver (root, sock, hostname) + cvsroot_t *root; + int sock; +- struct hostent *hostinfo; ++ const char *hostname; + { + char *str; + char buf[BUFSIZE]; +@@ -4192,9 +4257,9 @@ connect_to_gserver (root, sock, hostinfo + if (send (sock, str, strlen (str), 0) < 0) + error (1, 0, "cannot send: %s", SOCK_STRERROR (SOCK_ERRNO)); + +- if (strlen (hostinfo->h_name) > BUFSIZE - 5) ++ if (strlen (hostname) > BUFSIZE - 5) + error (1, 0, "Internal error: hostname exceeds length of buffer"); +- sprintf (buf, "cvs@%s", hostinfo->h_name); ++ sprintf (buf, "cvs@%s", hostname); + tok_in.length = strlen (buf); + tok_in.value = buf; + gss_import_name (&stat_min, &tok_in, GSS_C_NT_HOSTBASED_SERVICE, Added: soc2012/exxo/softnotes.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/exxo/softnotes.txt Mon May 28 16:56:37 2012 (r236601) @@ -0,0 +1,3 @@ +contrib/cvs FIXED (patch updated) +usr.bin/who OK (software dependant, utmpx fixed it) + From owner-svn-soc-all@FreeBSD.ORG Mon May 28 16:57:53 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 2670C1065670 for ; Mon, 28 May 2012 16:57:51 +0000 (UTC) (envelope-from gpf@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 28 May 2012 16:57:51 +0000 Date: Mon, 28 May 2012 16:57:51 +0000 From: gpf@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120528165751.2670C1065670@hub.freebsd.org> Cc: Subject: socsvn commit: r236602 - soc2012/gpf/misc X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 16:57:53 -0000 Author: gpf Date: Mon May 28 16:57:50 2012 New Revision: 236602 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236602 Log: fix print of file_id Modified: soc2012/gpf/misc/test_checksum.c Modified: soc2012/gpf/misc/test_checksum.c ============================================================================== --- soc2012/gpf/misc/test_checksum.c Mon May 28 16:56:37 2012 (r236601) +++ soc2012/gpf/misc/test_checksum.c Mon May 28 16:57:50 2012 (r236602) @@ -155,7 +155,7 @@ for (i = 0; i < checksum_hash_tablep->size; i++) { printf("\nbucket %d with elements: %u\n", i, checksum_hash_tablep->buckets[i].nelements); LIST_FOREACH(fhp, &(checksum_hash_tablep->buckets[i].file_headers), bucket_entries) { - printf("\tid = %d!\tnhashes = %d\n", (int)fhp->file_id, fhp->nhashes); + printf("\tid = %llu!\tnhashes = %d\n", fhp->file_id, fhp->nhashes); TAILQ_FOREACH(csp, &(fhp->checksums), checksum_entries) { printf("\t\tdigest="); for (j = 0; j < hash_len; j++) From owner-svn-soc-all@FreeBSD.ORG Mon May 28 17:02:34 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 1390C106564A for ; Mon, 28 May 2012 17:02:32 +0000 (UTC) (envelope-from gpf@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 28 May 2012 17:02:32 +0000 Date: Mon, 28 May 2012 17:02:32 +0000 From: gpf@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120528170232.1390C106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r236605 - in soc2012/gpf/pefs_kmod: sbin/pefs sys/fs/pefs X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 17:02:34 -0000 Author: gpf Date: Mon May 28 17:02:31 2012 New Revision: 236605 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236605 Log: add ioctl() to retrieve ciphertext for specific 4k sector. Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.c soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs.h soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs_vnops.c Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c ============================================================================== --- soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c Mon May 28 16:37:42 2012 (r236604) +++ soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c Mon May 28 17:02:31 2012 (r236605) @@ -69,6 +69,7 @@ #define PEFS_FH_SIZE 16 #define PEFS_BUCKET_SIZE 8 +/* XXXgpf: unions for on disk structs and move to a different header? */ struct checksum_file_header { uint8_t version; uint8_t reserved; @@ -83,6 +84,7 @@ TAILQ_ENTRY(checksum) checksum_entries; }; +/* XXXgpf: [TODO] turns offsets to 64bits uints (or off_t?) */ struct file_header { uint32_t nhashes; uint64_t file_id; @@ -108,13 +110,25 @@ pefs_compute_file_checksums(struct file_header *fhp, const EVP_MD *md, uint8_t hash_len) { - char buf[PEFS_SECTOR_SIZE]; + + struct pefs_xsector_ctext xsct; EVP_MD_CTX mdctx; - int md_len, i, fd, bytes_read; + struct stat sb; + off_t resid; + uint32_t bytes_to_read; + int error, i, fd, md_len; struct checksum *csp; TAILQ_INIT(&(fhp->checksums)); + /* XXXgpf: what happens if file size > 2^64? */ + if (stat(fhp->path, &sb) != 0) { + warn("cannot stat file %s", fhp->path); + return (PEFS_ERR_SYS); + } + + resid = sb.st_size; + fd = open(fhp->path, O_RDONLY); if (fd < 0) { warn("failed to open file: %s", fhp->path); @@ -122,13 +136,31 @@ } fhp->nhashes = 0; - while ((bytes_read = read(fd, buf, sizeof(buf))) > 0) { + xsct.pxsct_offset = 0; + while (resid > 0) { + if (resid > PEFS_SECTOR_SIZE) + bytes_to_read = PEFS_SECTOR_SIZE; + else + bytes_to_read = resid; + + resid-=bytes_to_read; + xsct.pxsct_ctext_len = bytes_to_read; + error = ioctl(fd, PEFS_GETSECTORCTEXT, &xsct); + if (error != 0) { + pefs_warn("error retrieving ciphertext of %s", fhp->path); + close(fd); + return (PEFS_ERR_IO); + } + xsct.pxsct_offset+= xsct.pxsct_ctext_len; + EVP_MD_CTX_init(&mdctx); EVP_DigestInit_ex(&mdctx, md, NULL); - EVP_DigestUpdate(&mdctx, buf, bytes_read); + EVP_DigestUpdate(&mdctx, xsct.pxsct_ctext, xsct.pxsct_ctext_len); - dprintf(("read %d bytes\n", bytes_read)); - //for (i=0; ibuckets[i].nelements)); LIST_FOREACH(fhp, &(checksum_hash_tablep->buckets[i].file_headers), bucket_entries) { //printf(("\tpath=%s!\t id = %d!\tnhashes = %d\n", fhp->path, (int)fhp->file_id, fhp->nhashes)); - dprintf(("\tid = %d!\tnhashes = %d\n", (int)fhp->file_id, fhp->nhashes)); + dprintf(("\tid = %llu!\tnhashes = %d\n", fhp->file_id, fhp->nhashes)); TAILQ_FOREACH(csp, &(fhp->checksums), checksum_entries) { dprintf(("\t\tdigest=")); for (j = 0; j < hash_len; j++) @@ -613,7 +645,7 @@ * All data member writes are done separately so as to avoid alignment problems. * Writes are always in little endian byte order. * - * TODO more comments about internal structure of file + * XXXgpf: [TODO] more comments about internal structure of file. */ static int pefs_write_checksum_file(int fdout, struct checksum_file_header *cfhp, struct hash_table *chtp) Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.c ============================================================================== --- soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.c Mon May 28 16:37:42 2012 (r236604) +++ soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.c Mon May 28 17:02:31 2012 (r236605) @@ -108,6 +108,8 @@ { NULL, NULL }, }; + +/* XXXgpf: [TODO] should probably add more at a later point */ const char *supported_digests[] = {"sha256","sha512"}; void @@ -1048,7 +1050,6 @@ /* by default create checksum file under $PWD */ snprintf(csm_path, sizeof(csm_path), "./%s", PEFS_FILE_CHECKSUM); - /* XXXgpf: [TODO] add argument for user to specify path for .pefs. checksum */ while ((i = getopt(argc, argv, "a:i:p:")) != -1) switch(i) { case 'a': Modified: soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs.h ============================================================================== --- soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs.h Mon May 28 16:37:42 2012 (r236604) +++ soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs.h Mon May 28 17:02:31 2012 (r236605) @@ -61,6 +61,12 @@ char pnm_filename[MAXPATHLEN]; }; +struct pefs_xsector_ctext { + off_t pxsct_offset; + uint32_t pxsct_ctext_len; + char pxsct_ctext[PEFS_SECTOR_SIZE]; +}; + #ifdef _IO #define PEFS_GETKEY _IOWR('p', 0, struct pefs_xkey) #define PEFS_ADDKEY _IOWR('p', 1, struct pefs_xkey) @@ -69,6 +75,7 @@ #define PEFS_FLUSHKEYS _IO('p', 4) #define PEFS_GETNODEKEY _IOWR('p', 5, struct pefs_xkey) #define PEFS_GETNAMEMAC _IOWR('p', 6, struct pefs_namemac) +#define PEFS_GETSECTORCTEXT _IOWR('p', 7, struct pefs_xsector_ctext) #endif #ifdef _KERNEL Modified: soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs_vnops.c ============================================================================== --- soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs_vnops.c Mon May 28 16:37:42 2012 (r236604) +++ soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs_vnops.c Mon May 28 17:02:31 2012 (r236605) @@ -2357,15 +2357,20 @@ { struct pefs_enccn enccn; struct componentname cn; + struct pefs_chunk pc; + u_quad_t fsize; struct vnode *vp = ap->a_vp; + struct vnode *lvp = PEFS_LOWERVP(vp); struct pefs_xkey *xk = ap->a_data; struct pefs_namemac *namemac = ap->a_data; + struct pefs_xsector_ctext *xsct = ap->a_data; struct ucred *cred = ap->a_cred; struct thread *td = ap->a_td; struct mount *mp = vp->v_mount; struct pefs_mount *pm = VFS_TO_PEFS(mp); struct pefs_node *pn; struct pefs_key *pk; + struct uio *puio; char *enc, *buf; size_t enc_len, buf_len; int error = 0, i, r; @@ -2470,28 +2475,73 @@ if (pefs_key_remove_all(pm)) pefs_flushkey(mp, td, PEFS_FLUSHKEY_ALL, NULL); break; + case PEFS_GETSECTORCTEXT: + vn_lock(vp, LK_EXCLUSIVE); + + if (vp->v_type != VREG) { + printf("pefs_ioctl: PEFS_GETSECTORCTEXT vp is not a reg file\n"); + VOP_UNLOCK(vp, 0); + return (EOPNOTSUPP); + } + + error = pefs_getsize(vp, &fsize, cred); + if (error != 0) { + VOP_UNLOCK(vp, 0); + return (error); + } + + if (xsct->pxsct_ctext_len > PEFS_SECTOR_SIZE || xsct->pxsct_ctext_len == 0 + || xsct->pxsct_ctext_len > fsize) { + printf("pefs_ioctl: PEFS_GETSECTORCTEXT invalid len: %d\n", + xsct->pxsct_ctext_len); + VOP_UNLOCK(vp, 0); + return (EINVAL); + } + + if (xsct->pxsct_offset > (fsize - xsct->pxsct_ctext_len)) { + printf("pefs_ioctl: PEFS_GETSECTORCTEXT invalid offset: %llu\n", + xsct->pxsct_offset); + VOP_UNLOCK(vp, 0); + return (EINVAL); + } + + pn = VP_TO_PN(vp); + pefs_chunk_create(&pc, pn, xsct->pxsct_ctext_len); + puio = pefs_chunk_uio(&pc, xsct->pxsct_offset, UIO_READ); + + /* XXXgpf: is this lock really necessary? */ + vn_lock(lvp, LK_EXCLUSIVE); + error = VOP_READ(lvp, puio, IO_UNIT | IO_NODELOCKED, cred); + VOP_UNLOCK(lvp, 0); + + if (error == 0) + memcpy(xsct->pxsct_ctext, pc.pc_base, xsct->pxsct_ctext_len); + + pefs_chunk_free(&pc, pn); + VOP_UNLOCK(vp, 0); + break; case PEFS_GETNAMEMAC: - /* XXXgpf: should I change printf to PEFSDEBUG or something else? */ + vn_lock(vp, LK_EXCLUSIVE); + /* XXXgpf: should I change printf to something else? e.g. PEFSDEBUG */ if (vp->v_type != VDIR) { printf("pefs_ioctl: PEFS_GETNAMEMAC vp is not a directory\n"); - error = EINVAL; - break; + VOP_UNLOCK(vp, 0); + return (EINVAL); } if (strnlen(namemac->pnm_filename, sizeof(namemac->pnm_filename)) != namemac->pnm_namelen) { printf("pefs_ioctl: PEFS_GETNAMEMAC incorrect pnm_namelen %d\n", namemac->pnm_namelen); - error = EINVAL; - break; + VOP_UNLOCK(vp, 0); + return (EINVAL); } if (strchr(namemac->pnm_filename, '/') != NULL) { printf("pefs_ioctl: PEFS_GETNAMEMAC pnm_filename contains '/'\n"); - error = EINVAL; - break; + VOP_UNLOCK(vp, 0); + return (EINVAL); } - vn_lock(vp, LK_EXCLUSIVE); pefs_enccn_init(&enccn); cn.cn_nameiop = LOOKUP; @@ -2522,6 +2572,10 @@ r = pefs_name_pton(enc, enc_len, buf, buf_len); if (r <= 0) error = EINVAL; + /* + * XXXgpf: [TODO] endianess!! Change int64_t to char[8] + * and deal with endianess at user-space + */ else memcpy(&(namemac->pnm_csum), buf, PEFS_NAME_CSUM_SIZE); From owner-svn-soc-all@FreeBSD.ORG Mon May 28 18:03:11 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 386B9106566B for ; Mon, 28 May 2012 18:03:10 +0000 (UTC) (envelope-from exxo@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 28 May 2012 18:03:10 +0000 Date: Mon, 28 May 2012 18:03:10 +0000 From: exxo@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120528180310.386B9106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236608 - soc2012/exxo X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 18:03:11 -0000 Author: exxo Date: Mon May 28 18:03:09 2012 New Revision: 236608 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236608 Log: Delete old patch location Deleted: soc2012/exxo/cvs-inet6.patch From owner-svn-soc-all@FreeBSD.ORG Tue May 29 02:35:15 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 48030106566C for ; Tue, 29 May 2012 02:35:14 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 02:35:14 +0000 Date: Tue, 29 May 2012 02:35:14 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529023514.48030106566C@hub.freebsd.org> Cc: Subject: socsvn commit: r236632 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 02:35:15 -0000 Author: jhagewood Date: Tue May 29 02:35:13 2012 New Revision: 236632 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236632 Log: Deleted: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Tue May 29 02:35:16 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id A6B471065670 for ; Tue, 29 May 2012 02:35:14 +0000 (UTC) (envelope-from tzabal@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 02:35:14 +0000 Date: Tue, 29 May 2012 02:35:14 +0000 From: tzabal@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529023514.A6B471065670@hub.freebsd.org> Cc: Subject: socsvn commit: r236633 - soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 02:35:16 -0000 Author: tzabal Date: Tue May 29 02:35:14 2012 New Revision: 236633 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236633 Log: Updated version of /usr/sbin/crashreport. Modified: soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport/crashreport.sh Modified: soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport/crashreport.sh ============================================================================== --- soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport/crashreport.sh Tue May 29 02:35:13 2012 (r236632) +++ soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport/crashreport.sh Tue May 29 02:35:14 2012 (r236633) @@ -2,16 +2,16 @@ . /etc/rc.conf + print_usage() { echo "usage: $(basename $0) [-d dumpdir] [-f file] [-e email]" } -# Constants +# Default dump directory DUMPDIR='/var/crash' -# Script variables _dumpdir="" _file="" _email="" @@ -35,19 +35,11 @@ esac done -echo 'We start with:' -echo "_dumpdir = ${_dumpdir}" -echo "_file = ${_file}" -echo "_email = ${_email}" -echo '---------------' -echo 'We end up with:' ## Find the dump directory -# Check the parameter if [ -z "${_dumpdir}" ]; then - # Check the dumpdir of /etc/rc.conf + # dumpdir of /etc/rc.conf if [ -z "${dumpdir}" ]; then - # Use the default dumpdir _dumpdir=${DUMPDIR} else _dumpdir=${dumpdir} @@ -64,16 +56,14 @@ exit 2 fi -echo "_dumpdir = ${_dumpdir}" ## Find the file that contains the debugging information ## It is either a core.txt.X or a textdump.tar.X +X="" BOUNDS="${_dumpdir}/bounds" CORE="${_dumpdir}/core.txt" TEXTDUMP="${_dumpdir}/textdump.tar" -X="" -# Check the parameter if [ -z "${_file}" ]; then # Find it using the file bounds if [ -r "${BOUNDS}" ]; then @@ -86,7 +76,7 @@ fi # Otherwise, use this (heavier) way else - _file=`ls ${_dumpdir} | grep '[a-z]*\.[a-z]*\.\w*' | \ + _file=`ls ${_dumpdir} | egrep '[a-z]+\.[a-z]+\.[0-9]+' | \ sort -n -t . -k 3 | tail -1` fi fi @@ -96,12 +86,10 @@ exit 3 fi -echo "_file = ${_file}" ## Find the email that will be used for contact -# Check the parameter if [ -z "${_email}" ]; then - # The email of /etc/rc.conf + # email of /etc/rc.conf _email="${email}" fi @@ -115,14 +103,24 @@ > /dev/null if [ "$?" -ne "0" ]; then - echo "Email address ${_email} is invalid." + echo "crashreport: Email address ${_email} is invalid." exit 5 fi -echo "_email = ${_email}" -## Send the report -echo 'Sending the report...' +## Bundle the report +report="report.tar" +email_file=`mktemp /tmp/crashreport.XXXXXX` + +echo "${_email}" > ${email_file} +tar -c -f ${report} ${_dumpdir}/${_file} ${email_file} + + +## Send the report to the Central Collector machine +user="reporter" +hostname="akcrs.dyndns.org" +scp -q ${report} ${user}@${hostname}: + -# Everything went smooth +# Everything went smoothly exit 0 \ No newline at end of file From owner-svn-soc-all@FreeBSD.ORG Tue May 29 02:36:12 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 298811065670 for ; Tue, 29 May 2012 02:36:11 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 02:36:11 +0000 Date: Tue, 29 May 2012 02:36:11 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529023611.298811065670@hub.freebsd.org> Cc: Subject: socsvn commit: r236634 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 02:36:12 -0000 Author: jhagewood Date: Tue May 29 02:36:10 2012 New Revision: 236634 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236634 Log: Added: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Tue May 29 02:37:46 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id B3BD4106566C for ; Tue, 29 May 2012 02:37:44 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 02:37:44 +0000 Date: Tue, 29 May 2012 02:37:44 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529023744.B3BD4106566C@hub.freebsd.org> Cc: Subject: socsvn commit: r236635 - in soc2012/jhagewood/mdocml: . mdocml-1.12.1 mdocml-1.12.1-orig mdocml_patches X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 02:37:46 -0000 Author: jhagewood Date: Tue May 29 02:37:44 2012 New Revision: 236635 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236635 Log: Added: soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/whatis.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1/whatis.1 soc2012/jhagewood/mdocml/mdocml_patches/ soc2012/jhagewood/mdocml/mdocml_patches/patch-config.txt soc2012/jhagewood/mdocml/mdocml_patches/patch-lib.in.txt soc2012/jhagewood/mdocml/mdocml_patches/patch-mdoc_validate.c soc2012/jhagewood/mdocml/mdocml_patches/patch-msec.in.txt soc2012/jhagewood/mdocml/mdocml_test.sh (contents, props changed) soc2012/jhagewood/mdocml/svn-commit.tmp Added: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Tue May 29 02:37:44 2012 (r236635) @@ -0,0 +1,264 @@ +diff -rupN mdocml-1.12.1-orig/lib.in mdocml-1.12.1/lib.in +--- mdocml-1.12.1-orig/lib.in 2012-05-24 02:19:02.000000000 -0400 ++++ mdocml-1.12.1/lib.in 2012-05-24 02:19:03.000000000 -0400 +@@ -23,10 +23,10 @@ + * Be sure to escape strings. + */ + +-LINE("libarchive", "Reading and Writing Streaming Archives Library (libarchive, \\-larchive)") ++LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)") + LINE("libarm", "ARM Architecture Library (libarm, \\-larm)") + LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)") +-LINE("libbluetooth", "Bluetooth Library (libbluetooth, \\-lbluetooth)") ++LINE("libbluetooth", "Bluetooth User Library (libbluetooth, \\-lbluetooth)") + LINE("libbsm", "Basic Security Module User Library (libbsm, \\-lbsm)") + LINE("libc", "Standard C Library (libc, \\-lc)") + LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)") +@@ -41,10 +41,11 @@ LINE("libdevinfo", "Device and Resource + LINE("libdevstat", "Device Statistics Library (libdevstat, \\-ldevstat)") + LINE("libdisk", "Interface to Slice and Partition Labels Library (libdisk, \\-ldisk)") + LINE("libdwarf", "DWARF Access Library (libdwarf, \\-ldwarf)") +-LINE("libedit", "Command Line Editor Library (libedit, \\-ledit)") ++LINE("libedit", "Line Editor and History Library (libedit, \\-ledit)") ++LINE("libefi", "EFI Runtime Services Library (libefi, \\-lefi)") + LINE("libelf", "ELF Access Library (libelf, \\-lelf)") + LINE("libevent", "Event Notification Library (libevent, \\-levent)") +-LINE("libfetch", "File Transfer Library for URLs (libfetch, \\-lfetch)") ++LINE("libfetch", "File Transfer Library (libfetch, \\-lfetch)") + LINE("libform", "Curses Form Library (libform, \\-lform)") + LINE("libgeom", "Userland API Library for kernel GEOM subsystem (libgeom, \\-lgeom)") + LINE("libgpib", "General-Purpose Instrument Bus (GPIB) library (libgpib, \\-lgpib)") +@@ -70,7 +71,7 @@ LINE("libossaudio", "OSS Audio Emulation + LINE("libpam", "Pluggable Authentication Module Library (libpam, \\-lpam)") + LINE("libpcap", "Capture Library (libpcap, \\-lpcap)") + LINE("libpci", "PCI Bus Access Library (libpci, \\-lpci)") +-LINE("libpmc", "Performance Counters Library (libpmc, \\-lpmc)") ++LINE("libpmc", "Performance Monitoring Counters Interface Library (libpmc, \\-lpmc)") + LINE("libposix", "POSIX Compatibility Library (libposix, \\-lposix)") + LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)") + LINE("libprop", "Property Container Object Library (libprop, \\-lprop)") +diff -rupN mdocml-1.12.1-orig/mdoc_validate.c mdocml-1.12.1/mdoc_validate.c +--- mdocml-1.12.1-orig/mdoc_validate.c 2012-05-24 02:19:02.000000000 -0400 ++++ mdocml-1.12.1/mdoc_validate.c 2012-05-24 02:19:03.000000000 -0400 +@@ -2234,6 +2234,8 @@ post_os(POST_ARGS) + mdoc_nmsg(mdoc, n, MANDOCERR_MEM); + return(0); + } ++ if (strncmp(utsname.sysname, "FreeBSD", sizeof("FreeBSD")) == 0) ++ strtok(utsname.release, "-"); + if (strlcat(buf, utsname.release, BUFSIZ) >= BUFSIZ) { + mdoc_nmsg(mdoc, n, MANDOCERR_MEM); + return(0); +diff -rupN mdocml-1.12.1-orig/msec.in mdocml-1.12.1/msec.in +--- mdocml-1.12.1-orig/msec.in 2012-05-24 02:19:02.000000000 -0400 ++++ mdocml-1.12.1/msec.in 2012-05-24 02:19:03.000000000 -0400 +@@ -22,16 +22,16 @@ + * Be sure to escape strings. + */ + +-LINE("1", "General Commands Manual") +-LINE("2", "System Calls Manual") +-LINE("3", "Library Functions Manual") ++LINE("1", "FreeBSD General Commands Manual") ++LINE("2", "FreeBSD System Calls Manual") ++LINE("3", "FreeBSD Library Functions Manual") + LINE("3p", "Perl Library Functions Manual") +-LINE("4", "Kernel Interfaces Manual") +-LINE("5", "File Formats Manual") +-LINE("6", "Games Manual") +-LINE("7", "Miscellaneous Information Manual") +-LINE("8", "System Manager\'s Manual") +-LINE("9", "Kernel Developer\'s Manual") ++LINE("4", "FreeBSD Kernel Interfaces Manual") ++LINE("5", "FreeBSD File Formats Manual") ++LINE("6", "FreeBSD Games Manual") ++LINE("7", "FreeBSD Miscellaneous Information Manual") ++LINE("8", "FreeBSD System Manager\'s Manual") ++LINE("9", "FreeBSD Kernel Developer\'s Manual") + LINE("X11", "X11 Developer\'s Manual") + LINE("X11R6", "X11 Developer\'s Manual") + LINE("unass", "Unassociated") +diff -rupN mdocml-1.12.1-orig/roff.c mdocml-1.12.1/roff.c +--- mdocml-1.12.1-orig/roff.c 2012-05-24 02:19:02.000000000 -0400 ++++ mdocml-1.12.1/roff.c 2012-05-29 02:33:26.000000000 -0400 +@@ -49,14 +49,18 @@ enum rofft { + ROFF_if, + ROFF_ig, + ROFF_it, ++ ROFF_na, + ROFF_ne, + ROFF_nh, ++ ROFF_ni, + ROFF_nr, + ROFF_ns, + ROFF_ps, + ROFF_rm, ++ ROFF_rs, + ROFF_so, + ROFF_ta, ++ ROFF_ti, + ROFF_tr, + ROFF_TS, + ROFF_TE, +@@ -182,6 +186,7 @@ static const char *roff_getstrn(const st + const char *, size_t); + static enum rofferr roff_line_ignore(ROFF_ARGS); + static enum rofferr roff_nr(ROFF_ARGS); ++static enum rofferr roff_ns(ROFF_ARGS); + static void roff_openeqn(struct roff *, const char *, + int, int, const char *); + static enum rofft roff_parse(struct roff *, const char *, int *); +@@ -189,6 +194,7 @@ static enum rofferr roff_parsetext(char + static enum rofferr roff_res(struct roff *, + char **, size_t *, int, int); + static enum rofferr roff_rm(ROFF_ARGS); ++static enum rofferr roff_rs(ROFF_ARGS); + static void roff_setstr(struct roff *, + const char *, const char *, int); + static void roff_setstrn(struct roffkv **, const char *, +@@ -225,14 +231,18 @@ static struct roffmac roffs[ROFF_MAX] = + { "if", roff_cond, roff_cond_text, roff_cond_sub, ROFFMAC_STRUCT, NULL }, + { "ig", roff_block, roff_block_text, roff_block_sub, 0, NULL }, + { "it", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "na", roff_line_ignore, NULL, NULL, 0, NULL }, + { "ne", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nh", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ni", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nr", roff_nr, NULL, NULL, 0, NULL }, +- { "ns", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ns", roff_ns, NULL, NULL, 0, NULL }, + { "ps", roff_line_ignore, NULL, NULL, 0, NULL }, + { "rm", roff_rm, NULL, NULL, 0, NULL }, ++ { "rs", roff_line_ignore, NULL, NULL, 0, NULL }, + { "so", roff_so, NULL, NULL, 0, NULL }, + { "ta", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ti", roff_line_ignore, NULL, NULL, 0, NULL }, + { "tr", roff_tr, NULL, NULL, 0, NULL }, + { "TS", roff_TS, NULL, NULL, 0, NULL }, + { "TE", roff_TE, NULL, NULL, 0, NULL }, +@@ -407,6 +417,12 @@ roff_free(struct roff *r) + free(r); + } + ++/* TODO */ ++static enum rofferr ++roff_ad(ROFF_ARGS) ++{ ++ ++} + + struct roff * + roff_alloc(struct mparse *parse) +@@ -1234,6 +1250,20 @@ roff_regunset(struct roff *r, enum regs + r->regs[(int)reg].set = 0; + } + ++/* TODO */ ++static enum rofferr ++roff_na(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_it(ROFF_ARGS) ++{ ++ ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_nr(ROFF_ARGS) +@@ -1256,6 +1286,69 @@ roff_nr(ROFF_ARGS) + return(ROFF_IGN); + } + ++/* TODO */ ++static enum rofferr ++roff_ns(ROFF_ARGS) ++{ ++ ++ /* ++ * Turns on flag for "no-space mode". Blank lines are ommited from output ++ * as long as this mode is enabled. ++ */ ++ ++ // nospace_flag = 1; ++ return(ROFF_IGN); ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ti(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ta(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_hy(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ne(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_nh(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ni(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ps(ROFF_ARGS) ++{ ++ ++} + /* ARGSUSED */ + static enum rofferr + roff_rm(ROFF_ARGS) +@@ -1272,6 +1365,21 @@ roff_rm(ROFF_ARGS) + return(ROFF_IGN); + } + ++/* TODO */ ++static enum rofferr ++roff_ns(ROFF_ARGS) ++{ ++ ++ /* ++ * Turns off flag for "no-space mode". Blank lines will be outputted ++ * if this mode is dissabled. Dissabled by default. ++ */ ++ ++ // nospace_flag = 0; ++ return(ROFF_IGN); ++ ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_TE(ROFF_ARGS) Added: soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile Tue May 29 02:37:44 2012 (r236635) @@ -0,0 +1,645 @@ +.PHONY: clean install installwww +.SUFFIXES: .sgml .html .md5 .h .h.html +.SUFFIXES: .1 .3 .7 .8 +.SUFFIXES: .1.txt .3.txt .7.txt .8.txt +.SUFFIXES: .1.pdf .3.pdf .7.pdf .8.pdf +.SUFFIXES: .1.ps .3.ps .7.ps .8.ps +.SUFFIXES: .1.html .3.html .7.html .8.html +.SUFFIXES: .1.xhtml .3.xhtml .7.xhtml .8.xhtml + +# 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 4.5\"" + +VERSION = 1.12.1 +VDATE = 23 March 2012 + +# 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 + +# If your system has manpath(1), uncomment this. This is most any +# system that's not OpenBSD or NetBSD. If uncommented, apropos(1), +# mandocdb(8), and man.cgi will popen(3) manpath(1) to get the MANPATH +# variable. +#CFLAGS += -DUSE_MANPATH + +# If your system supports static binaries only, uncomment this. This +# appears only to be BSD UNIX systems (Mac OS X has no support and Linux +# requires -pthreads for static libdb). +STATIC = -static + +CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\"" +CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings +PREFIX = /usr/local +WWWPREFIX = /var/www +HTDOCDIR = $(WWWPREFIX)/htdocs +CGIBINDIR = $(WWWPREFIX)/cgi-bin +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 0755 +INSTALL_DATA = $(INSTALL) -m 0444 +INSTALL_LIB = $(INSTALL) -m 0644 +INSTALL_SOURCE = $(INSTALL) -m 0644 +INSTALL_MAN = $(INSTALL_DATA) + +# Non-BSD systems (Linux, etc.) need -ldb to compile mandocdb and +# apropos. +# However, if you don't have -ldb at all (or it's not native), then +# comment out apropos and mandocdb. +# +#DBLIB = -ldb +DBBIN = apropos mandocdb man.cgi catman whatis +DBLN = llib-lapropos.ln llib-lmandocdb.ln llib-lman.cgi.ln llib-lcatman.ln + +all: mandoc preconv demandoc $(DBBIN) + +SRCS = Makefile \ + TODO \ + apropos.1 \ + apropos.c \ + apropos_db.c \ + apropos_db.h \ + arch.c \ + arch.in \ + att.c \ + att.in \ + catman.8 \ + catman.c \ + cgi.c \ + chars.c \ + chars.in \ + compat_fgetln.c \ + compat_getsubopt.c \ + compat_strlcat.c \ + compat_strlcpy.c \ + config.h.post \ + config.h.pre \ + demandoc.1 \ + demandoc.c \ + eqn.7 \ + eqn.c \ + eqn_html.c \ + eqn_term.c \ + example.style.css \ + external.png \ + html.c \ + html.h \ + index.css \ + index.sgml \ + lib.c \ + lib.in \ + libman.h \ + libmandoc.h \ + libmdoc.h \ + libroff.h \ + main.c \ + main.h \ + man.7 \ + man.c \ + man.cgi.7 \ + man-cgi.css \ + man.h \ + man_hash.c \ + man_html.c \ + man_macro.c \ + man_term.c \ + man_validate.c \ + mandoc.1 \ + mandoc.3 \ + mandoc.c \ + mandoc.h \ + mandoc_char.7 \ + mandocdb.8 \ + mandocdb.c \ + mandocdb.h \ + manpath.c \ + manpath.h \ + mdoc.7 \ + mdoc.c \ + mdoc.h \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_html.c \ + mdoc_macro.c \ + mdoc_man.c \ + mdoc_term.c \ + mdoc_validate.c \ + msec.c \ + msec.in \ + out.c \ + out.h \ + preconv.1 \ + preconv.c \ + predefs.in \ + read.c \ + roff.7 \ + roff.c \ + st.c \ + st.in \ + style.css \ + tbl.7 \ + tbl.c \ + tbl_data.c \ + tbl_html.c \ + tbl_layout.c \ + tbl_opts.c \ + tbl_term.c \ + term.c \ + term.h \ + term_ascii.c \ + term_ps.c \ + test-fgetln.c \ + test-getsubopt.c \ + test-mmap.c \ + test-strlcat.c \ + test-strlcpy.c \ + test-strptime.c \ + tree.c \ + vol.c \ + vol.in \ + whatis.1 + +LIBMAN_OBJS = man.o \ + man_hash.o \ + man_macro.o \ + man_validate.o +LIBMAN_LNS = man.ln \ + man_hash.ln \ + man_macro.ln \ + man_validate.ln + +LIBMDOC_OBJS = arch.o \ + att.o \ + lib.o \ + mdoc.o \ + mdoc_argv.o \ + mdoc_hash.o \ + mdoc_macro.o \ + mdoc_validate.o \ + st.o \ + vol.o +LIBMDOC_LNS = arch.ln \ + att.ln \ + lib.ln \ + mdoc.ln \ + mdoc_argv.ln \ + mdoc_hash.ln \ + mdoc_macro.ln \ + mdoc_validate.ln \ + st.ln \ + vol.ln + +LIBROFF_OBJS = eqn.o \ + roff.o \ + tbl.o \ + tbl_data.o \ + tbl_layout.o \ + tbl_opts.o +LIBROFF_LNS = eqn.ln \ + roff.ln \ + tbl.ln \ + tbl_data.ln \ + tbl_layout.ln \ + tbl_opts.ln + +LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ + $(LIBMDOC_OBJS) \ + $(LIBROFF_OBJS) \ + chars.o \ + mandoc.o \ + msec.o \ + read.o +LIBMANDOC_LNS = $(LIBMAN_LNS) \ + $(LIBMDOC_LNS) \ + $(LIBROFF_LNS) \ + chars.ln \ + mandoc.ln \ + msec.ln \ + read.ln + +COMPAT_OBJS = compat_fgetln.o \ + compat_getsubopt.o \ + compat_strlcat.o \ + compat_strlcpy.o +COMPAT_LNS = compat_fgetln.ln \ + compat_getsubopt.ln \ + compat_strlcat.ln \ + compat_strlcpy.ln + +arch.o arch.ln: arch.in +att.o att.ln: att.in +chars.o chars.ln: chars.in +lib.o lib.ln: lib.in +msec.o msec.ln: msec.in +roff.o roff.ln: predefs.in +st.o st.ln: st.in +vol.o vol.ln: vol.in + +$(LIBMAN_OBJS) $(LIBMAN_LNS): libman.h +$(LIBMDOC_OBJS) $(LIBMDOC_LNS): libmdoc.h +$(LIBROFF_OBJS) $(LIBROFF_LNS): libroff.h +$(LIBMANDOC_OBJS) $(LIBMANDOC_LNS): mandoc.h mdoc.h man.h libmandoc.h config.h + +$(COMPAT_OBJS) $(COMPAT_LNS): config.h + +MANDOC_HTML_OBJS = eqn_html.o \ + html.o \ + man_html.o \ + mdoc_html.o \ + tbl_html.o +MANDOC_HTML_LNS = eqn_html.ln \ + html.ln \ + man_html.ln \ + mdoc_html.ln \ + tbl_html.ln + +MANDOC_MAN_OBJS = mdoc_man.o +MANDOC_MAN_LNS = mdoc_man.ln + +MANDOC_TERM_OBJS = eqn_term.o \ + man_term.o \ + mdoc_term.o \ + term.o \ + term_ascii.o \ + term_ps.o \ + tbl_term.o +MANDOC_TERM_LNS = eqn_term.ln \ + man_term.ln \ + mdoc_term.ln \ + term.ln \ + term_ascii.ln \ + term_ps.ln \ + tbl_term.ln + +MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + main.o \ + out.o \ + tree.o +MANDOC_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + main.ln \ + out.ln \ + tree.ln + +$(MANDOC_HTML_OBJS) $(MANDOC_HTML_LNS): html.h +$(MANDOC_TERM_OBJS) $(MANDOC_TERM_LNS): term.h +$(MANDOC_OBJS) $(MANDOC_LNS): main.h mandoc.h mdoc.h man.h config.h out.h + +MANDOCDB_OBJS = mandocdb.o manpath.o +MANDOCDB_LNS = mandocdb.ln manpath.ln + +$(MANDOCDB_OBJS) $(MANDOCDB_LNS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h + +PRECONV_OBJS = preconv.o +PRECONV_LNS = preconv.ln + +$(PRECONV_OBJS) $(PRECONV_LNS): config.h + +APROPOS_OBJS = apropos.o apropos_db.o manpath.o +APROPOS_LNS = apropos.ln apropos_db.ln manpath.ln + +$(APROPOS_OBJS) $(APROPOS_LNS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + cgi.o \ + apropos_db.o \ + manpath.o \ + out.o \ + tree.o + +CGI_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + cgi.ln \ + apropos_db.ln \ + manpath.ln \ + out.ln \ + tree.ln + +$(CGI_OBJS) $(CGI_LNS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CATMAN_OBJS = catman.o manpath.o +CATMAN_LNS = catman.ln manpath.ln + +$(CATMAN_OBJS) $(CATMAN_LNS): config.h mandoc.h manpath.h mandocdb.h + +DEMANDOC_OBJS = demandoc.o +DEMANDOC_LNS = demandoc.ln + +$(DEMANDOC_OBJS) $(DEMANDOC_LNS): config.h + +INDEX_MANS = apropos.1.html \ + apropos.1.xhtml \ + apropos.1.ps \ + apropos.1.pdf \ + apropos.1.txt \ + catman.8.html \ + catman.8.xhtml \ + catman.8.ps \ + catman.8.pdf \ + catman.8.txt \ + demandoc.1.html \ + demandoc.1.xhtml \ + demandoc.1.ps \ + demandoc.1.pdf \ + demandoc.1.txt \ + mandoc.1.html \ + mandoc.1.xhtml \ + mandoc.1.ps \ + mandoc.1.pdf \ + mandoc.1.txt \ + whatis.1.html \ + whatis.1.xhtml \ + whatis.1.ps \ + whatis.1.pdf \ + whatis.1.txt \ + mandoc.3.html \ + mandoc.3.xhtml \ + mandoc.3.ps \ + mandoc.3.pdf \ + mandoc.3.txt \ + eqn.7.html \ + eqn.7.xhtml \ + eqn.7.ps \ + eqn.7.pdf \ + eqn.7.txt \ + man.7.html \ + man.7.xhtml \ + man.7.ps \ + man.7.pdf \ + man.7.txt \ + man.cgi.7.html \ + man.cgi.7.xhtml \ + man.cgi.7.ps \ + man.cgi.7.pdf \ + man.cgi.7.txt \ + mandoc_char.7.html \ + mandoc_char.7.xhtml \ + mandoc_char.7.ps \ + mandoc_char.7.pdf \ + mandoc_char.7.txt \ + mdoc.7.html \ + mdoc.7.xhtml \ + mdoc.7.ps \ + mdoc.7.pdf \ + mdoc.7.txt \ + preconv.1.html \ + preconv.1.xhtml \ + preconv.1.ps \ + preconv.1.pdf \ + preconv.1.txt \ + roff.7.html \ + roff.7.xhtml \ + roff.7.ps \ + roff.7.pdf \ + roff.7.txt \ + tbl.7.html \ + tbl.7.xhtml \ + tbl.7.ps \ + tbl.7.pdf \ + tbl.7.txt \ + mandocdb.8.html \ + mandocdb.8.xhtml \ + mandocdb.8.ps \ + mandocdb.8.pdf \ + mandocdb.8.txt + +$(INDEX_MANS): mandoc + +INDEX_OBJS = $(INDEX_MANS) \ + man.h.html \ + mandoc.h.html \ + mdoc.h.html \ + mdocml.tar.gz \ + mdocml.md5 + +www: index.html + +lint: llib-lmandoc.ln llib-lpreconv.ln llib-ldemandoc.ln $(DBLN) + +clean: + rm -f libmandoc.a $(LIBMANDOC_OBJS) + rm -f llib-llibmandoc.ln $(LIBMANDOC_LNS) + rm -f mandocdb $(MANDOCDB_OBJS) + rm -f llib-lmandocdb.ln $(MANDOCDB_LNS) + rm -f preconv $(PRECONV_OBJS) + rm -f llib-lpreconv.ln $(PRECONV_LNS) + rm -f apropos whatis $(APROPOS_OBJS) + rm -f llib-lapropos.ln $(APROPOS_LNS) + rm -f man.cgi $(CGI_OBJS) + rm -f llib-lman.cgi.ln $(CGI_LNS) + rm -f catman $(CATMAN_OBJS) + rm -f llib-lcatman.ln $(CATMAN_LNS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f llib-ldemandoc.ln $(DEMANDOC_LNS) + rm -f mandoc $(MANDOC_OBJS) + rm -f llib-lmandoc.ln $(MANDOC_LNS) + rm -f config.h config.log $(COMPAT_OBJS) $(COMPAT_LNS) + rm -f mdocml.tar.gz mdocml-win32.zip mdocml-win64.zip mdocml-macosx.zip + rm -f index.html $(INDEX_OBJS) + rm -rf test-fgetln.dSYM + rm -rf test-strlcpy.dSYM + rm -rf test-strlcat.dSYM + rm -rf test-strptime.dSYM + rm -rf test-mmap.dSYM + rm -rf test-getsubopt.dSYM + rm -rf apropos.dSYM + rm -rf catman.dSYM + rm -rf mandocdb.dSYM + rm -rf whatis.dSYM + +install: all + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(EXAMPLEDIR) + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_PROGRAM) mandoc preconv demandoc $(DESTDIR)$(BINDIR) + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) mandoc.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) + +installcgi: all + mkdir -p $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(HTDOCDIR) + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css + $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR) + +installwww: www + mkdir -p $(PREFIX)/snapshots + mkdir -p $(PREFIX)/binaries + $(INSTALL_DATA) index.html external.png index.css $(PREFIX) + $(INSTALL_DATA) $(INDEX_MANS) style.css $(PREFIX) + $(INSTALL_DATA) mandoc.h.html man.h.html mdoc.h.html $(PREFIX) + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots/mdocml-$(VERSION).tar.gz + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots/mdocml-$(VERSION).md5 + +libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + +llib-llibmandoc.ln: $(COMPAT_LNS) $(LIBMANDOC_LNS) + $(LINT) $(LINTFLAGS) -Clibmandoc $(COMPAT_LNS) $(LIBMANDOC_LNS) + +mandoc: $(MANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a + +llib-lmandoc.ln: $(MANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandoc $(MANDOC_LNS) llib-llibmandoc.ln + +mandocdb: $(MANDOCDB_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB) + +llib-lmandocdb.ln: $(MANDOCDB_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandocdb $(MANDOCDB_LNS) llib-llibmandoc.ln + +preconv: $(PRECONV_OBJS) + $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS) + +llib-lpreconv.ln: $(PRECONV_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS) llib-llibmandoc.ln + +whatis: apropos + cp -f apropos whatis + +apropos: $(APROPOS_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) + +llib-lapropos.ln: $(APROPOS_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Capropos $(APROPOS_LNS) llib-llibmandoc.ln + +catman: $(CATMAN_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(CATMAN_OBJS) libmandoc.a $(DBLIB) + +llib-lcatman.ln: $(CATMAN_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Ccatman $(CATMAN_LNS) llib-llibmandoc.ln + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) + +llib-lman.cgi.ln: $(CGI_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cman.cgi $(CGI_LNS) llib-llibmandoc.ln + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a + +llib-ldemandoc.ln: $(DEMANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cdemandoc $(DEMANDOC_LNS) llib-llibmandoc.ln + +mdocml.md5: mdocml.tar.gz + md5 mdocml.tar.gz >$@ + +mdocml.tar.gz: $(SRCS) + mkdir -p .dist/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .dist/mdocml-$(VERSION) + ( cd .dist/ && tar zcf ../$@ ./ ) + rm -rf .dist/ + +mdocml-win32.zip: $(SRCS) + mkdir -p .win32/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win32 + cp .win32/Makefile .win32/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win32/Makefile.old >.win32/Makefile + ( cd .win32; \ + CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win32 + +mdocml-win64.zip: $(SRCS) + mkdir -p .win64/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win64 + cp .win64/Makefile .win64/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win64/Makefile.old >.win64/Makefile + ( cd .win64; \ + CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win64 + +mdocml-macosx.zip: $(SRCS) + mkdir -p .macosx/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .macosx + ( cd .macosx; \ + CFLAGS="-arch i386 -arch x86_64 -arch ppc" LDFLAGS="-arch i386 -arch x86_64 -arch ppc" make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .macosx + +index.html: $(INDEX_OBJS) + +config.h: config.h.pre config.h.post + rm -f config.log + ( cat config.h.pre; \ + echo; \ + if $(CC) $(CFLAGS) -Werror -o test-fgetln test-fgetln.c >> config.log 2>&1; then \ + echo '#define HAVE_FGETLN'; \ + rm test-fgetln; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strptime test-strptime.c >> config.log 2>&1; then \ + echo '#define HAVE_STRPTIME'; \ + rm test-strptime; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-getsubopt test-getsubopt.c >> config.log 2>&1; then \ + echo '#define HAVE_GETSUBOPT'; \ + rm test-getsubopt; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcat test-strlcat.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCAT'; \ + rm test-strlcat; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-mmap test-mmap.c >> config.log 2>&1; then \ + echo '#define HAVE_MMAP'; \ + rm test-mmap; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcpy test-strlcpy.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCPY'; \ + rm test-strlcpy; \ + fi; \ + echo; \ + cat config.h.post \ + ) > $@ + +.h.h.html: + highlight -I $< >$@ + +.1.1.txt .3.3.txt .7.7.txt .8.8.txt: + ./mandoc -Tascii -Wall,stop $< | col -b >$@ + +.1.1.html .3.3.html .7.7.html .8.8.html: + ./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@ + +.1.1.ps .3.3.ps .7.7.ps .8.8.ps: + ./mandoc -Tps -Wall,stop $< >$@ + +.1.1.xhtml .3.3.xhtml .7.7.xhtml .8.8.xhtml: + ./mandoc -Txhtml -Wall,stop -Ostyle=style.css,man=%N.%S.xhtml,includes=%I.html $< >$@ + +.1.1.pdf .3.3.pdf .7.7.pdf .8.8.pdf: + ./mandoc -Tpdf -Wall,stop $< >$@ + +.sgml.html: + validate --warn $< + sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@ Added: soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO Tue May 29 02:37:44 2012 (r236635) @@ -0,0 +1,372 @@ +************************************************************************ +* Official mandoc TODO. +* $Id: TODO,v 1.129 2012/03/04 23:53:37 schwarze Exp $ +************************************************************************ + +************************************************************************ +* parser bugs +************************************************************************ + +- ".\}" on its own line gets translated to bare ".\&" + which forces pset() into man(7) + and then triggers an unknown macro error + reported by naddy@ Sun, 3 Jul 2011 21:52:24 +0200 + +************************************************************************ +* formatter bugs +************************************************************************ + +- tbl(7): Horizontal and vertical lines are formatted badly: + With the box option, there is too much white space at the end of cells. + Horizontal lines from "=" lines are a bit too long. + yuri dot pankov at gmail dot com Thu, 14 Apr 2011 05:45:26 +0400 + +************************************************************************ +* missing features +************************************************************************ + +--- missing roff features ---------------------------------------------- + +- The pod2man preamble wants \h'...' with quoted numerical arguments, + see for example AUTHORS in MooseX::Getopt.3p, p5-MooseX-Getopt. + reported by Andreas Voegele + Tue, 22 Nov 2011 15:34:47 +0100 on ports@ + +- .if n \{ + .br\} + should cause an extra space to be raised. + +- .ad (adjust margins) + .ad l -- adjust left margin only (flush left) + .ad r -- adjust right margin only (flush right) + .ad c -- center text on line + .ad b -- adjust both margins (alias: .ad n) + .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). + +- .it (line traps) occur in mysql(1), yasm_arch(7) + generated by DocBook XSL Stylesheets v1.71.1 + reported by brad@ Sat, 15 Jan 2011 15:48:18 -0500 + +- .ns (no-space mode) occurs in xine-config(1) + reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + +- xloadimage(1) wants .ti (temporary indent), rep by naddy@ + +- .ta (tab settings) occurs in ircbug(1) and probably gnats(1) + reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 + +- \c (interrupted text) occurs in chat(8) + +- using undefined strings or macros defines them to be empty + wl@ Mon, 14 Nov 2011 14:37:01 +0000 + +--- missing mdoc features ---------------------------------------------- + +- fix bad block nesting involving multiple identical explicit blocks + see the OpenBSD mdoc_macro.c 1.47 commit message + +- .Bl -column .Xo support is missing + ultimate goal: + restore .Xr and .Dv to + lib/libc/compat-43/sigvec.3 + lib/libc/gen/signal.3 + lib/libc/sys/sigaction.2 + +- 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 + +- \\ is now implemented correctly + * when defining strings and macros using .ds and .de *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Tue May 29 03:56:05 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id C9FA8106566C for ; Tue, 29 May 2012 03:56:04 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 03:56:04 +0000 Date: Tue, 29 May 2012 03:56:04 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529035604.C9FA8106566C@hub.freebsd.org> Cc: Subject: socsvn commit: r236636 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 03:56:05 -0000 Author: jhagewood Date: Tue May 29 03:56:04 2012 New Revision: 236636 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236636 Log: Deleted: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Tue May 29 03:56:18 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id BBBA4106566B for ; Tue, 29 May 2012 03:56:17 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 03:56:17 +0000 Date: Tue, 29 May 2012 03:56:17 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529035617.BBBA4106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236637 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 03:56:18 -0000 Author: jhagewood Date: Tue May 29 03:56:17 2012 New Revision: 236637 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236637 Log: Added: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Tue May 29 03:57:18 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id A899B106566B for ; Tue, 29 May 2012 03:57:16 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 03:57:16 +0000 Date: Tue, 29 May 2012 03:57:16 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529035716.A899B106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236638 - in soc2012/jhagewood/mdocml: . mdocml-1.12.1 mdocml-1.12.1-orig mdocml_patches X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 03:57:18 -0000 Author: jhagewood Date: Tue May 29 03:57:16 2012 New Revision: 236638 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236638 Log: Added: soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/whatis.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1/whatis.1 soc2012/jhagewood/mdocml/mdocml_patches/ soc2012/jhagewood/mdocml/mdocml_patches/patch-config.txt soc2012/jhagewood/mdocml/mdocml_patches/patch-lib.in.txt soc2012/jhagewood/mdocml/mdocml_patches/patch-mdoc_validate.c soc2012/jhagewood/mdocml/mdocml_patches/patch-msec.in.txt soc2012/jhagewood/mdocml/mdocml_test.sh (contents, props changed) Added: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Tue May 29 03:57:16 2012 (r236638) @@ -0,0 +1,286 @@ +diff -rupN mdocml-1.12.1-orig/lib.in mdocml-1.12.1/lib.in +--- mdocml-1.12.1-orig/lib.in 2012-05-29 03:44:31.000000000 -0400 ++++ mdocml-1.12.1/lib.in 2012-05-29 03:44:32.000000000 -0400 +@@ -23,10 +23,10 @@ + * Be sure to escape strings. + */ + +-LINE("libarchive", "Reading and Writing Streaming Archives Library (libarchive, \\-larchive)") ++LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)") + LINE("libarm", "ARM Architecture Library (libarm, \\-larm)") + LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)") +-LINE("libbluetooth", "Bluetooth Library (libbluetooth, \\-lbluetooth)") ++LINE("libbluetooth", "Bluetooth User Library (libbluetooth, \\-lbluetooth)") + LINE("libbsm", "Basic Security Module User Library (libbsm, \\-lbsm)") + LINE("libc", "Standard C Library (libc, \\-lc)") + LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)") +@@ -41,10 +41,11 @@ LINE("libdevinfo", "Device and Resource + LINE("libdevstat", "Device Statistics Library (libdevstat, \\-ldevstat)") + LINE("libdisk", "Interface to Slice and Partition Labels Library (libdisk, \\-ldisk)") + LINE("libdwarf", "DWARF Access Library (libdwarf, \\-ldwarf)") +-LINE("libedit", "Command Line Editor Library (libedit, \\-ledit)") ++LINE("libedit", "Line Editor and History Library (libedit, \\-ledit)") ++LINE("libefi", "EFI Runtime Services Library (libefi, \\-lefi)") + LINE("libelf", "ELF Access Library (libelf, \\-lelf)") + LINE("libevent", "Event Notification Library (libevent, \\-levent)") +-LINE("libfetch", "File Transfer Library for URLs (libfetch, \\-lfetch)") ++LINE("libfetch", "File Transfer Library (libfetch, \\-lfetch)") + LINE("libform", "Curses Form Library (libform, \\-lform)") + LINE("libgeom", "Userland API Library for kernel GEOM subsystem (libgeom, \\-lgeom)") + LINE("libgpib", "General-Purpose Instrument Bus (GPIB) library (libgpib, \\-lgpib)") +@@ -70,7 +71,7 @@ LINE("libossaudio", "OSS Audio Emulation + LINE("libpam", "Pluggable Authentication Module Library (libpam, \\-lpam)") + LINE("libpcap", "Capture Library (libpcap, \\-lpcap)") + LINE("libpci", "PCI Bus Access Library (libpci, \\-lpci)") +-LINE("libpmc", "Performance Counters Library (libpmc, \\-lpmc)") ++LINE("libpmc", "Performance Monitoring Counters Interface Library (libpmc, \\-lpmc)") + LINE("libposix", "POSIX Compatibility Library (libposix, \\-lposix)") + LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)") + LINE("libprop", "Property Container Object Library (libprop, \\-lprop)") +diff -rupN mdocml-1.12.1-orig/mdoc_validate.c mdocml-1.12.1/mdoc_validate.c +--- mdocml-1.12.1-orig/mdoc_validate.c 2012-05-29 03:44:31.000000000 -0400 ++++ mdocml-1.12.1/mdoc_validate.c 2012-05-29 03:44:32.000000000 -0400 +@@ -2234,6 +2234,8 @@ post_os(POST_ARGS) + mdoc_nmsg(mdoc, n, MANDOCERR_MEM); + return(0); + } ++ if (strncmp(utsname.sysname, "FreeBSD", sizeof("FreeBSD")) == 0) ++ strtok(utsname.release, "-"); + if (strlcat(buf, utsname.release, BUFSIZ) >= BUFSIZ) { + mdoc_nmsg(mdoc, n, MANDOCERR_MEM); + return(0); +diff -rupN mdocml-1.12.1-orig/msec.in mdocml-1.12.1/msec.in +--- mdocml-1.12.1-orig/msec.in 2012-05-29 03:44:31.000000000 -0400 ++++ mdocml-1.12.1/msec.in 2012-05-29 03:44:32.000000000 -0400 +@@ -22,16 +22,16 @@ + * Be sure to escape strings. + */ + +-LINE("1", "General Commands Manual") +-LINE("2", "System Calls Manual") +-LINE("3", "Library Functions Manual") ++LINE("1", "FreeBSD General Commands Manual") ++LINE("2", "FreeBSD System Calls Manual") ++LINE("3", "FreeBSD Library Functions Manual") + LINE("3p", "Perl Library Functions Manual") +-LINE("4", "Kernel Interfaces Manual") +-LINE("5", "File Formats Manual") +-LINE("6", "Games Manual") +-LINE("7", "Miscellaneous Information Manual") +-LINE("8", "System Manager\'s Manual") +-LINE("9", "Kernel Developer\'s Manual") ++LINE("4", "FreeBSD Kernel Interfaces Manual") ++LINE("5", "FreeBSD File Formats Manual") ++LINE("6", "FreeBSD Games Manual") ++LINE("7", "FreeBSD Miscellaneous Information Manual") ++LINE("8", "FreeBSD System Manager\'s Manual") ++LINE("9", "FreeBSD Kernel Developer\'s Manual") + LINE("X11", "X11 Developer\'s Manual") + LINE("X11R6", "X11 Developer\'s Manual") + LINE("unass", "Unassociated") +diff -rupN mdocml-1.12.1-orig/roff.c mdocml-1.12.1/roff.c +--- mdocml-1.12.1-orig/roff.c 2012-05-29 03:44:31.000000000 -0400 ++++ mdocml-1.12.1/roff.c 2012-05-29 03:55:09.000000000 -0400 +@@ -49,14 +49,18 @@ enum rofft { + ROFF_if, + ROFF_ig, + ROFF_it, ++ ROFF_na, + ROFF_ne, + ROFF_nh, ++ ROFF_ni, + ROFF_nr, + ROFF_ns, + ROFF_ps, + ROFF_rm, ++ ROFF_rs, + ROFF_so, + ROFF_ta, ++ ROFF_ti, + ROFF_tr, + ROFF_TS, + ROFF_TE, +@@ -182,6 +186,7 @@ static const char *roff_getstrn(const st + const char *, size_t); + static enum rofferr roff_line_ignore(ROFF_ARGS); + static enum rofferr roff_nr(ROFF_ARGS); ++static enum rofferr roff_ns(ROFF_ARGS); + static void roff_openeqn(struct roff *, const char *, + int, int, const char *); + static enum rofft roff_parse(struct roff *, const char *, int *); +@@ -189,6 +194,7 @@ static enum rofferr roff_parsetext(char + static enum rofferr roff_res(struct roff *, + char **, size_t *, int, int); + static enum rofferr roff_rm(ROFF_ARGS); ++static enum rofferr roff_rs(ROFF_ARGS); + static void roff_setstr(struct roff *, + const char *, const char *, int); + static void roff_setstrn(struct roffkv **, const char *, +@@ -202,6 +208,8 @@ static enum rofferr roff_EN(ROFF_ARGS); + static enum rofferr roff_T_(ROFF_ARGS); + static enum rofferr roff_userdef(ROFF_ARGS); + ++int nospace_mode = 0; ++ + /* See roffhash_find() */ + + #define ASCII_HI 126 +@@ -225,14 +233,18 @@ static struct roffmac roffs[ROFF_MAX] = + { "if", roff_cond, roff_cond_text, roff_cond_sub, ROFFMAC_STRUCT, NULL }, + { "ig", roff_block, roff_block_text, roff_block_sub, 0, NULL }, + { "it", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "na", roff_line_ignore, NULL, NULL, 0, NULL }, + { "ne", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nh", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ni", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nr", roff_nr, NULL, NULL, 0, NULL }, +- { "ns", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ns", roff_ns, NULL, NULL, 0, NULL }, + { "ps", roff_line_ignore, NULL, NULL, 0, NULL }, + { "rm", roff_rm, NULL, NULL, 0, NULL }, ++ { "rs", roff_rs, NULL, NULL, 0, NULL }, + { "so", roff_so, NULL, NULL, 0, NULL }, + { "ta", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ti", roff_line_ignore, NULL, NULL, 0, NULL }, + { "tr", roff_tr, NULL, NULL, 0, NULL }, + { "TS", roff_TS, NULL, NULL, 0, NULL }, + { "TE", roff_TE, NULL, NULL, 0, NULL }, +@@ -299,6 +311,12 @@ roffhash_find(const char *p, size_t s) + if (NULL == (n = hash[buc])) + return(ROFF_MAX); + for ( ; n; n = n->next) ++ ++ /* ++ * The following if statement is a temporary, completely inelagant way to check ++ * if no-space mode is turned on. ++ */ ++ if (1 == nospace_mode && 0 == strncmp(n->name, "sp", 2)) continue; + if (0 == strncmp(n->name, p, s) && '\0' == n->name[(int)s]) + return((enum rofft)(n - roffs)); + +@@ -407,6 +425,12 @@ roff_free(struct roff *r) + free(r); + } + ++/* TODO */ ++static enum rofferr ++roff_ad(ROFF_ARGS) ++{ ++ ++} + + struct roff * + roff_alloc(struct mparse *parse) +@@ -1234,6 +1258,20 @@ roff_regunset(struct roff *r, enum regs + r->regs[(int)reg].set = 0; + } + ++/* TODO */ ++static enum rofferr ++roff_na(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_it(ROFF_ARGS) ++{ ++ ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_nr(ROFF_ARGS) +@@ -1256,6 +1294,69 @@ roff_nr(ROFF_ARGS) + return(ROFF_IGN); + } + ++/* TODO */ ++static enum rofferr ++roff_ns(ROFF_ARGS) ++{ ++ ++ /* ++ * Turns on flag for "no-space mode". Blank lines are ommited from output ++ * as long as this mode is enabled. ++ */ ++ ++ nospace_mode = 1; ++ return(ROFF_IGN); ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ti(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ta(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_hy(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ne(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_nh(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ni(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ps(ROFF_ARGS) ++{ ++ ++} + /* ARGSUSED */ + static enum rofferr + roff_rm(ROFF_ARGS) +@@ -1272,6 +1373,21 @@ roff_rm(ROFF_ARGS) + return(ROFF_IGN); + } + ++/* TODO */ ++static enum rofferr ++roff_rs(ROFF_ARGS) ++{ ++ ++ /* ++ * Turns off flag for "no-space mode". Blank lines will be outputted ++ * if this mode is dissabled. Dissabled by default. ++ */ ++ ++ nospace_mode = 0; ++ return(ROFF_IGN); ++ ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_TE(ROFF_ARGS) Added: soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile Tue May 29 03:57:16 2012 (r236638) @@ -0,0 +1,645 @@ +.PHONY: clean install installwww +.SUFFIXES: .sgml .html .md5 .h .h.html +.SUFFIXES: .1 .3 .7 .8 +.SUFFIXES: .1.txt .3.txt .7.txt .8.txt +.SUFFIXES: .1.pdf .3.pdf .7.pdf .8.pdf +.SUFFIXES: .1.ps .3.ps .7.ps .8.ps +.SUFFIXES: .1.html .3.html .7.html .8.html +.SUFFIXES: .1.xhtml .3.xhtml .7.xhtml .8.xhtml + +# 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 4.5\"" + +VERSION = 1.12.1 +VDATE = 23 March 2012 + +# 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 + +# If your system has manpath(1), uncomment this. This is most any +# system that's not OpenBSD or NetBSD. If uncommented, apropos(1), +# mandocdb(8), and man.cgi will popen(3) manpath(1) to get the MANPATH +# variable. +#CFLAGS += -DUSE_MANPATH + +# If your system supports static binaries only, uncomment this. This +# appears only to be BSD UNIX systems (Mac OS X has no support and Linux +# requires -pthreads for static libdb). +STATIC = -static + +CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\"" +CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings +PREFIX = /usr/local +WWWPREFIX = /var/www +HTDOCDIR = $(WWWPREFIX)/htdocs +CGIBINDIR = $(WWWPREFIX)/cgi-bin +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 0755 +INSTALL_DATA = $(INSTALL) -m 0444 +INSTALL_LIB = $(INSTALL) -m 0644 +INSTALL_SOURCE = $(INSTALL) -m 0644 +INSTALL_MAN = $(INSTALL_DATA) + +# Non-BSD systems (Linux, etc.) need -ldb to compile mandocdb and +# apropos. +# However, if you don't have -ldb at all (or it's not native), then +# comment out apropos and mandocdb. +# +#DBLIB = -ldb +DBBIN = apropos mandocdb man.cgi catman whatis +DBLN = llib-lapropos.ln llib-lmandocdb.ln llib-lman.cgi.ln llib-lcatman.ln + +all: mandoc preconv demandoc $(DBBIN) + +SRCS = Makefile \ + TODO \ + apropos.1 \ + apropos.c \ + apropos_db.c \ + apropos_db.h \ + arch.c \ + arch.in \ + att.c \ + att.in \ + catman.8 \ + catman.c \ + cgi.c \ + chars.c \ + chars.in \ + compat_fgetln.c \ + compat_getsubopt.c \ + compat_strlcat.c \ + compat_strlcpy.c \ + config.h.post \ + config.h.pre \ + demandoc.1 \ + demandoc.c \ + eqn.7 \ + eqn.c \ + eqn_html.c \ + eqn_term.c \ + example.style.css \ + external.png \ + html.c \ + html.h \ + index.css \ + index.sgml \ + lib.c \ + lib.in \ + libman.h \ + libmandoc.h \ + libmdoc.h \ + libroff.h \ + main.c \ + main.h \ + man.7 \ + man.c \ + man.cgi.7 \ + man-cgi.css \ + man.h \ + man_hash.c \ + man_html.c \ + man_macro.c \ + man_term.c \ + man_validate.c \ + mandoc.1 \ + mandoc.3 \ + mandoc.c \ + mandoc.h \ + mandoc_char.7 \ + mandocdb.8 \ + mandocdb.c \ + mandocdb.h \ + manpath.c \ + manpath.h \ + mdoc.7 \ + mdoc.c \ + mdoc.h \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_html.c \ + mdoc_macro.c \ + mdoc_man.c \ + mdoc_term.c \ + mdoc_validate.c \ + msec.c \ + msec.in \ + out.c \ + out.h \ + preconv.1 \ + preconv.c \ + predefs.in \ + read.c \ + roff.7 \ + roff.c \ + st.c \ + st.in \ + style.css \ + tbl.7 \ + tbl.c \ + tbl_data.c \ + tbl_html.c \ + tbl_layout.c \ + tbl_opts.c \ + tbl_term.c \ + term.c \ + term.h \ + term_ascii.c \ + term_ps.c \ + test-fgetln.c \ + test-getsubopt.c \ + test-mmap.c \ + test-strlcat.c \ + test-strlcpy.c \ + test-strptime.c \ + tree.c \ + vol.c \ + vol.in \ + whatis.1 + +LIBMAN_OBJS = man.o \ + man_hash.o \ + man_macro.o \ + man_validate.o +LIBMAN_LNS = man.ln \ + man_hash.ln \ + man_macro.ln \ + man_validate.ln + +LIBMDOC_OBJS = arch.o \ + att.o \ + lib.o \ + mdoc.o \ + mdoc_argv.o \ + mdoc_hash.o \ + mdoc_macro.o \ + mdoc_validate.o \ + st.o \ + vol.o +LIBMDOC_LNS = arch.ln \ + att.ln \ + lib.ln \ + mdoc.ln \ + mdoc_argv.ln \ + mdoc_hash.ln \ + mdoc_macro.ln \ + mdoc_validate.ln \ + st.ln \ + vol.ln + +LIBROFF_OBJS = eqn.o \ + roff.o \ + tbl.o \ + tbl_data.o \ + tbl_layout.o \ + tbl_opts.o +LIBROFF_LNS = eqn.ln \ + roff.ln \ + tbl.ln \ + tbl_data.ln \ + tbl_layout.ln \ + tbl_opts.ln + +LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ + $(LIBMDOC_OBJS) \ + $(LIBROFF_OBJS) \ + chars.o \ + mandoc.o \ + msec.o \ + read.o +LIBMANDOC_LNS = $(LIBMAN_LNS) \ + $(LIBMDOC_LNS) \ + $(LIBROFF_LNS) \ + chars.ln \ + mandoc.ln \ + msec.ln \ + read.ln + +COMPAT_OBJS = compat_fgetln.o \ + compat_getsubopt.o \ + compat_strlcat.o \ + compat_strlcpy.o +COMPAT_LNS = compat_fgetln.ln \ + compat_getsubopt.ln \ + compat_strlcat.ln \ + compat_strlcpy.ln + +arch.o arch.ln: arch.in +att.o att.ln: att.in +chars.o chars.ln: chars.in +lib.o lib.ln: lib.in +msec.o msec.ln: msec.in +roff.o roff.ln: predefs.in +st.o st.ln: st.in +vol.o vol.ln: vol.in + +$(LIBMAN_OBJS) $(LIBMAN_LNS): libman.h +$(LIBMDOC_OBJS) $(LIBMDOC_LNS): libmdoc.h +$(LIBROFF_OBJS) $(LIBROFF_LNS): libroff.h +$(LIBMANDOC_OBJS) $(LIBMANDOC_LNS): mandoc.h mdoc.h man.h libmandoc.h config.h + +$(COMPAT_OBJS) $(COMPAT_LNS): config.h + +MANDOC_HTML_OBJS = eqn_html.o \ + html.o \ + man_html.o \ + mdoc_html.o \ + tbl_html.o +MANDOC_HTML_LNS = eqn_html.ln \ + html.ln \ + man_html.ln \ + mdoc_html.ln \ + tbl_html.ln + +MANDOC_MAN_OBJS = mdoc_man.o +MANDOC_MAN_LNS = mdoc_man.ln + +MANDOC_TERM_OBJS = eqn_term.o \ + man_term.o \ + mdoc_term.o \ + term.o \ + term_ascii.o \ + term_ps.o \ + tbl_term.o +MANDOC_TERM_LNS = eqn_term.ln \ + man_term.ln \ + mdoc_term.ln \ + term.ln \ + term_ascii.ln \ + term_ps.ln \ + tbl_term.ln + +MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + main.o \ + out.o \ + tree.o +MANDOC_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + main.ln \ + out.ln \ + tree.ln + +$(MANDOC_HTML_OBJS) $(MANDOC_HTML_LNS): html.h +$(MANDOC_TERM_OBJS) $(MANDOC_TERM_LNS): term.h +$(MANDOC_OBJS) $(MANDOC_LNS): main.h mandoc.h mdoc.h man.h config.h out.h + +MANDOCDB_OBJS = mandocdb.o manpath.o +MANDOCDB_LNS = mandocdb.ln manpath.ln + +$(MANDOCDB_OBJS) $(MANDOCDB_LNS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h + +PRECONV_OBJS = preconv.o +PRECONV_LNS = preconv.ln + +$(PRECONV_OBJS) $(PRECONV_LNS): config.h + +APROPOS_OBJS = apropos.o apropos_db.o manpath.o +APROPOS_LNS = apropos.ln apropos_db.ln manpath.ln + +$(APROPOS_OBJS) $(APROPOS_LNS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + cgi.o \ + apropos_db.o \ + manpath.o \ + out.o \ + tree.o + +CGI_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + cgi.ln \ + apropos_db.ln \ + manpath.ln \ + out.ln \ + tree.ln + +$(CGI_OBJS) $(CGI_LNS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CATMAN_OBJS = catman.o manpath.o +CATMAN_LNS = catman.ln manpath.ln + +$(CATMAN_OBJS) $(CATMAN_LNS): config.h mandoc.h manpath.h mandocdb.h + +DEMANDOC_OBJS = demandoc.o +DEMANDOC_LNS = demandoc.ln + +$(DEMANDOC_OBJS) $(DEMANDOC_LNS): config.h + +INDEX_MANS = apropos.1.html \ + apropos.1.xhtml \ + apropos.1.ps \ + apropos.1.pdf \ + apropos.1.txt \ + catman.8.html \ + catman.8.xhtml \ + catman.8.ps \ + catman.8.pdf \ + catman.8.txt \ + demandoc.1.html \ + demandoc.1.xhtml \ + demandoc.1.ps \ + demandoc.1.pdf \ + demandoc.1.txt \ + mandoc.1.html \ + mandoc.1.xhtml \ + mandoc.1.ps \ + mandoc.1.pdf \ + mandoc.1.txt \ + whatis.1.html \ + whatis.1.xhtml \ + whatis.1.ps \ + whatis.1.pdf \ + whatis.1.txt \ + mandoc.3.html \ + mandoc.3.xhtml \ + mandoc.3.ps \ + mandoc.3.pdf \ + mandoc.3.txt \ + eqn.7.html \ + eqn.7.xhtml \ + eqn.7.ps \ + eqn.7.pdf \ + eqn.7.txt \ + man.7.html \ + man.7.xhtml \ + man.7.ps \ + man.7.pdf \ + man.7.txt \ + man.cgi.7.html \ + man.cgi.7.xhtml \ + man.cgi.7.ps \ + man.cgi.7.pdf \ + man.cgi.7.txt \ + mandoc_char.7.html \ + mandoc_char.7.xhtml \ + mandoc_char.7.ps \ + mandoc_char.7.pdf \ + mandoc_char.7.txt \ + mdoc.7.html \ + mdoc.7.xhtml \ + mdoc.7.ps \ + mdoc.7.pdf \ + mdoc.7.txt \ + preconv.1.html \ + preconv.1.xhtml \ + preconv.1.ps \ + preconv.1.pdf \ + preconv.1.txt \ + roff.7.html \ + roff.7.xhtml \ + roff.7.ps \ + roff.7.pdf \ + roff.7.txt \ + tbl.7.html \ + tbl.7.xhtml \ + tbl.7.ps \ + tbl.7.pdf \ + tbl.7.txt \ + mandocdb.8.html \ + mandocdb.8.xhtml \ + mandocdb.8.ps \ + mandocdb.8.pdf \ + mandocdb.8.txt + +$(INDEX_MANS): mandoc + +INDEX_OBJS = $(INDEX_MANS) \ + man.h.html \ + mandoc.h.html \ + mdoc.h.html \ + mdocml.tar.gz \ + mdocml.md5 + +www: index.html + +lint: llib-lmandoc.ln llib-lpreconv.ln llib-ldemandoc.ln $(DBLN) + +clean: + rm -f libmandoc.a $(LIBMANDOC_OBJS) + rm -f llib-llibmandoc.ln $(LIBMANDOC_LNS) + rm -f mandocdb $(MANDOCDB_OBJS) + rm -f llib-lmandocdb.ln $(MANDOCDB_LNS) + rm -f preconv $(PRECONV_OBJS) + rm -f llib-lpreconv.ln $(PRECONV_LNS) + rm -f apropos whatis $(APROPOS_OBJS) + rm -f llib-lapropos.ln $(APROPOS_LNS) + rm -f man.cgi $(CGI_OBJS) + rm -f llib-lman.cgi.ln $(CGI_LNS) + rm -f catman $(CATMAN_OBJS) + rm -f llib-lcatman.ln $(CATMAN_LNS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f llib-ldemandoc.ln $(DEMANDOC_LNS) + rm -f mandoc $(MANDOC_OBJS) + rm -f llib-lmandoc.ln $(MANDOC_LNS) + rm -f config.h config.log $(COMPAT_OBJS) $(COMPAT_LNS) + rm -f mdocml.tar.gz mdocml-win32.zip mdocml-win64.zip mdocml-macosx.zip + rm -f index.html $(INDEX_OBJS) + rm -rf test-fgetln.dSYM + rm -rf test-strlcpy.dSYM + rm -rf test-strlcat.dSYM + rm -rf test-strptime.dSYM + rm -rf test-mmap.dSYM + rm -rf test-getsubopt.dSYM + rm -rf apropos.dSYM + rm -rf catman.dSYM + rm -rf mandocdb.dSYM + rm -rf whatis.dSYM + +install: all + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(EXAMPLEDIR) + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_PROGRAM) mandoc preconv demandoc $(DESTDIR)$(BINDIR) + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) mandoc.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) + +installcgi: all + mkdir -p $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(HTDOCDIR) + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css + $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR) + +installwww: www + mkdir -p $(PREFIX)/snapshots + mkdir -p $(PREFIX)/binaries + $(INSTALL_DATA) index.html external.png index.css $(PREFIX) + $(INSTALL_DATA) $(INDEX_MANS) style.css $(PREFIX) + $(INSTALL_DATA) mandoc.h.html man.h.html mdoc.h.html $(PREFIX) + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots/mdocml-$(VERSION).tar.gz + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots/mdocml-$(VERSION).md5 + +libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + +llib-llibmandoc.ln: $(COMPAT_LNS) $(LIBMANDOC_LNS) + $(LINT) $(LINTFLAGS) -Clibmandoc $(COMPAT_LNS) $(LIBMANDOC_LNS) + +mandoc: $(MANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a + +llib-lmandoc.ln: $(MANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandoc $(MANDOC_LNS) llib-llibmandoc.ln + +mandocdb: $(MANDOCDB_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB) + +llib-lmandocdb.ln: $(MANDOCDB_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandocdb $(MANDOCDB_LNS) llib-llibmandoc.ln + +preconv: $(PRECONV_OBJS) + $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS) + +llib-lpreconv.ln: $(PRECONV_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS) llib-llibmandoc.ln + +whatis: apropos + cp -f apropos whatis + +apropos: $(APROPOS_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) + +llib-lapropos.ln: $(APROPOS_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Capropos $(APROPOS_LNS) llib-llibmandoc.ln + +catman: $(CATMAN_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(CATMAN_OBJS) libmandoc.a $(DBLIB) + +llib-lcatman.ln: $(CATMAN_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Ccatman $(CATMAN_LNS) llib-llibmandoc.ln + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) + +llib-lman.cgi.ln: $(CGI_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cman.cgi $(CGI_LNS) llib-llibmandoc.ln + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a + +llib-ldemandoc.ln: $(DEMANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cdemandoc $(DEMANDOC_LNS) llib-llibmandoc.ln + +mdocml.md5: mdocml.tar.gz + md5 mdocml.tar.gz >$@ + +mdocml.tar.gz: $(SRCS) + mkdir -p .dist/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .dist/mdocml-$(VERSION) + ( cd .dist/ && tar zcf ../$@ ./ ) + rm -rf .dist/ + +mdocml-win32.zip: $(SRCS) + mkdir -p .win32/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win32 + cp .win32/Makefile .win32/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win32/Makefile.old >.win32/Makefile + ( cd .win32; \ + CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win32 + +mdocml-win64.zip: $(SRCS) + mkdir -p .win64/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win64 + cp .win64/Makefile .win64/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win64/Makefile.old >.win64/Makefile + ( cd .win64; \ + CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win64 + +mdocml-macosx.zip: $(SRCS) + mkdir -p .macosx/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .macosx + ( cd .macosx; \ + CFLAGS="-arch i386 -arch x86_64 -arch ppc" LDFLAGS="-arch i386 -arch x86_64 -arch ppc" make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .macosx + +index.html: $(INDEX_OBJS) + +config.h: config.h.pre config.h.post + rm -f config.log + ( cat config.h.pre; \ + echo; \ + if $(CC) $(CFLAGS) -Werror -o test-fgetln test-fgetln.c >> config.log 2>&1; then \ + echo '#define HAVE_FGETLN'; \ + rm test-fgetln; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strptime test-strptime.c >> config.log 2>&1; then \ + echo '#define HAVE_STRPTIME'; \ + rm test-strptime; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-getsubopt test-getsubopt.c >> config.log 2>&1; then \ + echo '#define HAVE_GETSUBOPT'; \ + rm test-getsubopt; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcat test-strlcat.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCAT'; \ + rm test-strlcat; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-mmap test-mmap.c >> config.log 2>&1; then \ + echo '#define HAVE_MMAP'; \ + rm test-mmap; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcpy test-strlcpy.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCPY'; \ + rm test-strlcpy; \ + fi; \ + echo; \ + cat config.h.post \ + ) > $@ + +.h.h.html: + highlight -I $< >$@ + +.1.1.txt .3.3.txt .7.7.txt .8.8.txt: + ./mandoc -Tascii -Wall,stop $< | col -b >$@ + +.1.1.html .3.3.html .7.7.html .8.8.html: + ./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@ + +.1.1.ps .3.3.ps .7.7.ps .8.8.ps: + ./mandoc -Tps -Wall,stop $< >$@ + +.1.1.xhtml .3.3.xhtml .7.7.xhtml .8.8.xhtml: + ./mandoc -Txhtml -Wall,stop -Ostyle=style.css,man=%N.%S.xhtml,includes=%I.html $< >$@ + +.1.1.pdf .3.3.pdf .7.7.pdf .8.8.pdf: + ./mandoc -Tpdf -Wall,stop $< >$@ + +.sgml.html: + validate --warn $< + sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@ Added: soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO Tue May 29 03:57:16 2012 (r236638) @@ -0,0 +1,372 @@ +************************************************************************ +* Official mandoc TODO. +* $Id: TODO,v 1.129 2012/03/04 23:53:37 schwarze Exp $ +************************************************************************ + +************************************************************************ +* parser bugs +************************************************************************ + +- ".\}" on its own line gets translated to bare ".\&" + which forces pset() into man(7) + and then triggers an unknown macro error + reported by naddy@ Sun, 3 Jul 2011 21:52:24 +0200 + +************************************************************************ +* formatter bugs +************************************************************************ + +- tbl(7): Horizontal and vertical lines are formatted badly: + With the box option, there is too much white space at the end of cells. + Horizontal lines from "=" lines are a bit too long. + yuri dot pankov at gmail dot com Thu, 14 Apr 2011 05:45:26 +0400 + +************************************************************************ +* missing features +************************************************************************ + +--- missing roff features ---------------------------------------------- + +- The pod2man preamble wants \h'...' with quoted numerical arguments, + see for example AUTHORS in MooseX::Getopt.3p, p5-MooseX-Getopt. + reported by Andreas Voegele + Tue, 22 Nov 2011 15:34:47 +0100 on ports@ + +- .if n \{ + .br\} + should cause an extra space to be raised. + +- .ad (adjust margins) + .ad l -- adjust left margin only (flush left) + .ad r -- adjust right margin only (flush right) + .ad c -- center text on line + .ad b -- adjust both margins (alias: .ad n) + .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). + +- .it (line traps) occur in mysql(1), yasm_arch(7) + generated by DocBook XSL Stylesheets v1.71.1 + reported by brad@ Sat, 15 Jan 2011 15:48:18 -0500 + +- .ns (no-space mode) occurs in xine-config(1) + reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + +- xloadimage(1) wants .ti (temporary indent), rep by naddy@ + +- .ta (tab settings) occurs in ircbug(1) and probably gnats(1) + reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 + +- \c (interrupted text) occurs in chat(8) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Tue May 29 12:16:09 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id E5D001065679 for ; Tue, 29 May 2012 12:16:06 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 12:16:06 +0000 Date: Tue, 29 May 2012 12:16:06 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529121606.E5D001065679@hub.freebsd.org> Cc: Subject: socsvn commit: r236654 - in soc2012/gmiller/locking-head: include lib/libthr/thread X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 12:16:09 -0000 Author: gmiller Date: Tue May 29 12:16:06 2012 New Revision: 236654 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236654 Log: Add some of the stubs for mutexes and propagate the acquisition point information through the callers to the stubs. Modified: soc2012/gmiller/locking-head/include/pthread.h soc2012/gmiller/locking-head/lib/libthr/thread/Makefile.inc soc2012/gmiller/locking-head/lib/libthr/thread/thr_cond.c soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Modified: soc2012/gmiller/locking-head/include/pthread.h ============================================================================== --- soc2012/gmiller/locking-head/include/pthread.h Tue May 29 11:48:53 2012 (r236653) +++ soc2012/gmiller/locking-head/include/pthread.h Tue May 29 12:16:06 2012 (r236654) @@ -198,8 +198,10 @@ const pthread_condattr_t *); int pthread_cond_signal(pthread_cond_t *); int pthread_cond_timedwait(pthread_cond_t *, - pthread_mutex_t *, const struct timespec *); -int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); + pthread_mutex_t *, const struct timespec * + _PTHREAD_PROFILE_PARMS); +int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t * + _PTHREAD_PROFILE_PARMS); int pthread_create(pthread_t *, const pthread_attr_t *, void *(*) (void *), void *); int pthread_detach(pthread_t); @@ -222,9 +224,9 @@ int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *); int pthread_mutex_lock(pthread_mutex_t * _PTHREAD_PROFILE_PARMS); -int pthread_mutex_trylock(pthread_mutex_t *); +int pthread_mutex_trylock(pthread_mutex_t * _PTHREAD_PROFILE_PARMS); int pthread_mutex_timedlock(pthread_mutex_t *, - const struct timespec *); + const struct timespec * _PTHREAD_PROFILE_PARMS); int pthread_mutex_unlock(pthread_mutex_t *); int pthread_once(pthread_once_t *, void (*) (void)); int pthread_rwlock_destroy(pthread_rwlock_t *); @@ -305,10 +307,18 @@ #ifndef pthread_mutex_lock #define pthread_mutex_lock(m) \ pthread_mutex_lock (m, __FILE__, __LINE__) +#define pthread_mutex_trylock(m) \ + pthread_mutex_trylock (m, __FILE__, __LINE__) +#define pthread_mutex_timedlock(m, t) \ + pthread_mutex_timedlock (m, t, __FILE__, __LINE__) #endif #define _pthread_mutex_lock(m) \ _pthread_mutex_lock (m, __FILE__, __LINE__) +#define _pthread_mutex_trylock(m) \ + _pthread_mutex_trylock (m, __FILE__, __LINE__) +#define _pthread_mutex_timedlock(m, t) \ + _pthread_mutex_timedlock (m, t, __FILE__, __LINE__) #endif Modified: soc2012/gmiller/locking-head/lib/libthr/thread/Makefile.inc ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/Makefile.inc Tue May 29 11:48:53 2012 (r236653) +++ soc2012/gmiller/locking-head/lib/libthr/thread/Makefile.inc Tue May 29 12:16:06 2012 (r236654) @@ -35,6 +35,7 @@ thr_mutexattr.c \ thr_once.c \ thr_printf.c \ + thr_profile.c \ thr_pspinlock.c \ thr_resume_np.c \ thr_rtld.c \ Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_cond.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_cond.c Tue May 29 11:48:53 2012 (r236653) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_cond.c Tue May 29 12:16:06 2012 (r236654) @@ -39,12 +39,12 @@ /* * Prototypes */ -int __pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex); +int __pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex _PROFILE_PARMS); int __pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec * abstime); + const struct timespec * abstime _PROFILE_PARMS); static int cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); static int cond_wait_common(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec *abstime, int cancel); + const struct timespec *abstime, int cancel _PROFILE_PARMS); static int cond_signal_common(pthread_cond_t *cond); static int cond_broadcast_common(pthread_cond_t *cond); @@ -159,7 +159,7 @@ */ static int cond_wait_kernel(struct pthread_cond *cvp, struct pthread_mutex *mp, - const struct timespec *abstime, int cancel) + const struct timespec *abstime, int cancel _PROFILE_PARMS) { struct pthread *curthread = _get_curthread(); int recurse; @@ -186,9 +186,9 @@ * interesting error codes. */ if (error == 0) { - error2 = _mutex_cv_lock(mp, recurse); + error2 = _mutex_cv_lock(mp, recurse _PROFILE_PASS); } else if (error == EINTR || error == ETIMEDOUT) { - error2 = _mutex_cv_lock(mp, recurse); + error2 = _mutex_cv_lock(mp, recurse _PROFILE_PASS); if (error2 == 0 && cancel) _thr_testcancel(curthread); if (error == EINTR) @@ -211,7 +211,7 @@ static int cond_wait_user(struct pthread_cond *cvp, struct pthread_mutex *mp, - const struct timespec *abstime, int cancel) + const struct timespec *abstime, int cancel _PROFILE_PARMS) { struct pthread *curthread = _get_curthread(); struct sleepqueue *sq; @@ -256,7 +256,7 @@ _sleepq_remove(sq, curthread); _sleepq_unlock(cvp); curthread->mutex_obj = NULL; - _mutex_cv_lock(mp, recurse); + _mutex_cv_lock(mp, recurse _PROFILE_PASS); if (!THR_IN_CRITICAL(curthread)) _pthread_exit(PTHREAD_CANCELED); else /* this should not happen */ @@ -270,13 +270,13 @@ } _sleepq_unlock(cvp); curthread->mutex_obj = NULL; - _mutex_cv_lock(mp, recurse); + _mutex_cv_lock(mp, recurse _PROFILE_PASS); return (error); } static int cond_wait_common(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec *abstime, int cancel) + const struct timespec *abstime, int cancel _PROFILE_PARMS) { struct pthread *curthread = _get_curthread(); struct pthread_cond *cvp; @@ -294,47 +294,47 @@ (mp->m_lock.m_flags & (UMUTEX_PRIO_PROTECT|UMUTEX_PRIO_INHERIT| USYNC_PROCESS_SHARED)) != 0 || (cvp->__flags & USYNC_PROCESS_SHARED) != 0) - return cond_wait_kernel(cvp, mp, abstime, cancel); + return cond_wait_kernel(cvp, mp, abstime, cancel _PROFILE_PASS); else - return cond_wait_user(cvp, mp, abstime, cancel); + return cond_wait_user(cvp, mp, abstime, cancel _PROFILE_PASS); } int -_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) +_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex _PROFILE_PARMS) { - return (cond_wait_common(cond, mutex, NULL, 0)); + return (cond_wait_common(cond, mutex, NULL, 0 _PROFILE_PASS)); } int -__pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) +__pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex _PROFILE_PARMS) { - return (cond_wait_common(cond, mutex, NULL, 1)); + return (cond_wait_common(cond, mutex, NULL, 1 _PROFILE_PASS)); } int _pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec * abstime) + const struct timespec * abstime _PROFILE_PARMS) { if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) return (EINVAL); - return (cond_wait_common(cond, mutex, abstime, 0)); + return (cond_wait_common(cond, mutex, abstime, 0 _PROFILE_PASS)); } int __pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec *abstime) + const struct timespec *abstime _PROFILE_PARMS) { if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) return (EINVAL); - return (cond_wait_common(cond, mutex, abstime, 1)); + return (cond_wait_common(cond, mutex, abstime, 1 _PROFILE_PASS)); } static int Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c Tue May 29 11:48:53 2012 (r236653) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c Tue May 29 12:16:06 2012 (r236654) @@ -71,21 +71,15 @@ */ #define MUTEX_ADAPTIVE_SPINS 2000 -#ifdef LOCK_PROFILING -#define _PROFILE_PARMS , const char *file, int line -#else -#define _PROFILE_PARMS /* */ -#endif - /* * Prototypes */ int __pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *mutex_attr); -int __pthread_mutex_trylock(pthread_mutex_t *mutex); +int __pthread_mutex_trylock(pthread_mutex_t *mutex _PROFILE_PARMS); int __pthread_mutex_lock(pthread_mutex_t *mutex _PROFILE_PARMS); int __pthread_mutex_timedlock(pthread_mutex_t *mutex, - const struct timespec *abstime); + const struct timespec *abstime _PROFILE_PARMS); int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex, void *(calloc_cb)(size_t, size_t)); int _pthread_mutex_getspinloops_np(pthread_mutex_t *mutex, int *count); @@ -100,7 +94,7 @@ const struct timespec *abstime); static int mutex_unlock_common(struct pthread_mutex *, int); static int mutex_lock_sleep(struct pthread *, pthread_mutex_t, - const struct timespec *); + const struct timespec * _PROFILE_PARMS); __weak_reference(__pthread_mutex_init, pthread_mutex_init); __strong_reference(__pthread_mutex_init, _pthread_mutex_init); @@ -318,7 +312,7 @@ } static int -mutex_trylock_common(pthread_mutex_t *mutex) +mutex_trylock_common(pthread_mutex_t *mutex _PROFILE_PARMS) { struct pthread *curthread = _get_curthread(); struct pthread_mutex *m = *mutex; @@ -331,27 +325,33 @@ ret = _thr_umutex_trylock(&m->m_lock, id); if (__predict_true(ret == 0)) { ENQUEUE_MUTEX(curthread, m); + MUTEX_OBTAIN_SUCCESS(); } else if (m->m_owner == curthread) { ret = mutex_self_trylock(m); - } /* else {} */ + MUTEX_OBTAIN_FAILED(); + } else { + MUTEX_OBTAIN_FAILED(); + } + if (ret && (m->m_flags & PMUTEX_FLAG_PRIVATE)) THR_CRITICAL_LEAVE(curthread); + return (ret); } int -__pthread_mutex_trylock(pthread_mutex_t *mutex) +__pthread_mutex_trylock(pthread_mutex_t *mutex _PROFILE_PARMS) { struct pthread_mutex *m; CHECK_AND_INIT_MUTEX - return (mutex_trylock_common(mutex)); + return (mutex_trylock_common(mutex _PROFILE_PASS)); } static int mutex_lock_sleep(struct pthread *curthread, struct pthread_mutex *m, - const struct timespec *abstime) + const struct timespec *abstime _PROFILE_PARMS) { uint32_t id, owner; int count; @@ -360,9 +360,7 @@ if (m->m_owner == curthread) return mutex_self_lock(m, abstime); -#if 0 - lock_profile_obtain_lock_success(); -#endif + MUTEX_OBTAIN_FAILED(); id = TID(curthread); /* @@ -415,15 +413,17 @@ ret = __thr_umutex_timedlock(&m->m_lock, id, abstime); } done: - if (ret == 0) + if (ret == 0) { ENQUEUE_MUTEX(curthread, m); + MUTEX_OBTAIN_SUCCESS(); + } return (ret); } static inline int mutex_lock_common(struct pthread_mutex *m, - const struct timespec *abstime, int cvattach) + const struct timespec *abstime, int cvattach _PROFILE_PARMS) { struct pthread *curthread = _get_curthread(); int ret; @@ -434,7 +434,7 @@ ENQUEUE_MUTEX(curthread, m); ret = 0; } else { - ret = mutex_lock_sleep(curthread, m, abstime); + ret = mutex_lock_sleep(curthread, m, abstime _PROFILE_PASS); } if (ret && (m->m_flags & PMUTEX_FLAG_PRIVATE) && !cvattach) THR_CRITICAL_LEAVE(curthread); @@ -450,11 +450,11 @@ CHECK_AND_INIT_MUTEX - return (mutex_lock_common(m, NULL, 0)); + return (mutex_lock_common(m, NULL, 0 _PROFILE_PASS)); } int -__pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abstime) +__pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abstime _PROFILE_PARMS) { struct pthread_mutex *m; @@ -462,7 +462,7 @@ CHECK_AND_INIT_MUTEX - return (mutex_lock_common(m, abstime, 0)); + return (mutex_lock_common(m, abstime, 0 _PROFILE_PASS)); } int @@ -475,11 +475,11 @@ } int -_mutex_cv_lock(struct pthread_mutex *m, int count) +_mutex_cv_lock(struct pthread_mutex *m, int count _PROFILE_PARMS) { int error; - error = mutex_lock_common(m, NULL, 1); + error = mutex_lock_common(m, NULL, 1 _PROFILE_PASS); if (error == 0) m->m_count = count; return (error); Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Tue May 29 11:48:53 2012 (r236653) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Tue May 29 12:16:06 2012 (r236654) @@ -722,18 +722,31 @@ extern struct urwlock _thr_list_lock __hidden; extern struct umutex _thr_event_lock __hidden; +#ifdef LOCK_PROFILING +#define _PROFILE_PARMS , const char *file, int line +#define _PROFILE_PASS , file, line +#else +#define _PROFILE_PARMS /* */ +#define _PROFILE_PASS /* */ +#endif + /* * Function prototype definitions. */ __BEGIN_DECLS int _thr_setthreaded(int) __hidden; -int _mutex_cv_lock(struct pthread_mutex *, int count) __hidden; +int _mutex_cv_lock(struct pthread_mutex *, int count _PROFILE_PARMS) \ + __hidden; int _mutex_cv_unlock(struct pthread_mutex *, int *count) __hidden; int _mutex_cv_attach(struct pthread_mutex *, int count) __hidden; int _mutex_cv_detach(struct pthread_mutex *, int *count) __hidden; int _mutex_owned(struct pthread *, const struct pthread_mutex *) __hidden; int _mutex_reinit(pthread_mutex_t *) __hidden; void _mutex_fork(struct pthread *curthread) __hidden; +void _mutex_obtain_failed(struct pthread_mutex *, const char *, int) + __hidden; +void _mutex_obtain_success(struct pthread_mutex *, const char *, int) + __hidden; void _libpthread_init(struct pthread *) __hidden; struct pthread *_thr_alloc(struct pthread *) __hidden; void _thread_exit(const char *, int, const char *) __hidden __dead2; @@ -792,6 +805,18 @@ void _pthread_cancel_enter(int maycancel); void _pthread_cancel_leave(int maycancel); +#ifdef LOCK_PROFILING +#define MUTEX_OBTAIN_SUCCESS() \ + _mutex_obtain_success(m, file, line) +#define MUTEX_OBTAIN_FAILED() \ + _mutex_obtain_failed(m, file, line) +#else +#define MUTEX_OBTAIN_SUCCESS() \ + do { } while (0) +#define MUTEX_OBTAIN_FAILED() \ + do { } while (0) +#endif + /* #include */ #ifdef _SYS_FCNTL_H_ int __sys_fcntl(int, int, ...); From owner-svn-soc-all@FreeBSD.ORG Tue May 29 13:04:39 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 340121065674 for ; Tue, 29 May 2012 13:04:38 +0000 (UTC) (envelope-from rudot@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 13:04:38 +0000 Date: Tue, 29 May 2012 13:04:38 +0000 From: rudot@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529130438.340121065674@hub.freebsd.org> Cc: Subject: socsvn commit: r236657 - soc2012/rudot/aux X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 13:04:39 -0000 Author: rudot Date: Tue May 29 13:04:37 2012 New Revision: 236657 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236657 Log: a few helper scripts Added: soc2012/rudot/aux/proc_pcpu.sh (contents, props changed) soc2012/rudot/aux/user_pcpu.sh (contents, props changed) Modified: soc2012/rudot/aux/build_kernel.sh Modified: soc2012/rudot/aux/build_kernel.sh ============================================================================== --- soc2012/rudot/aux/build_kernel.sh Tue May 29 12:52:30 2012 (r236656) +++ soc2012/rudot/aux/build_kernel.sh Tue May 29 13:04:37 2012 (r236657) @@ -6,4 +6,4 @@ fi cd /usr/src -make buildkernel -DNO_MODULES -DNO_CLEAN KERNCONF=RCTL && make installkernel -DNO_MODULES KERNCONF=RCTL +make buildkernel -DNO_MODULES -DNO_CLEAN -DNO_KERNELDEPEND KERNCONF=RCTL && make installkernel -DNO_MODULES KERNCONF=RCTL Added: soc2012/rudot/aux/proc_pcpu.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/rudot/aux/proc_pcpu.sh Tue May 29 13:04:37 2012 (r236657) @@ -0,0 +1,8 @@ +if [ -z $1 ]; then + echo "Usage: ${0} pid" + exit +else + PROC=${1} +fi + +rctl -u process:${PROC}: | grep pcpu Added: soc2012/rudot/aux/user_pcpu.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/rudot/aux/user_pcpu.sh Tue May 29 13:04:37 2012 (r236657) @@ -0,0 +1,7 @@ +if [ -z $1 ]; then + USER=root +else + USER=${1} +fi + +rctl -u user:${USER}: | grep pcpu From owner-svn-soc-all@FreeBSD.ORG Tue May 29 16:05:20 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id E0219106564A for ; Tue, 29 May 2012 16:05:18 +0000 (UTC) (envelope-from scher@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 16:05:18 +0000 Date: Tue, 29 May 2012 16:05:18 +0000 From: scher@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529160518.E0219106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r236669 - soc2012/scher/par_ports/head/Mk X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 16:05:21 -0000 Author: scher Date: Tue May 29 16:05:18 2012 New Revision: 236669 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236669 Log: [fixed] Trigger name changed to suit variable naming _parv_WANT_PARALLEL_BUILD kill signal changed to USR1 make utility exit with 158 status on lock [new_feature] ${.CURDIR} locking behaviour for dependency build ${PKG_DBDIR} locking phases for XXX-depends and lib-depends targets Blocking Parallel build/install support for port's dependencies in XXX-depends and lib-depends targets Submitted by: Alexander Pronin Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk soc2012/scher/par_ports/head/Mk/bsd.port.mk Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Tue May 29 15:56:30 2012 (r236668) +++ soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Tue May 29 16:05:18 2012 (r236669) @@ -5,6 +5,11 @@ # # Please view me with 4 column tabs! +# +# _parv_WANT_PARALLEL_BUILD +# _parv_ATTEMPTS_TO_LOCK +# +# _dparv_= @@ -31,7 +36,7 @@ _parv_DEFAULT_TARGETS= all check-sanity fetch checksum extract patch configure build install _parv_IS_DEFAULT_TARGET= 0 -# e.g. make "WANT_PARALLEL_BUILD=" +# e.g. make -D_parv_WANT_PARALLEL_BUILD # All target will be evaluated. It is in default sequence # .if !${.TARGETS} @@ -50,7 +55,7 @@ ##################################################### # Commands _parv_KILL= /bin/kill -_parv_KILL_FLAGS= -- +_parv_KILL_SIGNAL= USR1 _parv_PKILL= /bin/pkill _parv_PKILL_FLAGS= -P @@ -72,6 +77,8 @@ _parv_ON_LOCK_EXIT_STATUS= 2 _parv_LOCKF_EX_TEMPFAIL= 75 +_parv_MAKE_LOCK_EXIT_STATUS= 158 + # Senquence of commands to lock a directory using ${_parv_LOCK_FILE}. # During evaluation of the following commands lockf(1) is holding lock on ${_parv_LOCK_FILE} file. # Hence NO other process is able to evaluate any commands using lockf(1) Modified: soc2012/scher/par_ports/head/Mk/bsd.port.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.port.mk Tue May 29 15:56:30 2012 (r236668) +++ soc2012/scher/par_ports/head/Mk/bsd.port.mk Tue May 29 16:05:18 2012 (r236669) @@ -1129,8 +1129,8 @@ .include "${PORTSDIR}/Mk/bsd.commands.mk" ############### PAR_PORTS SPECIFIC COMMENT LINE ############### -# _parv_WANT_PARALLEL_BUILD - define this variable if port want to enable -# parallel build/install features +# _parv_WANT_PARALLEL_BUILD - assign this variable any value if port want to enable +# parallel build/install features. # .if defined(_parv_WANT_PARALLEL_BUILD) @@ -1531,7 +1531,19 @@ .BEGIN: . if defined(_parv_WANT_PARALLEL_BUILD) . if ${_parv_IS_DEFAULT_TARGET} +. if defined(INSTALLS_DEPENDS) + @( ${_parv_.CURDIR_LOCK_LOOP} ) || { \ + status=$$?; \ + if [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ + ${_parv_KILL} -${_parv_KILL_SIGNAL} ${.MAKE.PID} && \ + ${_parv_PKILL} ${_parv_PKILL_FLAGS} $$$$; \ + else \ + exit $${status}; \ + fi; \ + } +. else @attempts=-1; ${_parv_.CURDIR_LOCK_LOOP} +. endif . endif . endif # You can force skipping these test by defining IGNORE_PATH_CHECKS @@ -5022,6 +5034,11 @@ _DEPEND_ALWAYS= 0 .endif +############### PAR_PORTS SPECIFIC COMMENT LINE ############### +# _INSTALL_DEPENDS script is surrounded by while loop. +# When the port is installed it is necessary to break most inner while loop. +############### END OF PAR_PORTS SPECIFIC COMMENT LINE ############### + _INSTALL_DEPENDS= \ if [ X${USE_PACKAGE_DEPENDS} != "X" ]; then \ subpkgfile=`(cd $$dir; ${MAKE} $$depends_args -V PKGFILE)`; \ @@ -5038,10 +5055,24 @@ ${PKG_ADD} $${subpkgfile}; \ fi; \ else \ - (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \ + (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) && status=$$? || status=$$?; \ fi; \ else \ - (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \ + (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args; ) && status=$$? || status=$$?; \ + fi; \ + if [ ! ${_parv_WANT_PARALLEL_BUILD} ] && [ $${status} != 0 ]; then \ + exit $${status}; \ + fi; \ + if [ ${_parv_WANT_PARALLEL_BUILD} ]; then \ + if [ $${status} -eq 0 ]; then \ + _parv_next_dep=1; \ + elif [ $${status} -eq ${_parv_MAKE_LOCK_EXIT_STATUS} ]; then \ + ${ECHO_CMD} $${prog} may be installing now.; \ + sleep 2; \ + continue; \ + else \ + exit $${status}; \ + fi; \ fi; \ ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; @@ -5071,6 +5102,11 @@ target="${DEPENDS_TARGET}"; \ depends_args="${DEPENDS_ARGS}"; \ fi; \ + _parv_next_dep=0; \ + while [ $${_parv_next_dep} -eq 0 ]; do \ + if [ ${_parv_WANT_PARALLEL_BUILD} ]; then \ + ( attempts=-1; ${_parv_PKG_DBDIR_LOCK_LOOP} ); \ + fi; \ if ${EXPR} "$$prog" : \\/ >/dev/null; then \ if [ -e "$$prog" ]; then \ if [ "$$prog" = "${NONEXISTENT}" ]; then \ @@ -5130,6 +5166,22 @@ notfound=1; \ fi; \ fi; \ + if [ ${_parv_WANT_PARALLEL_BUILD} ] && [ $${notfound} -eq 1 ]; then \ + ( ${_parv_CHECK_LOCK} ) || { \ + status=$$?; \ + if [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ + ( ${_parv_PKG_DBDIR_DO_UNLOCK} ); \ + ${ECHO_CMD} $${prog} may be installing now.; \ + sleep 2; \ + continue; \ + else \ + exit $${status}; \ + fi; \ + }; \ + fi; \ + if [ ${_parv_WANT_PARALLEL_BUILD} ]; then \ + ( ${_parv_PKG_DBDIR_DO_UNLOCK} ); \ + fi; \ if [ $$notfound != 0 ]; then \ ${ECHO_MSG} "===> Verifying $$target for $$prog in $$dir"; \ if [ ! -d "$$dir" ]; then \ @@ -5138,6 +5190,9 @@ ${_INSTALL_DEPENDS} \ fi; \ fi; \ + if [ $${notfound} -eq 0 ]; then _parv_next_dep=1; fi; \ + if [ ! ${_parv_WANT_PARALLEL_BUILD} ]; then _parv_next_dep=1; fi; \ + done; \ done .endif .else @@ -5159,6 +5214,11 @@ dir=$${dir%%:*}; \ fi; \ ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library: $$lib"; \ + _parv_next_dep=0; \ + while [ $${_parv_next_dep} -eq 0 ]; do \ + if [ ${_parv_WANT_PARALLEL_BUILD} ]; then \ + ( attempts=-1; ${_parv_PKG_DBDIR_LOCK_LOOP} ); \ + fi; \ if ${LDCONFIG} ${_LDCONFIG_FLAGS} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \ ${ECHO_MSG} " - found"; \ if [ ${_DEPEND_ALWAYS} = 1 ]; then \ @@ -5171,6 +5231,22 @@ ${ECHO_MSG} " - not found"; \ notfound=1; \ fi; \ + if [ ${_parv_WANT_PARALLEL_BUILD} ] && [ $${notfound} -eq 1 ]; then \ + ( ${_parv_CHECK_LOCK} ) || { \ + status=$$?; \ + if [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ + ( ${_parv_PKG_DBDIR_DO_UNLOCK} ); \ + ${ECHO_CMD} $${prog} may be installing now.; \ + sleep 2; \ + continue; \ + else \ + exit $${status}; \ + fi; \ + }; \ + fi; \ + if [ ${_parv_WANT_PARALLEL_BUILD} ]; then \ + ( ${_parv_PKG_DBDIR_DO_UNLOCK} ); \ + fi; \ if [ $$notfound != 0 ]; then \ ${ECHO_MSG} "===> Verifying $$target for $$lib in $$dir"; \ if [ ! -d "$$dir" ]; then \ @@ -5183,6 +5259,9 @@ fi; \ fi; \ fi; \ + if [ $${notfound} -eq 0 ]; then _parv_next_dep=1; fi; \ + if [ ! ${_parv_WANT_PARALLEL_BUILD} ]; then _parv_next_dep=1; fi; \ + done; \ done .endif @@ -5921,13 +6000,7 @@ .if !defined(NO_PKG_REGISTER) ############### PAR_PORTS SPECIFIC COMMENT LINE ############### .if defined(_parv_WANT_PARALLEL_BUILD) - @( attempts=-1; ${_parv_PKG_DBDIR_LOCK_LOOP} ) || { \ - status=$$?; \ - ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} Unable to lock ${PKG_DBDIR}. Exit status $${status}; \ - ${_dparv_END_OUTPUT}; \ - exit 1; \ - } + @( attempts=-1; ${_parv_PKG_DBDIR_LOCK_LOOP} ) .endif ############### END OF PAR_PORTS SPECIFIC COMMENT LINE ############### @if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} ${PKG_DBDIR}; fi @@ -5977,13 +6050,7 @@ fi ############### PAR_PORTS SPECIFIC COMMENT LINE ############### .if defined(_parv_WANT_PARALLEL_BUILD) - @( ${_parv_PKG_DBDIR_DO_UNLOCK} ) || { \ - status=$$?; \ - ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} Unable to unlock ${PKG_DBDIR}. Exit status $${status}; \ - ${_dparv_END_OUTPUT}; \ - exit 1; \ - } + @( ${_parv_PKG_DBDIR_DO_UNLOCK} ) .endif ############### END OF PAR_PORTS SPECIFIC COMMENT LINE ############### .else From owner-svn-soc-all@FreeBSD.ORG Tue May 29 18:26:47 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 779B61065678 for ; Tue, 29 May 2012 18:26:45 +0000 (UTC) (envelope-from vbotton@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 18:26:45 +0000 Date: Tue, 29 May 2012 18:26:45 +0000 From: vbotton@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529182645.779B61065678@hub.freebsd.org> Cc: Subject: socsvn commit: r236675 - soc2012/vbotton/ntfs_apple X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 18:26:47 -0000 Author: vbotton Date: Tue May 29 18:26:44 2012 New Revision: 236675 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236675 Log: replace some endianness functions Modified: soc2012/vbotton/ntfs_apple/ntfs_attr.c soc2012/vbotton/ntfs_apple/ntfs_attr.h soc2012/vbotton/ntfs_apple/ntfs_inode.h soc2012/vbotton/ntfs_apple/ntfs_time.h soc2012/vbotton/ntfs_apple/ntfs_types.h Modified: soc2012/vbotton/ntfs_apple/ntfs_attr.c ============================================================================== --- soc2012/vbotton/ntfs_apple/ntfs_attr.c Tue May 29 17:53:11 2012 (r236674) +++ soc2012/vbotton/ntfs_apple/ntfs_attr.c Tue May 29 18:26:44 2012 (r236675) @@ -94,7 +94,7 @@ ntfs_debug("Entering for mft_no 0x%llx, type 0x%x.", (unsigned long long)ni->mft_no, - (unsigned)le32_to_cpu(ni->type)); + (unsigned)le32toh(ni->type)); /* If the attribute is resident there is nothing to do. */ if (!NInoNonResident(ni)) { ntfs_debug("Done (resident, nothing to do)."); @@ -140,9 +140,9 @@ * allocated size is correct. */ if (!a->lowest_vcn) - if (sle64_to_cpu(a->allocated_size) != + if (le64toh(a->allocated_size) != ni->allocated_size) - panic("%s(): sle64_to_cpu(a->allocated_size) " + panic("%s(): le64toh(a->allocated_size) " "!= ni->allocated_size\n", __FUNCTION__); /* @@ -150,11 +150,11 @@ * vcn we looked up and that the highest_vcn of the attribute * is above the current vcn. */ - if (sle64_to_cpu(a->lowest_vcn) != vcn || (vcn && - sle64_to_cpu(a->highest_vcn) < vcn)) + if (le64toh(a->lowest_vcn) != vcn || (vcn && + le64toh(a->highest_vcn) < vcn)) goto corrupt_err; /* Determine the next vcn. */ - vcn = sle64_to_cpu(a->highest_vcn) + 1; + vcn = le64toh(a->highest_vcn) + 1; /* * Finally, map the runlist fragment contained in this * attribute extent. @@ -259,7 +259,7 @@ if (!a->non_resident) panic("%s(): !a->non_resident\n", __FUNCTION__); ctx_is_temporary = FALSE; - end_vcn = sle64_to_cpu(a->highest_vcn); + end_vcn = le64toh(a->highest_vcn); lck_spin_lock(&ni->size_lock); allocated_size_vcn = ni->allocated_size >> ni->vol->cluster_size_shift; @@ -273,9 +273,9 @@ */ if (vcn >= allocated_size_vcn || (a->type == ni->type && a->name_length == ni->name_len && - !bcmp((u8*)a + le16_to_cpu(a->name_offset), + !bcmp((u8*)a + le16toh(a->name_offset), ni->name, ni->name_len) && - sle64_to_cpu(a->lowest_vcn) <= vcn && + le64toh(a->lowest_vcn) <= vcn && end_vcn >= vcn)) ctx_needs_reset = FALSE; else { @@ -307,7 +307,7 @@ * we then try to map the already mapped runlist fragment and * ntfs_mapping_pairs_decompress() fails. */ - end_vcn = sle64_to_cpu(a->highest_vcn) + 1; + end_vcn = le64toh(a->highest_vcn) + 1; if (vcn && vcn >= end_vcn) { err = ENOENT; goto err; @@ -366,8 +366,8 @@ */ if (err2) { if (err2 == ENOMEM) { - (void)thread_block( - THREAD_CONTINUE_NULL); + /* (void)thread_block( + THREAD_CONTINUE_NULL);*/ goto retry_map; } ctx->is_error = 1; @@ -676,7 +676,7 @@ ctx->is_iteration = 0; /* Sanity checks are performed elsewhere. */ ctx->a = (ATTR_RECORD*)((u8*)ctx->m + - le16_to_cpu(ctx->m->attrs_offset)); + le16toh(ctx->m->attrs_offset)); /* * This needs resetting due to * ntfs_attr_find_in_attribute_list() which can leave it set @@ -808,14 +808,14 @@ a = ctx->a; ctx->is_first = 0; } else - a = (ATTR_RECORD*)((u8*)ctx->a + le32_to_cpu(ctx->a->length)); - for (;; a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length))) { + a = (ATTR_RECORD*)((u8*)ctx->a + le32toh(ctx->a->length)); + for (;; a = (ATTR_RECORD*)((u8*)a + le32toh(a->length))) { if ((u8*)a < (u8*)ctx->m || (u8*)a > (u8*)ctx->m + - le32_to_cpu(ctx->m->bytes_allocated)) + le32toh(ctx->m->bytes_allocated)) break; ctx->a = a; if (((!is_iteration || type != AT_UNUSED) && - le32_to_cpu(a->type) > le32_to_cpu(type)) || + le32toh(a->type) > le32toh(type)) || a->type == AT_END) return ENOENT; if (!a->length) @@ -839,9 +839,9 @@ unsigned len, ofs; len = a->name_length; - ofs = le16_to_cpu(a->name_offset); + ofs = le16toh(a->name_offset); if (ofs + (len * sizeof(ntfschar)) > - le32_to_cpu(a->length)) + le32toh(a->length)) break; if (!ntfs_are_names_equal(name, name_len, (ntfschar*)((u8*)a + ofs), len, @@ -884,9 +884,9 @@ unsigned len, ofs; int rc; - len = le32_to_cpu(a->value_length); - ofs = le16_to_cpu(a->value_offset); - if (ofs + len > le32_to_cpu(a->length)) + len = le32toh(a->value_length); + ofs = le16toh(a->value_offset); + if (ofs + len > le32toh(a->length)) break; rc = memcmp(val, (u8*)a + ofs, len <= val_len ? len : val_len); @@ -992,7 +992,7 @@ panic("%s(): ctx->is_iteration\n", __FUNCTION__); base_ni = ctx->base_ni; ntfs_debug("Entering for mft_no 0x%llx, type 0x%x.", - (unsigned long long)ni->mft_no, le32_to_cpu(type)); + (unsigned long long)ni->mft_no, le32toh(type)); if (!base_ni) { /* First call happens with the base mft record. */ base_ni = ctx->base_ni = ctx->ni; @@ -1016,7 +1016,7 @@ ctx->is_first = 0; } else al_entry = (ATTR_LIST_ENTRY*)((u8*)ctx->al_entry + - le16_to_cpu(ctx->al_entry->length)); + le16toh(ctx->al_entry->length)); for (;; al_entry = next_al_entry) { /* Out of bounds check. */ if ((u8*)al_entry < base_ni->attr_list || @@ -1029,12 +1029,12 @@ if (!al_entry->length) break; if ((u8*)al_entry + 6 > al_end || (u8*)al_entry + - le16_to_cpu(al_entry->length) > al_end) + le16toh(al_entry->length) > al_end) break; next_al_entry = (ATTR_LIST_ENTRY*)((u8*)al_entry + - le16_to_cpu(al_entry->length)); + le16toh(al_entry->length)); if (al_entry->type != type) { - if (le32_to_cpu(al_entry->type) < le32_to_cpu(type)) + if (le32toh(al_entry->type) < le32toh(type)) continue; goto not_found; } @@ -1089,9 +1089,9 @@ */ if (lowest_vcn && (u8*)next_al_entry >= al_start && (u8*)next_al_entry + 6 < al_end && - (u8*)next_al_entry + le16_to_cpu( + (u8*)next_al_entry + le16toh( next_al_entry->length) <= al_end && - sle64_to_cpu(next_al_entry->lowest_vcn) <= + le64toh(next_al_entry->lowest_vcn) <= lowest_vcn && next_al_entry->type == al_entry->type && next_al_entry->name_length == al_name_len && @@ -1147,7 +1147,7 @@ } } a = ctx->a = (ATTR_RECORD*)((u8*)ctx->m + - le16_to_cpu(ctx->m->attrs_offset)); + le16toh(ctx->m->attrs_offset)); /* * ctx->ni, ctx->m, and ctx->a now point to the mft record * containing the attribute represented by the current @@ -1168,7 +1168,7 @@ */ do_next_attr_loop: if ((u8*)a < (u8*)ctx->m || (u8*)a > (u8*)ctx->m + - le32_to_cpu(ctx->m->bytes_allocated)) + le32toh(ctx->m->bytes_allocated)) break; if (a->type == AT_END) continue; @@ -1184,7 +1184,7 @@ if (al_entry->type != a->type) break; if (!ntfs_are_names_equal((ntfschar*)((u8*)a + - le16_to_cpu(a->name_offset)), a->name_length, + le16toh(a->name_offset)), a->name_length, al_name, al_name_len, case_sensitive, vol->upcase, vol->upcase_len)) break; @@ -1194,15 +1194,15 @@ * have found it! */ if (!val || (!a->non_resident && - le32_to_cpu(a->value_length) == val_len && - !bcmp((u8*)a + le16_to_cpu(a->value_offset), + le32toh(a->value_length) == val_len && + !bcmp((u8*)a + le16toh(a->value_offset), val, val_len))) { ntfs_debug("Done, found."); return 0; } do_next_attr: /* Proceed to the next attribute in the current mft record. */ - a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length)); + a = (ATTR_RECORD*)((u8*)a + le32toh(a->length)); goto do_next_attr_loop; } if (!err) { @@ -1247,7 +1247,7 @@ ntfs_extent_mft_record_unmap(ni); ctx->m = ctx->base_m; ctx->a = (ATTR_RECORD*)((u8*)ctx->m + - le16_to_cpu(ctx->m->attrs_offset)); + le16toh(ctx->m->attrs_offset)); ctx->is_first = 1; ctx->ni = base_ni; /* @@ -1352,7 +1352,7 @@ for (ad = vol->attrdef; (u8*)ad - (u8*)vol->attrdef < vol->attrdef_size && ad->type; ++ad) { /* If we have not found it yet, carry on searching. */ - if (le32_to_cpu(type) > le32_to_cpu(ad->type)) + if (le32toh(type) > le32toh(ad->type)) continue; /* If we have found the attribute, return it. */ if (type == ad->type) @@ -1362,7 +1362,7 @@ } /* Attribute not found. */ ntfs_debug("Attribute type 0x%x not found in $AttrDef.", - le32_to_cpu(type)); + le32toh(type)); return NULL; } @@ -1396,10 +1396,10 @@ if (!ad) return ENOENT; /* Do the bounds check. */ - if ((sle64_to_cpu(ad->min_size) > 0 && - size < sle64_to_cpu(ad->min_size)) || - (sle64_to_cpu(ad->max_size) > 0 && - size > sle64_to_cpu(ad->max_size)) || + if ((le64toh(ad->min_size) > 0 && + size < le64toh(ad->min_size)) || + (le64toh(ad->max_size) > 0 && + size > le64toh(ad->max_size)) || (u64)size > NTFS_MAX_ATTRIBUTE_SIZE) return ERANGE; return 0; @@ -1470,8 +1470,8 @@ { ATTR_RECORD *first_a, *next_a; - first_a = (ATTR_RECORD*)((u8*)m + le16_to_cpu(m->attrs_offset)); - next_a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length)); + first_a = (ATTR_RECORD*)((u8*)m + le16toh(m->attrs_offset)); + next_a = (ATTR_RECORD*)((u8*)a + le32toh(a->length)); return (first_a == a && next_a->type == AT_END); } @@ -1490,10 +1490,10 @@ */ void ntfs_attr_record_delete_internal(MFT_RECORD *m, ATTR_RECORD *a) { - const u32 new_muse = le32_to_cpu(m->bytes_in_use) - - le32_to_cpu(a->length); + const u32 new_muse = le32toh(m->bytes_in_use) - + le32toh(a->length); /* Move attributes following @a into the position of @a. */ - memmove(a, (u8*)a + le32_to_cpu(a->length), + memmove(a, (u8*)a + le32toh(a->length), new_muse - ((u8*)a - (u8*)m)); /* Adjust @m to reflect the change in used space. */ m->bytes_in_use = cpu_to_le32(new_muse); @@ -1545,7 +1545,7 @@ a = ctx->a; ntfs_debug("Entering for attribute type 0x%x located in %s mft " "record 0x%llx. Attribute list attribute is " - "%spresent.", (unsigned)le32_to_cpu(a->type), + "%spresent.", (unsigned)le32toh(a->type), (base_ni == ni) ? "base" : "extent", (unsigned long long)ni->mft_no, NInoAttrList(base_ni) ? "" : "not "); @@ -1577,9 +1577,9 @@ * it is the only attribute in the extent mft record thus we need to * free the extent mft record instead of deleting the attribute record. */ - if (base_ni == ni || (u8*)m + le16_to_cpu(m->attrs_offset) != (u8*)a || + if (base_ni == ni || (u8*)m + le16toh(m->attrs_offset) != (u8*)a || ((ATTR_RECORD*)((u8*)a + - le32_to_cpu(a->length)))->type != AT_END) { + le32toh(a->length)))->type != AT_END) { ntfs_attr_record_delete_internal(m, a); /* * If the attribute was not in the base mft record mark the @@ -1718,13 +1718,13 @@ errno_t ntfs_attr_record_make_space(MFT_RECORD *m, ATTR_RECORD *a, u32 size) { u32 new_muse; - const u32 muse = le32_to_cpu(m->bytes_in_use); + const u32 muse = le32toh(m->bytes_in_use); /* Align to 8 bytes if it is not already done. */ if (size & 7) size = (size + 7) & ~7; new_muse = muse + size; /* Not enough space in this mft record. */ - if (new_muse > le32_to_cpu(m->bytes_allocated)) + if (new_muse > le32toh(m->bytes_allocated)) return ENOSPC; /* Move attributes starting with @a to make space of @size bytes. */ memmove((u8*)a + size, a, muse - ((u8*)a - (u8*)m)); @@ -1761,7 +1761,7 @@ */ errno_t ntfs_attr_record_resize(MFT_RECORD *m, ATTR_RECORD *a, u32 new_size) { - const u32 old_size = le32_to_cpu(a->length); + const u32 old_size = le32toh(a->length); ntfs_debug("Entering for new_size %u.", new_size); /* Align to 8 bytes if it is not already done. */ @@ -1769,10 +1769,10 @@ new_size = (new_size + 7) & ~7; /* If the actual attribute length has changed, move things around. */ if (new_size != old_size) { - const u32 muse = le32_to_cpu(m->bytes_in_use); + const u32 muse = le32toh(m->bytes_in_use); const u32 new_muse = muse - old_size + new_size; /* Not enough space in this mft record. */ - if (new_muse > le32_to_cpu(m->bytes_allocated)) + if (new_muse > le32toh(m->bytes_allocated)) return ENOSPC; /* Move attributes following @a to their new location. */ memmove((u8*)a + new_size, (u8*)a + old_size, @@ -1855,7 +1855,7 @@ "name len 0x%x, first_vcn 0x%llx, last_vcn 0x%llx, " "ctx is %spresent.", (unsigned long long)base_ni->mft_no, - (unsigned)le32_to_cpu(ni->type), ni->name_len, + (unsigned)le32toh(ni->type), ni->name_len, (unsigned long long)first_vcn, (unsigned long long)last_vcn, ctx ? "" : "not "); @@ -1943,9 +1943,9 @@ if (vol->major_ver <= 1) a->compression_unit = NTFS_COMPRESSION_UNIT; restart_compressed_size_add: - if ((first_vcn > sle64_to_cpu(a->highest_vcn) + 1) && + if ((first_vcn > le64toh(a->highest_vcn) + 1) && !(err = ntfs_attr_record_resize(ctx->m, a, - le32_to_cpu(a->length) + + le32toh(a->length) + sizeof(a->compressed_size)))) { /* * Move everything at the offset of the compressed size @@ -1955,7 +1955,7 @@ compressed_size) + sizeof(a->compressed_size), (u8*)a + offsetof(ATTR_RECORD, compressed_size), - le32_to_cpu(a->length) - offsetof( + le32toh(a->length) - offsetof( ATTR_RECORD, compressed_size)); /* * Update the name offset to match the moved data. If @@ -1964,7 +1964,7 @@ * incorrect value. */ if (a->name_length) - a->name_offset = htole16(le16_to_cpu( + a->name_offset = htole16(le16toh( a->name_offset) + sizeof(a->compressed_size)); else @@ -1972,7 +1972,7 @@ ATTR_RECORD, compressed_size) + sizeof(a->compressed_size)); /* Update the mapping pairs offset. */ - mp_ofs = le16_to_cpu(a->mapping_pairs_offset) + + mp_ofs = le16toh(a->mapping_pairs_offset) + sizeof(a->compressed_size); goto sparse_done; } @@ -1995,7 +1995,7 @@ * the needed alignment padding. */ if (((sizeof(ATTR_RECORD) + a->name_length * sizeof(ntfschar) + - 7) & ~7) + 8 <= le32_to_cpu(a->length)) { + 7) & ~7) + 8 <= le32toh(a->length)) { add_compressed_size: /* * Move the name back to the new end of the attribute @@ -2003,7 +2003,7 @@ */ if (a->name_length) memmove((u8*)a + sizeof(ATTR_RECORD), (u8*)a + - le16_to_cpu(a->name_offset), + le16toh(a->name_offset), a->name_length * sizeof(ntfschar)); /* @@ -2123,13 +2123,13 @@ * record. */ err = ntfs_attr_record_resize(ctx->m, a, - le32_to_cpu(m->bytes_allocated) - - le32_to_cpu(m->bytes_in_use) + - le32_to_cpu(a->length)); + le32toh(m->bytes_allocated) - + le32toh(m->bytes_in_use) + + le32toh(a->length)); if (err) panic("%s(): err - resize failed\n", __FUNCTION__); if (((sizeof(ATTR_RECORD) + a->name_length * sizeof(ntfschar) + - 7) & ~7) + 8 > le32_to_cpu(a->length)) + 7) & ~7) + 8 > le32toh(a->length)) panic("%s(): attribute record is still too small\n", __FUNCTION__); goto add_compressed_size; @@ -2153,7 +2153,7 @@ * preserve it or we would lose the data. */ a->compression_unit = 0; - if (first_vcn > sle64_to_cpu(a->highest_vcn) + 1) { + if (first_vcn > le64toh(a->highest_vcn) + 1) { /* * Move everything after the compressed size forward to the * offset of the compressed size thus deleting the compressed @@ -2162,7 +2162,7 @@ memmove((u8*)a + offsetof(ATTR_RECORD, compressed_size), (u8*)a + offsetof(ATTR_RECORD, compressed_size) + sizeof(a->compressed_size), - le32_to_cpu(a->length) - (offsetof(ATTR_RECORD, + le32toh(a->length) - (offsetof(ATTR_RECORD, compressed_size) + sizeof(a->compressed_size))); /* * Update the name offset and the mapping pairs offset to match @@ -2175,10 +2175,10 @@ compressed_size)); else a->name_offset = htole16( - le16_to_cpu(a->name_offset) - + le16toh(a->name_offset) - sizeof(a->compressed_size)); a->mapping_pairs_offset = htole16( - le16_to_cpu(a->mapping_pairs_offset) - + le16toh(a->mapping_pairs_offset) - sizeof(a->compressed_size)); /* * Shrink the attribute record to reflect the removal of the @@ -2186,7 +2186,7 @@ * the attribute smaller thus by definition there there is * enough space to do so. */ - err = ntfs_attr_record_resize(ctx->m, a, le32_to_cpu( + err = ntfs_attr_record_resize(ctx->m, a, le32toh( a->length) - sizeof(a->compressed_size)); if (err) panic("%s(): err\n", __FUNCTION__); @@ -2209,7 +2209,7 @@ */ if (a->name_length) memmove((u8*)a + offsetof(ATTR_RECORD, compressed_size), - (u8*)a + le16_to_cpu(a->name_offset), + (u8*)a + le16toh(a->name_offset), a->name_length * sizeof(ntfschar)); /* * Update the name offset and the mapping pairs offset to match the @@ -2242,7 +2242,7 @@ * attribute extent, look up the attribute extent containing the first * vcn. */ - if (mpa_is_valid && first_vcn > sle64_to_cpu(a->highest_vcn) + 1) { + if (mpa_is_valid && first_vcn > le64toh(a->highest_vcn) + 1) { err = ntfs_attr_lookup(ni->type, ni->name, ni->name_len, first_vcn, NULL, 0, ctx); if (err) { @@ -2370,7 +2370,7 @@ * consumed the old one. */ m->next_attr_instance = htole16( - (le16_to_cpu(m->next_attr_instance) + 1) & 0xffff); + (le16toh(m->next_attr_instance) + 1) & 0xffff); a->value_length = cpu_to_le32(val_len); a->value_offset = htole16(val_ofs); if (type == AT_FILENAME) @@ -2431,7 +2431,7 @@ ntfs_debug("Entering for mft_no 0x%llx, attribute type 0x%x, name_len " "0x%x, val_len 0x%x.", (unsigned long long)ni->mft_no, - (unsigned)le32_to_cpu(type), name_len, val_len); + (unsigned)le32toh(type), name_len, val_len); vol = ni->vol; /* * Calculate the offset into the new attribute at which the attribute @@ -2531,7 +2531,7 @@ ntfs_error(vol->mp, "Failed to add attribute type " "0x%x to mft_no 0x%llx because looking " "up the attribute failed (error %d).", - (unsigned)le32_to_cpu(type), + (unsigned)le32toh(type), (unsigned long long)ni->mft_no, -err); return err; } @@ -2546,7 +2546,7 @@ "0x%x to mft_no 0x%llx because " "allocating a new extent mft record " "failed (error %d).", - (unsigned)le32_to_cpu(type), + (unsigned)le32toh(type), (unsigned long long)ni->mft_no, err); /* * If we added the attribute list attribute above we @@ -2592,7 +2592,7 @@ * consumed the old one. */ m->next_attr_instance = htole16( - (le16_to_cpu(m->next_attr_instance) + 1) & 0xffff); + (le16toh(m->next_attr_instance) + 1) & 0xffff); a->value_length = cpu_to_le32(val_len); a->value_offset = htole16(val_ofs); if (type == AT_FILENAME) @@ -2603,7 +2603,7 @@ name_len << NTFSCHAR_SIZE_SHIFT); /* If a value is specified, copy it into place. */ if (val) { - memcpy((u8*)a + le16_to_cpu(a->value_offset), val, val_len); + memcpy((u8*)a + le16toh(a->value_offset), val, val_len); /* * Ensure the mft record containing the new filename attribute * gets written out. @@ -2884,10 +2884,10 @@ errno_t ntfs_resident_attr_value_resize(MFT_RECORD *m, ATTR_RECORD *a, const u32 new_size) { - const u32 old_size = le32_to_cpu(a->value_length); + const u32 old_size = le32toh(a->value_length); /* Resize the resident part of the attribute record. */ - if (ntfs_attr_record_resize(m, a, le16_to_cpu(a->value_offset) + + if (ntfs_attr_record_resize(m, a, le16toh(a->value_offset) + new_size)) return ENOSPC; /* @@ -2895,7 +2895,7 @@ * the area between the old size and @new_size. */ if (new_size > old_size) - bzero((u8*)a + le16_to_cpu(a->value_offset) + old_size, + bzero((u8*)a + le16toh(a->value_offset) + old_size, new_size - old_size); /* Finally update the length of the attribute value. */ a->value_length = cpu_to_le32(new_size); @@ -3039,11 +3039,11 @@ * If the page is not uptodate bring it uptodate by copying from the * attribute value. */ - attr_size = le32_to_cpu(a->value_length); + attr_size = le32toh(a->value_length); if (attr_size != data_size) panic("%s(): attr_size != data_size\n", __FUNCTION__); if (upl && !upl_valid_page(pl, 0)) { - memcpy(kaddr, (u8*)a + le16_to_cpu(a->value_offset), + memcpy(kaddr, (u8*)a + le16toh(a->value_offset), attr_size); bzero(kaddr + attr_size, PAGE_SIZE - attr_size); } @@ -3062,10 +3062,10 @@ * The attribute record size required cannot be larger than the amount * of space in an mft record. */ - if (arec_size > le32_to_cpu(m->bytes_allocated) - - le16_to_cpu(m->attrs_offset)) - panic("%s(): arec_size > le32_to_cpu(m->bytes_allocated) - " - "le16_to_cpu(m->attrs_offset)\n", + if (arec_size > le32toh(m->bytes_allocated) - + le16toh(m->attrs_offset)) + panic("%s(): arec_size > le32toh(m->bytes_allocated) - " + "le16toh(m->attrs_offset)\n", __FUNCTION__); /* * To make space in the mft record we would like to try to make other @@ -3181,7 +3181,7 @@ } ntfs_error(vol->mp, "Failed to move attribute type 0x%x out " "of base mft_no 0x%llx into an extent mft " - "record (error %d).", le32_to_cpu(type), + "record (error %d).", le32toh(type), base_ni->mft_no, err); goto unm_err; } @@ -3190,7 +3190,7 @@ * The number of free bytes needed in the mft record so the resize can * succeed. */ - bytes_needed = arec_size - le32_to_cpu(a->length); + bytes_needed = arec_size - le32toh(a->length); /* * The MFT reference of the mft record in which the attribute to be * made non-resident is located. @@ -3283,7 +3283,7 @@ * But first find the attribute list entry matching the * attribute record so it can be updated. */ - a_name = (ntfschar*)((u8*)a + le16_to_cpu(a->name_offset)); + a_name = (ntfschar*)((u8*)a + le16toh(a->name_offset)); al_entry = (ATTR_LIST_ENTRY*)base_ni->attr_list; do { /* @@ -3295,7 +3295,7 @@ "found in attribute list " "attribute of base mft record " "0x%llx. Run chkdsk.", - (unsigned)le32_to_cpu(a->type), + (unsigned)le32toh(a->type), (unsigned long long) base_ni->mft_no); NVolSetErrors(vol); @@ -3323,7 +3323,7 @@ "attribute list attribute of " "base mft record 0x%llx. Run " "chkdsk.", - (unsigned)le32_to_cpu(a->type), + (unsigned)le32toh(a->type), (unsigned long long) base_ni->mft_no); NVolSetErrors(vol); @@ -3332,7 +3332,7 @@ } /* Go to the next attribute list entry. */ al_entry = (ATTR_LIST_ENTRY*)((u8*)al_entry + - le16_to_cpu(al_entry->length)); + le16toh(al_entry->length)); } while (1); /* Finally, move the attribute to an extent record. */ err = ntfs_attr_record_move_for_attr_list_attribute(&actx, @@ -3342,7 +3342,7 @@ "0x%x out of base mft record 0x%llx " "and into an extent mft record (error " "%d). Run chkdsk.", - (unsigned)le32_to_cpu(a->type), + (unsigned)le32toh(a->type), (unsigned long long)base_ni->mft_no, err); NVolSetErrors(vol); @@ -3398,8 +3398,8 @@ goto retry_resize; } /* If we now have enough space retry the resize. */ - if (bytes_needed > le32_to_cpu(m->bytes_allocated) - - le32_to_cpu(m->bytes_in_use)) { + if (bytes_needed > le32toh(m->bytes_allocated) - + le32toh(m->bytes_in_use)) { a = ctx.a; goto retry_resize; } @@ -3413,7 +3413,7 @@ /* Move the attribute name if it exists and update the offset. */ if (a->name_length) memmove((u8*)a + name_ofs, - (u8*)a + le16_to_cpu(a->name_offset), + (u8*)a + le16toh(a->name_offset), a->name_length * sizeof(ntfschar)); a->name_offset = htole16(name_ofs); /* Setup the fields specific to non-resident attributes. */ @@ -3582,7 +3582,7 @@ base_ni = al_ctx->ni; ntfs_debug("Entering for mft_no 0x%llx, attribute type 0x%x.", (unsigned long long)base_ni->mft_no, - (unsigned)le32_to_cpu(al_entry->type)); + (unsigned)le32toh(al_entry->type)); /* * Allocate a new extent mft record, attach it to the base ntfs inode * and set up the search context to point to it. @@ -3601,7 +3601,7 @@ "mft record failed (error %d).", err); return err; } - attr_len = le32_to_cpu(al_ctx->a->length); + attr_len = le32toh(al_ctx->a->length); /* Make space for the attribute extent and copy it into place. */ err = ntfs_attr_record_make_space(m, a, attr_len); /* @@ -3633,7 +3633,7 @@ * consumed the old one. */ m->next_attr_instance = htole16( - (le16_to_cpu(m->next_attr_instance) + 1) & 0xffff); + (le16toh(m->next_attr_instance) + 1) & 0xffff); /* * Ensure the changes make it to disk later and unmap the mft record as * we do not need it any more right now. @@ -3706,8 +3706,8 @@ "attribute type 0x%x.", (unsigned long long)base_ni->mft_no, (unsigned long long)ni->mft_no, - (unsigned)le32_to_cpu(a->type)); - attr_len = le32_to_cpu(a->length); + (unsigned)le32toh(a->type)); + attr_len = le32toh(a->length); /* Allocate a temporary buffer to hold the attribute to be moved. */ a_copy = OSMalloc(attr_len, ntfs_malloc_tag); if (!a_copy) { @@ -3726,7 +3726,7 @@ * attribute in the mft record as this would not gain anything thus * report a bug in this case. */ - if (((ATTR_RECORD*)((u8*)m + le16_to_cpu(m->attrs_offset)))->type == + if (((ATTR_RECORD*)((u8*)m + le16toh(m->attrs_offset)))->type == AT_END) panic("%s(): Is only attribute in mft record!\n", __FUNCTION__); /* Ensure the changes make it to disk later. */ @@ -3791,7 +3791,7 @@ * consumed the old one. */ m->next_attr_instance = htole16( - (le16_to_cpu(m->next_attr_instance) + 1) & 0xffff); + (le16toh(m->next_attr_instance) + 1) & 0xffff); /* Ensure the changes make it to disk later. */ NInoSetMrecNeedsDirtying(ni); /* @@ -3806,7 +3806,7 @@ err = ntfs_rl_write(base_ni->vol, base_ni->attr_list, base_ni->attr_list_size, &base_ni->attr_list_rl, ofs, - le16_to_cpu(ctx->al_entry->length)); + le16toh(ctx->al_entry->length)); if (err) { ntfs_error(base_ni->vol->mp, "Failed to update " "on-disk attribute list attribute of " @@ -3819,7 +3819,7 @@ ATTR_LIST_ENTRY *al_entry; al_entry = (ATTR_LIST_ENTRY*)((u8*)a + - le16_to_cpu(a->value_offset) + + le16toh(a->value_offset) + ((u8*)ctx->al_entry - base_ni->attr_list)); al_entry->mft_reference = ctx->al_entry->mft_reference; al_entry->instance = ctx->al_entry->instance; @@ -3927,7 +3927,7 @@ "size 0x%llx, old initialized size 0x%llx, new " "initialized size 0x%llx.", (unsigned long long)ni->mft_no, - (unsigned)le32_to_cpu(ni->type), + (unsigned)le32toh(ni->type), (unsigned long long)ni->data_size, (unsigned long long)ni->initialized_size, (unsigned long long)new_init_size); @@ -3973,12 +3973,12 @@ if (new_init_size >> 32) panic("%s(): new_init_size >> 32\n", __FUNCTION__); - if (new_init_size > le32_to_cpu(a->length) - - le16_to_cpu(a->value_offset)) + if (new_init_size > le32toh(a->length) - + le16toh(a->value_offset)) panic("%s(): new_init_size > " - "le32_to_cpu(" + "le32toh(" "a->length) - " - "le16_to_cpu(" + "le16toh(" "a->value_offset)\n", __FUNCTION__); a->value_length = cpu_to_le32(new_init_size); @@ -4129,14 +4129,14 @@ if (a->non_resident) panic("%s(): a->non_resident\n", __FUNCTION__); /* The total length of the attribute value. */ - attr_len = le32_to_cpu(a->value_length); + attr_len = le32toh(a->value_length); if (size != attr_len) panic("%s(): size != attr_len\n", __FUNCTION__); /* * Do the zeroing in the mft record and update the attribute size in * the mft record. */ - kattr = (u8*)a + le16_to_cpu(a->value_offset); + kattr = (u8*)a + le16toh(a->value_offset); bzero(kattr + attr_len, new_init_size - attr_len); a->value_length = cpu_to_le32((u32)new_init_size); /* Update the sizes in the ntfs inode as well as the ubc size. */ @@ -4175,8 +4175,8 @@ a = ctx->a; if (!a->non_resident) panic("%s(): !a->non_resident\n", __FUNCTION__); - if (size != sle64_to_cpu(a->data_size)) - panic("%s(): size != sle64_to_cpu(a->data_size)\n", + if (size != le64toh(a->data_size)) + panic("%s(): size != le64toh(a->data_size)\n", __FUNCTION__); size = new_init_size; lck_spin_lock(&ni->size_lock); @@ -4537,7 +4537,7 @@ ntfs_debug("Entering for mft_no 0x%llx, type 0x%x, name_len 0x%x.", (unsigned long long)base_ni->mft_no, - (unsigned)le32_to_cpu(ni->type), ni->name_len); + (unsigned)le32toh(ni->type), ni->name_len); return ENOTSUP; #if 0 vol = base_ni->vol; @@ -4564,7 +4564,7 @@ if (a->flags & ATTR_IS_COMPRESSED) panic("%s(): a->flags & ATTR_IS_COMPRESSED)\n", __FUNCTION__); retry_attr_rec_resize: - err = ntfs_attr_record_resize(m, a, le32_to_cpu(a->length) + + err = ntfs_attr_record_resize(m, a, le32toh(a->length) + sizeof(a->compressed_size)); if (!err) { /* @@ -4574,7 +4574,7 @@ memmove((u8*)a + offsetof(ATTR_RECORD, compressed_size) + sizeof(a->compressed_size), (u8*)a + offsetof(ATTR_RECORD, compressed_size), - le32_to_cpu(a->length) - offsetof(ATTR_RECORD, + le32toh(a->length) - offsetof(ATTR_RECORD, compressed_size)); /* * Update the name offset to match the moved data. If there is @@ -4583,7 +4583,7 @@ */ if (a->name_length) a->name_offset = htole16( - le16_to_cpu(a->name_offset) + + le16toh(a->name_offset) + sizeof(a->compressed_size)); else a->name_offset = htole16( @@ -4591,7 +4591,7 @@ compressed_size) + sizeof(a->compressed_size)); /* Update the mapping pairs offset to its new location. */ - mp_ofs = le16_to_cpu(a->mapping_pairs_offset) + + mp_ofs = le16toh(a->mapping_pairs_offset) + sizeof(a->compressed_size); goto set_compressed_size; } @@ -4712,7 +4712,7 @@ if (name_size) memmove((u8*)a + offsetof(ATTR_RECORD, compressed_size) + sizeof(a->compressed_size), (u8*)a + - le16_to_cpu(a->name_offset), name_size); + le16toh(a->name_offset), name_size); a->name_offset = htole16(offsetof(ATTR_RECORD, compressed_size) + sizeof(a->compressed_size)); /* Update the mapping pairs offset to its new location. */ @@ -4763,7 +4763,7 @@ * runlist elements that were stored in the base attribute extent * before we added the compressed size to the attribute record. */ - highest_vcn = sle64_to_cpu(a->highest_vcn); + highest_vcn = le64toh(a->highest_vcn); err = ntfs_get_size_for_mapping_pairs(vol, ni->rl.elements ? ni->rl.rl : NULL, 0, highest_vcn, &mp_size); if (err) { @@ -4773,7 +4773,7 @@ } /* Write the mapping pairs array. */ err = ntfs_mapping_pairs_build(vol, (s8*)a + mp_ofs, - le32_to_cpu(a->length) - mp_ofs, ni->rl.elements ? + le32toh(a->length) - mp_ofs, ni->rl.elements ? ni->rl.rl : NULL, 0, highest_vcn, &stop_vcn); if (err && err != ENOSPC) { ntfs_error(vol->mp, "Failed to rebuild mapping pairs array " @@ -4864,7 +4864,7 @@ * list attribute entry for the created attribute extent. */ al_entry = ctx->al_entry = (ATTR_LIST_ENTRY*)((u8*)ctx->al_entry + - le16_to_cpu(ctx->al_entry->length)); + le16toh(ctx->al_entry->length)); al_entry_len = (offsetof(ATTR_LIST_ENTRY, name) + name_size + 7) & ~7; new_al_size = base_ni->attr_list_size + al_entry_len; /* Out of bounds checks. */ @@ -4945,7 +4945,7 @@ * consumed the old one. */ m->next_attr_instance = htole16( - (le16_to_cpu(m->next_attr_instance) + 1) & 0xffff); + (le16toh(m->next_attr_instance) + 1) & 0xffff); al_entry->lowest_vcn = a->lowest_vcn = cpu_to_sle64(stop_vcn); a->highest_vcn = cpu_to_sle64(highest_vcn); al_entry->mft_reference = MK_LE_MREF(eni->mft_no, eni->seq_no); @@ -4993,7 +4993,7 @@ * attribute record. */ err = ntfs_mapping_pairs_build(vol, (s8*)a + mp_ofs, - le32_to_cpu(a->length) - mp_ofs, rl, stop_vcn, + le32toh(a->length) - mp_ofs, rl, stop_vcn, highest_vcn, &stop_vcn); if (err && err != ENOSPC) { ntfs_error(vol->mp, "Failed to rebuild mapping pairs array " @@ -5091,7 +5091,7 @@ memmove((u8*)a + offsetof(ATTR_RECORD, compressed_size), (u8*)a + offsetof(ATTR_RECORD, compressed_size) + sizeof(a->compressed_size), - le32_to_cpu(a->length) - (offsetof(ATTR_RECORD, + le32toh(a->length) - (offsetof(ATTR_RECORD, compressed_size) + sizeof(a->compressed_size))); /* * Update the name offset and the mapping pairs offset to match @@ -5104,10 +5104,10 @@ compressed_size)); else a->name_offset = htole16( - le16_to_cpu(a->name_offset) - + le16toh(a->name_offset) - sizeof(a->compressed_size)); a->mapping_pairs_offset = htole16( - le16_to_cpu(a->mapping_pairs_offset) - + le16toh(a->mapping_pairs_offset) - sizeof(a->compressed_size)); /* Set the compression unit to 0. */ a->compression_unit = 0; @@ -5125,7 +5125,7 @@ * enough space to do so. */ err = ntfs_attr_record_resize(ctx->m, a, - le32_to_cpu(a->length) - + le32toh(a->length) - sizeof(a->compressed_size)); if (err) panic("%s(): err\n", __FUNCTION__); @@ -5526,7 +5526,7 @@ * attribute record get the attribute record containing it so * we can update the mapping pairs array. */ - if (vcn > sle64_to_cpu(a->highest_vcn)) { + if (vcn > le64toh(a->highest_vcn)) { /* Ensure the modified mft record is written out. */ NInoSetMrecNeedsDirtying(ctx->ni); err = ntfs_attr_lookup(ni->type, ni->name, ni->name_len, @@ -5546,7 +5546,7 @@ * Get the size for the new mapping pairs array for this * attribute extent. */ - lowest_vcn = sle64_to_cpu(a->lowest_vcn); + lowest_vcn = le64toh(a->lowest_vcn); /* * Get the runlist element containing the lowest vcn. * @@ -5564,7 +5564,7 @@ "pairs array (error %d).", err); goto undo_sparse; } - mp_ofs = le16_to_cpu(a->mapping_pairs_offset); + mp_ofs = le16toh(a->mapping_pairs_offset); retry_attr_rec_resize: /* * Extend the attribute record to fit the bigger mapping pairs @@ -5655,9 +5655,9 @@ */ goto retry_attr_rec_resize; } - max_size = (le32_to_cpu(m->bytes_allocated) - - le32_to_cpu(m->bytes_in_use)) & ~7; - max_size += le32_to_cpu(a->length) - mp_ofs; + max_size = (le32toh(m->bytes_allocated) - + le32toh(m->bytes_in_use)) & ~7; + max_size += le32toh(a->length) - mp_ofs; err = ntfs_attr_record_resize(m, a, max_size + mp_ofs); /* * We worked out the exact size we can extend to so the resize @@ -5677,7 +5677,7 @@ * to build the mapping pairs array. */ err = ntfs_mapping_pairs_build(vol, (s8*)a + mp_ofs, - le32_to_cpu(a->length) - mp_ofs, rl2, + le32toh(a->length) - mp_ofs, rl2, lowest_vcn, highest_vcn, &stop_vcn); if (err && err != ENOSPC) { ntfs_error(vol->mp, "Cannot fill hole of mft_no " @@ -5685,7 +5685,7 @@ "building the mapping pairs array " "failed (error %d).", (unsigned long long)ni->mft_no, - (unsigned)le32_to_cpu(ni->type), err); + (unsigned)le32toh(ni->type), err); err = EIO; /* * Need to set @a->highest_vcn to enable correct error @@ -5693,7 +5693,7 @@ */ // TODO: HERE... if (!is_first) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Tue May 29 20:51:22 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id A7052106567D for ; Tue, 29 May 2012 20:51:20 +0000 (UTC) (envelope-from rudot@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 20:51:20 +0000 Date: Tue, 29 May 2012 20:51:20 +0000 From: rudot@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529205120.A7052106567D@hub.freebsd.org> Cc: Subject: socsvn commit: r236685 - in soc2012/rudot: aux sys/kern X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 20:51:22 -0000 Author: rudot Date: Tue May 29 20:51:19 2012 New Revision: 236685 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236685 Log: set the pcpu racct resource in the racctd while enumerating all procs. Thus also processes that start sleeping for a longer time have their pcpu resource updated. Added: soc2012/rudot/aux/list_changes.sh (contents, props changed) Modified: soc2012/rudot/sys/kern/kern_racct.c soc2012/rudot/sys/kern/sched_4bsd.c Added: soc2012/rudot/aux/list_changes.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/rudot/aux/list_changes.sh Tue May 29 20:51:19 2012 (r236685) @@ -0,0 +1,40 @@ +usage() +{ + echo "Usage: $0 [-v] [-w]" +} + +VERBOSE= +WRITE= + +while getopts "vw" OPTION +do + case $OPTION in + v) + VERBOSE=1 + ;; + w) + WRITE=1 + ;; + ?) + usage + exit + ;; + esac +done + +FILES=`find ../sys -name "*.[ch]"` + +for file in $FILES +do + tree_file=/usr/src/${file#*/} + if [ -n "$WRITE" ]; then + if ! diff -q $file $tree_file > /dev/null; then + echo "Copying $tree_file to $file" + cp "$tree_file" "$file" + fi + elif [ -z "$VERBOSE" ]; then + diff -q "$file" "$tree_file" + else + diff -u "$file" "$tree_file" + fi +done Modified: soc2012/rudot/sys/kern/kern_racct.c ============================================================================== --- soc2012/rudot/sys/kern/kern_racct.c Tue May 29 19:55:07 2012 (r236684) +++ soc2012/rudot/sys/kern/kern_racct.c Tue May 29 20:51:19 2012 (r236685) @@ -413,8 +413,8 @@ return (error); } -void -racct_set_force(struct proc *p, int resource, uint64_t amount) +static void +racct_set_force_locked(struct proc *p, int resource, uint64_t amount) { int64_t diff; @@ -425,13 +425,19 @@ */ PROC_LOCK_ASSERT(p, MA_OWNED); - mtx_lock(&racct_lock); diff = amount - p->p_racct->r_resources[resource]; racct_alloc_resource(p->p_racct, resource, diff); if (diff > 0) racct_add_cred_locked(p->p_ucred, resource, diff); else if (diff < 0) racct_sub_cred_locked(p->p_ucred, resource, -diff); +} + +void +racct_set_force(struct proc *p, int resource, uint64_t amount) +{ + mtx_lock(&racct_lock); + racct_set_force_locked(p, resource, amount); mtx_unlock(&racct_lock); } @@ -696,6 +702,8 @@ struct proc *p; struct timeval wallclock; uint64_t runtime; + fixpt_t pctcpu; + int pct_human; for (;;) { sx_slock(&allproc_lock); @@ -706,10 +714,15 @@ microuptime(&wallclock); timevalsub(&wallclock, &p->p_stats->p_start); + pctcpu = 0; PROC_LOCK(p); PROC_SLOCK(p); - FOREACH_THREAD_IN_PROC(p, td) + FOREACH_THREAD_IN_PROC(p, td) { ruxagg(p, td); + thread_lock(td); + pctcpu += sched_pctcpu(td); + thread_unlock(td); + } runtime = cputick2usec(p->p_rux.rux_runtime); PROC_SUNLOCK(p); #ifdef notyet @@ -720,7 +733,14 @@ runtime = p->p_prev_runtime; #endif p->p_prev_runtime = runtime; + pct_human = (100 * pctcpu) / FSCALE; mtx_lock(&racct_lock); + /* + * I use _force_ here because we always want to have + * the real value in the RACCT_PCTCPU resource + * regardless of the limits set. + */ + racct_set_force_locked(p, RACCT_PCTCPU, pct_human); racct_set_locked(p, RACCT_CPU, runtime); racct_set_locked(p, RACCT_WALLCLOCK, (uint64_t)wallclock.tv_sec * 1000000 + Modified: soc2012/rudot/sys/kern/sched_4bsd.c ============================================================================== --- soc2012/rudot/sys/kern/sched_4bsd.c Tue May 29 19:55:07 2012 (r236684) +++ soc2012/rudot/sys/kern/sched_4bsd.c Tue May 29 20:51:19 2012 (r236685) @@ -694,7 +694,6 @@ struct pcpuidlestat *stat; struct td_sched *ts; #ifdef RACCT - int error; int pct_human; fixpt_t pctcpu; struct thread *tdp; @@ -732,9 +731,8 @@ thread_unlock(tdp); } pct_human = (100 * pctcpu) / FSCALE; - error = racct_set(td->td_proc, RACCT_PCTCPU, pct_human); - if ((error != 0) || - (pct_human >= racct_get_limit(td->td_proc, RACCT_PCTCPU))) { + racct_set_force(td->td_proc, RACCT_PCTCPU, pct_human); + if (pct_human >= racct_get_limit(td->td_proc, RACCT_PCTCPU)) { pause("racct", hz); } #endif From owner-svn-soc-all@FreeBSD.ORG Tue May 29 21:47:59 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 44460106564A for ; Tue, 29 May 2012 21:47:57 +0000 (UTC) (envelope-from aleek@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 21:47:57 +0000 Date: Tue, 29 May 2012 21:47:57 +0000 From: aleek@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529214757.44460106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r236688 - in soc2012/aleek/beaglexm-armv6: . sys/arm/ti/omap3 X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 21:47:59 -0000 Author: aleek Date: Tue May 29 21:47:56 2012 New Revision: 236688 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236688 Log: merging omap3 branch to armv6 part 1 Added: soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/files.omap35xx soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap35xx.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_intr.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_prcm_clks.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_scm_padconf.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_timer.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3var.h soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/std.omap35xx soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/uart_bus_omap3.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/uart_cpu_omap3.c Modified: soc2012/aleek/beaglexm-armv6/ (props changed) Added: soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/files.omap35xx ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/files.omap35xx Tue May 29 21:47:56 2012 (r236688) @@ -0,0 +1,27 @@ +#$FreeBSD$ + +arm/ti/omap.c standard +arm/ti/omap_cpuid.c standard +arm/ti/omap_dma.c standard +arm/ti/omap_prcm.c standard +arm/ti/omap_scm.c standard +arm/ti/omap_gpio.c optional gpio +arm/ti/omap_gptimer.c standard +arm/ti/omap_mmc.c optional mmc +arm/ti/omap_space_asm.S standard +arm/ti/omap_i2c.c optional iic + +arm/ti/omap3/omap35xx.c standard +arm/ti/omap3/omap3_intr.c standard +arm/ti/omap3/omap3_prcm_clks.c standard +arm/ti/omap3/omap3_scm_padconf.c standard +arm/ti/omap3/omap3_timer.c standard + +arm/ti/omap3/uart_cpu_omap3.c optional uart +#arm/ti/omap3/uart_bus_omap3.c optional uart + +dev/uart/uart_dev_ns8250.c optional uart + +# USB Host controller +arm/ti/omap_ehci.c optional ehci usb + Added: soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap35xx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap35xx.c Tue May 29 21:47:56 2012 (r236688) @@ -0,0 +1,491 @@ +/*- + * Copyright (c) 2011 + * Ben Gray . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#define _ARM32_BUS_DMA_PRIVATE +#include + +#include +#include +#include + +struct omap3_softc *g_omap3_softc = NULL; + + +/* + * Standard priority levels for the system - 0 has the highest priority and 63 + * is the lowest. + * + * Currently these are all set to the same standard value. + */ +static const int omap35xx_irq_prio[96] = +{ + 0, /* MPU emulation(2) */ + 0, /* MPU emulation(2) */ + 0, /* MPU emulation(2) */ + 0, /* MPU emulation(2) */ + 0, /* Sidetone MCBSP2 overflow */ + 0, /* Sidetone MCBSP3 overflow */ + 0, /* MPU subsystem secure state-machine abort (2) */ + 0, /* External source (active low) */ + 0, /* RESERVED */ + 0, /* SMX error for debug */ + 0, /* SMX error for application */ + 0, /* PRCM module IRQ */ + 0, /* System DMA request 0(3) */ + 0, /* System DMA request 1(3) */ + 0, /* System DMA request 2 */ + 0, /* System DMA request 3 */ + 0, /* McBSP module 1 IRQ (3) */ + 0, /* McBSP module 2 IRQ (3) */ + 0, /* SmartReflex™ 1 */ + 0, /* SmartReflex™ 2 */ + 0, /* General-purpose memory controller module */ + 0, /* 2D/3D graphics module */ + 0, /* McBSP module 3(3) */ + 0, /* McBSP module 4(3) */ + 0, /* Camera interface request 0 */ + 0, /* Display subsystem module(3) */ + 0, /* Mailbox user 0 request */ + 0, /* McBSP module 5 (3) */ + 0, /* IVA2 MMU */ + 0, /* GPIO module 1(3) */ + 0, /* GPIO module 2(3) */ + 0, /* GPIO module 3(3) */ + 0, /* GPIO module 4(3) */ + 0, /* GPIO module 5(3) */ + 0, /* GPIO module 6(3) */ + 0, /* USIM interrupt (HS devices only) (4) */ + 0, /* Watchdog timer module 3 overflow */ + 0, /* General-purpose timer module 1 */ + 0, /* General-purpose timer module 2 */ + 0, /* General-purpose timer module 3 */ + 0, /* General-purpose timer module 4 */ + 0, /* General-purpose timer module 5(3) */ + 0, /* General-purpose timer module 6(3) */ + 0, /* General-purpose timer module 7(3) */ + 0, /* General-purpose timer module 8(3) */ + 0, /* General-purpose timer module 9 */ + 0, /* General-purpose timer module 10 */ + 0, /* General-purpose timer module 11 */ + 0, /* McSPI module 4 */ + 0, /* SHA-1/MD5 crypto-accelerator 2 (HS devices only)(4) */ + 0, /* PKA crypto-accelerator (HS devices only) (4) */ + 0, /* SHA-2/MD5 crypto-accelerator 1 (HS devices only) (4) */ + 0, /* RNG module (HS devices only) (4) */ + 0, /* MG function (3) */ + 0, /* McBSP module 4 transmit(3) */ + 0, /* McBSP module 4 receive(3) */ + 0, /* I2C module 1 */ + 0, /* I2C module 2 */ + 0, /* HDQ / One-wire */ + 0, /* McBSP module 1 transmit(3) */ + 0, /* McBSP module 1 receive(3) */ + 0, /* I2C module 3 */ + 0, /* McBSP module 2 transmit(3) */ + 0, /* McBSP module 2 receive(3) */ + 0, /* PKA crypto-accelerator (HS devices only) (4) */ + 0, /* McSPI module 1 */ + 0, /* McSPI module 2 */ + 0, /* RESERVED */ + 0, /* RESERVED */ + 0, /* RESERVED */ + 0, /* RESERVED */ + 0, /* RESERVED */ + 0, /* UART module 1 */ + 0, /* UART module 2 */ + 0, /* UART module 3 (also infrared)(3) */ + 0, /* Merged interrupt for PBIASlite1 and 2 */ + 0, /* OHCI controller HSUSB MP Host Interrupt */ + 0, /* EHCI controller HSUSB MP Host Interrupt */ + 0, /* HSUSB MP TLL Interrupt */ + 0, /* SHA2/MD5 crypto-accelerator 1 (HS devices only) (4) */ + 0, /* Reserved */ + 0, /* McBSP module 5 transmit(3) */ + 0, /* McBSP module 5 receive(3) */ + 0, /* MMC/SD module 1 */ + 0, /* MS-PRO™ module */ + 0, /* Reserved */ + 0, /* MMC/SD module 2 */ + 0, /* MPU ICR */ + 0, /* RESERVED */ + 0, /* McBSP module 3 transmit(3) */ + 0, /* McBSP module 3 receive(3) */ + 0, /* McSPI module 3 */ + 0, /* High-Speed USB OTG controller */ + 0, /* High-Speed USB OTG DMA controller */ + 0, /* MMC/SD module 3 */ + 0, /* General-purpose timer module 12 */ +}; + + +static const struct omap_cpu_dev omap35xx_devs[] = +{ + /** + * OMAP35xx - General Purpose Timers + * This module provides interfaces to the general purpose timers. + */ + { .name = "omap_gptimer", + .unit = 0, + .mem = { { OMAP35XX_GPTIMER1_HWBASE, OMAP35XX_GPTIMER_SIZE }, + { OMAP35XX_GPTIMER2_HWBASE, OMAP35XX_GPTIMER_SIZE }, + { OMAP35XX_GPTIMER3_HWBASE, OMAP35XX_GPTIMER_SIZE }, + { OMAP35XX_GPTIMER4_HWBASE, OMAP35XX_GPTIMER_SIZE }, + { OMAP35XX_GPTIMER5_HWBASE, OMAP35XX_GPTIMER_SIZE }, + { OMAP35XX_GPTIMER6_HWBASE, OMAP35XX_GPTIMER_SIZE }, + { OMAP35XX_GPTIMER7_HWBASE, OMAP35XX_GPTIMER_SIZE }, + { OMAP35XX_GPTIMER8_HWBASE, OMAP35XX_GPTIMER_SIZE }, + { OMAP35XX_GPTIMER9_HWBASE, OMAP35XX_GPTIMER_SIZE }, + { OMAP35XX_GPTIMER10_HWBASE, OMAP35XX_GPTIMER_SIZE }, + { OMAP35XX_GPTIMER11_HWBASE, OMAP35XX_GPTIMER_SIZE }, + { 0, 0 } + }, + .irqs = { OMAP35XX_IRQ_GPT1, + OMAP35XX_IRQ_GPT2, + OMAP35XX_IRQ_GPT3, + OMAP35XX_IRQ_GPT4, + OMAP35XX_IRQ_GPT5, + OMAP35XX_IRQ_GPT6, + OMAP35XX_IRQ_GPT7, + OMAP35XX_IRQ_GPT8, + OMAP35XX_IRQ_GPT9, + OMAP35XX_IRQ_GPT10, + OMAP35XX_IRQ_GPT11, + -1, + }, + }, + + /** + * OMAP35xx - DMA + * This module provides interfaces to the direct memory access controller + */ + { .name = "omap_dma", + .unit = 0, + .mem = { { OMAP35XX_SDMA_HWBASE, OMAP35XX_SDMA_SIZE }, + { 0, 0 } + }, + .irqs = { OMAP35XX_IRQ_SDMA0, + OMAP35XX_IRQ_SDMA1, + OMAP35XX_IRQ_SDMA2, + OMAP35XX_IRQ_SDMA3, + -1, + }, + }, + + /** + * OMAP35xx - I2C + * This module provides interfaces to the I2C controller + * Note: generally this should be the first function sub-device because + * it's used for the TWL power control device. + */ + { .name = "omap_i2c", + .unit = 0, + .mem = { { OMAP35XX_I2C1_HWBASE, OMAP35XX_I2C1_SIZE }, + { 0, 0 } + }, + .irqs = { OMAP35XX_IRQ_I2C1, + -1, + }, + }, + + /** + * OMAP35xx - GPIO + * There are 6 GPIO register sets, with each set representing 32 GPIO + * pins. + */ + { .name = "gpio", + .unit = 0, + .mem = { { OMAP35XX_GPIO1_HWBASE, OMAP35XX_GPIO1_SIZE }, + { OMAP35XX_GPIO2_HWBASE, OMAP35XX_GPIO2_SIZE }, + { OMAP35XX_GPIO3_HWBASE, OMAP35XX_GPIO3_SIZE }, + { OMAP35XX_GPIO4_HWBASE, OMAP35XX_GPIO4_SIZE }, + { OMAP35XX_GPIO5_HWBASE, OMAP35XX_GPIO5_SIZE }, + { OMAP35XX_GPIO6_HWBASE, OMAP35XX_GPIO6_SIZE }, + { 0, 0 } + }, + .irqs = { OMAP35XX_IRQ_GPIO1_MPU, + OMAP35XX_IRQ_GPIO2_MPU, + OMAP35XX_IRQ_GPIO3_MPU, + OMAP35XX_IRQ_GPIO4_MPU, + OMAP35XX_IRQ_GPIO5_MPU, + OMAP35XX_IRQ_GPIO6_MPU, + -1, + }, + }, + + /** + * OMAP35xx - MMC/SDIO + * There are a total of 3 MMC modules on OMAP3 + */ + { .name = "omap_mmc", + .unit = 0, + .mem = { { OMAP35XX_MMCHS1_HWBASE, OMAP35XX_MMCHS_SIZE }, + { 0, 0 } + }, + .irqs = { OMAP35XX_IRQ_MMC1, + -1, + }, + }, + + /** + * OMAP35xx - USB EHCI + * The OMAP EHCI driver expects three different register sets, one for + * the actual EHCI registers and the other two control the interface. + */ + { .name = "ehci", + .unit = 0, + .mem = { { OMAP35XX_USB_EHCI_HWBASE, OMAP35XX_USB_EHCI_SIZE }, + { OMAP35XX_USB_UHH_HWBASE, OMAP35XX_USB_UHH_SIZE }, + { OMAP35XX_USB_TLL_HWBASE, OMAP35XX_USB_TLL_SIZE }, + { 0, 0 } + }, + .irqs = { OMAP35XX_IRQ_EHCI, + -1, + }, + }, + + { 0, 0, { { 0, 0 } }, { -1 } } +}; + + + +/** + * omap_sdram_size - called from machdep to get the total memory size + * + * Since this function is called very early in the boot, there is none of the + * bus handling code setup. However the boot device map will be setup, so + * we can directly access registers already mapped. + * + * This is a bit ugly, but since we need this information early on and the + * only way to get it (appart from hardcoding it or via kernel args) is to read + * from the EMIF_SRAM registers. + * + * RETURNS: + * The size of memory in bytes. + */ +unsigned int +omap_sdram_size(void) +{ + uint32_t size; + uint32_t sdrc_mcfg_0, sdrc_mcfg_1; + + sdrc_mcfg_0 = *((volatile uint32_t *)(OMAP35XX_SDRC_MCFG(0))); + sdrc_mcfg_1 = *((volatile uint32_t *)(OMAP35XX_SDRC_MCFG(1))); + + /* The size is given in bits 17:8 in 2MB chunk sizes */ + size = ((sdrc_mcfg_0 >> 8) & 0x3FF) * (2 * 1024 * 1024); + size += ((sdrc_mcfg_1 >> 8) & 0x3FF) * (2 * 1024 * 1024); + +printf("[BRG] omap_sdram_size : size = %u\n", size); + + return (size); +} + + + + +/** + * omap35xx_add_child - add a child item to the root omap device + * @dev: the parent device + * @order: defines roughly the order with which to add the child to the parent + * @name: the name to give to the child item + * @unit: the unit number for the device + * @addr: the base address of the register set for device + * @size: the number of a bytes in register set + * @irq: the IRQ number(s) for the device + * + * Adds a child to the omap base device. + * + */ +static void +omap35xx_add_child(device_t dev, int prio, const char *name, int unit, + const struct omap_mem_range mem[], const int irqs[]) +{ + device_t kid; + struct omap_ivar *ivar; + unsigned int i; + + /* Start by adding the actual child to the parent (us) */ + kid = device_add_child_ordered(dev, prio, name, unit); + if (kid == NULL) { + printf("Can't add child %s%d ordered\n", name, unit); + return; + } + + /* Allocate some memory for the omap_ivar structure */ + ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); + if (ivar == NULL) { + device_delete_child(dev, kid); + printf("Can't add alloc ivar\n"); + return; + } + + /* Assign the ivars to the child item and populate with the device resources */ + device_set_ivars(kid, ivar); + + /* Assign the IRQ(s) in the resource list */ + resource_list_init(&ivar->resources); + if (irqs) { + for (i = 0; *irqs != -1; i++, irqs++) { + bus_set_resource(kid, SYS_RES_IRQ, i, *irqs, 1); + } + } + + /* Assign the memory region to the resource list */ + if (mem) { + for (i = 0; mem->base != 0; i++, mem++) { + bus_set_resource(kid, SYS_RES_MEMORY, i, mem->base, mem->size); + } + } +} + + +/** + * omap35xx_cpu_add_builtin_children - adds the SoC child components + * @dev: this device, the one we are adding to + * + * Adds child devices from the omap35xx_devs list. + * + */ +static void +omap35xx_cpu_add_builtin_children(device_t dev) +{ + int i; + const struct omap_cpu_dev *walker; + + /* Setup all the clock devices - this is not the tick timers, rather it's + * the individual functional and interface clocks for the SoC modules. + */ + omap3_clk_init(dev, 1); + + /* Setup the system control module driver, which basically is just the + * padconf (pinmux) for the OMAP35xx devices. + */ + omap3_padconf_init(dev, 1); + + /* Add the rest of the children from the array above */ + for (i = 5, walker = omap35xx_devs; walker->name; i++, walker++) { + omap35xx_add_child(dev, i, walker->name, walker->unit, + walker->mem, walker->irqs); + } +} + + +/** + * omap35xx_identify - adds the SoC child components + * @dev: this device, the one we are adding to + * + * Adds a child to the omap3 base device. + * + */ +static void +omap35xx_identify(driver_t *drv, device_t parent) +{ + /* Add the resources for this "omap35xx" device */ + omap35xx_add_child(parent, 0, "omap35xx", 0, NULL, NULL); + + /* Add the other SOC components */ + omap35xx_cpu_add_builtin_children(parent); +} + +/** + * omap35xx_probe - called when the device is probed + * @dev: the new device + * + * All we do in this routine is set the description of this device + * + */ +static int +omap35xx_probe(device_t dev) +{ + device_set_desc(dev, "TI OMAP35XX"); + return (0); +} + +/** + * omap35xx_attach - called when the device is attached + * @dev: the new device + * + * All we do in this routine is set the description of this device + * + */ +static int +omap35xx_attach(device_t dev) +{ + struct omap_softc *omapsc = device_get_softc(device_get_parent(dev)); + struct omap3_softc *sc = device_get_softc(dev); + + sc->sc_iotag = omapsc->sc_iotag; + sc->sc_dev = dev; + + + /* Map in the interrupt controller register set */ + if (bus_space_map(sc->sc_iotag, OMAP35XX_INTCPS_HWBASE, + OMAP35XX_INTCPS_SIZE, 0, &sc->sc_intcps_ioh)) { + panic("%s: Cannot map registers", device_get_name(dev)); + } + + + /* Save the device structure globally for the IRQ handling */ + g_omap3_softc = sc; + + /* TODO: Revisit - Install an interrupt post filter */ + arm_post_filter = omap3_post_filter_intr; + + /* Setup the OMAP3 interrupt controller */ + omap3_setup_intr_controller(g_omap3_softc, omap35xx_irq_prio); + + return (0); +} + + + +static device_method_t omap35xx_methods[] = { + DEVMETHOD(device_probe, omap35xx_probe), + DEVMETHOD(device_attach, omap35xx_attach), + DEVMETHOD(device_identify, omap35xx_identify), + {0, 0}, +}; + +static driver_t omap35xx_driver = { + "omap35xx", + omap35xx_methods, + sizeof(struct omap3_softc), +}; + +static devclass_t omap35xx_devclass; + +DRIVER_MODULE(omap35xx, omap, omap35xx_driver, omap35xx_devclass, 0, 0); Added: soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_intr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_intr.c Tue May 29 21:47:56 2012 (r236688) @@ -0,0 +1,233 @@ +/*- + * Copyright (c) 2011 + * Ben Gray . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include + + + +/* + * There are a number of ways that interrupt handling is implemented in + * the various ARM platforms, the PXA has the neatest way, it creates another + * device driver that handles everything. However IMO this is rather heavy- + * weight for playing with IRQs which should be quite fast ... so I've + * gone for something similar to the IXP425, which just directly plays with + * registers. This assumes that the interrupt control registers are already + * mapped in virtual memory at a fixed virtual address ... simplies. + * + * The intcps (OMAP3 interrupt controller) has some nice registers, were + * you write a bit to clear or set the mask register ... I think in theory + * that means that you don't need to disable interrupts while doing this, + * because it is an atomic operation. + * + * TODO: check this. + * + */ + + + +#define INTCPS_SYSCONFIG 0x10 +#define INTCPS_SYSSTATUS 0x14 +#define INTCPS_SIR_IRQ 0x40 +#define INTCPS_SIR_FIQ 0x44 +#define INTCPS_CONTROL 0x48 +#define INTCPS_PROTECTION 0x4C +#define INTCPS_IDLE 0x50 +#define INTCPS_IRQ_PRIORITY 0x60 +#define INTCPS_FIQ_PRIORITY 0x64 +#define INTCPS_THRESHOLD 0x68 +#define INTCPS_ITR(n) (0x80 + (0x20 * (n))) +#define INTCPS_MIR(n) (0x84 + (0x20 * (n))) +#define INTCPS_MIR_CLEAR(n) (0x88 + (0x20 * (n))) +#define INTCPS_MIR_SET(n) (0x8C + (0x20 * (n))) +#define INTCPS_ISR_SET(n) (0x90 + (0x20 * (n))) +#define INTCPS_ISR_CLEAR(n) (0x94 + (0x20 * (n))) +#define INTCPS_PENDING_IRQ(n) (0x98 + (0x20 * (n))) +#define INTCPS_PENDING_FIQ(n) (0x9C + (0x20 * (n))) +#define INTCPS_ILR(m) (0x100 + (0x4 * (m))) + + + + +/** + * omap3_post_filter_intr - called after the IRQ has been filtered + * @arg: the IRQ number + * + * Called after the interrupt handler has done it's stuff, can be used to + * clean up interrupts that haven't been handled properly. + * + * + * RETURNS: + * nothing + */ +void +omap3_post_filter_intr(void *arg) +{ + /* uintptr_t irq = (uintptr_t) arg; */ + + /* data synchronization barrier */ + cpu_drain_writebuf(); +} + + + + + +/** + * arm_mask_irq - masks an IRQ (disables it) + * @nb: the number of the IRQ to mask (disable) + * + * Disables the interrupt at the HW level. + * + * + * RETURNS: + * nothing + */ +void +arm_mask_irq(uintptr_t nb) +{ + bus_space_write_4(g_omap3_softc->sc_iotag, g_omap3_softc->sc_intcps_ioh, + INTCPS_MIR_SET(nb >> 5), 1UL << (nb & 0x1F)); +} + + +/** + * arm_unmask_irq - unmasks an IRQ (enables it) + * @nb: the number of the IRQ to unmask (enable) + * + * Enables the interrupt at the HW level. + * + * + * RETURNS: + * nothing + */ +void +arm_unmask_irq(uintptr_t nb) +{ + // printf("[BRG] unmasking IRQ %d (off %d, bit %d)\n", nb, (nb >> 5), (nb & 0x1F)); + + bus_space_write_4(g_omap3_softc->sc_iotag, g_omap3_softc->sc_intcps_ioh, + INTCPS_MIR_CLEAR(nb >> 5), 1UL << (nb & 0x1F)); +} + + + +/** + * arm_get_next_irq - gets the next tripped interrupt + * @last_irq: the number of the last IRQ processed + * + * Enables the interrupt at the HW level. + * + * + * RETURNS: + * nothing + */ +int +arm_get_next_irq(int last_irq) +{ + uint32_t active_irq; + + /* clean-up the last IRQ */ + if (last_irq != -1) { + + /* clear the interrupt status flag */ + bus_space_write_4(g_omap3_softc->sc_iotag, g_omap3_softc->sc_intcps_ioh, + INTCPS_ISR_CLEAR(last_irq >> 5), + 1UL << (last_irq & 0x1F)); + + /* tell the interrupt logic we've dealt with the interrupt */ + bus_space_write_4(g_omap3_softc->sc_iotag, g_omap3_softc->sc_intcps_ioh, + INTCPS_CONTROL, 1); + } + + /* Get the next active interrupt */ + active_irq = bus_space_read_4(g_omap3_softc->sc_iotag, + g_omap3_softc->sc_intcps_ioh, INTCPS_SIR_IRQ); + + /* Check for spurious interrupt */ + if ((active_irq & 0xffffff80) == 0xffffff80) { + device_printf(g_omap3_softc->sc_dev, "Spurious interrupt detected " + "(0x%08x)\n", active_irq); + return -1; + } + + /* Just get the active IRQ part */ + active_irq &= 0x7F; + + /* Return the new IRQ if it is different from the previous */ + if (active_irq != last_irq) + return active_irq; + else + return -1; +} + + +/** + * omap3_setup_intr_controller - configures and enables the OMAP3 interrupt + * controller (INTCPS) + * + * + * + * RETURNS: + * nothing + */ +int +omap3_setup_intr_controller(struct omap3_softc *sc, const const int *irqs) +{ + uint32_t syscfg; + uint32_t i; + + if (sc != g_omap3_softc) + panic("Invalid omap3 soft context\n"); + + + /* Reset the interrupt controller */ + bus_space_write_4(g_omap3_softc->sc_iotag, g_omap3_softc->sc_intcps_ioh, + INTCPS_SYSCONFIG, 0x2); + + /* Loop a number of times to check if the INTCPS has come out of reset */ + for (i = 0; i < 10000; i++) { + syscfg = bus_space_read_4(g_omap3_softc->sc_iotag, + g_omap3_softc->sc_intcps_ioh, INTCPS_SYSCONFIG); + if (syscfg & 0x1UL) + break; + } + + + + return 0; +} + Added: soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_prcm_clks.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_prcm_clks.c Tue May 29 21:47:56 2012 (r236688) @@ -0,0 +1,1196 @@ +/*- + * Copyright (c) 2011 + * Ben Gray . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + + +/* + * This file defines the clock configuration for the OMAP3xxx series of + * devices. + * + * How This is Suppose to Work + * =========================== + * - There is a top level omap_prcm module that defines all OMAP SoC drivers + * should use to enable/disable the system clocks regardless of the version + * of OMAP device they are running on. This top level PRCM module is just + * a thin shim to chip specific functions that perform the donkey work of + * configuring the clock - this file is the 'donkey' for OMAP35xx devices. + * + * - The key bit in this file is the omap_clk_devmap array, it's + * used by the omap_prcm driver to determine what clocks are valid and which + * functions to call to manipulate them. + * + * - In essence you just need to define some callbacks for each of the + * clocks and then you're done. + * + * - The other thing worth noting is that when the omap_prcm device + * is registered you typically pass in some memory ranges which are the + * SYS_MEMORY resources. These resources are in turn allocated using + * bus_allocate_resources(...) and the resource handles are passed to all + * individual clock callback handlers. + * + * + * + * + */ + + +void +omap3_clk_init(device_t dev, int prio); + +static int +omap3_clk_generic_activate(const struct omap_clock_dev *clkdev, + struct resource* mem_res[]); + +static int +omap3_clk_generic_deactivate(const struct omap_clock_dev *clkdev, + struct resource* mem_res[]); + +static int +omap3_clk_generic_accessible(const struct omap_clock_dev *clkdev, + struct resource* mem_res[]); + +static int +omap3_clk_generic_set_source(const struct omap_clock_dev *clkdev, clk_src_t clksrc, + struct resource* mem_res[]); + +static int +omap3_clk_generic_get_source_freq(const struct omap_clock_dev *clkdev, + unsigned int *freq, + struct resource* mem_res[]); + + +static int +omap3_clk_gptimer_get_source_freq(const struct omap_clock_dev *clkdev, + unsigned int *freq, + struct resource* mem_res[]); +static int +omap3_clk_gptimer_set_source(const struct omap_clock_dev *clkdev, + clk_src_t clksrc, struct resource* mem_res[]); + + + +static int +omap3_clk_alwayson_null_func(const struct omap_clock_dev *clkdev, + struct resource* mem_res[]); + + + +static int +omap3_clk_get_sysclk_freq(const struct omap_clock_dev *clkdev, + unsigned int *freq, struct resource* mem_res[]); + +static int +omap3_clk_get_arm_fclk_freq(const struct omap_clock_dev *clkdev, + unsigned int *freq, struct resource* mem_res[]); + + + +static int +omap3_clk_hsusbhost_activate(const struct omap_clock_dev *clkdev, + struct resource* mem_res[]); + +static int +omap3_clk_hsusbhost_deactivate(const struct omap_clock_dev *clkdev, + struct resource* mem_res[]); + + + + +#define FREQ_96MHZ 96000000 +#define FREQ_64MHZ 64000000 +#define FREQ_48MHZ 48000000 +#define FREQ_32KHZ 32000 + + + +/** + * Only one memory regions is needed for OMAP35xx clock control (unlike OMAP4) + * + * CM Instance - 0x4800 4000 : 0x4800 5500 + * PRM Instance - 0x4830 6000 : 0x4830 8000 + * + */ +#define CM_INSTANCE_MEM_REGION 0 +#define PRM_INSTANCE_MEM_REGION 1 + +#define IVA2_CM_OFFSET 0x0000 +#define OCP_SYSTEM_CM_OFFSET 0x0800 +#define MPU_CM_OFFSET 0x0900 +#define CORE_CM_OFFSET 0x0A00 +#define SGX_CM_OFFSET 0x0B00 +#define WKUP_CM_OFFSET 0x0C00 +#define CLOCK_CTRL_CM_OFFSET 0x0D00 +#define DSS_CM_OFFSET 0x0E00 +#define CAM_CM_OFFSET 0x0F00 +#define PER_CM_OFFSET 0x1000 +#define EMU_CM_OFFSET 0x1100 +#define GLOBAL_CM_OFFSET 0x1200 +#define NEON_CM_OFFSET 0x1300 +#define USBHOST_CM_OFFSET 0x1400 + +#define IVA2_PRM_OFFSET 0x0000 +#define OCP_SYSTEM_PRM_OFFSET 0x0800 +#define MPU_PRM_OFFSET 0x0900 +#define CORE_PRM_OFFSET 0x0A00 +#define SGX_PRM_OFFSET 0x0B00 +#define WKUP_PRM_OFFSET 0x0C00 +#define CLOCK_CTRL_PRM_OFFSET 0x0D00 +#define DSS_PRM_OFFSET 0x0E00 +#define CAM_PRM_OFFSET 0x0F00 +#define PER_PRM_OFFSET 0x1000 +#define EMU_PRM_OFFSET 0x1100 +#define GLOBAL_PRM_OFFSET 0x1200 +#define NEON_PRM_OFFSET 0x1300 +#define USBHOST_PRM_OFFSET 0x1400 + + + + + + +/** + * omap_clk_devmap - Array of clock devices available on OMAP3xxx devices + * + * This map only defines which clocks are valid and the callback functions + * for clock activate, deactivate, etc. It is used by the top level omap_prcm + * driver. + * + * The actual details of the clocks (config registers, bit fields, sources, + * etc) are in the private g_omap3_clk_details array below. + * + */ + +#define OMAP3_GENERIC_CLOCK_DEV(i) \ + { .id = (i), \ + .clk_activate = omap3_clk_generic_activate, \ + .clk_deactivate = omap3_clk_generic_deactivate, \ + .clk_set_source = omap3_clk_generic_set_source, \ + .clk_accessible = omap3_clk_generic_accessible, \ + .clk_get_source_freq = omap3_clk_generic_get_source_freq \ + } + +#define OMAP3_GPTIMER_CLOCK_DEV(i) \ + { .id = (i), \ + .clk_activate = omap3_clk_generic_activate, \ + .clk_deactivate = omap3_clk_generic_deactivate, \ + .clk_set_source = omap3_clk_gptimer_set_source, \ + .clk_accessible = omap3_clk_generic_accessible, \ + .clk_get_source_freq = omap3_clk_gptimer_get_source_freq \ + } + +#define OMAP3_ALWAYSON_CLOCK_DEV(i) \ + { .id = (i), \ + .clk_activate = omap3_clk_alwayson_null_func, \ + .clk_deactivate = omap3_clk_alwayson_null_func, \ + .clk_set_source = NULL, \ + .clk_accessible = omap3_clk_alwayson_null_func, \ + .clk_get_source_freq = NULL \ + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Tue May 29 22:33:26 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id E31DC106566C for ; Tue, 29 May 2012 22:33:24 +0000 (UTC) (envelope-from scher@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 29 May 2012 22:33:24 +0000 Date: Tue, 29 May 2012 22:33:24 +0000 From: scher@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120529223324.E31DC106566C@hub.freebsd.org> Cc: Subject: socsvn commit: r236691 - in soc2012/scher/par_ports/head: Mk lock X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 22:33:27 -0000 Author: scher Date: Tue May 29 22:33:24 2012 New Revision: 236691 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236691 Log: [fixed] bsd.parallel.mk - new locking behaviour bsd.port.mk - few changes just to match new locking behaviour [new_feature] bsd.port.mk - create ${LOCK_DIR} if it is missed bsd.parallel.mk - check-lock target All ports lock files are moved to seperate directory. bsd.parallel.mk: ${PORTSDIR}/lock - is used to keep ports lock files ${_parv_LOCK_DIR_LOCK_FILE} - port's lock file name - is set to ${PKGNAME} Reason: Former changes make possible to implement sufficient conflicts checking redisign. It was impossible to find port's dir in pots tree using package name RE in ${CONFLICTS} variable. Now it is possible just to explore ${LOCK_DIR}. Submitted by: Alexander Pronin Added: soc2012/scher/par_ports/head/lock/ Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk soc2012/scher/par_ports/head/Mk/bsd.port.mk Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Tue May 29 21:59:09 2012 (r236690) +++ soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Tue May 29 22:33:24 2012 (r236691) @@ -65,7 +65,9 @@ ##################################################### # Locking variables and tools #PKG_DBDIR?= /var/db/pkg -_parv_LOCK_FILE= .lock +LOCK_DIR= ${PORTSDIR}/lock +_parv_PKG_DBDIR_LOCK_FILE= .lock +_parv_LOCK_DIR_LOCK_FILE= ${PKGNAME} _parv_WAIT_FOR_LOCK_TIME= 5 _parv_WAIT_FOR_UNLOCK_TIME= 15 @@ -88,13 +90,15 @@ # # If the directory is locked this script returns ${_parv_ON_LOCK_EXIT_STATUS}. # -# ${${_lock_dir}} == ${PKG_DBDIR} OR ${.CURDIR} +# ${${_lock_dir}} == ${PKG_DBDIR} OR ${LOCK_DIR} # -.for _lock_dir in PKG_DBDIR .CURDIR +.for _lock_dir in PKG_DBDIR LOCK_DIR # _parv_PKG_DBDIR_LOCK_SEQ -# _parv_.CURDIR_LOCK_SEQ +# _parv_LOCK_DIR_LOCK_SEQ # -_parv_${_lock_dir}_LOCK_SEQ= \ +_parv_LOCK_FILE:= ${_parv_${_lock_dir}_LOCK_FILE} + +_parv_${_lock_dir}_LOCK_SEQ:= \ ${CHMOD} 777 ${${_lock_dir}}/${_parv_LOCK_FILE}; \ pid=$$(${CAT} ${${_lock_dir}}/${_parv_LOCK_FILE}); \ if [ $${pid} ]; then \ @@ -105,13 +109,13 @@ ${_dparv_START_OUTPUT}; \ ${ECHO_CMD} "Dir: ${${_lock_dir}} Stalled lock Detected!"; \ ${ECHO_CMD} "Deleting stalled lock. PID=$${pid}"; \ - ${ECHO_CMD} "Locking: ${${_lock_dir}}"; \ + ${ECHO_CMD} "Locking: ${${_lock_dir}}/${_parv_LOCK_FILE}"; \ ${_dparv_END_OUTPUT}; \ ${ECHO_CMD} ${.MAKE.PID} > ${${_lock_dir}}/${_parv_LOCK_FILE}; \ fi; \ else \ ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} "Locking: ${${_lock_dir}}"; \ + ${ECHO_CMD} "Locking: ${${_lock_dir}}/${_parv_LOCK_FILE}"; \ ${_dparv_END_OUTPUT}; \ ${ECHO_CMD} ${.MAKE.PID} > ${${_lock_dir}}/${_parv_LOCK_FILE}; \ fi @@ -119,11 +123,11 @@ ##################################################### # _parv_PKG_DBDIR_DO_LOCK -# _parv_.CURDIR_DO_LOCK +# _parv_LOCK_DIR_DO_LOCK # This scripts handles exit status of lockf(1) call. # It substitutes exit status 75 of lockf(1) for ${_parv_ON_LOCK_EXIT_STATUS} and pushes it. # -_parv_${_lock_dir}_DO_LOCK= \ +_parv_${_lock_dir}_DO_LOCK:= \ lockf -k -t ${_parv_WAIT_FOR_LOCK_TIME} ${${_lock_dir}}/${_parv_LOCK_FILE} ${SH} -c '${_parv_${_lock_dir}_LOCK_SEQ}' || { \ status=$$?; \ if [ $${status} -eq ${_parv_LOCKF_EX_TEMPFAIL} ] || \ @@ -141,11 +145,11 @@ # Loops to lock directory # _parv_PKG_DBDIR_LOCK_LOOP -# _parv_.CURDIR_LOCK_LOOP +# _parv_LOCK_DIR_LOCK_LOOP # $${attempts} - Number of attempts to lock a directory. Exetranl variable. # Default value = 1, if this var is not set. # Set this variable to -1 for infinity loop. -# e.g. ( attempts=10; ${_parv_.CURDIR_LOCK_LOOP} ) && ..... || .... +# e.g. ( attempts=10; ${_parv_LOCK_DIR_LOCK_LOOP} ) && ..... || .... # _parv_${_lock_dir}_LOCK_LOOP= \ enable_feedback=${_parv_ON_LOCK_FEEDBACK_TIMEOUT}; \ @@ -158,7 +162,7 @@ elif [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ if [ $$(( $${enable_feedback} % ${_parv_ON_LOCK_FEEDBACK_TIMEOUT} )) -eq 0 ]; then \ ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} "Unable to lock ${${_lock_dir}}"; \ + ${ECHO_CMD} "Unable to lock ${${_lock_dir}}/${_parv_LOCK_FILE}"; \ ${ECHO_CMD} "Dir: ${${_lock_dir}} is already locked by another working process ..."; \ ${ECHO_CMD} "Waiting for unlock ........................................................."; \ ${_dparv_END_OUTPUT}; \ @@ -176,13 +180,13 @@ ##################################################### # _parv_PKG_DBDIR_DO_UNLOCK -# _parv_.CURDIR_DO_UNLOCK +# _parv_LOCK_DIR_DO_UNLOCK # -_parv_${_lock_dir}_DO_UNLOCK= \ +_parv_${_lock_dir}_DO_UNLOCK:= \ lockf -k -t ${_parv_WAIT_FOR_UNLOCK_TIME} ${${_lock_dir}}/${_parv_LOCK_FILE} \ ${RM} ${${_lock_dir}}/${_parv_LOCK_FILE} && { \ ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} "Dir: ${${_lock_dir}} is unlocked"; \ + ${ECHO_CMD} "Dir: ${${_lock_dir}}/${_parv_LOCK_FILE} is unlocked"; \ ${_dparv_END_OUTPUT}; \ } || { \ ${_dparv_START_OUTPUT}; \ @@ -193,38 +197,38 @@ .endfor # _lock_dir in PKG_DBDIR .CURDIR - +.undef _parv_LOCK_FILE ##################################################### # _parv_CHECK_SEQ # _parv_CHECK_LOCK # The former variables Implement check for lock utility -# $${dir} - dir to check. External variable for script. Assign this variable -# appropriate value before executing this script e.g. ( dir=/some/dir/to/check; ${_parv_CHECK_LOCK} ) || ... -# Script exits with status ${_parv_ON_LOCK_EXIT_STATUS} if $${dir} is locked -# +# $${pkg_name} - port to check. External variable for script. Supports shell RE. Assign this variable +# appropriate value before executing this script e.g. ( pkg_name=apache-[1234]; ${_parv_CHECK_LOCK} ) || ... +# Script exits with status ${_parv_ON_LOCK_EXIT_STATUS} if $${pkg_name} is locked +# _parv_CHECK_SEQ= \ - ${CHMOD} 777 $${dir}/${_parv_LOCK_FILE}; \ - pid=\$$(${CAT} $${dir}/${_parv_LOCK_FILE}); \ + ${CHMOD} 777 ${LOCK_DIR}/$${pkg_name}; \ + pid=\$$(${CAT} ${LOCK_DIR}/$${pkg_name}); \ if [ \$${pid} ]; then \ ps -p \$${pid} > /dev/null && status=\$$? || status=\$$?; \ if [ \$${status} -eq 0 ]; then \ ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} Unable to lock $${dir}; \ - ${ECHO_CMD} Dir: $${dir} is already locked by another working process ...; \ + ${ECHO_CMD} Unable to lock ${LOCK_DIR}/$${pkg_name}; \ + ${ECHO_CMD} Dir: ${LOCK_DIR} is already locked by another working process ...; \ ${_dparv_START_OUTPUT}; \ exit ${_parv_ON_LOCK_EXIT_STATUS}; \ else \ ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} Dir: $${dir} Stalled lock Detected!; \ + ${ECHO_CMD} Dir: ${LOCK_DIR}/$${pkg_name} Stalled lock Detected!; \ ${ECHO_CMD} Deleting stalled lock. PID=\$${pid}; \ ${_dparv_END_OUTPUT}; \ fi; \ fi; \ - ${RM} -rf $${dir}/${_parv_LOCK_FILE} + ${RM} -rf ${LOCK_DIR}/$${pkg_name} _parv_CHECK_LOCK= \ - lockf -k -t ${_parv_WAIT_FOR_LOCK_TIME} $${dir}/${_parv_LOCK_FILE} ${SH} -c "${_parv_CHECK_SEQ}" || { \ + lockf -k -t ${_parv_WAIT_FOR_LOCK_TIME} ${LOCK_DIR}/$${pkg_name} ${SH} -c "${_parv_CHECK_SEQ}" || { \ status=$$?; \ if [ $${status} -eq ${_parv_LOCKF_EX_TEMPFAIL} ] || \ [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ @@ -237,9 +241,21 @@ fi; \ } +_parv_ON_LOCK_EXIT_SEQ= \ + status=$$?; \ + if [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ + ${_parv_KILL} -${_parv_KILL_SIGNAL} ${.MAKE.PID} && \ + ${_parv_PKILL} ${_parv_PKILL_FLAGS} $$$$; \ + else \ + exit $${status}; \ + fi + # End of Locking variables and tools section ##################################################### +check-lock: + @( pkg_name=${PKGNAME}; ${_parv_CHECK_LOCK} ) || { ${_parv_ON_LOCK_EXIT_SEQ}; } + do-lock: @${DO_NADA} Modified: soc2012/scher/par_ports/head/Mk/bsd.port.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.port.mk Tue May 29 21:59:09 2012 (r236690) +++ soc2012/scher/par_ports/head/Mk/bsd.port.mk Tue May 29 22:33:24 2012 (r236691) @@ -1530,19 +1530,17 @@ .if defined(_parv_WANT_PARALLEL_BUILD) || !defined(IGNORE_PATH_CHECKS) .BEGIN: . if defined(_parv_WANT_PARALLEL_BUILD) + @if [ ! -d ${LOCK_DIR} ]; then \ + ${_dparv_START_OUTPUT}; \ + ${ECHO_CMD} "Creating lock dir"; \ + ${_dparv_END_OUTPUT}; \ + ${MKDIR} ${LOCK_DIR}; \ + fi . if ${_parv_IS_DEFAULT_TARGET} . if defined(INSTALLS_DEPENDS) - @( ${_parv_.CURDIR_LOCK_LOOP} ) || { \ - status=$$?; \ - if [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ - ${_parv_KILL} -${_parv_KILL_SIGNAL} ${.MAKE.PID} && \ - ${_parv_PKILL} ${_parv_PKILL_FLAGS} $$$$; \ - else \ - exit $${status}; \ - fi; \ - } + @( ${_parv_LOCK_DIR_LOCK_LOOP} ) || { ${_parv_ON_LOCK_EXIT_SEQ}; } . else - @attempts=-1; ${_parv_.CURDIR_LOCK_LOOP} + @attempts=-1; ${_parv_LOCK_DIR_LOCK_LOOP} . endif . endif . endif @@ -1559,7 +1557,7 @@ .if defined(_parv_WANT_PARALLEL_BUILD) .END: . if ${_parv_IS_DEFAULT_TARGET} - @${_parv_.CURDIR_DO_UNLOCK} + @${_parv_LOCK_DIR_DO_UNLOCK} . endif .endif ############### END OF PAR_PORTS SPECIFIC COMMENT LINE ############### @@ -5167,9 +5165,9 @@ fi; \ fi; \ if [ ${_parv_WANT_PARALLEL_BUILD} ] && [ $${notfound} -eq 1 ]; then \ - ( ${_parv_CHECK_LOCK} ) || { \ + ( cd $${dir}; ${MAKE} check-lock ) || { \ status=$$?; \ - if [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ + if [ $${status} -eq ${_parv_MAKE_LOCK_EXIT_STATUS} ]; then \ ( ${_parv_PKG_DBDIR_DO_UNLOCK} ); \ ${ECHO_CMD} $${prog} may be installing now.; \ sleep 2; \ @@ -5232,9 +5230,9 @@ notfound=1; \ fi; \ if [ ${_parv_WANT_PARALLEL_BUILD} ] && [ $${notfound} -eq 1 ]; then \ - ( ${_parv_CHECK_LOCK} ) || { \ + ( cd $${dir}; ${MAKE} check-lock ) || { \ status=$$?; \ - if [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ + if [ $${status} -eq ${_parv_MAKE_LOCK_EXIT_STATUS} ]; then \ ( ${_parv_PKG_DBDIR_DO_UNLOCK} ); \ ${ECHO_CMD} $${prog} may be installing now.; \ sleep 2; \ From owner-svn-soc-all@FreeBSD.ORG Wed May 30 12:26:32 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 59184106564A for ; Wed, 30 May 2012 12:26:30 +0000 (UTC) (envelope-from gpf@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Wed, 30 May 2012 12:26:30 +0000 Date: Wed, 30 May 2012 12:26:30 +0000 From: gpf@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120530122630.59184106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r236735 - in soc2012/gpf/pefs_kmod: sbin/pefs sys/fs/pefs X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2012 12:26:32 -0000 Author: gpf Date: Wed May 30 12:26:29 2012 New Revision: 236735 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236735 Log: -update XXX markers -axe the pefs_addchecklist command and all associated code -some code refactoring -fix endianess bug with exported name checksum value from kernel by ioctl() Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.c soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.h soc2012/gpf/pefs_kmod/sbin/pefs/pefs_subr.c soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs.h soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs_vnops.c Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c ============================================================================== --- soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c Wed May 30 11:48:57 2012 (r236734) +++ soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c Wed May 30 12:26:29 2012 (r236735) @@ -52,7 +52,7 @@ #include "pefs_ctl.h" -//#define PEFS_INTEGRITY_DEBUG +#define PEFS_INTEGRITY_DEBUG #if defined (PEFS_INTEGRITY_DEBUG) #define dprintf(a) printf a #else @@ -84,7 +84,7 @@ TAILQ_ENTRY(checksum) checksum_entries; }; -/* XXXgpf: [TODO] turns offsets to 64bits uints (or off_t?) */ +/* XXXgpf: [TODO] turns offsets to uint64_t? */ struct file_header { uint32_t nhashes; uint64_t file_id; @@ -359,8 +359,9 @@ pefs_get_file_id(struct file_header *fhp) { char parent_dir[MAXPATHLEN]; - struct pefs_namemac namemac; + struct pefs_xnamecsum xncs; char *pch; + uint64_t temp; int error, fd; /* feed parent directory to ioctl() */ @@ -380,13 +381,16 @@ pch = strrchr(fhp->path, '/'); pch++; - strlcpy(namemac.pnm_filename, pch, sizeof(namemac.pnm_filename)); - namemac.pnm_namelen = strnlen(namemac.pnm_filename, sizeof(namemac.pnm_filename)); + strlcpy(xncs.pxnc_filename, pch, sizeof(xncs.pxnc_filename)); + xncs.pxnc_namelen = strnlen(xncs.pxnc_filename, sizeof(xncs.pxnc_filename)); - error = ioctl(fd, PEFS_GETNAMEMAC, &namemac); + error = ioctl(fd, PEFS_GETNAMECSUM, &xncs); - if (error == 0) - fhp->file_id = namemac.pnm_csum; + if (error == 0) { + /* XXXgpf: Is this correct? */ + memcpy(&temp, xncs.pxnc_csum, sizeof(xncs.pxnc_csum)); + fhp->file_id = be64toh(temp); + } else pefs_warn("failed to fetch file id from kernel"); @@ -645,7 +649,8 @@ * All data member writes are done separately so as to avoid alignment problems. * Writes are always in little endian byte order. * - * XXXgpf: [TODO] more comments about internal structure of file. + * XXXgpf: [TODO] more comments about internal structure of file. This should probably + * be done after design crystalizes (cuckoo hashing? embed? etc). */ static int pefs_write_checksum_file(int fdout, struct checksum_file_header *cfhp, struct hash_table *chtp) @@ -749,7 +754,9 @@ } /* - * XXXgpf: [TODO] proper comment header, I am sleepy Z_Z + * An in memory database is created from entries in fpin. This database is later written + * to file ".pefs.checksum" which is created under csm_path. algo is used as a cryptographic + * hash function that produces checksums for 4k blocks of each file. */ int pefs_create_checksum_file(FILE *fpin, char *fsroot, char *csm_path, const char *algo) @@ -794,159 +801,3 @@ return (error); } - -/* - * Transform a decrypted fullpath residing in fsroot to an - * encrypted fullpath residing in fromfsroot. - */ -static int -pefs_get_enc_path(struct file_header *fhp, char *fsroot, char *fromfsroot) -{ - /* XXXgpf: can there be a problem with paths greater than MAXPATHLEN? */ - char enc_path[MAXPATHLEN]; - char dec_path[MAXPATHLEN]; - char original_path[MAXPATHLEN]; - char buf[MAXPATHLEN]; - struct stat sb; - char *rel_path; - char *pch; - DIR *dirp; - struct dirent *dp; - uint32_t ino; - int found; - - strlcpy(enc_path, fromfsroot, sizeof(enc_path)); - strlcpy(dec_path, fsroot, sizeof(dec_path)); - - strlcpy(original_path, fhp->path, sizeof(original_path)); - rel_path = original_path + strlen(fsroot); - - dprintf(("constructing encrypted path for: %s%s\n", fsroot, rel_path)); - - pch = strtok (rel_path,"/"); - while (pch != NULL) { - dprintf(("enc path = %s\tdec path = %s\n", enc_path, dec_path)); - dprintf(("next element: %s", pch)); - snprintf(buf, sizeof(buf), "%s/%s", dec_path, pch); - strlcpy(dec_path, buf, sizeof(dec_path)); - - /* grab inode from dec_path */ - if (stat(buf, &sb) != 0) { - warn("cannot stat file %s", buf); - return (PEFS_ERR_SYS); - } - ino = sb.st_ino; - dprintf(("\t%d\n", ino)); - - /* try to find inode in dirents of enc_path */ - dirp = opendir(enc_path); - if (dirp == NULL) { - warn("cannot open dir %s", enc_path); - return (PEFS_ERR_SYS); - } - - found = 0; - while (dirp != NULL) { - if ( (dp = readdir(dirp)) != NULL) { - if (dp->d_fileno == ino) { - found = 1; - break; - } - } - else { - closedir(dirp); - break; - } - } - - if (found == 0) { - pefs_warn("inode: %d not found in directory: %s", ino, enc_path); - return (PEFS_ERR_NOENT); - } - - /* append the encrypted filename and continue */ - snprintf(buf, sizeof(buf), "%s/%s", enc_path, dp->d_name); - strlcpy(enc_path, buf, sizeof(enc_path)); - closedir(dirp); - - pch = strtok (NULL, "/"); - } - - dprintf(("\nresulting enc path = %s\n", enc_path)); - if (stat(buf, &sb) != 0) { - warn("cannot stat file %s", enc_path); - return (PEFS_ERR_SYS); - } - - /* - * XXXgpf: [TODO] deal with other types of files - */ - if (S_ISREG(sb.st_mode) == 0) { - pefs_warn("filename: %s is not a regular file", enc_path); - return (PEFS_ERR_INVALID); - } - - strlcpy(fhp->path, enc_path, sizeof(fhp->path)); - strlcat(fhp->path, "\n", sizeof(fhp->path)); - - return (0); -} - -static int -pefs_write_to_checklist(int fdout, struct file_header *fhp) -{ - uint32_t bytes, len; - - len = strnlen(fhp->path, sizeof(fhp->path)); - bytes = write(fdout, fhp->path, len); - if (bytes != len) { - warn("error writing '%s' to checklist file", fhp->path); - return (PEFS_ERR_IO); - } - - return (0); -} - -/* - * This function creates the checklist that will be used by pefs_addchecksum. - * For each file entry: - * 1) semantic checks: residing in pefs filesystem & regular file type checks. - * 2) the encrypted fullpath of the file is retrieved - * 3) entry is written to checklist_file - */ -int -pefs_create_checklist(FILE *fpin, int fdout, char *fsroot, char *fromfsroot) -{ - struct statfs fs; - struct file_header *fhp; - int error; - - error = 0; - - if (statfs(fsroot, &fs) == -1) { - pefs_warn("statfs failed: %s: %s", fsroot, strerror(errno)); - return (PEFS_ERR_SYS); - } - - while((fhp = pefs_next_file(fpin, &error)) != NULL) { - error = pefs_file_semantic_checks(fhp, &fs); - if (error != 0) - goto out; - - error = pefs_get_enc_path(fhp, fsroot, fromfsroot); - if (error != 0) - goto out; - - error = pefs_write_to_checklist(fdout, fhp); - if (error != 0) - goto out; - - free(fhp); - } - -out: - if (fhp != NULL) - free(fhp); - - return (error); -} Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.c ============================================================================== --- soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.c Wed May 30 11:48:57 2012 (r236734) +++ soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.c Wed May 30 12:26:29 2012 (r236735) @@ -76,7 +76,6 @@ static int pefs_showchains(int argc, char *argv[]); static int pefs_showalgs(int argc, char *argv[]); static int pefs_addchecksum(int argc, char *argv[]); -static int pefs_addchecklist(int argc, char *argv[]); typedef int (*command_func_t)(int argc, char **argv); typedef int (*keyop_func_t)(struct pefs_keychain_head *kch, int fd, @@ -104,7 +103,6 @@ { "showchains", pefs_showchains }, { "showalgs", pefs_showalgs }, { "addchecksum", pefs_addchecksum}, - { "addchecklist", pefs_addchecklist}, { NULL, NULL }, }; @@ -146,16 +144,6 @@ exit(PEFS_ERR_INVALID); } -static void -initfsroots(int argc, char **argv, int flags, char *fsroot, char *fromfsroot, size_t size) -{ - if (!checkargs_fs(argc, argv)) - pefs_usage(); - - if (pefs_getfsroots(argv[0], flags, fsroot, fromfsroot, size) != 0) - exit(PEFS_ERR_INVALID); -} - static int openx_rdonly(const char *path) { @@ -1115,102 +1103,6 @@ return (error); } -/* - * XXXgpf: This should get the axe soon. But I'm keeping it here - * a little while longer just in case. - * - * pefs addchecklist [-i inputfile] [-o outputfile] filesystem - * - * $command creates an outputfile that may be supplied to - * `pefs addchecksum`. - * - * inputfile contains list of files that need integrity checking. - * Entries of this file list are just filepaths. Only one entry per line - * is allowed. - * e.g. "/mnt/my_file.txt\n" - * - * outputfile will be created and it will contain the same list of files, - * but encrypted filenames will be used instead. - * - * filesystem should be already mounted and key already supplied, so that - * filenames are decrypted. However, it must *not* be mounted on the same - * directory so that both decrypted and encrypted filenames exist at the - * same time in the system. - * - * A proper way of ensuring integrity checks for a pefs filesystem would be: - * - * pefs mount /usr/home/paul/priv.enc /mnt - * pefs addkey -c /mnt - * ./my_script > filelist.txt - * pefs addchecklist -i filelist.txt pefs_filelist /mnt - * pefs unmount /mnt - * pefs addchecksum -i pefs_filelist /usr/home/paul/p.enc - * pefs mount -o checksum=yes /usr/home/paul/priv.enc /any/path - * - */ -static int -pefs_addchecklist(int argc, char *argv[]) -{ - char fsroot[MAXPATHLEN], fromfsroot[MAXPATHLEN]; - char output_file[MAXPATHLEN]; - FILE *fpin; - int error, fdout, i; - - fpin = NULL; - fdout = -1; - - while ((i = getopt(argc, argv, "i:o:")) != -1) - switch(i) { - case 'i': - fpin = fopen(optarg, "r"); - if (fpin == NULL) { - warn("cannot open inputfile: %s", optarg); - return (PEFS_ERR_INVALID); - } - break; - case 'o': - strlcpy(output_file, optarg, sizeof(output_file)); - fdout = open(output_file, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); - if (fdout == -1) { - warn("cannot open %s", optarg); - return (PEFS_ERR_IO); - } - break; - default: - pefs_usage(); - } - argc -= optind; - argv += optind; - - if (fpin == NULL) { - pefs_warn("please supply an input file [-i]"); - return (PEFS_ERR_USAGE); - } - - if (fdout == -1) { - pefs_warn("please supply an output file [-o]"); - return (PEFS_ERR_USAGE); - } - - initfsroots(argc, argv, 0, fsroot, fromfsroot, sizeof(fsroot)); - - if (strcmp(fsroot, fromfsroot) == 0) { - pefs_warn("filesystem: %s must not be mounted upon itself!\n", fromfsroot); - unlink(output_file); - return (PEFS_ERR_USAGE); - } - - error = pefs_create_checklist(fpin, fdout, fsroot, fromfsroot); - - fclose(fpin); - close(fdout); - - if (error != 0) - unlink(output_file); - - return (error); -} - static void pefs_usage_alg(void) { @@ -1237,7 +1129,6 @@ " pefs showchains [-fp] [-i iterations] [-k keyfile] filesystem\n" " pefs showalgs\n" " pefs addchecksum [-a algo] [-i inputfile] [-p checksumpath] filesystem\n" -" pefs addchecklist [-i inputfile] [-o outputfile] filesystem\n" ); exit(PEFS_ERR_USAGE); } Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.h ============================================================================== --- soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.h Wed May 30 11:48:57 2012 (r236734) +++ soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.h Wed May 30 12:26:29 2012 (r236735) @@ -95,7 +95,6 @@ const struct pefs_xkey *xk_parent); uintmax_t pefs_keyid_as_int(char *keyid); int pefs_create_checksum_file(FILE *fpin, char *fsroot, char *csm_path, const char *algo); -int pefs_create_checklist(FILE *fpin, int fdout, char *fsroot, char *fromfsroot); const char * pefs_alg_name(struct pefs_xkey *xk); void pefs_alg_list(FILE *stream); Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_subr.c ============================================================================== --- soc2012/gpf/pefs_kmod/sbin/pefs/pefs_subr.c Wed May 30 11:48:57 2012 (r236734) +++ soc2012/gpf/pefs_kmod/sbin/pefs/pefs_subr.c Wed May 30 12:26:29 2012 (r236735) @@ -74,33 +74,3 @@ return (0); } -int -pefs_getfsroots(const char *path, int flags, char *fsroot, char * fromfsroot, size_t size) -{ - struct statfs fs; - const char *realfsroot, *realfromfsroot; - - if (statfs(path, &fs) == -1) { - pefs_warn("statfs failed: %s: %s", path, strerror(errno)); - return (PEFS_ERR_SYS); - } - - realfsroot = fs.f_mntonname; - if (strcmp(PEFS_FSTYPE, fs.f_fstypename) != 0) { - if ((flags & PEFS_FS_IGNORE_TYPE) != 0) - realfsroot = path; - else { - pefs_warn("invalid file system type: %s", path); - return (PEFS_ERR_INVALID); - } - } - - realfromfsroot = fs.f_mntfromname; - if (fromfsroot != NULL) - strlcpy(fromfsroot, realfromfsroot, size); - - if (fsroot != NULL) - strlcpy(fsroot, realfsroot, size); - - return (0); -} Modified: soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs.h ============================================================================== --- soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs.h Wed May 30 11:48:57 2012 (r236734) +++ soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs.h Wed May 30 12:26:29 2012 (r236735) @@ -48,17 +48,11 @@ char pxk_key[PEFS_KEY_SIZE]; }; -/* - * XXXgpf: [TODO] gleb says: - Adding 'x' to mark - it as exported to userspace will also be wise. So it's better be - pefs_xnamecsum or pefs_xname_csum. - */ -struct pefs_namemac { - uint64_t pnm_csum; - uint32_t pnm_namelen; +struct pefs_xnamecsum { + uint32_t pxnc_namelen; + char pxnc_csum[PEFS_NAME_CSUM_SIZE]; /* XXXgpf: should probably be MAXNAMLEN */ - char pnm_filename[MAXPATHLEN]; + char pxnc_filename[MAXPATHLEN]; }; struct pefs_xsector_ctext { @@ -74,7 +68,7 @@ #define PEFS_DELKEY _IOWR('p', 3, struct pefs_xkey) #define PEFS_FLUSHKEYS _IO('p', 4) #define PEFS_GETNODEKEY _IOWR('p', 5, struct pefs_xkey) -#define PEFS_GETNAMEMAC _IOWR('p', 6, struct pefs_namemac) +#define PEFS_GETNAMECSUM _IOWR('p', 6, struct pefs_xnamecsum) #define PEFS_GETSECTORCTEXT _IOWR('p', 7, struct pefs_xsector_ctext) #endif Modified: soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs_vnops.c ============================================================================== --- soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs_vnops.c Wed May 30 11:48:57 2012 (r236734) +++ soc2012/gpf/pefs_kmod/sys/fs/pefs/pefs_vnops.c Wed May 30 12:26:29 2012 (r236735) @@ -2362,7 +2362,7 @@ struct vnode *vp = ap->a_vp; struct vnode *lvp = PEFS_LOWERVP(vp); struct pefs_xkey *xk = ap->a_data; - struct pefs_namemac *namemac = ap->a_data; + struct pefs_xnamecsum *xncs = ap->a_data; struct pefs_xsector_ctext *xsct = ap->a_data; struct ucred *cred = ap->a_cred; struct thread *td = ap->a_td; @@ -2520,7 +2520,7 @@ pefs_chunk_free(&pc, pn); VOP_UNLOCK(vp, 0); break; - case PEFS_GETNAMEMAC: + case PEFS_GETNAMECSUM: vn_lock(vp, LK_EXCLUSIVE); /* XXXgpf: should I change printf to something else? e.g. PEFSDEBUG */ if (vp->v_type != VDIR) { @@ -2529,14 +2529,14 @@ return (EINVAL); } - if (strnlen(namemac->pnm_filename, sizeof(namemac->pnm_filename)) != - namemac->pnm_namelen) { - printf("pefs_ioctl: PEFS_GETNAMEMAC incorrect pnm_namelen %d\n", namemac->pnm_namelen); + if (strnlen(xncs->pxnc_filename, sizeof(xncs->pxnc_filename)) != + xncs->pxnc_namelen) { + printf("pefs_ioctl: PEFS_GETNAMEMAC incorrect pnm_namelen %d\n", xncs->pxnc_namelen); VOP_UNLOCK(vp, 0); return (EINVAL); } - if (strchr(namemac->pnm_filename, '/') != NULL) { + if (strchr(xncs->pxnc_filename, '/') != NULL) { printf("pefs_ioctl: PEFS_GETNAMEMAC pnm_filename contains '/'\n"); VOP_UNLOCK(vp, 0); return (EINVAL); @@ -2549,9 +2549,10 @@ cn.cn_cred = cred; cn.cn_lkflags = 0; cn.cn_flags = 0; - cn.cn_nameptr = namemac->pnm_filename; - cn.cn_namelen = namemac->pnm_namelen; + cn.cn_nameptr = xncs->pxnc_filename; + cn.cn_namelen = xncs->pxnc_namelen; + /* XXXgpf: does this lookup rely solely on present cache data? */ error = pefs_enccn_lookup(&enccn, vp, &cn); VOP_UNLOCK(vp, 0); @@ -2572,12 +2573,8 @@ r = pefs_name_pton(enc, enc_len, buf, buf_len); if (r <= 0) error = EINVAL; - /* - * XXXgpf: [TODO] endianess!! Change int64_t to char[8] - * and deal with endianess at user-space - */ else - memcpy(&(namemac->pnm_csum), buf, PEFS_NAME_CSUM_SIZE); + memcpy(xncs->pxnc_csum, buf, sizeof(xncs->pxnc_csum)); pefs_enccn_free(&enccn); free(buf, M_TEMP); From owner-svn-soc-all@FreeBSD.ORG Wed May 30 19:05:00 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 9DC3C1065672 for ; Wed, 30 May 2012 19:04:58 +0000 (UTC) (envelope-from scher@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Wed, 30 May 2012 19:04:58 +0000 Date: Wed, 30 May 2012 19:04:58 +0000 From: scher@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120530190458.9DC3C1065672@hub.freebsd.org> Cc: Subject: socsvn commit: r236758 - soc2012/scher/par_ports/head/Mk X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2012 19:05:00 -0000 Author: scher Date: Wed May 30 19:04:58 2012 New Revision: 236758 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236758 Log: [bugfix] ":=" Type of MAkefile variable expansion leads to wrong results of "$$(...)" command. [new_feature] seal breakpoint targets for debbuging purpose Submitted by: Alexander Pronin Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Wed May 30 18:05:48 2012 (r236757) +++ soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Wed May 30 19:04:58 2012 (r236758) @@ -27,6 +27,11 @@ ${ECHO_CMD} Press any key when you are ready to continue; \ read non_existed_var +seal: + @echo " <<<<<< ===== WE ARE HERE ===== >>>>>>" +breakpoint: + @${_dparv_DEBUGGING_BREAKPOINT} + # Delay for feedback message if the directory is locked. # Just not to annoy a user with feedback message on each attempt to lock a directory. _parv_ON_LOCK_FEEDBACK_TIMEOUT?= 2 @@ -81,10 +86,10 @@ _parv_MAKE_LOCK_EXIT_STATUS= 158 -# Senquence of commands to lock a directory using ${_parv_LOCK_FILE}. -# During evaluation of the following commands lockf(1) is holding lock on ${_parv_LOCK_FILE} file. +# Senquence of commands to lock a directory using ${_parv_${_lock_dir}_LOCK_FILE}. +# During evaluation of the following commands lockf(1) is holding lock on ${_parv_${_lock_dir}_LOCK_FILE} file. # Hence NO other process is able to evaluate any commands using lockf(1) -# locking on the same ${_parv_LOCK_FILE} file. +# locking on the same ${_parv_${_lock_dir}_LOCK_FILE} file. # # Stalled locks cheking enabled. # @@ -96,11 +101,11 @@ # _parv_PKG_DBDIR_LOCK_SEQ # _parv_LOCK_DIR_LOCK_SEQ # -_parv_LOCK_FILE:= ${_parv_${_lock_dir}_LOCK_FILE} +#_parv_${_lock_dir}_LOCK_FILE:= ${_parv_${_lock_dir}_LOCK_FILE} -_parv_${_lock_dir}_LOCK_SEQ:= \ - ${CHMOD} 777 ${${_lock_dir}}/${_parv_LOCK_FILE}; \ - pid=$$(${CAT} ${${_lock_dir}}/${_parv_LOCK_FILE}); \ +_parv_${_lock_dir}_LOCK_SEQ= \ + ${CHMOD} 777 ${${_lock_dir}}/${_parv_${_lock_dir}_LOCK_FILE}; \ + pid=$$(${CAT} ${${_lock_dir}}/${_parv_${_lock_dir}_LOCK_FILE}); \ if [ $${pid} ]; then \ ps -p $${pid} > /dev/null && status=$$? || status=$$?; \ if [ $${status} -eq 0 ]; then \ @@ -109,15 +114,15 @@ ${_dparv_START_OUTPUT}; \ ${ECHO_CMD} "Dir: ${${_lock_dir}} Stalled lock Detected!"; \ ${ECHO_CMD} "Deleting stalled lock. PID=$${pid}"; \ - ${ECHO_CMD} "Locking: ${${_lock_dir}}/${_parv_LOCK_FILE}"; \ + ${ECHO_CMD} "Locking: ${${_lock_dir}}/${_parv_${_lock_dir}_LOCK_FILE}"; \ ${_dparv_END_OUTPUT}; \ - ${ECHO_CMD} ${.MAKE.PID} > ${${_lock_dir}}/${_parv_LOCK_FILE}; \ + ${ECHO_CMD} ${.MAKE.PID} > ${${_lock_dir}}/${_parv_${_lock_dir}_LOCK_FILE}; \ fi; \ else \ ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} "Locking: ${${_lock_dir}}/${_parv_LOCK_FILE}"; \ + ${ECHO_CMD} "Locking: ${${_lock_dir}}/${_parv_${_lock_dir}_LOCK_FILE}"; \ ${_dparv_END_OUTPUT}; \ - ${ECHO_CMD} ${.MAKE.PID} > ${${_lock_dir}}/${_parv_LOCK_FILE}; \ + ${ECHO_CMD} ${.MAKE.PID} > ${${_lock_dir}}/${_parv_${_lock_dir}_LOCK_FILE}; \ fi ##################################################### @@ -127,8 +132,8 @@ # This scripts handles exit status of lockf(1) call. # It substitutes exit status 75 of lockf(1) for ${_parv_ON_LOCK_EXIT_STATUS} and pushes it. # -_parv_${_lock_dir}_DO_LOCK:= \ - lockf -k -t ${_parv_WAIT_FOR_LOCK_TIME} ${${_lock_dir}}/${_parv_LOCK_FILE} ${SH} -c '${_parv_${_lock_dir}_LOCK_SEQ}' || { \ +_parv_${_lock_dir}_DO_LOCK= \ + lockf -k -t ${_parv_WAIT_FOR_LOCK_TIME} ${${_lock_dir}}/${_parv_${_lock_dir}_LOCK_FILE} ${SH} -c '${_parv_${_lock_dir}_LOCK_SEQ}' || { \ status=$$?; \ if [ $${status} -eq ${_parv_LOCKF_EX_TEMPFAIL} ] || \ [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ @@ -137,7 +142,7 @@ ${_dparv_START_OUTPUT}; \ ${ECHO_CMD} "Unhandled EXIT STATUS = $${status}. Terminating"; \ ${_dparv_END_OUTPUT}; \ - exit $${status}; \ + exit 1; \ fi; \ } @@ -162,7 +167,7 @@ elif [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ if [ $$(( $${enable_feedback} % ${_parv_ON_LOCK_FEEDBACK_TIMEOUT} )) -eq 0 ]; then \ ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} "Unable to lock ${${_lock_dir}}/${_parv_LOCK_FILE}"; \ + ${ECHO_CMD} "Unable to lock ${${_lock_dir}}/${_parv_${_lock_dir}_LOCK_FILE}"; \ ${ECHO_CMD} "Dir: ${${_lock_dir}} is already locked by another working process ..."; \ ${ECHO_CMD} "Waiting for unlock ........................................................."; \ ${_dparv_END_OUTPUT}; \ @@ -182,22 +187,22 @@ # _parv_PKG_DBDIR_DO_UNLOCK # _parv_LOCK_DIR_DO_UNLOCK # -_parv_${_lock_dir}_DO_UNLOCK:= \ - lockf -k -t ${_parv_WAIT_FOR_UNLOCK_TIME} ${${_lock_dir}}/${_parv_LOCK_FILE} \ - ${RM} ${${_lock_dir}}/${_parv_LOCK_FILE} && { \ +_parv_${_lock_dir}_DO_UNLOCK= \ + lockf -k -t ${_parv_WAIT_FOR_UNLOCK_TIME} ${${_lock_dir}}/${_parv_${_lock_dir}_LOCK_FILE} \ + ${RM} ${${_lock_dir}}/${_parv_${_lock_dir}_LOCK_FILE} && { \ ${_dparv_START_OUTPUT}; \ - ${ECHO_CMD} "Dir: ${${_lock_dir}}/${_parv_LOCK_FILE} is unlocked"; \ + ${ECHO_CMD} "Dir: ${${_lock_dir}}/${_parv_${_lock_dir}_LOCK_FILE} is unlocked"; \ ${_dparv_END_OUTPUT}; \ } || { \ ${_dparv_START_OUTPUT}; \ ${ECHO_CMD} "Hard unlock!"; \ - ${RM} -rf ${${_lock_dir}}/${_parv_LOCK_FILE}; \ + ${RM} -rf ${${_lock_dir}}/${_parv_${_lock_dir}_LOCK_FILE}; \ ${_dparv_END_OUTPUT}; \ } .endfor # _lock_dir in PKG_DBDIR .CURDIR -.undef _parv_LOCK_FILE +.undef _parv_${_lock_dir}_LOCK_FILE ##################################################### # _parv_CHECK_SEQ @@ -237,7 +242,7 @@ ${_dparv_START_OUTPUT}; \ ${ECHO_CMD} "Unhandled EXIT STATUS = $${status}. Terminating"; \ ${_dparv_END_OUTPUT}; \ - exit $${status}; \ + exit 1; \ fi; \ } @@ -255,7 +260,13 @@ check-lock: @( pkg_name=${PKGNAME}; ${_parv_CHECK_LOCK} ) || { ${_parv_ON_LOCK_EXIT_SEQ}; } - + +lock-pkg-dbdir: + @attempts=-1; ${_parv_PKG_DBDIR_LOCK_LOOP} + +unlock-pkg-dbdir: + @${_parv_PKG_DBDIR_DO_UNLOCK} + do-lock: @${DO_NADA} From owner-svn-soc-all@FreeBSD.ORG Wed May 30 21:43:10 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id E91A11065679 for ; Wed, 30 May 2012 21:43:07 +0000 (UTC) (envelope-from scher@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Wed, 30 May 2012 21:43:07 +0000 Date: Wed, 30 May 2012 21:43:07 +0000 From: scher@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120530214307.E91A11065679@hub.freebsd.org> Cc: Subject: socsvn commit: r236766 - in soc2012/scher/par_ports/head/fake_ports: with_conflicts with_conflicts/fake3 with_conflicts/fake4 with_deps/fake1 with_deps/fake2 X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2012 21:43:10 -0000 Author: scher Date: Wed May 30 21:43:07 2012 New Revision: 236766 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236766 Log: [new_feature] New ports for testing conflicts checking [fixed] Some not meaningful changes for ports dependency testing Added: soc2012/scher/par_ports/head/fake_ports/with_conflicts/ soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake3/ (props changed) soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake3/Makefile (contents, props changed) soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake3/pkg-descr soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake4/ soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake4/Makefile (contents, props changed) soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake4/pkg-descr Modified: soc2012/scher/par_ports/head/fake_ports/with_deps/fake1/Makefile soc2012/scher/par_ports/head/fake_ports/with_deps/fake2/Makefile Added: soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake3/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake3/Makefile Wed May 30 21:43:07 2012 (r236766) @@ -0,0 +1,18 @@ +PORTNAME=fake3 +PORTVERSION=1.0 +DISTFILES=fake-1.0.tar.gz +CATEGORIES=fake_ports + + +WRKSRC= ${WRKDIR}/fake-1.0 + +do-install: + @echo "Port: "fake3" is installing now" + @echo "Press any key to continue:" + @read i + touch ${PORTSDIR}/tmp/fake3; + +pre-clean: + rm -rf ${PORTSDIR}/tmp/fake3; + +.include Added: soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake3/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake3/pkg-descr Wed May 30 21:43:07 2012 (r236766) @@ -0,0 +1,2 @@ +This is a description for fake port +That is all so far \ No newline at end of file Added: soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake4/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake4/Makefile Wed May 30 21:43:07 2012 (r236766) @@ -0,0 +1,18 @@ +PORTNAME=fake4 +PORTVERSION=1.0 +DISTFILES=fake-1.0.tar.gz +CATEGORIES=fake_ports + + +WRKSRC= ${WRKDIR}/fake-1.0 + +CONFLICTS= fake3-* fake-* + +NOCLEANDEPENDS= + +do-install: + @echo "Port: "fake4" is installing now" + @echo "Press any key to continue:" + @read i + +.include Added: soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake4/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/scher/par_ports/head/fake_ports/with_conflicts/fake4/pkg-descr Wed May 30 21:43:07 2012 (r236766) @@ -0,0 +1,2 @@ +This is a description for fake port +That is all so far \ No newline at end of file Modified: soc2012/scher/par_ports/head/fake_ports/with_deps/fake1/Makefile ============================================================================== --- soc2012/scher/par_ports/head/fake_ports/with_deps/fake1/Makefile Wed May 30 20:56:07 2012 (r236765) +++ soc2012/scher/par_ports/head/fake_ports/with_deps/fake1/Makefile Wed May 30 21:43:07 2012 (r236766) @@ -10,5 +10,9 @@ @echo "Port: "fake1" is installing now" @echo "Press any key to continue:" @read i + touch ${PORTSDIR}/tmp/fake1; + +pre-clean: + rm -rf ${PORTSDIR}/tmp/fake1; .include Modified: soc2012/scher/par_ports/head/fake_ports/with_deps/fake2/Makefile ============================================================================== --- soc2012/scher/par_ports/head/fake_ports/with_deps/fake2/Makefile Wed May 30 20:56:07 2012 (r236765) +++ soc2012/scher/par_ports/head/fake_ports/with_deps/fake2/Makefile Wed May 30 21:43:07 2012 (r236766) @@ -5,11 +5,11 @@ WRKSRC= ${WRKDIR}/fake-1.0 -FETCH_DEPENDS= /un/existed/path:/usr/home/scher/project/fake_ports/with_deps/fake1 +FETCH_DEPENDS= ${PORTSDIR}/tmp/fake1:/usr/home/scher/project/fake_ports/with_deps/fake1 NOCLEANDEPENDS= do-install: - @echo "Port: "fake" is installing now" + @echo "Port: "fake2" is installing now" .include From owner-svn-soc-all@FreeBSD.ORG Wed May 30 22:06:17 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 93CE01065670 for ; Wed, 30 May 2012 22:06:15 +0000 (UTC) (envelope-from scher@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Wed, 30 May 2012 22:06:15 +0000 Date: Wed, 30 May 2012 22:06:15 +0000 From: scher@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120530220615.93CE01065670@hub.freebsd.org> Cc: Subject: socsvn commit: r236771 - soc2012/scher/par_ports/head/Mk X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2012 22:06:17 -0000 Author: scher Date: Wed May 30 22:06:15 2012 New Revision: 236771 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236771 Log: [new_feature] bsd.parallel.mk: new target for checking conflicts with currently installing ports bsd.port.mk: new checking conflicts target is integrated Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk soc2012/scher/par_ports/head/Mk/bsd.port.mk Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Wed May 30 21:28:37 2012 (r236770) +++ soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Wed May 30 22:06:15 2012 (r236771) @@ -261,6 +261,34 @@ check-lock: @( pkg_name=${PKGNAME}; ${_parv_CHECK_LOCK} ) || { ${_parv_ON_LOCK_EXIT_SEQ}; } +check-active-build-conflicts: +.if ( defined(CONFLICTS) || defined(CONFLICTS_BUILD) || defined(CONFLICTS_INSTALL)) && !defined(DISABLE_CONFLICTS) + @conflicts_with=; \ + active_builds=$$(cd ${LOCK_DIR}; ${LS} -dA ${CONFLICTS} ${CONFLICTS_BUILD} ${CONFLICTS_INSTALL} 2> /dev/null || ); \ + for entry in $${active_builds}; do \ + ( pkg_name=$${entry}; ${_parv_CHECK_LOCK} ) || { \ + status=$$?; \ + if [ $${status} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \ + conflicts_with="$${conflicts_with} $${entry}"; \ + else \ + exit 1; \ + fi; \ + }; \ + done; \ + if [ -n "$${conflicts_with}" ]; then \ + ${_dparv_START_OUTPUT}; \ + ${ECHO_MSG}; \ + ${ECHO_MSG} "===> ${PKGNAME} conflicts with currently installing package(s): "; \ + for entry in $${conflicts_with}; do \ + ${ECHO_MSG} " $${entry}"; \ + done; \ + ${ECHO_MSG}; \ + ${ECHO_MSG} " Please remove them first with pkg_delete(1)."; \ + ${_dparv_END_OUTPUT}; \ + exit 1; \ + fi +.endif + lock-pkg-dbdir: @attempts=-1; ${_parv_PKG_DBDIR_LOCK_LOOP} Modified: soc2012/scher/par_ports/head/Mk/bsd.port.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.port.mk Wed May 30 21:28:37 2012 (r236770) +++ soc2012/scher/par_ports/head/Mk/bsd.port.mk Wed May 30 22:06:15 2012 (r236771) @@ -1137,6 +1137,20 @@ .include "${PORTSDIR}/Mk/bsd.parallel.mk" .endif +.if !target(lock-pkg-dbdir) +lock-pkg-dbdir: + @{DO_NADA} +.endif + +.if !target(unlock-pkg-dbdir) +unlock-pkg-dbdir: + @{DO_NADA} +.endif + +.if !target(check-active-build-conflicts) +check-active-build-conflicts: + @{DO_NADA} +.endif ############### ENDF OF PAR_PORTS SPECIFIC COMMENT LINE ############### # @@ -3807,7 +3821,7 @@ # Check conflicts .if !target(check-conflicts) -check-conflicts: check-build-conflicts check-install-conflicts +check-conflicts: check-active-build-conflicts check-build-conflicts check-install-conflicts .endif .if !target(check-build-conflicts) @@ -4324,7 +4338,7 @@ .endif _SANITY_SEQ= ${_CHROOT_SEQ} pre-everything check-makefile \ check-categories check-makevars check-desktop-entries \ - check-depends identify-install-conflicts check-deprecated \ + check-depends check-active-build-conflicts identify-install-conflicts check-deprecated \ check-vulnerable check-license buildanyway-message \ options-message From owner-svn-soc-all@FreeBSD.ORG Wed May 30 22:26:15 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id A060D106566C for ; Wed, 30 May 2012 22:26:14 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Wed, 30 May 2012 22:26:14 +0000 Date: Wed, 30 May 2012 22:26:14 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120530222614.A060D106566C@hub.freebsd.org> Cc: Subject: socsvn commit: r236772 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2012 22:26:15 -0000 Author: jhagewood Date: Wed May 30 22:26:13 2012 New Revision: 236772 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236772 Log: Deleted: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Wed May 30 22:26:31 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 0FC871065953 for ; Wed, 30 May 2012 22:26:29 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Wed, 30 May 2012 22:26:29 +0000 Date: Wed, 30 May 2012 22:26:29 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120530222630.0FC871065953@hub.freebsd.org> Cc: Subject: socsvn commit: r236773 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2012 22:26:31 -0000 Author: jhagewood Date: Wed May 30 22:26:28 2012 New Revision: 236773 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236773 Log: Added: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Wed May 30 22:28:10 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 4CFBF1065676 for ; Wed, 30 May 2012 22:28:09 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Wed, 30 May 2012 22:28:09 +0000 Date: Wed, 30 May 2012 22:28:09 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120530222809.4CFBF1065676@hub.freebsd.org> Cc: Subject: socsvn commit: r236774 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2012 22:28:10 -0000 Author: jhagewood Date: Wed May 30 22:28:09 2012 New Revision: 236774 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236774 Log: Deleted: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Wed May 30 22:28:18 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id A228D1065675 for ; Wed, 30 May 2012 22:28:17 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Wed, 30 May 2012 22:28:17 +0000 Date: Wed, 30 May 2012 22:28:17 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120530222817.A228D1065675@hub.freebsd.org> Cc: Subject: socsvn commit: r236775 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2012 22:28:18 -0000 Author: jhagewood Date: Wed May 30 22:28:17 2012 New Revision: 236775 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236775 Log: Added: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Wed May 30 22:29:04 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 7A2BD106566B for ; Wed, 30 May 2012 22:29:02 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Wed, 30 May 2012 22:29:02 +0000 Date: Wed, 30 May 2012 22:29:02 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120530222902.7A2BD106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236776 - in soc2012/jhagewood/mdocml: . macro_files mdocml-1.12.1 mdocml-1.12.1-orig mdocml_patches X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2012 22:29:04 -0000 Author: jhagewood Date: Wed May 30 22:29:02 2012 New Revision: 236776 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236776 Log: Added: soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/macro_files/ soc2012/jhagewood/mdocml/macro_files/nospace_macros soc2012/jhagewood/mdocml/mdocml-1.12.1/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/whatis.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1/whatis.1 soc2012/jhagewood/mdocml/mdocml_patches/ soc2012/jhagewood/mdocml/mdocml_patches/patch-config.txt soc2012/jhagewood/mdocml/mdocml_patches/patch-lib.in.txt soc2012/jhagewood/mdocml/mdocml_patches/patch-mdoc_validate.c soc2012/jhagewood/mdocml/mdocml_patches/patch-msec.in.txt soc2012/jhagewood/mdocml/mdocml_test.sh (contents, props changed) Added: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Wed May 30 22:29:02 2012 (r236776) @@ -0,0 +1,312 @@ +diff -rupN mdocml-1.12.1-orig//lib.in mdocml-1.12.1//lib.in +--- mdocml-1.12.1-orig//lib.in 2012-05-30 13:45:57.241288831 -0400 ++++ mdocml-1.12.1//lib.in 2012-05-30 13:45:58.461290510 -0400 +@@ -23,10 +23,10 @@ + * Be sure to escape strings. + */ + +-LINE("libarchive", "Reading and Writing Streaming Archives Library (libarchive, \\-larchive)") ++LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)") + LINE("libarm", "ARM Architecture Library (libarm, \\-larm)") + LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)") +-LINE("libbluetooth", "Bluetooth Library (libbluetooth, \\-lbluetooth)") ++LINE("libbluetooth", "Bluetooth User Library (libbluetooth, \\-lbluetooth)") + LINE("libbsm", "Basic Security Module User Library (libbsm, \\-lbsm)") + LINE("libc", "Standard C Library (libc, \\-lc)") + LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)") +@@ -41,10 +41,11 @@ LINE("libdevinfo", "Device and Resource + LINE("libdevstat", "Device Statistics Library (libdevstat, \\-ldevstat)") + LINE("libdisk", "Interface to Slice and Partition Labels Library (libdisk, \\-ldisk)") + LINE("libdwarf", "DWARF Access Library (libdwarf, \\-ldwarf)") +-LINE("libedit", "Command Line Editor Library (libedit, \\-ledit)") ++LINE("libedit", "Line Editor and History Library (libedit, \\-ledit)") ++LINE("libefi", "EFI Runtime Services Library (libefi, \\-lefi)") + LINE("libelf", "ELF Access Library (libelf, \\-lelf)") + LINE("libevent", "Event Notification Library (libevent, \\-levent)") +-LINE("libfetch", "File Transfer Library for URLs (libfetch, \\-lfetch)") ++LINE("libfetch", "File Transfer Library (libfetch, \\-lfetch)") + LINE("libform", "Curses Form Library (libform, \\-lform)") + LINE("libgeom", "Userland API Library for kernel GEOM subsystem (libgeom, \\-lgeom)") + LINE("libgpib", "General-Purpose Instrument Bus (GPIB) library (libgpib, \\-lgpib)") +@@ -70,7 +71,7 @@ LINE("libossaudio", "OSS Audio Emulation + LINE("libpam", "Pluggable Authentication Module Library (libpam, \\-lpam)") + LINE("libpcap", "Capture Library (libpcap, \\-lpcap)") + LINE("libpci", "PCI Bus Access Library (libpci, \\-lpci)") +-LINE("libpmc", "Performance Counters Library (libpmc, \\-lpmc)") ++LINE("libpmc", "Performance Monitoring Counters Interface Library (libpmc, \\-lpmc)") + LINE("libposix", "POSIX Compatibility Library (libposix, \\-lposix)") + LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)") + LINE("libprop", "Property Container Object Library (libprop, \\-lprop)") +diff -rupN mdocml-1.12.1-orig//mandoc.h mdocml-1.12.1//mandoc.h +--- mdocml-1.12.1-orig//mandoc.h 2012-05-30 13:45:57.221288794 -0400 ++++ mdocml-1.12.1//mandoc.h 2012-05-30 18:21:29.464174958 -0400 +@@ -397,6 +397,8 @@ struct mchars; + struct mdoc; + struct man; + ++int no_space = 0; ++ + __BEGIN_DECLS + + void *mandoc_calloc(size_t, size_t); +diff -rupN mdocml-1.12.1-orig//man_term.c mdocml-1.12.1//man_term.c +--- mdocml-1.12.1-orig//man_term.c 2012-05-30 13:45:57.241288831 -0400 ++++ mdocml-1.12.1//man_term.c 2012-05-30 18:22:27.164254833 -0400 +@@ -129,7 +129,7 @@ static const struct termact termacts[MAN + { pre_OP, NULL, 0 }, /* OP */ + }; + +- ++extern int nospace_mode; + + void + terminal_man(void *arg, const struct man *man) +@@ -455,7 +455,13 @@ pre_sp(DECL_ARGS) + len = n->child ? a2height(p, n->child->string) : 1; + break; + } +- ++ ++ /* ++ * If no-space mode is on, returns without creating new spaces. ++ */ ++ ++ if (no_space == 1) ++ return(0); + if (0 == len) + term_newln(p); + for (i = 0; i < len; i++) +diff -rupN mdocml-1.12.1-orig//mdoc_validate.c mdocml-1.12.1//mdoc_validate.c +--- mdocml-1.12.1-orig//mdoc_validate.c 2012-05-30 13:45:57.251288839 -0400 ++++ mdocml-1.12.1//mdoc_validate.c 2012-05-30 13:45:58.471290536 -0400 +@@ -2234,6 +2234,8 @@ post_os(POST_ARGS) + mdoc_nmsg(mdoc, n, MANDOCERR_MEM); + return(0); + } ++ if (strncmp(utsname.sysname, "FreeBSD", sizeof("FreeBSD")) == 0) ++ strtok(utsname.release, "-"); + if (strlcat(buf, utsname.release, BUFSIZ) >= BUFSIZ) { + mdoc_nmsg(mdoc, n, MANDOCERR_MEM); + return(0); +diff -rupN mdocml-1.12.1-orig//msec.in mdocml-1.12.1//msec.in +--- mdocml-1.12.1-orig//msec.in 2012-05-30 13:45:57.231288804 -0400 ++++ mdocml-1.12.1//msec.in 2012-05-30 13:45:58.451290497 -0400 +@@ -22,16 +22,16 @@ + * Be sure to escape strings. + */ + +-LINE("1", "General Commands Manual") +-LINE("2", "System Calls Manual") +-LINE("3", "Library Functions Manual") ++LINE("1", "FreeBSD General Commands Manual") ++LINE("2", "FreeBSD System Calls Manual") ++LINE("3", "FreeBSD Library Functions Manual") + LINE("3p", "Perl Library Functions Manual") +-LINE("4", "Kernel Interfaces Manual") +-LINE("5", "File Formats Manual") +-LINE("6", "Games Manual") +-LINE("7", "Miscellaneous Information Manual") +-LINE("8", "System Manager\'s Manual") +-LINE("9", "Kernel Developer\'s Manual") ++LINE("4", "FreeBSD Kernel Interfaces Manual") ++LINE("5", "FreeBSD File Formats Manual") ++LINE("6", "FreeBSD Games Manual") ++LINE("7", "FreeBSD Miscellaneous Information Manual") ++LINE("8", "FreeBSD System Manager\'s Manual") ++LINE("9", "FreeBSD Kernel Developer\'s Manual") + LINE("X11", "X11 Developer\'s Manual") + LINE("X11R6", "X11 Developer\'s Manual") + LINE("unass", "Unassociated") +diff -rupN mdocml-1.12.1-orig//roff.c mdocml-1.12.1//roff.c +--- mdocml-1.12.1-orig//roff.c 2012-05-30 13:45:57.251288839 -0400 ++++ mdocml-1.12.1//roff.c 2012-05-30 18:21:17.314158130 -0400 +@@ -49,14 +49,18 @@ enum rofft { + ROFF_if, + ROFF_ig, + ROFF_it, ++ ROFF_na, + ROFF_ne, + ROFF_nh, ++ ROFF_ni, + ROFF_nr, + ROFF_ns, + ROFF_ps, + ROFF_rm, ++ ROFF_rs, + ROFF_so, + ROFF_ta, ++ ROFF_ti, + ROFF_tr, + ROFF_TS, + ROFF_TE, +@@ -182,6 +186,7 @@ static const char *roff_getstrn(const st + const char *, size_t); + static enum rofferr roff_line_ignore(ROFF_ARGS); + static enum rofferr roff_nr(ROFF_ARGS); ++static enum rofferr roff_ns(ROFF_ARGS); + static void roff_openeqn(struct roff *, const char *, + int, int, const char *); + static enum rofft roff_parse(struct roff *, const char *, int *); +@@ -189,6 +194,7 @@ static enum rofferr roff_parsetext(char + static enum rofferr roff_res(struct roff *, + char **, size_t *, int, int); + static enum rofferr roff_rm(ROFF_ARGS); ++static enum rofferr roff_rs(ROFF_ARGS); + static void roff_setstr(struct roff *, + const char *, const char *, int); + static void roff_setstrn(struct roffkv **, const char *, +@@ -202,6 +208,8 @@ static enum rofferr roff_EN(ROFF_ARGS); + static enum rofferr roff_T_(ROFF_ARGS); + static enum rofferr roff_userdef(ROFF_ARGS); + ++extern int nospace_mode; ++ + /* See roffhash_find() */ + + #define ASCII_HI 126 +@@ -225,14 +233,18 @@ static struct roffmac roffs[ROFF_MAX] = + { "if", roff_cond, roff_cond_text, roff_cond_sub, ROFFMAC_STRUCT, NULL }, + { "ig", roff_block, roff_block_text, roff_block_sub, 0, NULL }, + { "it", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "na", roff_line_ignore, NULL, NULL, 0, NULL }, + { "ne", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nh", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ni", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nr", roff_nr, NULL, NULL, 0, NULL }, +- { "ns", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ns", roff_ns, NULL, NULL, 0, NULL }, + { "ps", roff_line_ignore, NULL, NULL, 0, NULL }, + { "rm", roff_rm, NULL, NULL, 0, NULL }, ++ { "rs", roff_rs, NULL, NULL, 0, NULL }, + { "so", roff_so, NULL, NULL, 0, NULL }, + { "ta", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ti", roff_line_ignore, NULL, NULL, 0, NULL }, + { "tr", roff_tr, NULL, NULL, 0, NULL }, + { "TS", roff_TS, NULL, NULL, 0, NULL }, + { "TE", roff_TE, NULL, NULL, 0, NULL }, +@@ -407,6 +419,12 @@ roff_free(struct roff *r) + free(r); + } + ++/* TODO */ ++static enum rofferr ++roff_ad(ROFF_ARGS) ++{ ++ ++} + + struct roff * + roff_alloc(struct mparse *parse) +@@ -1234,6 +1252,20 @@ roff_regunset(struct roff *r, enum regs + r->regs[(int)reg].set = 0; + } + ++/* TODO */ ++static enum rofferr ++roff_na(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_it(ROFF_ARGS) ++{ ++ ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_nr(ROFF_ARGS) +@@ -1256,6 +1288,69 @@ roff_nr(ROFF_ARGS) + return(ROFF_IGN); + } + ++/* TODO */ ++static enum rofferr ++roff_ns(ROFF_ARGS) ++{ ++ ++ /* ++ * Turns on flag for "no-space mode". Blank lines are ommited from output ++ * as long as this mode is enabled. ++ */ ++ ++ nospace_mode = 1; ++ return(ROFF_IGN); ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ti(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ta(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_hy(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ne(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_nh(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ni(ROFF_ARGS) ++{ ++ ++} ++ ++/* TODO */ ++static enum rofferr ++roff_ps(ROFF_ARGS) ++{ ++ ++} + /* ARGSUSED */ + static enum rofferr + roff_rm(ROFF_ARGS) +@@ -1272,6 +1367,21 @@ roff_rm(ROFF_ARGS) + return(ROFF_IGN); + } + ++/* TODO */ ++static enum rofferr ++roff_rs(ROFF_ARGS) ++{ ++ ++ /* ++ * Turns off flag for "no-space mode". Blank lines will be outputted ++ * if this mode is dissabled. Dissabled by default. ++ */ ++ ++ nospace_mode = 0; ++ return(ROFF_IGN); ++ ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_TE(ROFF_ARGS) Added: soc2012/jhagewood/mdocml/macro_files/nospace_macros ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/macro_files/nospace_macros Wed May 30 22:29:02 2012 (r236776) @@ -0,0 +1,12 @@ +.\" Google Summer of Code 2012 +.\" Jesse Hagewood +.\" jhagewood@freebsd.org +.\" macrofile for requests missing from mdocml. +.\" +.\" .ns - no-space mode on +.\" .rs - no-space mode off + +.de ns +. rm sp +. rm br +.. Added: soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile Wed May 30 22:29:02 2012 (r236776) @@ -0,0 +1,645 @@ +.PHONY: clean install installwww +.SUFFIXES: .sgml .html .md5 .h .h.html +.SUFFIXES: .1 .3 .7 .8 +.SUFFIXES: .1.txt .3.txt .7.txt .8.txt +.SUFFIXES: .1.pdf .3.pdf .7.pdf .8.pdf +.SUFFIXES: .1.ps .3.ps .7.ps .8.ps +.SUFFIXES: .1.html .3.html .7.html .8.html +.SUFFIXES: .1.xhtml .3.xhtml .7.xhtml .8.xhtml + +# 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 4.5\"" + +VERSION = 1.12.1 +VDATE = 23 March 2012 + +# 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 + +# If your system has manpath(1), uncomment this. This is most any +# system that's not OpenBSD or NetBSD. If uncommented, apropos(1), +# mandocdb(8), and man.cgi will popen(3) manpath(1) to get the MANPATH +# variable. +#CFLAGS += -DUSE_MANPATH + +# If your system supports static binaries only, uncomment this. This +# appears only to be BSD UNIX systems (Mac OS X has no support and Linux +# requires -pthreads for static libdb). +STATIC = -static + +CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\"" +CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings +PREFIX = /usr/local +WWWPREFIX = /var/www +HTDOCDIR = $(WWWPREFIX)/htdocs +CGIBINDIR = $(WWWPREFIX)/cgi-bin +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 0755 +INSTALL_DATA = $(INSTALL) -m 0444 +INSTALL_LIB = $(INSTALL) -m 0644 +INSTALL_SOURCE = $(INSTALL) -m 0644 +INSTALL_MAN = $(INSTALL_DATA) + +# Non-BSD systems (Linux, etc.) need -ldb to compile mandocdb and +# apropos. +# However, if you don't have -ldb at all (or it's not native), then +# comment out apropos and mandocdb. +# +#DBLIB = -ldb +DBBIN = apropos mandocdb man.cgi catman whatis +DBLN = llib-lapropos.ln llib-lmandocdb.ln llib-lman.cgi.ln llib-lcatman.ln + +all: mandoc preconv demandoc $(DBBIN) + +SRCS = Makefile \ + TODO \ + apropos.1 \ + apropos.c \ + apropos_db.c \ + apropos_db.h \ + arch.c \ + arch.in \ + att.c \ + att.in \ + catman.8 \ + catman.c \ + cgi.c \ + chars.c \ + chars.in \ + compat_fgetln.c \ + compat_getsubopt.c \ + compat_strlcat.c \ + compat_strlcpy.c \ + config.h.post \ + config.h.pre \ + demandoc.1 \ + demandoc.c \ + eqn.7 \ + eqn.c \ + eqn_html.c \ + eqn_term.c \ + example.style.css \ + external.png \ + html.c \ + html.h \ + index.css \ + index.sgml \ + lib.c \ + lib.in \ + libman.h \ + libmandoc.h \ + libmdoc.h \ + libroff.h \ + main.c \ + main.h \ + man.7 \ + man.c \ + man.cgi.7 \ + man-cgi.css \ + man.h \ + man_hash.c \ + man_html.c \ + man_macro.c \ + man_term.c \ + man_validate.c \ + mandoc.1 \ + mandoc.3 \ + mandoc.c \ + mandoc.h \ + mandoc_char.7 \ + mandocdb.8 \ + mandocdb.c \ + mandocdb.h \ + manpath.c \ + manpath.h \ + mdoc.7 \ + mdoc.c \ + mdoc.h \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_html.c \ + mdoc_macro.c \ + mdoc_man.c \ + mdoc_term.c \ + mdoc_validate.c \ + msec.c \ + msec.in \ + out.c \ + out.h \ + preconv.1 \ + preconv.c \ + predefs.in \ + read.c \ + roff.7 \ + roff.c \ + st.c \ + st.in \ + style.css \ + tbl.7 \ + tbl.c \ + tbl_data.c \ + tbl_html.c \ + tbl_layout.c \ + tbl_opts.c \ + tbl_term.c \ + term.c \ + term.h \ + term_ascii.c \ + term_ps.c \ + test-fgetln.c \ + test-getsubopt.c \ + test-mmap.c \ + test-strlcat.c \ + test-strlcpy.c \ + test-strptime.c \ + tree.c \ + vol.c \ + vol.in \ + whatis.1 + +LIBMAN_OBJS = man.o \ + man_hash.o \ + man_macro.o \ + man_validate.o +LIBMAN_LNS = man.ln \ + man_hash.ln \ + man_macro.ln \ + man_validate.ln + +LIBMDOC_OBJS = arch.o \ + att.o \ + lib.o \ + mdoc.o \ + mdoc_argv.o \ + mdoc_hash.o \ + mdoc_macro.o \ + mdoc_validate.o \ + st.o \ + vol.o +LIBMDOC_LNS = arch.ln \ + att.ln \ + lib.ln \ + mdoc.ln \ + mdoc_argv.ln \ + mdoc_hash.ln \ + mdoc_macro.ln \ + mdoc_validate.ln \ + st.ln \ + vol.ln + +LIBROFF_OBJS = eqn.o \ + roff.o \ + tbl.o \ + tbl_data.o \ + tbl_layout.o \ + tbl_opts.o +LIBROFF_LNS = eqn.ln \ + roff.ln \ + tbl.ln \ + tbl_data.ln \ + tbl_layout.ln \ + tbl_opts.ln + +LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ + $(LIBMDOC_OBJS) \ + $(LIBROFF_OBJS) \ + chars.o \ + mandoc.o \ + msec.o \ + read.o +LIBMANDOC_LNS = $(LIBMAN_LNS) \ + $(LIBMDOC_LNS) \ + $(LIBROFF_LNS) \ + chars.ln \ + mandoc.ln \ + msec.ln \ + read.ln + +COMPAT_OBJS = compat_fgetln.o \ + compat_getsubopt.o \ + compat_strlcat.o \ + compat_strlcpy.o +COMPAT_LNS = compat_fgetln.ln \ + compat_getsubopt.ln \ + compat_strlcat.ln \ + compat_strlcpy.ln + +arch.o arch.ln: arch.in +att.o att.ln: att.in +chars.o chars.ln: chars.in +lib.o lib.ln: lib.in +msec.o msec.ln: msec.in +roff.o roff.ln: predefs.in +st.o st.ln: st.in +vol.o vol.ln: vol.in + +$(LIBMAN_OBJS) $(LIBMAN_LNS): libman.h +$(LIBMDOC_OBJS) $(LIBMDOC_LNS): libmdoc.h +$(LIBROFF_OBJS) $(LIBROFF_LNS): libroff.h +$(LIBMANDOC_OBJS) $(LIBMANDOC_LNS): mandoc.h mdoc.h man.h libmandoc.h config.h + +$(COMPAT_OBJS) $(COMPAT_LNS): config.h + +MANDOC_HTML_OBJS = eqn_html.o \ + html.o \ + man_html.o \ + mdoc_html.o \ + tbl_html.o +MANDOC_HTML_LNS = eqn_html.ln \ + html.ln \ + man_html.ln \ + mdoc_html.ln \ + tbl_html.ln + +MANDOC_MAN_OBJS = mdoc_man.o +MANDOC_MAN_LNS = mdoc_man.ln + +MANDOC_TERM_OBJS = eqn_term.o \ + man_term.o \ + mdoc_term.o \ + term.o \ + term_ascii.o \ + term_ps.o \ + tbl_term.o +MANDOC_TERM_LNS = eqn_term.ln \ + man_term.ln \ + mdoc_term.ln \ + term.ln \ + term_ascii.ln \ + term_ps.ln \ + tbl_term.ln + +MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + main.o \ + out.o \ + tree.o +MANDOC_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + main.ln \ + out.ln \ + tree.ln + +$(MANDOC_HTML_OBJS) $(MANDOC_HTML_LNS): html.h +$(MANDOC_TERM_OBJS) $(MANDOC_TERM_LNS): term.h +$(MANDOC_OBJS) $(MANDOC_LNS): main.h mandoc.h mdoc.h man.h config.h out.h + +MANDOCDB_OBJS = mandocdb.o manpath.o +MANDOCDB_LNS = mandocdb.ln manpath.ln + +$(MANDOCDB_OBJS) $(MANDOCDB_LNS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h + +PRECONV_OBJS = preconv.o +PRECONV_LNS = preconv.ln + +$(PRECONV_OBJS) $(PRECONV_LNS): config.h + +APROPOS_OBJS = apropos.o apropos_db.o manpath.o +APROPOS_LNS = apropos.ln apropos_db.ln manpath.ln + +$(APROPOS_OBJS) $(APROPOS_LNS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + cgi.o \ + apropos_db.o \ + manpath.o \ + out.o \ + tree.o + +CGI_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + cgi.ln \ + apropos_db.ln \ + manpath.ln \ + out.ln \ + tree.ln + +$(CGI_OBJS) $(CGI_LNS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CATMAN_OBJS = catman.o manpath.o +CATMAN_LNS = catman.ln manpath.ln + +$(CATMAN_OBJS) $(CATMAN_LNS): config.h mandoc.h manpath.h mandocdb.h + +DEMANDOC_OBJS = demandoc.o +DEMANDOC_LNS = demandoc.ln + +$(DEMANDOC_OBJS) $(DEMANDOC_LNS): config.h + +INDEX_MANS = apropos.1.html \ + apropos.1.xhtml \ + apropos.1.ps \ + apropos.1.pdf \ + apropos.1.txt \ + catman.8.html \ + catman.8.xhtml \ + catman.8.ps \ + catman.8.pdf \ + catman.8.txt \ + demandoc.1.html \ + demandoc.1.xhtml \ + demandoc.1.ps \ + demandoc.1.pdf \ + demandoc.1.txt \ + mandoc.1.html \ + mandoc.1.xhtml \ + mandoc.1.ps \ + mandoc.1.pdf \ + mandoc.1.txt \ + whatis.1.html \ + whatis.1.xhtml \ + whatis.1.ps \ + whatis.1.pdf \ + whatis.1.txt \ + mandoc.3.html \ + mandoc.3.xhtml \ + mandoc.3.ps \ + mandoc.3.pdf \ + mandoc.3.txt \ + eqn.7.html \ + eqn.7.xhtml \ + eqn.7.ps \ + eqn.7.pdf \ + eqn.7.txt \ + man.7.html \ + man.7.xhtml \ + man.7.ps \ + man.7.pdf \ + man.7.txt \ + man.cgi.7.html \ + man.cgi.7.xhtml \ + man.cgi.7.ps \ + man.cgi.7.pdf \ + man.cgi.7.txt \ + mandoc_char.7.html \ + mandoc_char.7.xhtml \ + mandoc_char.7.ps \ + mandoc_char.7.pdf \ + mandoc_char.7.txt \ + mdoc.7.html \ + mdoc.7.xhtml \ + mdoc.7.ps \ + mdoc.7.pdf \ + mdoc.7.txt \ + preconv.1.html \ + preconv.1.xhtml \ + preconv.1.ps \ + preconv.1.pdf \ + preconv.1.txt \ + roff.7.html \ + roff.7.xhtml \ + roff.7.ps \ + roff.7.pdf \ + roff.7.txt \ + tbl.7.html \ + tbl.7.xhtml \ + tbl.7.ps \ + tbl.7.pdf \ + tbl.7.txt \ + mandocdb.8.html \ + mandocdb.8.xhtml \ + mandocdb.8.ps \ + mandocdb.8.pdf \ + mandocdb.8.txt + +$(INDEX_MANS): mandoc + +INDEX_OBJS = $(INDEX_MANS) \ + man.h.html \ + mandoc.h.html \ + mdoc.h.html \ + mdocml.tar.gz \ + mdocml.md5 + +www: index.html + +lint: llib-lmandoc.ln llib-lpreconv.ln llib-ldemandoc.ln $(DBLN) + +clean: + rm -f libmandoc.a $(LIBMANDOC_OBJS) + rm -f llib-llibmandoc.ln $(LIBMANDOC_LNS) + rm -f mandocdb $(MANDOCDB_OBJS) + rm -f llib-lmandocdb.ln $(MANDOCDB_LNS) + rm -f preconv $(PRECONV_OBJS) + rm -f llib-lpreconv.ln $(PRECONV_LNS) + rm -f apropos whatis $(APROPOS_OBJS) + rm -f llib-lapropos.ln $(APROPOS_LNS) + rm -f man.cgi $(CGI_OBJS) + rm -f llib-lman.cgi.ln $(CGI_LNS) + rm -f catman $(CATMAN_OBJS) + rm -f llib-lcatman.ln $(CATMAN_LNS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f llib-ldemandoc.ln $(DEMANDOC_LNS) + rm -f mandoc $(MANDOC_OBJS) + rm -f llib-lmandoc.ln $(MANDOC_LNS) + rm -f config.h config.log $(COMPAT_OBJS) $(COMPAT_LNS) + rm -f mdocml.tar.gz mdocml-win32.zip mdocml-win64.zip mdocml-macosx.zip + rm -f index.html $(INDEX_OBJS) + rm -rf test-fgetln.dSYM + rm -rf test-strlcpy.dSYM + rm -rf test-strlcat.dSYM + rm -rf test-strptime.dSYM + rm -rf test-mmap.dSYM + rm -rf test-getsubopt.dSYM + rm -rf apropos.dSYM + rm -rf catman.dSYM + rm -rf mandocdb.dSYM + rm -rf whatis.dSYM + +install: all + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(EXAMPLEDIR) + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_PROGRAM) mandoc preconv demandoc $(DESTDIR)$(BINDIR) + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) mandoc.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) + +installcgi: all + mkdir -p $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(HTDOCDIR) + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css + $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR) + +installwww: www + mkdir -p $(PREFIX)/snapshots + mkdir -p $(PREFIX)/binaries + $(INSTALL_DATA) index.html external.png index.css $(PREFIX) + $(INSTALL_DATA) $(INDEX_MANS) style.css $(PREFIX) + $(INSTALL_DATA) mandoc.h.html man.h.html mdoc.h.html $(PREFIX) + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots/mdocml-$(VERSION).tar.gz + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots/mdocml-$(VERSION).md5 + +libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + +llib-llibmandoc.ln: $(COMPAT_LNS) $(LIBMANDOC_LNS) + $(LINT) $(LINTFLAGS) -Clibmandoc $(COMPAT_LNS) $(LIBMANDOC_LNS) + +mandoc: $(MANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a + +llib-lmandoc.ln: $(MANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandoc $(MANDOC_LNS) llib-llibmandoc.ln + +mandocdb: $(MANDOCDB_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB) + +llib-lmandocdb.ln: $(MANDOCDB_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandocdb $(MANDOCDB_LNS) llib-llibmandoc.ln + +preconv: $(PRECONV_OBJS) + $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS) + +llib-lpreconv.ln: $(PRECONV_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS) llib-llibmandoc.ln + +whatis: apropos + cp -f apropos whatis + +apropos: $(APROPOS_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) + +llib-lapropos.ln: $(APROPOS_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Capropos $(APROPOS_LNS) llib-llibmandoc.ln + +catman: $(CATMAN_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(CATMAN_OBJS) libmandoc.a $(DBLIB) + +llib-lcatman.ln: $(CATMAN_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Ccatman $(CATMAN_LNS) llib-llibmandoc.ln + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) + +llib-lman.cgi.ln: $(CGI_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cman.cgi $(CGI_LNS) llib-llibmandoc.ln + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a + +llib-ldemandoc.ln: $(DEMANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cdemandoc $(DEMANDOC_LNS) llib-llibmandoc.ln + +mdocml.md5: mdocml.tar.gz + md5 mdocml.tar.gz >$@ + +mdocml.tar.gz: $(SRCS) + mkdir -p .dist/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .dist/mdocml-$(VERSION) + ( cd .dist/ && tar zcf ../$@ ./ ) + rm -rf .dist/ + +mdocml-win32.zip: $(SRCS) + mkdir -p .win32/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win32 + cp .win32/Makefile .win32/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win32/Makefile.old >.win32/Makefile + ( cd .win32; \ + CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win32 + +mdocml-win64.zip: $(SRCS) + mkdir -p .win64/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win64 + cp .win64/Makefile .win64/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win64/Makefile.old >.win64/Makefile + ( cd .win64; \ + CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win64 + +mdocml-macosx.zip: $(SRCS) + mkdir -p .macosx/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .macosx + ( cd .macosx; \ + CFLAGS="-arch i386 -arch x86_64 -arch ppc" LDFLAGS="-arch i386 -arch x86_64 -arch ppc" make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .macosx + +index.html: $(INDEX_OBJS) + +config.h: config.h.pre config.h.post + rm -f config.log + ( cat config.h.pre; \ + echo; \ + if $(CC) $(CFLAGS) -Werror -o test-fgetln test-fgetln.c >> config.log 2>&1; then \ + echo '#define HAVE_FGETLN'; \ + rm test-fgetln; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strptime test-strptime.c >> config.log 2>&1; then \ + echo '#define HAVE_STRPTIME'; \ + rm test-strptime; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-getsubopt test-getsubopt.c >> config.log 2>&1; then \ + echo '#define HAVE_GETSUBOPT'; \ + rm test-getsubopt; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcat test-strlcat.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCAT'; \ + rm test-strlcat; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-mmap test-mmap.c >> config.log 2>&1; then \ + echo '#define HAVE_MMAP'; \ + rm test-mmap; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcpy test-strlcpy.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCPY'; \ + rm test-strlcpy; \ + fi; \ + echo; \ + cat config.h.post \ + ) > $@ + +.h.h.html: + highlight -I $< >$@ + +.1.1.txt .3.3.txt .7.7.txt .8.8.txt: + ./mandoc -Tascii -Wall,stop $< | col -b >$@ + +.1.1.html .3.3.html .7.7.html .8.8.html: + ./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@ + +.1.1.ps .3.3.ps .7.7.ps .8.8.ps: + ./mandoc -Tps -Wall,stop $< >$@ + +.1.1.xhtml .3.3.xhtml .7.7.xhtml .8.8.xhtml: + ./mandoc -Txhtml -Wall,stop -Ostyle=style.css,man=%N.%S.xhtml,includes=%I.html $< >$@ + +.1.1.pdf .3.3.pdf .7.7.pdf .8.8.pdf: + ./mandoc -Tpdf -Wall,stop $< >$@ + +.sgml.html: + validate --warn $< + sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@ Added: soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO Wed May 30 22:29:02 2012 (r236776) @@ -0,0 +1,372 @@ +************************************************************************ +* Official mandoc TODO. +* $Id: TODO,v 1.129 2012/03/04 23:53:37 schwarze Exp $ +************************************************************************ + +************************************************************************ +* parser bugs +************************************************************************ + +- ".\}" on its own line gets translated to bare ".\&" + which forces pset() into man(7) + and then triggers an unknown macro error + reported by naddy@ Sun, 3 Jul 2011 21:52:24 +0200 + +************************************************************************ +* formatter bugs +************************************************************************ + +- tbl(7): Horizontal and vertical lines are formatted badly: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Thu May 31 07:15:08 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id A92511065672 for ; Thu, 31 May 2012 07:15:07 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 07:15:07 +0000 Date: Thu, 31 May 2012 07:15:07 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531071507.A92511065672@hub.freebsd.org> Cc: Subject: socsvn commit: r236792 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 07:15:08 -0000 Author: jhagewood Date: Thu May 31 07:15:06 2012 New Revision: 236792 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236792 Log: Deleted: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Thu May 31 07:15:16 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 918581065689 for ; Thu, 31 May 2012 07:15:15 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 07:15:15 +0000 Date: Thu, 31 May 2012 07:15:15 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531071515.918581065689@hub.freebsd.org> Cc: Subject: socsvn commit: r236793 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 07:15:16 -0000 Author: jhagewood Date: Thu May 31 07:15:15 2012 New Revision: 236793 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236793 Log: Added: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Thu May 31 07:16:05 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id AEA8E106566B for ; Thu, 31 May 2012 07:16:03 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 07:16:03 +0000 Date: Thu, 31 May 2012 07:16:03 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531071603.AEA8E106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236794 - in soc2012/jhagewood/mdocml: . mdocml-1.12.1 mdocml-1.12.1-orig mdocml_patches X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 07:16:05 -0000 Author: jhagewood Date: Thu May 31 07:16:03 2012 New Revision: 236794 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236794 Log: Added: soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/whatis.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1/whatis.1 soc2012/jhagewood/mdocml/mdocml_patches/ soc2012/jhagewood/mdocml/mdocml_patches/patch-config.txt soc2012/jhagewood/mdocml/mdocml_patches/patch-lib.in.txt soc2012/jhagewood/mdocml/mdocml_patches/patch-mdoc_validate.c soc2012/jhagewood/mdocml/mdocml_patches/patch-msec.in.txt soc2012/jhagewood/mdocml/mdocml_test.sh (contents, props changed) Added: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Thu May 31 07:16:03 2012 (r236794) @@ -0,0 +1,80 @@ +diff -rupN mdocml-1.12.1-orig//libmandoc.h mdocml-1.12.1//libmandoc.h +--- mdocml-1.12.1-orig//libmandoc.h 2012-05-30 13:45:57.251288839 -0400 ++++ mdocml-1.12.1//libmandoc.h 2012-05-31 03:01:28.836378241 -0400 +@@ -31,6 +31,7 @@ enum rofferr { + + enum regs { + REG_nS = 0, /* nS register */ ++ REG_ns = 0, /* ns register (no-space) */ + REG__MAX + }; + +diff -rupN mdocml-1.12.1-orig//roff.c mdocml-1.12.1//roff.c +--- mdocml-1.12.1-orig//roff.c 2012-05-30 13:45:57.251288839 -0400 ++++ mdocml-1.12.1//roff.c 2012-05-31 03:06:10.196382542 -0400 +@@ -55,6 +55,7 @@ enum rofft { + ROFF_ns, + ROFF_ps, + ROFF_rm, ++ ROFF_rs, + ROFF_so, + ROFF_ta, + ROFF_tr, +@@ -182,6 +183,7 @@ static const char *roff_getstrn(const st + const char *, size_t); + static enum rofferr roff_line_ignore(ROFF_ARGS); + static enum rofferr roff_nr(ROFF_ARGS); ++static enum rofferr roff_ns(ROFF_ARGS); + static void roff_openeqn(struct roff *, const char *, + int, int, const char *); + static enum rofft roff_parse(struct roff *, const char *, int *); +@@ -189,6 +191,7 @@ static enum rofferr roff_parsetext(char + static enum rofferr roff_res(struct roff *, + char **, size_t *, int, int); + static enum rofferr roff_rm(ROFF_ARGS); ++static enum rofferr roff_rs(ROFF_ARGS); + static void roff_setstr(struct roff *, + const char *, const char *, int); + static void roff_setstrn(struct roffkv **, const char *, +@@ -228,9 +231,10 @@ static struct roffmac roffs[ROFF_MAX] = + { "ne", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nh", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nr", roff_nr, NULL, NULL, 0, NULL }, +- { "ns", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ns", roff_ns, NULL, NULL, 0, NULL }, + { "ps", roff_line_ignore, NULL, NULL, 0, NULL }, + { "rm", roff_rm, NULL, NULL, 0, NULL }, ++ { "rs", roff_rs, NULL, NULL, 0, NULL }, + { "so", roff_so, NULL, NULL, 0, NULL }, + { "ta", roff_line_ignore, NULL, NULL, 0, NULL }, + { "tr", roff_tr, NULL, NULL, 0, NULL }, +@@ -1256,6 +1260,14 @@ roff_nr(ROFF_ARGS) + return(ROFF_IGN); + } + ++static enum rofferr ++roff_ns(ROFF_ARGS) ++{ ++ /* Sets no-space register to 1. (on) */ ++ REG_ns = 1; ++ return(ROFF_IGN); ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_rm(ROFF_ARGS) +@@ -1272,6 +1284,14 @@ roff_rm(ROFF_ARGS) + return(ROFF_IGN); + } + ++static enum rofferr ++roff_rs(ROFF_ARGS) ++{ ++ /* Sets no-space register to 0. */ ++ REG_ns = 0; ++ return(ROFF_IGN); ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_TE(ROFF_ARGS) Added: soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile Thu May 31 07:16:03 2012 (r236794) @@ -0,0 +1,645 @@ +.PHONY: clean install installwww +.SUFFIXES: .sgml .html .md5 .h .h.html +.SUFFIXES: .1 .3 .7 .8 +.SUFFIXES: .1.txt .3.txt .7.txt .8.txt +.SUFFIXES: .1.pdf .3.pdf .7.pdf .8.pdf +.SUFFIXES: .1.ps .3.ps .7.ps .8.ps +.SUFFIXES: .1.html .3.html .7.html .8.html +.SUFFIXES: .1.xhtml .3.xhtml .7.xhtml .8.xhtml + +# 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 4.5\"" + +VERSION = 1.12.1 +VDATE = 23 March 2012 + +# 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 + +# If your system has manpath(1), uncomment this. This is most any +# system that's not OpenBSD or NetBSD. If uncommented, apropos(1), +# mandocdb(8), and man.cgi will popen(3) manpath(1) to get the MANPATH +# variable. +#CFLAGS += -DUSE_MANPATH + +# If your system supports static binaries only, uncomment this. This +# appears only to be BSD UNIX systems (Mac OS X has no support and Linux +# requires -pthreads for static libdb). +STATIC = -static + +CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\"" +CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings +PREFIX = /usr/local +WWWPREFIX = /var/www +HTDOCDIR = $(WWWPREFIX)/htdocs +CGIBINDIR = $(WWWPREFIX)/cgi-bin +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 0755 +INSTALL_DATA = $(INSTALL) -m 0444 +INSTALL_LIB = $(INSTALL) -m 0644 +INSTALL_SOURCE = $(INSTALL) -m 0644 +INSTALL_MAN = $(INSTALL_DATA) + +# Non-BSD systems (Linux, etc.) need -ldb to compile mandocdb and +# apropos. +# However, if you don't have -ldb at all (or it's not native), then +# comment out apropos and mandocdb. +# +#DBLIB = -ldb +DBBIN = apropos mandocdb man.cgi catman whatis +DBLN = llib-lapropos.ln llib-lmandocdb.ln llib-lman.cgi.ln llib-lcatman.ln + +all: mandoc preconv demandoc $(DBBIN) + +SRCS = Makefile \ + TODO \ + apropos.1 \ + apropos.c \ + apropos_db.c \ + apropos_db.h \ + arch.c \ + arch.in \ + att.c \ + att.in \ + catman.8 \ + catman.c \ + cgi.c \ + chars.c \ + chars.in \ + compat_fgetln.c \ + compat_getsubopt.c \ + compat_strlcat.c \ + compat_strlcpy.c \ + config.h.post \ + config.h.pre \ + demandoc.1 \ + demandoc.c \ + eqn.7 \ + eqn.c \ + eqn_html.c \ + eqn_term.c \ + example.style.css \ + external.png \ + html.c \ + html.h \ + index.css \ + index.sgml \ + lib.c \ + lib.in \ + libman.h \ + libmandoc.h \ + libmdoc.h \ + libroff.h \ + main.c \ + main.h \ + man.7 \ + man.c \ + man.cgi.7 \ + man-cgi.css \ + man.h \ + man_hash.c \ + man_html.c \ + man_macro.c \ + man_term.c \ + man_validate.c \ + mandoc.1 \ + mandoc.3 \ + mandoc.c \ + mandoc.h \ + mandoc_char.7 \ + mandocdb.8 \ + mandocdb.c \ + mandocdb.h \ + manpath.c \ + manpath.h \ + mdoc.7 \ + mdoc.c \ + mdoc.h \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_html.c \ + mdoc_macro.c \ + mdoc_man.c \ + mdoc_term.c \ + mdoc_validate.c \ + msec.c \ + msec.in \ + out.c \ + out.h \ + preconv.1 \ + preconv.c \ + predefs.in \ + read.c \ + roff.7 \ + roff.c \ + st.c \ + st.in \ + style.css \ + tbl.7 \ + tbl.c \ + tbl_data.c \ + tbl_html.c \ + tbl_layout.c \ + tbl_opts.c \ + tbl_term.c \ + term.c \ + term.h \ + term_ascii.c \ + term_ps.c \ + test-fgetln.c \ + test-getsubopt.c \ + test-mmap.c \ + test-strlcat.c \ + test-strlcpy.c \ + test-strptime.c \ + tree.c \ + vol.c \ + vol.in \ + whatis.1 + +LIBMAN_OBJS = man.o \ + man_hash.o \ + man_macro.o \ + man_validate.o +LIBMAN_LNS = man.ln \ + man_hash.ln \ + man_macro.ln \ + man_validate.ln + +LIBMDOC_OBJS = arch.o \ + att.o \ + lib.o \ + mdoc.o \ + mdoc_argv.o \ + mdoc_hash.o \ + mdoc_macro.o \ + mdoc_validate.o \ + st.o \ + vol.o +LIBMDOC_LNS = arch.ln \ + att.ln \ + lib.ln \ + mdoc.ln \ + mdoc_argv.ln \ + mdoc_hash.ln \ + mdoc_macro.ln \ + mdoc_validate.ln \ + st.ln \ + vol.ln + +LIBROFF_OBJS = eqn.o \ + roff.o \ + tbl.o \ + tbl_data.o \ + tbl_layout.o \ + tbl_opts.o +LIBROFF_LNS = eqn.ln \ + roff.ln \ + tbl.ln \ + tbl_data.ln \ + tbl_layout.ln \ + tbl_opts.ln + +LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ + $(LIBMDOC_OBJS) \ + $(LIBROFF_OBJS) \ + chars.o \ + mandoc.o \ + msec.o \ + read.o +LIBMANDOC_LNS = $(LIBMAN_LNS) \ + $(LIBMDOC_LNS) \ + $(LIBROFF_LNS) \ + chars.ln \ + mandoc.ln \ + msec.ln \ + read.ln + +COMPAT_OBJS = compat_fgetln.o \ + compat_getsubopt.o \ + compat_strlcat.o \ + compat_strlcpy.o +COMPAT_LNS = compat_fgetln.ln \ + compat_getsubopt.ln \ + compat_strlcat.ln \ + compat_strlcpy.ln + +arch.o arch.ln: arch.in +att.o att.ln: att.in +chars.o chars.ln: chars.in +lib.o lib.ln: lib.in +msec.o msec.ln: msec.in +roff.o roff.ln: predefs.in +st.o st.ln: st.in +vol.o vol.ln: vol.in + +$(LIBMAN_OBJS) $(LIBMAN_LNS): libman.h +$(LIBMDOC_OBJS) $(LIBMDOC_LNS): libmdoc.h +$(LIBROFF_OBJS) $(LIBROFF_LNS): libroff.h +$(LIBMANDOC_OBJS) $(LIBMANDOC_LNS): mandoc.h mdoc.h man.h libmandoc.h config.h + +$(COMPAT_OBJS) $(COMPAT_LNS): config.h + +MANDOC_HTML_OBJS = eqn_html.o \ + html.o \ + man_html.o \ + mdoc_html.o \ + tbl_html.o +MANDOC_HTML_LNS = eqn_html.ln \ + html.ln \ + man_html.ln \ + mdoc_html.ln \ + tbl_html.ln + +MANDOC_MAN_OBJS = mdoc_man.o +MANDOC_MAN_LNS = mdoc_man.ln + +MANDOC_TERM_OBJS = eqn_term.o \ + man_term.o \ + mdoc_term.o \ + term.o \ + term_ascii.o \ + term_ps.o \ + tbl_term.o +MANDOC_TERM_LNS = eqn_term.ln \ + man_term.ln \ + mdoc_term.ln \ + term.ln \ + term_ascii.ln \ + term_ps.ln \ + tbl_term.ln + +MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + main.o \ + out.o \ + tree.o +MANDOC_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + main.ln \ + out.ln \ + tree.ln + +$(MANDOC_HTML_OBJS) $(MANDOC_HTML_LNS): html.h +$(MANDOC_TERM_OBJS) $(MANDOC_TERM_LNS): term.h +$(MANDOC_OBJS) $(MANDOC_LNS): main.h mandoc.h mdoc.h man.h config.h out.h + +MANDOCDB_OBJS = mandocdb.o manpath.o +MANDOCDB_LNS = mandocdb.ln manpath.ln + +$(MANDOCDB_OBJS) $(MANDOCDB_LNS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h + +PRECONV_OBJS = preconv.o +PRECONV_LNS = preconv.ln + +$(PRECONV_OBJS) $(PRECONV_LNS): config.h + +APROPOS_OBJS = apropos.o apropos_db.o manpath.o +APROPOS_LNS = apropos.ln apropos_db.ln manpath.ln + +$(APROPOS_OBJS) $(APROPOS_LNS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + cgi.o \ + apropos_db.o \ + manpath.o \ + out.o \ + tree.o + +CGI_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + cgi.ln \ + apropos_db.ln \ + manpath.ln \ + out.ln \ + tree.ln + +$(CGI_OBJS) $(CGI_LNS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CATMAN_OBJS = catman.o manpath.o +CATMAN_LNS = catman.ln manpath.ln + +$(CATMAN_OBJS) $(CATMAN_LNS): config.h mandoc.h manpath.h mandocdb.h + +DEMANDOC_OBJS = demandoc.o +DEMANDOC_LNS = demandoc.ln + +$(DEMANDOC_OBJS) $(DEMANDOC_LNS): config.h + +INDEX_MANS = apropos.1.html \ + apropos.1.xhtml \ + apropos.1.ps \ + apropos.1.pdf \ + apropos.1.txt \ + catman.8.html \ + catman.8.xhtml \ + catman.8.ps \ + catman.8.pdf \ + catman.8.txt \ + demandoc.1.html \ + demandoc.1.xhtml \ + demandoc.1.ps \ + demandoc.1.pdf \ + demandoc.1.txt \ + mandoc.1.html \ + mandoc.1.xhtml \ + mandoc.1.ps \ + mandoc.1.pdf \ + mandoc.1.txt \ + whatis.1.html \ + whatis.1.xhtml \ + whatis.1.ps \ + whatis.1.pdf \ + whatis.1.txt \ + mandoc.3.html \ + mandoc.3.xhtml \ + mandoc.3.ps \ + mandoc.3.pdf \ + mandoc.3.txt \ + eqn.7.html \ + eqn.7.xhtml \ + eqn.7.ps \ + eqn.7.pdf \ + eqn.7.txt \ + man.7.html \ + man.7.xhtml \ + man.7.ps \ + man.7.pdf \ + man.7.txt \ + man.cgi.7.html \ + man.cgi.7.xhtml \ + man.cgi.7.ps \ + man.cgi.7.pdf \ + man.cgi.7.txt \ + mandoc_char.7.html \ + mandoc_char.7.xhtml \ + mandoc_char.7.ps \ + mandoc_char.7.pdf \ + mandoc_char.7.txt \ + mdoc.7.html \ + mdoc.7.xhtml \ + mdoc.7.ps \ + mdoc.7.pdf \ + mdoc.7.txt \ + preconv.1.html \ + preconv.1.xhtml \ + preconv.1.ps \ + preconv.1.pdf \ + preconv.1.txt \ + roff.7.html \ + roff.7.xhtml \ + roff.7.ps \ + roff.7.pdf \ + roff.7.txt \ + tbl.7.html \ + tbl.7.xhtml \ + tbl.7.ps \ + tbl.7.pdf \ + tbl.7.txt \ + mandocdb.8.html \ + mandocdb.8.xhtml \ + mandocdb.8.ps \ + mandocdb.8.pdf \ + mandocdb.8.txt + +$(INDEX_MANS): mandoc + +INDEX_OBJS = $(INDEX_MANS) \ + man.h.html \ + mandoc.h.html \ + mdoc.h.html \ + mdocml.tar.gz \ + mdocml.md5 + +www: index.html + +lint: llib-lmandoc.ln llib-lpreconv.ln llib-ldemandoc.ln $(DBLN) + +clean: + rm -f libmandoc.a $(LIBMANDOC_OBJS) + rm -f llib-llibmandoc.ln $(LIBMANDOC_LNS) + rm -f mandocdb $(MANDOCDB_OBJS) + rm -f llib-lmandocdb.ln $(MANDOCDB_LNS) + rm -f preconv $(PRECONV_OBJS) + rm -f llib-lpreconv.ln $(PRECONV_LNS) + rm -f apropos whatis $(APROPOS_OBJS) + rm -f llib-lapropos.ln $(APROPOS_LNS) + rm -f man.cgi $(CGI_OBJS) + rm -f llib-lman.cgi.ln $(CGI_LNS) + rm -f catman $(CATMAN_OBJS) + rm -f llib-lcatman.ln $(CATMAN_LNS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f llib-ldemandoc.ln $(DEMANDOC_LNS) + rm -f mandoc $(MANDOC_OBJS) + rm -f llib-lmandoc.ln $(MANDOC_LNS) + rm -f config.h config.log $(COMPAT_OBJS) $(COMPAT_LNS) + rm -f mdocml.tar.gz mdocml-win32.zip mdocml-win64.zip mdocml-macosx.zip + rm -f index.html $(INDEX_OBJS) + rm -rf test-fgetln.dSYM + rm -rf test-strlcpy.dSYM + rm -rf test-strlcat.dSYM + rm -rf test-strptime.dSYM + rm -rf test-mmap.dSYM + rm -rf test-getsubopt.dSYM + rm -rf apropos.dSYM + rm -rf catman.dSYM + rm -rf mandocdb.dSYM + rm -rf whatis.dSYM + +install: all + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(EXAMPLEDIR) + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_PROGRAM) mandoc preconv demandoc $(DESTDIR)$(BINDIR) + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) mandoc.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) + +installcgi: all + mkdir -p $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(HTDOCDIR) + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css + $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR) + +installwww: www + mkdir -p $(PREFIX)/snapshots + mkdir -p $(PREFIX)/binaries + $(INSTALL_DATA) index.html external.png index.css $(PREFIX) + $(INSTALL_DATA) $(INDEX_MANS) style.css $(PREFIX) + $(INSTALL_DATA) mandoc.h.html man.h.html mdoc.h.html $(PREFIX) + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots/mdocml-$(VERSION).tar.gz + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots/mdocml-$(VERSION).md5 + +libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + +llib-llibmandoc.ln: $(COMPAT_LNS) $(LIBMANDOC_LNS) + $(LINT) $(LINTFLAGS) -Clibmandoc $(COMPAT_LNS) $(LIBMANDOC_LNS) + +mandoc: $(MANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a + +llib-lmandoc.ln: $(MANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandoc $(MANDOC_LNS) llib-llibmandoc.ln + +mandocdb: $(MANDOCDB_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB) + +llib-lmandocdb.ln: $(MANDOCDB_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandocdb $(MANDOCDB_LNS) llib-llibmandoc.ln + +preconv: $(PRECONV_OBJS) + $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS) + +llib-lpreconv.ln: $(PRECONV_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS) llib-llibmandoc.ln + +whatis: apropos + cp -f apropos whatis + +apropos: $(APROPOS_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) + +llib-lapropos.ln: $(APROPOS_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Capropos $(APROPOS_LNS) llib-llibmandoc.ln + +catman: $(CATMAN_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(CATMAN_OBJS) libmandoc.a $(DBLIB) + +llib-lcatman.ln: $(CATMAN_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Ccatman $(CATMAN_LNS) llib-llibmandoc.ln + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) + +llib-lman.cgi.ln: $(CGI_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cman.cgi $(CGI_LNS) llib-llibmandoc.ln + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a + +llib-ldemandoc.ln: $(DEMANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cdemandoc $(DEMANDOC_LNS) llib-llibmandoc.ln + +mdocml.md5: mdocml.tar.gz + md5 mdocml.tar.gz >$@ + +mdocml.tar.gz: $(SRCS) + mkdir -p .dist/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .dist/mdocml-$(VERSION) + ( cd .dist/ && tar zcf ../$@ ./ ) + rm -rf .dist/ + +mdocml-win32.zip: $(SRCS) + mkdir -p .win32/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win32 + cp .win32/Makefile .win32/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win32/Makefile.old >.win32/Makefile + ( cd .win32; \ + CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win32 + +mdocml-win64.zip: $(SRCS) + mkdir -p .win64/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win64 + cp .win64/Makefile .win64/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win64/Makefile.old >.win64/Makefile + ( cd .win64; \ + CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win64 + +mdocml-macosx.zip: $(SRCS) + mkdir -p .macosx/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .macosx + ( cd .macosx; \ + CFLAGS="-arch i386 -arch x86_64 -arch ppc" LDFLAGS="-arch i386 -arch x86_64 -arch ppc" make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .macosx + +index.html: $(INDEX_OBJS) + +config.h: config.h.pre config.h.post + rm -f config.log + ( cat config.h.pre; \ + echo; \ + if $(CC) $(CFLAGS) -Werror -o test-fgetln test-fgetln.c >> config.log 2>&1; then \ + echo '#define HAVE_FGETLN'; \ + rm test-fgetln; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strptime test-strptime.c >> config.log 2>&1; then \ + echo '#define HAVE_STRPTIME'; \ + rm test-strptime; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-getsubopt test-getsubopt.c >> config.log 2>&1; then \ + echo '#define HAVE_GETSUBOPT'; \ + rm test-getsubopt; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcat test-strlcat.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCAT'; \ + rm test-strlcat; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-mmap test-mmap.c >> config.log 2>&1; then \ + echo '#define HAVE_MMAP'; \ + rm test-mmap; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcpy test-strlcpy.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCPY'; \ + rm test-strlcpy; \ + fi; \ + echo; \ + cat config.h.post \ + ) > $@ + +.h.h.html: + highlight -I $< >$@ + +.1.1.txt .3.3.txt .7.7.txt .8.8.txt: + ./mandoc -Tascii -Wall,stop $< | col -b >$@ + +.1.1.html .3.3.html .7.7.html .8.8.html: + ./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@ + +.1.1.ps .3.3.ps .7.7.ps .8.8.ps: + ./mandoc -Tps -Wall,stop $< >$@ + +.1.1.xhtml .3.3.xhtml .7.7.xhtml .8.8.xhtml: + ./mandoc -Txhtml -Wall,stop -Ostyle=style.css,man=%N.%S.xhtml,includes=%I.html $< >$@ + +.1.1.pdf .3.3.pdf .7.7.pdf .8.8.pdf: + ./mandoc -Tpdf -Wall,stop $< >$@ + +.sgml.html: + validate --warn $< + sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@ Added: soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO Thu May 31 07:16:03 2012 (r236794) @@ -0,0 +1,372 @@ +************************************************************************ +* Official mandoc TODO. +* $Id: TODO,v 1.129 2012/03/04 23:53:37 schwarze Exp $ +************************************************************************ + +************************************************************************ +* parser bugs +************************************************************************ + +- ".\}" on its own line gets translated to bare ".\&" + which forces pset() into man(7) + and then triggers an unknown macro error + reported by naddy@ Sun, 3 Jul 2011 21:52:24 +0200 + +************************************************************************ +* formatter bugs +************************************************************************ + +- tbl(7): Horizontal and vertical lines are formatted badly: + With the box option, there is too much white space at the end of cells. + Horizontal lines from "=" lines are a bit too long. + yuri dot pankov at gmail dot com Thu, 14 Apr 2011 05:45:26 +0400 + +************************************************************************ +* missing features +************************************************************************ + +--- missing roff features ---------------------------------------------- + +- The pod2man preamble wants \h'...' with quoted numerical arguments, + see for example AUTHORS in MooseX::Getopt.3p, p5-MooseX-Getopt. + reported by Andreas Voegele + Tue, 22 Nov 2011 15:34:47 +0100 on ports@ + +- .if n \{ + .br\} + should cause an extra space to be raised. + +- .ad (adjust margins) + .ad l -- adjust left margin only (flush left) + .ad r -- adjust right margin only (flush right) + .ad c -- center text on line + .ad b -- adjust both margins (alias: .ad n) + .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). + +- .it (line traps) occur in mysql(1), yasm_arch(7) + generated by DocBook XSL Stylesheets v1.71.1 + reported by brad@ Sat, 15 Jan 2011 15:48:18 -0500 + +- .ns (no-space mode) occurs in xine-config(1) + reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + +- xloadimage(1) wants .ti (temporary indent), rep by naddy@ + +- .ta (tab settings) occurs in ircbug(1) and probably gnats(1) + reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 + +- \c (interrupted text) occurs in chat(8) + +- using undefined strings or macros defines them to be empty + wl@ Mon, 14 Nov 2011 14:37:01 +0000 + +--- missing mdoc features ---------------------------------------------- + +- fix bad block nesting involving multiple identical explicit blocks + see the OpenBSD mdoc_macro.c 1.47 commit message + +- .Bl -column .Xo support is missing + ultimate goal: + restore .Xr and .Dv to + lib/libc/compat-43/sigvec.3 + lib/libc/gen/signal.3 + lib/libc/sys/sigaction.2 + +- 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 + +- \\ is now implemented correctly + * when defining strings and macros using .ds and .de + * when parsing roff(7) and man(7) macro arguments + It does not yet work in mdoc(7) macro arguments + because libmdoc does not yet use mandoc_getarg(). + Also check what happens in plain text, it must be identical to \e. + +- .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). + +- implement blank `Bl -column', such as + .Bl -column + .It foo Ta bar + .El + +- explicitly disallow nested `Bl -column', which would clobber internal + flags defined for struct mdoc_macro + +- 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 + ugly code from login.conf(5): + .Bl -column minpasswordlen program xetcxmotd + .It path Ta path Ta value of Dv _PATH_DEFPATH + .br + Default search path. + reported by Michal Mazurek + via jmc@ Thu, 7 Apr 2011 16:00:53 +0059 + +- inside `.Bl -column' phrases, punctuation is handled like normal + text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -." + +- inside `.Bl -column' phrases, TERMP_IGNDELIM handling by `Pf' + is not safe, e.g. `.Bl -column .It Pf a b .' gives "ab." + but should give "ab ." + +- set a meaningful default if no `Bl' list type is assigned + +- have a blank `It' head for `Bl -tag' not puke + +- prohibit `Nm' from having non-text HEAD children + (e.g., NetBSD mDNSShared/dns-sd.1) + (mdoc_html.c and mdoc_term.c `Nm' handlers can be slightly simplified) + +- 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 + macro, while mandoc treats it as a block macro and breaks the line. + No idea how the logic for distinguishing in-line and block instances + should be, needs investigation. + uqs@ Thu, 2 Jun 2011 11:03:51 +0200 + uqs@ Thu, 2 Jun 2011 11:33:35 +0200 + +--- missing man features ----------------------------------------------- + +- groff an-ext.tmac macros (.UR, .UE) occur in xine(5) + reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + +- -T[x]html doesn't stipulate non-collapsing spaces in literal mode + +--- missing tbl features ----------------------------------------------- + +- implement basic non-parametric .de to support e.g. sox(1) + reported by naddy@ Sat, 16 Oct 2010 23:51:57 +0200 + *** sox(1) still doesn't work, tbl(1) errors need investigation + +- 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 + +--- missing misc features ---------------------------------------------- + +- clean up escape sequence handling, creating three classes: + (1) fully implemented, or parsed and ignored without loss of content + (2) unimplemented, potentially causing loss of content + or serious mangling of formatting (e.g. \n) -> ERROR + see textproc/mgdiff(1) for nice examples + (3) undefined, just output the character -> perhaps WARNING + +- The \t escape sequence is the same as a literal tab, see for example + the ASCII table in hexdump(1) where + .Bl -column \&000_nu \&001_so \&002_st \&003_et \&004_eo + .It \&000\ nul\t001\ soh\t002\ stx\t003\ etx\t004\ eot\t005\ enq + produces + 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq + and the example in oldrdist(1) + +- 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. + For details, see http://docutils.sourceforge.net/rst.html + noted by stsp@ Sat, 24 Apr 2010 09:17:55 +0200 + reminded by nicm@ Mon, 3 May 2010 09:52:41 +0100 + +- check compatibility with Plan9: + http://swtch.com/usr/local/plan9/tmac/tmac.an + http://swtch.com/plan9port/man/man7/man.html + "Anthony J. Bentley" 28 Dec 2010 21:58:40 -0700 + +************************************************************************ +* formatting issues: ugly output +************************************************************************ + +- a column list with blank `Ta' cells triggers a spurrious + start-with-whitespace printing of a newline + +- double quotes inside double quotes are escaped by doubling them + implement this in mdoc(7), too + so far, we only have it in roff(7) and man(7) + reminded by millert@ Thu, 09 Dec 2010 17:29:52 -0500 + +- perl(1) SYNOPSIS looks bad; reported by deraadt@ + 1) man(7) seems to need SYNOPSIS .Nm blocks, too + +- In .Bl -column, + .It Em AuthenticationKey Length + 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 + +- 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 + +- .%T can have trailing punctuation. Currently, it puts the trailing + punctuation into a trailing MDOC_TEXT element inside its own scope. + That element should rather be outside its scope, such that the + punctuation does not get underlines. This is not trivial to + implement because .%T then needs some features of in_line_eoln() - + 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". + +- in enclosures, mandoc sometimes fancies a bogus end of sentence + reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059 + +************************************************************************ +* formatting issues: gratuitous differences +************************************************************************ + +- .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. + +- In .Bl -bullet, the groff bullet is "+\b+\bo\bo", the mandoc bullet + is just "o\bo". + see for example OpenBSD ksh(1) + +- The characters "|" and "\*(Ba" should never be bold, + not even in the middle of a word, e.g. ".Cm b\*(Bac" in + "mknod [-m mode] name b|c major minor" + in OpenBSD ksh(1) + +- A bogus .Pp between two .It must not produce a double blank line, + see between -R and -r in OpenBSD rm(1), before "update" in mount(8), + or in DIAGNOSTICS in init(8), or before "is always true" in ksh(1). + The same happens with .Pp just before .El, see bgpd.conf(5). + Also have `It' complain if `Pp' is invoked at certain times (not + -compact?). + +- .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) + +- 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). + +- 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 + +- .Nx 1.0a + should be "NetBSD 1.0A", not "NetBSD 1.0a", + see OpenBSD ccdconfig(8). + +- 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). + +- When the -width string contains macros, the macros must be rendered + before measuring the width, for example + .Bl -tag -width ".Dv message" + in magic(5), located in src/usr.bin/file, is the same + as -width 7n, not -width 11n. + The same applies to .Bl -column column widths; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Thu May 31 07:23:07 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 321BA106566B for ; Thu, 31 May 2012 07:23:06 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 07:23:06 +0000 Date: Thu, 31 May 2012 07:23:06 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531072306.321BA106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236795 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 07:23:07 -0000 Author: jhagewood Date: Thu May 31 07:23:05 2012 New Revision: 236795 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236795 Log: Deleted: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Thu May 31 07:23:23 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id E772A106566C for ; Thu, 31 May 2012 07:23:21 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 07:23:21 +0000 Date: Thu, 31 May 2012 07:23:21 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531072321.E772A106566C@hub.freebsd.org> Cc: Subject: socsvn commit: r236796 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 07:23:23 -0000 Author: jhagewood Date: Thu May 31 07:23:21 2012 New Revision: 236796 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236796 Log: Added: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Thu May 31 07:24:04 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 296C9106564A for ; Thu, 31 May 2012 07:24:02 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 07:24:02 +0000 Date: Thu, 31 May 2012 07:24:02 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531072402.296C9106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r236797 - in soc2012/jhagewood/mdocml: . mdocml-1.12.1 mdocml-1.12.1-orig mdocml_patches X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 07:24:04 -0000 Author: jhagewood Date: Thu May 31 07:24:01 2012 New Revision: 236797 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236797 Log: Added: soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/whatis.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1/whatis.1 soc2012/jhagewood/mdocml/mdocml_patches/ soc2012/jhagewood/mdocml/mdocml_patches/patch-config.txt soc2012/jhagewood/mdocml/mdocml_patches/patch-lib.in.txt soc2012/jhagewood/mdocml/mdocml_patches/patch-mdoc_validate.c soc2012/jhagewood/mdocml/mdocml_patches/patch-msec.in.txt soc2012/jhagewood/mdocml/mdocml_test.sh (contents, props changed) Added: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Thu May 31 07:24:01 2012 (r236797) @@ -0,0 +1,119 @@ +diff -rupN mdocml-1.12.1-orig//libmandoc.h mdocml-1.12.1//libmandoc.h +--- mdocml-1.12.1-orig//libmandoc.h 2012-05-30 13:45:57.251288839 -0400 ++++ mdocml-1.12.1//libmandoc.h 2012-05-31 03:01:28.836378241 -0400 +@@ -31,6 +31,7 @@ enum rofferr { + + enum regs { + REG_nS = 0, /* nS register */ ++ REG_ns = 0, /* ns register (no-space) */ + REG__MAX + }; + +diff -rupN mdocml-1.12.1-orig//mdoc_html.c mdocml-1.12.1//mdoc_html.c +--- mdocml-1.12.1-orig//mdoc_html.c 2012-05-30 13:45:57.221288794 -0400 ++++ mdocml-1.12.1//mdoc_html.c 2012-05-31 03:21:44.956396839 -0400 +@@ -767,10 +767,12 @@ mdoc_xr_pre(MDOC_ARGS) + static int + mdoc_ns_pre(MDOC_ARGS) + { +- +- if ( ! (MDOC_LINE & n->flags)) +- h->flags |= HTML_NOSPACE; +- return(1); ++ if(!roff_regisset(m->roff, REG_ns)) ++ { ++ if ( ! (MDOC_LINE & n->flags)) ++ h->flags |= HTML_NOSPACE; ++ return(1); ++ } + } + + +diff -rupN mdocml-1.12.1-orig//mdoc_term.c mdocml-1.12.1//mdoc_term.c +--- mdocml-1.12.1-orig//mdoc_term.c 2012-05-30 13:45:57.241288831 -0400 ++++ mdocml-1.12.1//mdoc_term.c 2012-05-31 03:19:48.736395055 -0400 +@@ -1147,9 +1147,12 @@ termp_an_post(DECL_ARGS) + static int + termp_ns_pre(DECL_ARGS) + { +- +- if ( ! (MDOC_LINE & n->flags)) +- p->flags |= TERMP_NOSPACE; ++ if (!roff_regisset(m->roff, REG_ns)) ++ { ++ if ( ! (MDOC_LINE & n->flags)) ++ p->flags |= TERMP_NOSPACE; ++ return(1); ++ } + return(1); + } + +diff -rupN mdocml-1.12.1-orig//roff.c mdocml-1.12.1//roff.c +--- mdocml-1.12.1-orig//roff.c 2012-05-30 13:45:57.251288839 -0400 ++++ mdocml-1.12.1//roff.c 2012-05-31 03:06:10.196382542 -0400 +@@ -55,6 +55,7 @@ enum rofft { + ROFF_ns, + ROFF_ps, + ROFF_rm, ++ ROFF_rs, + ROFF_so, + ROFF_ta, + ROFF_tr, +@@ -182,6 +183,7 @@ static const char *roff_getstrn(const st + const char *, size_t); + static enum rofferr roff_line_ignore(ROFF_ARGS); + static enum rofferr roff_nr(ROFF_ARGS); ++static enum rofferr roff_ns(ROFF_ARGS); + static void roff_openeqn(struct roff *, const char *, + int, int, const char *); + static enum rofft roff_parse(struct roff *, const char *, int *); +@@ -189,6 +191,7 @@ static enum rofferr roff_parsetext(char + static enum rofferr roff_res(struct roff *, + char **, size_t *, int, int); + static enum rofferr roff_rm(ROFF_ARGS); ++static enum rofferr roff_rs(ROFF_ARGS); + static void roff_setstr(struct roff *, + const char *, const char *, int); + static void roff_setstrn(struct roffkv **, const char *, +@@ -228,9 +231,10 @@ static struct roffmac roffs[ROFF_MAX] = + { "ne", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nh", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nr", roff_nr, NULL, NULL, 0, NULL }, +- { "ns", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ns", roff_ns, NULL, NULL, 0, NULL }, + { "ps", roff_line_ignore, NULL, NULL, 0, NULL }, + { "rm", roff_rm, NULL, NULL, 0, NULL }, ++ { "rs", roff_rs, NULL, NULL, 0, NULL }, + { "so", roff_so, NULL, NULL, 0, NULL }, + { "ta", roff_line_ignore, NULL, NULL, 0, NULL }, + { "tr", roff_tr, NULL, NULL, 0, NULL }, +@@ -1256,6 +1260,14 @@ roff_nr(ROFF_ARGS) + return(ROFF_IGN); + } + ++static enum rofferr ++roff_ns(ROFF_ARGS) ++{ ++ /* Sets no-space register to 1. (on) */ ++ REG_ns = 1; ++ return(ROFF_IGN); ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_rm(ROFF_ARGS) +@@ -1272,6 +1284,14 @@ roff_rm(ROFF_ARGS) + return(ROFF_IGN); + } + ++static enum rofferr ++roff_rs(ROFF_ARGS) ++{ ++ /* Sets no-space register to 0. */ ++ REG_ns = 0; ++ return(ROFF_IGN); ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_TE(ROFF_ARGS) Added: soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile Thu May 31 07:24:01 2012 (r236797) @@ -0,0 +1,645 @@ +.PHONY: clean install installwww +.SUFFIXES: .sgml .html .md5 .h .h.html +.SUFFIXES: .1 .3 .7 .8 +.SUFFIXES: .1.txt .3.txt .7.txt .8.txt +.SUFFIXES: .1.pdf .3.pdf .7.pdf .8.pdf +.SUFFIXES: .1.ps .3.ps .7.ps .8.ps +.SUFFIXES: .1.html .3.html .7.html .8.html +.SUFFIXES: .1.xhtml .3.xhtml .7.xhtml .8.xhtml + +# 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 4.5\"" + +VERSION = 1.12.1 +VDATE = 23 March 2012 + +# 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 + +# If your system has manpath(1), uncomment this. This is most any +# system that's not OpenBSD or NetBSD. If uncommented, apropos(1), +# mandocdb(8), and man.cgi will popen(3) manpath(1) to get the MANPATH +# variable. +#CFLAGS += -DUSE_MANPATH + +# If your system supports static binaries only, uncomment this. This +# appears only to be BSD UNIX systems (Mac OS X has no support and Linux +# requires -pthreads for static libdb). +STATIC = -static + +CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\"" +CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings +PREFIX = /usr/local +WWWPREFIX = /var/www +HTDOCDIR = $(WWWPREFIX)/htdocs +CGIBINDIR = $(WWWPREFIX)/cgi-bin +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 0755 +INSTALL_DATA = $(INSTALL) -m 0444 +INSTALL_LIB = $(INSTALL) -m 0644 +INSTALL_SOURCE = $(INSTALL) -m 0644 +INSTALL_MAN = $(INSTALL_DATA) + +# Non-BSD systems (Linux, etc.) need -ldb to compile mandocdb and +# apropos. +# However, if you don't have -ldb at all (or it's not native), then +# comment out apropos and mandocdb. +# +#DBLIB = -ldb +DBBIN = apropos mandocdb man.cgi catman whatis +DBLN = llib-lapropos.ln llib-lmandocdb.ln llib-lman.cgi.ln llib-lcatman.ln + +all: mandoc preconv demandoc $(DBBIN) + +SRCS = Makefile \ + TODO \ + apropos.1 \ + apropos.c \ + apropos_db.c \ + apropos_db.h \ + arch.c \ + arch.in \ + att.c \ + att.in \ + catman.8 \ + catman.c \ + cgi.c \ + chars.c \ + chars.in \ + compat_fgetln.c \ + compat_getsubopt.c \ + compat_strlcat.c \ + compat_strlcpy.c \ + config.h.post \ + config.h.pre \ + demandoc.1 \ + demandoc.c \ + eqn.7 \ + eqn.c \ + eqn_html.c \ + eqn_term.c \ + example.style.css \ + external.png \ + html.c \ + html.h \ + index.css \ + index.sgml \ + lib.c \ + lib.in \ + libman.h \ + libmandoc.h \ + libmdoc.h \ + libroff.h \ + main.c \ + main.h \ + man.7 \ + man.c \ + man.cgi.7 \ + man-cgi.css \ + man.h \ + man_hash.c \ + man_html.c \ + man_macro.c \ + man_term.c \ + man_validate.c \ + mandoc.1 \ + mandoc.3 \ + mandoc.c \ + mandoc.h \ + mandoc_char.7 \ + mandocdb.8 \ + mandocdb.c \ + mandocdb.h \ + manpath.c \ + manpath.h \ + mdoc.7 \ + mdoc.c \ + mdoc.h \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_html.c \ + mdoc_macro.c \ + mdoc_man.c \ + mdoc_term.c \ + mdoc_validate.c \ + msec.c \ + msec.in \ + out.c \ + out.h \ + preconv.1 \ + preconv.c \ + predefs.in \ + read.c \ + roff.7 \ + roff.c \ + st.c \ + st.in \ + style.css \ + tbl.7 \ + tbl.c \ + tbl_data.c \ + tbl_html.c \ + tbl_layout.c \ + tbl_opts.c \ + tbl_term.c \ + term.c \ + term.h \ + term_ascii.c \ + term_ps.c \ + test-fgetln.c \ + test-getsubopt.c \ + test-mmap.c \ + test-strlcat.c \ + test-strlcpy.c \ + test-strptime.c \ + tree.c \ + vol.c \ + vol.in \ + whatis.1 + +LIBMAN_OBJS = man.o \ + man_hash.o \ + man_macro.o \ + man_validate.o +LIBMAN_LNS = man.ln \ + man_hash.ln \ + man_macro.ln \ + man_validate.ln + +LIBMDOC_OBJS = arch.o \ + att.o \ + lib.o \ + mdoc.o \ + mdoc_argv.o \ + mdoc_hash.o \ + mdoc_macro.o \ + mdoc_validate.o \ + st.o \ + vol.o +LIBMDOC_LNS = arch.ln \ + att.ln \ + lib.ln \ + mdoc.ln \ + mdoc_argv.ln \ + mdoc_hash.ln \ + mdoc_macro.ln \ + mdoc_validate.ln \ + st.ln \ + vol.ln + +LIBROFF_OBJS = eqn.o \ + roff.o \ + tbl.o \ + tbl_data.o \ + tbl_layout.o \ + tbl_opts.o +LIBROFF_LNS = eqn.ln \ + roff.ln \ + tbl.ln \ + tbl_data.ln \ + tbl_layout.ln \ + tbl_opts.ln + +LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ + $(LIBMDOC_OBJS) \ + $(LIBROFF_OBJS) \ + chars.o \ + mandoc.o \ + msec.o \ + read.o +LIBMANDOC_LNS = $(LIBMAN_LNS) \ + $(LIBMDOC_LNS) \ + $(LIBROFF_LNS) \ + chars.ln \ + mandoc.ln \ + msec.ln \ + read.ln + +COMPAT_OBJS = compat_fgetln.o \ + compat_getsubopt.o \ + compat_strlcat.o \ + compat_strlcpy.o +COMPAT_LNS = compat_fgetln.ln \ + compat_getsubopt.ln \ + compat_strlcat.ln \ + compat_strlcpy.ln + +arch.o arch.ln: arch.in +att.o att.ln: att.in +chars.o chars.ln: chars.in +lib.o lib.ln: lib.in +msec.o msec.ln: msec.in +roff.o roff.ln: predefs.in +st.o st.ln: st.in +vol.o vol.ln: vol.in + +$(LIBMAN_OBJS) $(LIBMAN_LNS): libman.h +$(LIBMDOC_OBJS) $(LIBMDOC_LNS): libmdoc.h +$(LIBROFF_OBJS) $(LIBROFF_LNS): libroff.h +$(LIBMANDOC_OBJS) $(LIBMANDOC_LNS): mandoc.h mdoc.h man.h libmandoc.h config.h + +$(COMPAT_OBJS) $(COMPAT_LNS): config.h + +MANDOC_HTML_OBJS = eqn_html.o \ + html.o \ + man_html.o \ + mdoc_html.o \ + tbl_html.o +MANDOC_HTML_LNS = eqn_html.ln \ + html.ln \ + man_html.ln \ + mdoc_html.ln \ + tbl_html.ln + +MANDOC_MAN_OBJS = mdoc_man.o +MANDOC_MAN_LNS = mdoc_man.ln + +MANDOC_TERM_OBJS = eqn_term.o \ + man_term.o \ + mdoc_term.o \ + term.o \ + term_ascii.o \ + term_ps.o \ + tbl_term.o +MANDOC_TERM_LNS = eqn_term.ln \ + man_term.ln \ + mdoc_term.ln \ + term.ln \ + term_ascii.ln \ + term_ps.ln \ + tbl_term.ln + +MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + main.o \ + out.o \ + tree.o +MANDOC_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + main.ln \ + out.ln \ + tree.ln + +$(MANDOC_HTML_OBJS) $(MANDOC_HTML_LNS): html.h +$(MANDOC_TERM_OBJS) $(MANDOC_TERM_LNS): term.h +$(MANDOC_OBJS) $(MANDOC_LNS): main.h mandoc.h mdoc.h man.h config.h out.h + +MANDOCDB_OBJS = mandocdb.o manpath.o +MANDOCDB_LNS = mandocdb.ln manpath.ln + +$(MANDOCDB_OBJS) $(MANDOCDB_LNS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h + +PRECONV_OBJS = preconv.o +PRECONV_LNS = preconv.ln + +$(PRECONV_OBJS) $(PRECONV_LNS): config.h + +APROPOS_OBJS = apropos.o apropos_db.o manpath.o +APROPOS_LNS = apropos.ln apropos_db.ln manpath.ln + +$(APROPOS_OBJS) $(APROPOS_LNS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + cgi.o \ + apropos_db.o \ + manpath.o \ + out.o \ + tree.o + +CGI_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + cgi.ln \ + apropos_db.ln \ + manpath.ln \ + out.ln \ + tree.ln + +$(CGI_OBJS) $(CGI_LNS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CATMAN_OBJS = catman.o manpath.o +CATMAN_LNS = catman.ln manpath.ln + +$(CATMAN_OBJS) $(CATMAN_LNS): config.h mandoc.h manpath.h mandocdb.h + +DEMANDOC_OBJS = demandoc.o +DEMANDOC_LNS = demandoc.ln + +$(DEMANDOC_OBJS) $(DEMANDOC_LNS): config.h + +INDEX_MANS = apropos.1.html \ + apropos.1.xhtml \ + apropos.1.ps \ + apropos.1.pdf \ + apropos.1.txt \ + catman.8.html \ + catman.8.xhtml \ + catman.8.ps \ + catman.8.pdf \ + catman.8.txt \ + demandoc.1.html \ + demandoc.1.xhtml \ + demandoc.1.ps \ + demandoc.1.pdf \ + demandoc.1.txt \ + mandoc.1.html \ + mandoc.1.xhtml \ + mandoc.1.ps \ + mandoc.1.pdf \ + mandoc.1.txt \ + whatis.1.html \ + whatis.1.xhtml \ + whatis.1.ps \ + whatis.1.pdf \ + whatis.1.txt \ + mandoc.3.html \ + mandoc.3.xhtml \ + mandoc.3.ps \ + mandoc.3.pdf \ + mandoc.3.txt \ + eqn.7.html \ + eqn.7.xhtml \ + eqn.7.ps \ + eqn.7.pdf \ + eqn.7.txt \ + man.7.html \ + man.7.xhtml \ + man.7.ps \ + man.7.pdf \ + man.7.txt \ + man.cgi.7.html \ + man.cgi.7.xhtml \ + man.cgi.7.ps \ + man.cgi.7.pdf \ + man.cgi.7.txt \ + mandoc_char.7.html \ + mandoc_char.7.xhtml \ + mandoc_char.7.ps \ + mandoc_char.7.pdf \ + mandoc_char.7.txt \ + mdoc.7.html \ + mdoc.7.xhtml \ + mdoc.7.ps \ + mdoc.7.pdf \ + mdoc.7.txt \ + preconv.1.html \ + preconv.1.xhtml \ + preconv.1.ps \ + preconv.1.pdf \ + preconv.1.txt \ + roff.7.html \ + roff.7.xhtml \ + roff.7.ps \ + roff.7.pdf \ + roff.7.txt \ + tbl.7.html \ + tbl.7.xhtml \ + tbl.7.ps \ + tbl.7.pdf \ + tbl.7.txt \ + mandocdb.8.html \ + mandocdb.8.xhtml \ + mandocdb.8.ps \ + mandocdb.8.pdf \ + mandocdb.8.txt + +$(INDEX_MANS): mandoc + +INDEX_OBJS = $(INDEX_MANS) \ + man.h.html \ + mandoc.h.html \ + mdoc.h.html \ + mdocml.tar.gz \ + mdocml.md5 + +www: index.html + +lint: llib-lmandoc.ln llib-lpreconv.ln llib-ldemandoc.ln $(DBLN) + +clean: + rm -f libmandoc.a $(LIBMANDOC_OBJS) + rm -f llib-llibmandoc.ln $(LIBMANDOC_LNS) + rm -f mandocdb $(MANDOCDB_OBJS) + rm -f llib-lmandocdb.ln $(MANDOCDB_LNS) + rm -f preconv $(PRECONV_OBJS) + rm -f llib-lpreconv.ln $(PRECONV_LNS) + rm -f apropos whatis $(APROPOS_OBJS) + rm -f llib-lapropos.ln $(APROPOS_LNS) + rm -f man.cgi $(CGI_OBJS) + rm -f llib-lman.cgi.ln $(CGI_LNS) + rm -f catman $(CATMAN_OBJS) + rm -f llib-lcatman.ln $(CATMAN_LNS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f llib-ldemandoc.ln $(DEMANDOC_LNS) + rm -f mandoc $(MANDOC_OBJS) + rm -f llib-lmandoc.ln $(MANDOC_LNS) + rm -f config.h config.log $(COMPAT_OBJS) $(COMPAT_LNS) + rm -f mdocml.tar.gz mdocml-win32.zip mdocml-win64.zip mdocml-macosx.zip + rm -f index.html $(INDEX_OBJS) + rm -rf test-fgetln.dSYM + rm -rf test-strlcpy.dSYM + rm -rf test-strlcat.dSYM + rm -rf test-strptime.dSYM + rm -rf test-mmap.dSYM + rm -rf test-getsubopt.dSYM + rm -rf apropos.dSYM + rm -rf catman.dSYM + rm -rf mandocdb.dSYM + rm -rf whatis.dSYM + +install: all + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(EXAMPLEDIR) + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_PROGRAM) mandoc preconv demandoc $(DESTDIR)$(BINDIR) + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) mandoc.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) + +installcgi: all + mkdir -p $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(HTDOCDIR) + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css + $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR) + +installwww: www + mkdir -p $(PREFIX)/snapshots + mkdir -p $(PREFIX)/binaries + $(INSTALL_DATA) index.html external.png index.css $(PREFIX) + $(INSTALL_DATA) $(INDEX_MANS) style.css $(PREFIX) + $(INSTALL_DATA) mandoc.h.html man.h.html mdoc.h.html $(PREFIX) + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots/mdocml-$(VERSION).tar.gz + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots/mdocml-$(VERSION).md5 + +libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + +llib-llibmandoc.ln: $(COMPAT_LNS) $(LIBMANDOC_LNS) + $(LINT) $(LINTFLAGS) -Clibmandoc $(COMPAT_LNS) $(LIBMANDOC_LNS) + +mandoc: $(MANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a + +llib-lmandoc.ln: $(MANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandoc $(MANDOC_LNS) llib-llibmandoc.ln + +mandocdb: $(MANDOCDB_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB) + +llib-lmandocdb.ln: $(MANDOCDB_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandocdb $(MANDOCDB_LNS) llib-llibmandoc.ln + +preconv: $(PRECONV_OBJS) + $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS) + +llib-lpreconv.ln: $(PRECONV_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS) llib-llibmandoc.ln + +whatis: apropos + cp -f apropos whatis + +apropos: $(APROPOS_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) + +llib-lapropos.ln: $(APROPOS_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Capropos $(APROPOS_LNS) llib-llibmandoc.ln + +catman: $(CATMAN_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(CATMAN_OBJS) libmandoc.a $(DBLIB) + +llib-lcatman.ln: $(CATMAN_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Ccatman $(CATMAN_LNS) llib-llibmandoc.ln + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) + +llib-lman.cgi.ln: $(CGI_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cman.cgi $(CGI_LNS) llib-llibmandoc.ln + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a + +llib-ldemandoc.ln: $(DEMANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cdemandoc $(DEMANDOC_LNS) llib-llibmandoc.ln + +mdocml.md5: mdocml.tar.gz + md5 mdocml.tar.gz >$@ + +mdocml.tar.gz: $(SRCS) + mkdir -p .dist/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .dist/mdocml-$(VERSION) + ( cd .dist/ && tar zcf ../$@ ./ ) + rm -rf .dist/ + +mdocml-win32.zip: $(SRCS) + mkdir -p .win32/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win32 + cp .win32/Makefile .win32/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win32/Makefile.old >.win32/Makefile + ( cd .win32; \ + CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win32 + +mdocml-win64.zip: $(SRCS) + mkdir -p .win64/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win64 + cp .win64/Makefile .win64/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win64/Makefile.old >.win64/Makefile + ( cd .win64; \ + CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win64 + +mdocml-macosx.zip: $(SRCS) + mkdir -p .macosx/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .macosx + ( cd .macosx; \ + CFLAGS="-arch i386 -arch x86_64 -arch ppc" LDFLAGS="-arch i386 -arch x86_64 -arch ppc" make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .macosx + +index.html: $(INDEX_OBJS) + +config.h: config.h.pre config.h.post + rm -f config.log + ( cat config.h.pre; \ + echo; \ + if $(CC) $(CFLAGS) -Werror -o test-fgetln test-fgetln.c >> config.log 2>&1; then \ + echo '#define HAVE_FGETLN'; \ + rm test-fgetln; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strptime test-strptime.c >> config.log 2>&1; then \ + echo '#define HAVE_STRPTIME'; \ + rm test-strptime; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-getsubopt test-getsubopt.c >> config.log 2>&1; then \ + echo '#define HAVE_GETSUBOPT'; \ + rm test-getsubopt; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcat test-strlcat.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCAT'; \ + rm test-strlcat; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-mmap test-mmap.c >> config.log 2>&1; then \ + echo '#define HAVE_MMAP'; \ + rm test-mmap; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcpy test-strlcpy.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCPY'; \ + rm test-strlcpy; \ + fi; \ + echo; \ + cat config.h.post \ + ) > $@ + +.h.h.html: + highlight -I $< >$@ + +.1.1.txt .3.3.txt .7.7.txt .8.8.txt: + ./mandoc -Tascii -Wall,stop $< | col -b >$@ + +.1.1.html .3.3.html .7.7.html .8.8.html: + ./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@ + +.1.1.ps .3.3.ps .7.7.ps .8.8.ps: + ./mandoc -Tps -Wall,stop $< >$@ + +.1.1.xhtml .3.3.xhtml .7.7.xhtml .8.8.xhtml: + ./mandoc -Txhtml -Wall,stop -Ostyle=style.css,man=%N.%S.xhtml,includes=%I.html $< >$@ + +.1.1.pdf .3.3.pdf .7.7.pdf .8.8.pdf: + ./mandoc -Tpdf -Wall,stop $< >$@ + +.sgml.html: + validate --warn $< + sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@ Added: soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO Thu May 31 07:24:01 2012 (r236797) @@ -0,0 +1,372 @@ +************************************************************************ +* Official mandoc TODO. +* $Id: TODO,v 1.129 2012/03/04 23:53:37 schwarze Exp $ +************************************************************************ + +************************************************************************ +* parser bugs +************************************************************************ + +- ".\}" on its own line gets translated to bare ".\&" + which forces pset() into man(7) + and then triggers an unknown macro error + reported by naddy@ Sun, 3 Jul 2011 21:52:24 +0200 + +************************************************************************ +* formatter bugs +************************************************************************ + +- tbl(7): Horizontal and vertical lines are formatted badly: + With the box option, there is too much white space at the end of cells. + Horizontal lines from "=" lines are a bit too long. + yuri dot pankov at gmail dot com Thu, 14 Apr 2011 05:45:26 +0400 + +************************************************************************ +* missing features +************************************************************************ + +--- missing roff features ---------------------------------------------- + +- The pod2man preamble wants \h'...' with quoted numerical arguments, + see for example AUTHORS in MooseX::Getopt.3p, p5-MooseX-Getopt. + reported by Andreas Voegele + Tue, 22 Nov 2011 15:34:47 +0100 on ports@ + +- .if n \{ + .br\} + should cause an extra space to be raised. + +- .ad (adjust margins) + .ad l -- adjust left margin only (flush left) + .ad r -- adjust right margin only (flush right) + .ad c -- center text on line + .ad b -- adjust both margins (alias: .ad n) + .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). + +- .it (line traps) occur in mysql(1), yasm_arch(7) + generated by DocBook XSL Stylesheets v1.71.1 + reported by brad@ Sat, 15 Jan 2011 15:48:18 -0500 + +- .ns (no-space mode) occurs in xine-config(1) + reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + +- xloadimage(1) wants .ti (temporary indent), rep by naddy@ + +- .ta (tab settings) occurs in ircbug(1) and probably gnats(1) + reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 + +- \c (interrupted text) occurs in chat(8) + +- using undefined strings or macros defines them to be empty + wl@ Mon, 14 Nov 2011 14:37:01 +0000 + +--- missing mdoc features ---------------------------------------------- + +- fix bad block nesting involving multiple identical explicit blocks + see the OpenBSD mdoc_macro.c 1.47 commit message + +- .Bl -column .Xo support is missing + ultimate goal: + restore .Xr and .Dv to + lib/libc/compat-43/sigvec.3 + lib/libc/gen/signal.3 + lib/libc/sys/sigaction.2 + +- 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 + +- \\ is now implemented correctly + * when defining strings and macros using .ds and .de + * when parsing roff(7) and man(7) macro arguments + It does not yet work in mdoc(7) macro arguments + because libmdoc does not yet use mandoc_getarg(). + Also check what happens in plain text, it must be identical to \e. + +- .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). + +- implement blank `Bl -column', such as + .Bl -column + .It foo Ta bar + .El + +- explicitly disallow nested `Bl -column', which would clobber internal + flags defined for struct mdoc_macro + +- 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 + ugly code from login.conf(5): + .Bl -column minpasswordlen program xetcxmotd + .It path Ta path Ta value of Dv _PATH_DEFPATH + .br + Default search path. + reported by Michal Mazurek + via jmc@ Thu, 7 Apr 2011 16:00:53 +0059 + +- inside `.Bl -column' phrases, punctuation is handled like normal + text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -." + +- inside `.Bl -column' phrases, TERMP_IGNDELIM handling by `Pf' + is not safe, e.g. `.Bl -column .It Pf a b .' gives "ab." + but should give "ab ." + +- set a meaningful default if no `Bl' list type is assigned + +- have a blank `It' head for `Bl -tag' not puke + +- prohibit `Nm' from having non-text HEAD children + (e.g., NetBSD mDNSShared/dns-sd.1) + (mdoc_html.c and mdoc_term.c `Nm' handlers can be slightly simplified) + +- 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 + macro, while mandoc treats it as a block macro and breaks the line. + No idea how the logic for distinguishing in-line and block instances + should be, needs investigation. + uqs@ Thu, 2 Jun 2011 11:03:51 +0200 + uqs@ Thu, 2 Jun 2011 11:33:35 +0200 + +--- missing man features ----------------------------------------------- + +- groff an-ext.tmac macros (.UR, .UE) occur in xine(5) + reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + +- -T[x]html doesn't stipulate non-collapsing spaces in literal mode + +--- missing tbl features ----------------------------------------------- + +- implement basic non-parametric .de to support e.g. sox(1) + reported by naddy@ Sat, 16 Oct 2010 23:51:57 +0200 + *** sox(1) still doesn't work, tbl(1) errors need investigation + +- 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 + +--- missing misc features ---------------------------------------------- + +- clean up escape sequence handling, creating three classes: + (1) fully implemented, or parsed and ignored without loss of content + (2) unimplemented, potentially causing loss of content + or serious mangling of formatting (e.g. \n) -> ERROR + see textproc/mgdiff(1) for nice examples + (3) undefined, just output the character -> perhaps WARNING + +- The \t escape sequence is the same as a literal tab, see for example + the ASCII table in hexdump(1) where + .Bl -column \&000_nu \&001_so \&002_st \&003_et \&004_eo + .It \&000\ nul\t001\ soh\t002\ stx\t003\ etx\t004\ eot\t005\ enq + produces + 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq + and the example in oldrdist(1) + +- 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. + For details, see http://docutils.sourceforge.net/rst.html + noted by stsp@ Sat, 24 Apr 2010 09:17:55 +0200 + reminded by nicm@ Mon, 3 May 2010 09:52:41 +0100 + +- check compatibility with Plan9: + http://swtch.com/usr/local/plan9/tmac/tmac.an + http://swtch.com/plan9port/man/man7/man.html + "Anthony J. Bentley" 28 Dec 2010 21:58:40 -0700 + +************************************************************************ +* formatting issues: ugly output +************************************************************************ + +- a column list with blank `Ta' cells triggers a spurrious + start-with-whitespace printing of a newline + +- double quotes inside double quotes are escaped by doubling them + implement this in mdoc(7), too + so far, we only have it in roff(7) and man(7) + reminded by millert@ Thu, 09 Dec 2010 17:29:52 -0500 + +- perl(1) SYNOPSIS looks bad; reported by deraadt@ + 1) man(7) seems to need SYNOPSIS .Nm blocks, too + +- In .Bl -column, + .It Em AuthenticationKey Length + 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 + +- 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 + +- .%T can have trailing punctuation. Currently, it puts the trailing + punctuation into a trailing MDOC_TEXT element inside its own scope. + That element should rather be outside its scope, such that the + punctuation does not get underlines. This is not trivial to + implement because .%T then needs some features of in_line_eoln() - + 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". + +- in enclosures, mandoc sometimes fancies a bogus end of sentence + reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059 + +************************************************************************ +* formatting issues: gratuitous differences +************************************************************************ + +- .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. + +- In .Bl -bullet, the groff bullet is "+\b+\bo\bo", the mandoc bullet + is just "o\bo". + see for example OpenBSD ksh(1) + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Thu May 31 07:42:59 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 595FD1065679 for ; Thu, 31 May 2012 07:42:57 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 07:42:57 +0000 Date: Thu, 31 May 2012 07:42:57 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531074257.595FD1065679@hub.freebsd.org> Cc: Subject: socsvn commit: r236798 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 07:42:59 -0000 Author: jhagewood Date: Thu May 31 07:42:57 2012 New Revision: 236798 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236798 Log: Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- soc2012/jhagewood/mdocml/hagewood-mdocml.patch Thu May 31 07:24:01 2012 (r236797) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Thu May 31 07:42:57 2012 (r236798) @@ -1,6 +1,6 @@ -diff -rupN mdocml-1.12.1-orig//libmandoc.h mdocml-1.12.1//libmandoc.h ---- mdocml-1.12.1-orig//libmandoc.h 2012-05-30 13:45:57.251288839 -0400 -+++ mdocml-1.12.1//libmandoc.h 2012-05-31 03:01:28.836378241 -0400 +diff -rupN mdocml-1.12.1-orig/libmandoc.h mdocml-1.12.1/libmandoc.h +--- mdocml-1.12.1-orig/libmandoc.h 2012-05-31 07:34:22.000000000 -0400 ++++ mdocml-1.12.1/libmandoc.h 2012-05-31 07:34:23.000000000 -0400 @@ -31,6 +31,7 @@ enum rofferr { enum regs { @@ -9,9 +9,9 @@ REG__MAX }; -diff -rupN mdocml-1.12.1-orig//mdoc_html.c mdocml-1.12.1//mdoc_html.c ---- mdocml-1.12.1-orig//mdoc_html.c 2012-05-30 13:45:57.221288794 -0400 -+++ mdocml-1.12.1//mdoc_html.c 2012-05-31 03:21:44.956396839 -0400 +diff -rupN mdocml-1.12.1-orig/mdoc_html.c mdocml-1.12.1/mdoc_html.c +--- mdocml-1.12.1-orig/mdoc_html.c 2012-05-31 07:34:22.000000000 -0400 ++++ mdocml-1.12.1/mdoc_html.c 2012-05-31 07:37:11.000000000 -0400 @@ -767,10 +767,12 @@ mdoc_xr_pre(MDOC_ARGS) static int mdoc_ns_pre(MDOC_ARGS) @@ -20,7 +20,7 @@ - if ( ! (MDOC_LINE & n->flags)) - h->flags |= HTML_NOSPACE; - return(1); -+ if(!roff_regisset(m->roff, REG_ns)) ++ if(!roff_regisset(n->roff, REG_ns)) + { + if ( ! (MDOC_LINE & n->flags)) + h->flags |= HTML_NOSPACE; @@ -29,9 +29,9 @@ } -diff -rupN mdocml-1.12.1-orig//mdoc_term.c mdocml-1.12.1//mdoc_term.c ---- mdocml-1.12.1-orig//mdoc_term.c 2012-05-30 13:45:57.241288831 -0400 -+++ mdocml-1.12.1//mdoc_term.c 2012-05-31 03:19:48.736395055 -0400 +diff -rupN mdocml-1.12.1-orig/mdoc_term.c mdocml-1.12.1/mdoc_term.c +--- mdocml-1.12.1-orig/mdoc_term.c 2012-05-31 07:34:22.000000000 -0400 ++++ mdocml-1.12.1/mdoc_term.c 2012-05-31 07:37:36.000000000 -0400 @@ -1147,9 +1147,12 @@ termp_an_post(DECL_ARGS) static int termp_ns_pre(DECL_ARGS) @@ -39,7 +39,7 @@ - - if ( ! (MDOC_LINE & n->flags)) - p->flags |= TERMP_NOSPACE; -+ if (!roff_regisset(m->roff, REG_ns)) ++ if (!roff_regisset(n->roff, REG_ns)) + { + if ( ! (MDOC_LINE & n->flags)) + p->flags |= TERMP_NOSPACE; @@ -48,9 +48,9 @@ return(1); } -diff -rupN mdocml-1.12.1-orig//roff.c mdocml-1.12.1//roff.c ---- mdocml-1.12.1-orig//roff.c 2012-05-30 13:45:57.251288839 -0400 -+++ mdocml-1.12.1//roff.c 2012-05-31 03:06:10.196382542 -0400 +diff -rupN mdocml-1.12.1-orig/roff.c mdocml-1.12.1/roff.c +--- mdocml-1.12.1-orig/roff.c 2012-05-31 07:34:22.000000000 -0400 ++++ mdocml-1.12.1/roff.c 2012-05-31 07:34:23.000000000 -0400 @@ -55,6 +55,7 @@ enum rofft { ROFF_ns, ROFF_ps, From owner-svn-soc-all@FreeBSD.ORG Thu May 31 07:43:16 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id D21951065670 for ; Thu, 31 May 2012 07:43:14 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 07:43:14 +0000 Date: Thu, 31 May 2012 07:43:14 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531074314.D21951065670@hub.freebsd.org> Cc: Subject: socsvn commit: r236799 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 07:43:17 -0000 Author: jhagewood Date: Thu May 31 07:43:14 2012 New Revision: 236799 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236799 Log: Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- soc2012/jhagewood/mdocml/hagewood-mdocml.patch Thu May 31 07:42:57 2012 (r236798) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Thu May 31 07:43:14 2012 (r236799) @@ -11,7 +11,7 @@ diff -rupN mdocml-1.12.1-orig/mdoc_html.c mdocml-1.12.1/mdoc_html.c --- mdocml-1.12.1-orig/mdoc_html.c 2012-05-31 07:34:22.000000000 -0400 -+++ mdocml-1.12.1/mdoc_html.c 2012-05-31 07:37:11.000000000 -0400 ++++ mdocml-1.12.1/mdoc_html.c 2012-05-31 07:40:22.000000000 -0400 @@ -767,10 +767,12 @@ mdoc_xr_pre(MDOC_ARGS) static int mdoc_ns_pre(MDOC_ARGS) @@ -20,7 +20,7 @@ - if ( ! (MDOC_LINE & n->flags)) - h->flags |= HTML_NOSPACE; - return(1); -+ if(!roff_regisset(n->roff, REG_ns)) ++ if(!roff_regisset(m->roff, REG_ns)) + { + if ( ! (MDOC_LINE & n->flags)) + h->flags |= HTML_NOSPACE; @@ -31,7 +31,7 @@ diff -rupN mdocml-1.12.1-orig/mdoc_term.c mdocml-1.12.1/mdoc_term.c --- mdocml-1.12.1-orig/mdoc_term.c 2012-05-31 07:34:22.000000000 -0400 -+++ mdocml-1.12.1/mdoc_term.c 2012-05-31 07:37:36.000000000 -0400 ++++ mdocml-1.12.1/mdoc_term.c 2012-05-31 07:40:22.000000000 -0400 @@ -1147,9 +1147,12 @@ termp_an_post(DECL_ARGS) static int termp_ns_pre(DECL_ARGS) @@ -39,7 +39,7 @@ - - if ( ! (MDOC_LINE & n->flags)) - p->flags |= TERMP_NOSPACE; -+ if (!roff_regisset(n->roff, REG_ns)) ++ if (!roff_regisset(m->roff, REG_ns)) + { + if ( ! (MDOC_LINE & n->flags)) + p->flags |= TERMP_NOSPACE; From owner-svn-soc-all@FreeBSD.ORG Thu May 31 07:56:44 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 5FFB41065694 for ; Thu, 31 May 2012 07:56:42 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 07:56:42 +0000 Date: Thu, 31 May 2012 07:56:42 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531075642.5FFB41065694@hub.freebsd.org> Cc: Subject: socsvn commit: r236800 - in soc2012/jhagewood/mdocml: . mdocml-1.12.1 X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 07:56:44 -0000 Author: jhagewood Date: Thu May 31 07:56:41 2012 New Revision: 236800 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236800 Log: Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- soc2012/jhagewood/mdocml/hagewood-mdocml.patch Thu May 31 07:43:14 2012 (r236799) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Thu May 31 07:56:41 2012 (r236800) @@ -11,8 +11,16 @@ diff -rupN mdocml-1.12.1-orig/mdoc_html.c mdocml-1.12.1/mdoc_html.c --- mdocml-1.12.1-orig/mdoc_html.c 2012-05-31 07:34:22.000000000 -0400 -+++ mdocml-1.12.1/mdoc_html.c 2012-05-31 07:40:22.000000000 -0400 -@@ -767,10 +767,12 @@ mdoc_xr_pre(MDOC_ARGS) ++++ mdocml-1.12.1/mdoc_html.c 2012-05-31 07:55:41.000000000 -0400 +@@ -28,6 +28,7 @@ + #include + + #include "mandoc.h" ++#include "libmandoc.h" + #include "out.h" + #include "html.h" + #include "mdoc.h" +@@ -767,10 +768,12 @@ mdoc_xr_pre(MDOC_ARGS) static int mdoc_ns_pre(MDOC_ARGS) { @@ -20,7 +28,7 @@ - if ( ! (MDOC_LINE & n->flags)) - h->flags |= HTML_NOSPACE; - return(1); -+ if(!roff_regisset(m->roff, REG_ns)) ++ if(!roff_regisset(n->type, REG_ns)) + { + if ( ! (MDOC_LINE & n->flags)) + h->flags |= HTML_NOSPACE; @@ -31,15 +39,23 @@ diff -rupN mdocml-1.12.1-orig/mdoc_term.c mdocml-1.12.1/mdoc_term.c --- mdocml-1.12.1-orig/mdoc_term.c 2012-05-31 07:34:22.000000000 -0400 -+++ mdocml-1.12.1/mdoc_term.c 2012-05-31 07:40:22.000000000 -0400 -@@ -1147,9 +1147,12 @@ termp_an_post(DECL_ARGS) ++++ mdocml-1.12.1/mdoc_term.c 2012-05-31 07:56:00.000000000 -0400 +@@ -29,6 +29,7 @@ + #include + + #include "mandoc.h" ++#include "libmandoc.h" + #include "out.h" + #include "term.h" + #include "mdoc.h" +@@ -1147,9 +1148,12 @@ termp_an_post(DECL_ARGS) static int termp_ns_pre(DECL_ARGS) { - - if ( ! (MDOC_LINE & n->flags)) - p->flags |= TERMP_NOSPACE; -+ if (!roff_regisset(m->roff, REG_ns)) ++ if (!roff_regisset(n->type, REG_ns)) + { + if ( ! (MDOC_LINE & n->flags)) + p->flags |= TERMP_NOSPACE; Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Thu May 31 07:43:14 2012 (r236799) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Thu May 31 07:56:41 2012 (r236800) @@ -28,6 +28,7 @@ #include #include "mandoc.h" +#include "libmandoc.h" #include "out.h" #include "html.h" #include "mdoc.h" @@ -767,7 +768,7 @@ static int mdoc_ns_pre(MDOC_ARGS) { - if(!roff_regisset(m->roff, REG_ns)) + if(!roff_regisset(n->type, REG_ns)) { if ( ! (MDOC_LINE & n->flags)) h->flags |= HTML_NOSPACE; Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Thu May 31 07:43:14 2012 (r236799) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Thu May 31 07:56:41 2012 (r236800) @@ -29,6 +29,7 @@ #include #include "mandoc.h" +#include "libmandoc.h" #include "out.h" #include "term.h" #include "mdoc.h" @@ -1147,7 +1148,7 @@ static int termp_ns_pre(DECL_ARGS) { - if (!roff_regisset(m->roff, REG_ns)) + if (!roff_regisset(n->type, REG_ns)) { if ( ! (MDOC_LINE & n->flags)) p->flags |= TERMP_NOSPACE; From owner-svn-soc-all@FreeBSD.ORG Thu May 31 08:01:37 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 577181065687 for ; Thu, 31 May 2012 08:01:35 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 08:01:35 +0000 Date: Thu, 31 May 2012 08:01:35 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531080135.577181065687@hub.freebsd.org> Cc: Subject: socsvn commit: r236804 - in soc2012/jhagewood/mdocml: . mdocml-1.12.1 X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 08:01:37 -0000 Author: jhagewood Date: Thu May 31 08:01:35 2012 New Revision: 236804 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236804 Log: Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- soc2012/jhagewood/mdocml/hagewood-mdocml.patch Thu May 31 07:44:27 2012 (r236803) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Thu May 31 08:01:35 2012 (r236804) @@ -11,7 +11,7 @@ diff -rupN mdocml-1.12.1-orig/mdoc_html.c mdocml-1.12.1/mdoc_html.c --- mdocml-1.12.1-orig/mdoc_html.c 2012-05-31 07:34:22.000000000 -0400 -+++ mdocml-1.12.1/mdoc_html.c 2012-05-31 07:55:41.000000000 -0400 ++++ mdocml-1.12.1/mdoc_html.c 2012-05-31 08:00:40.000000000 -0400 @@ -28,6 +28,7 @@ #include @@ -28,7 +28,7 @@ - if ( ! (MDOC_LINE & n->flags)) - h->flags |= HTML_NOSPACE; - return(1); -+ if(!roff_regisset(n->type, REG_ns)) ++ if(!roff_regisset(m->roff, REG_ns)) + { + if ( ! (MDOC_LINE & n->flags)) + h->flags |= HTML_NOSPACE; @@ -39,7 +39,7 @@ diff -rupN mdocml-1.12.1-orig/mdoc_term.c mdocml-1.12.1/mdoc_term.c --- mdocml-1.12.1-orig/mdoc_term.c 2012-05-31 07:34:22.000000000 -0400 -+++ mdocml-1.12.1/mdoc_term.c 2012-05-31 07:56:00.000000000 -0400 ++++ mdocml-1.12.1/mdoc_term.c 2012-05-31 08:00:51.000000000 -0400 @@ -29,6 +29,7 @@ #include @@ -55,7 +55,7 @@ - - if ( ! (MDOC_LINE & n->flags)) - p->flags |= TERMP_NOSPACE; -+ if (!roff_regisset(n->type, REG_ns)) ++ if (!roff_regisset(m->roff, REG_ns)) + { + if ( ! (MDOC_LINE & n->flags)) + p->flags |= TERMP_NOSPACE; Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Thu May 31 07:44:27 2012 (r236803) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Thu May 31 08:01:35 2012 (r236804) @@ -768,7 +768,7 @@ static int mdoc_ns_pre(MDOC_ARGS) { - if(!roff_regisset(n->type, REG_ns)) + if(!roff_regisset(m->roff, REG_ns)) { if ( ! (MDOC_LINE & n->flags)) h->flags |= HTML_NOSPACE; Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Thu May 31 07:44:27 2012 (r236803) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Thu May 31 08:01:35 2012 (r236804) @@ -1148,7 +1148,7 @@ static int termp_ns_pre(DECL_ARGS) { - if (!roff_regisset(n->type, REG_ns)) + if (!roff_regisset(m->roff, REG_ns)) { if ( ! (MDOC_LINE & n->flags)) p->flags |= TERMP_NOSPACE; From owner-svn-soc-all@FreeBSD.ORG Thu May 31 11:07:17 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 082B9106566B for ; Thu, 31 May 2012 11:07:15 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 11:07:15 +0000 Date: Thu, 31 May 2012 11:07:15 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531110715.082B9106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236806 - soc2012/gmiller/locking-head/lib/libthr/thread X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 11:07:17 -0000 Author: gmiller Date: Thu May 31 11:07:14 2012 New Revision: 236806 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236806 Log: Add the remaining lock profiling call points for mutexes. Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c Thu May 31 08:22:02 2012 (r236805) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c Thu May 31 11:07:14 2012 (r236806) @@ -89,9 +89,9 @@ int _pthread_mutex_getyieldloops_np(pthread_mutex_t *mutex, int *count); int __pthread_mutex_setyieldloops_np(pthread_mutex_t *mutex, int count); -static int mutex_self_trylock(pthread_mutex_t); +static int mutex_self_trylock(pthread_mutex_t _PROFILE_PARMS); static int mutex_self_lock(pthread_mutex_t, - const struct timespec *abstime); + const struct timespec *abstime _PROFILE_PARMS); static int mutex_unlock_common(struct pthread_mutex *, int); static int mutex_lock_sleep(struct pthread *, pthread_mutex_t, const struct timespec * _PROFILE_PARMS); @@ -327,7 +327,7 @@ ENQUEUE_MUTEX(curthread, m); MUTEX_OBTAIN_SUCCESS(); } else if (m->m_owner == curthread) { - ret = mutex_self_trylock(m); + ret = mutex_self_trylock(m _PROFILE_PASS); MUTEX_OBTAIN_FAILED(); } else { MUTEX_OBTAIN_FAILED(); @@ -358,7 +358,7 @@ int ret; if (m->m_owner == curthread) - return mutex_self_lock(m, abstime); + return mutex_self_lock(m, abstime _PROFILE_PASS); MUTEX_OBTAIN_FAILED(); @@ -433,6 +433,8 @@ if (_thr_umutex_trylock2(&m->m_lock, TID(curthread)) == 0) { ENQUEUE_MUTEX(curthread, m); ret = 0; + + MUTEX_OBTAIN_SUCCESS(); } else { ret = mutex_lock_sleep(curthread, m, abstime _PROFILE_PASS); } @@ -541,7 +543,7 @@ } static int -mutex_self_trylock(struct pthread_mutex *m) +mutex_self_trylock(struct pthread_mutex *m _PROFILE_PARMS) { int ret; @@ -565,11 +567,18 @@ ret = EINVAL; } + if (ret == 0) { + MUTEX_OBTAIN_SUCCESS(); + } else { + MUTEX_OBTAIN_FAILED(); + } + return (ret); } static int -mutex_self_lock(struct pthread_mutex *m, const struct timespec *abstime) +mutex_self_lock(struct pthread_mutex *m, const struct timespec *abstime + _PROFILE_PARMS) { struct timespec ts1, ts2; int ret; @@ -577,6 +586,8 @@ switch (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_ADAPTIVE_NP: + MUTEX_OBTAIN_FAILED(); + if (abstime) { if (abstime->tv_sec < 0 || abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) { @@ -601,6 +612,8 @@ * What SS2 define as a 'normal' mutex. Intentionally * deadlock on attempts to get a lock you already own. */ + MUTEX_OBTAIN_FAILED(); + ret = 0; if (abstime) { if (abstime->tv_sec < 0 || abstime->tv_nsec < 0 || @@ -625,15 +638,21 @@ if (m->m_count + 1 > 0) { m->m_count++; ret = 0; - } else + } else { ret = EAGAIN; - break; + MUTEX_OBTAIN_FAILED(); + } + break; default: /* Trap invalid mutex types; */ ret = EINVAL; } + if (ret == 0) { + MUTEX_OBTAIN_SUCCESS(); + } + return (ret); } @@ -661,7 +680,13 @@ PMUTEX_TYPE(m->m_flags) == PTHREAD_MUTEX_RECURSIVE && m->m_count > 0)) { m->m_count--; + + if (m->m_count == 0) { + MUTEX_RELEASE(m); + } } else { + MUTEX_RELEASE(m); + if ((m->m_flags & PMUTEX_FLAG_DEFERED) != 0) { defered = 1; m->m_flags &= ~PMUTEX_FLAG_DEFERED; Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Thu May 31 08:22:02 2012 (r236805) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Thu May 31 11:07:14 2012 (r236806) @@ -747,6 +747,7 @@ __hidden; void _mutex_obtain_success(struct pthread_mutex *, const char *, int) __hidden; +void _mutex_release(struct pthread_mutex *) __hidden; void _libpthread_init(struct pthread *) __hidden; struct pthread *_thr_alloc(struct pthread *) __hidden; void _thread_exit(const char *, int, const char *) __hidden __dead2; @@ -810,11 +811,11 @@ _mutex_obtain_success(m, file, line) #define MUTEX_OBTAIN_FAILED() \ _mutex_obtain_failed(m, file, line) +#define MUTEX_RELEASE(m) _mutex_release(m) #else -#define MUTEX_OBTAIN_SUCCESS() \ - do { } while (0) -#define MUTEX_OBTAIN_FAILED() \ - do { } while (0) +#define MUTEX_OBTAIN_SUCCESS() do { } while (0) +#define MUTEX_OBTAIN_FAILED() do { } while (0) +#define MUTEX_RELEASE(m) do { } while (0) #endif /* #include */ From owner-svn-soc-all@FreeBSD.ORG Thu May 31 11:25:49 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id E89E61065678 for ; Thu, 31 May 2012 11:25:46 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 11:25:46 +0000 Date: Thu, 31 May 2012 11:25:46 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531112546.E89E61065678@hub.freebsd.org> Cc: Subject: socsvn commit: r236807 - soc2012/gmiller/locking-head/lib/libthr/thread X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 11:25:49 -0000 Author: gmiller Date: Thu May 31 11:25:46 2012 New Revision: 236807 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236807 Log: Make the mutex parameter (m) explicit for MUTEX_OBTAIN_SUCCESS() and MUTEX_OBTAIN_FAILED() for consistency and readability. Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c Thu May 31 11:07:14 2012 (r236806) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c Thu May 31 11:25:46 2012 (r236807) @@ -325,12 +325,12 @@ ret = _thr_umutex_trylock(&m->m_lock, id); if (__predict_true(ret == 0)) { ENQUEUE_MUTEX(curthread, m); - MUTEX_OBTAIN_SUCCESS(); + MUTEX_OBTAIN_SUCCESS(m); } else if (m->m_owner == curthread) { ret = mutex_self_trylock(m _PROFILE_PASS); - MUTEX_OBTAIN_FAILED(); + MUTEX_OBTAIN_FAILED(m); } else { - MUTEX_OBTAIN_FAILED(); + MUTEX_OBTAIN_FAILED(m); } if (ret && (m->m_flags & PMUTEX_FLAG_PRIVATE)) @@ -360,7 +360,7 @@ if (m->m_owner == curthread) return mutex_self_lock(m, abstime _PROFILE_PASS); - MUTEX_OBTAIN_FAILED(); + MUTEX_OBTAIN_FAILED(m); id = TID(curthread); /* @@ -415,7 +415,7 @@ done: if (ret == 0) { ENQUEUE_MUTEX(curthread, m); - MUTEX_OBTAIN_SUCCESS(); + MUTEX_OBTAIN_SUCCESS(m); } return (ret); @@ -434,7 +434,7 @@ ENQUEUE_MUTEX(curthread, m); ret = 0; - MUTEX_OBTAIN_SUCCESS(); + MUTEX_OBTAIN_SUCCESS(m); } else { ret = mutex_lock_sleep(curthread, m, abstime _PROFILE_PASS); } @@ -568,9 +568,9 @@ } if (ret == 0) { - MUTEX_OBTAIN_SUCCESS(); + MUTEX_OBTAIN_SUCCESS(m); } else { - MUTEX_OBTAIN_FAILED(); + MUTEX_OBTAIN_FAILED(m); } return (ret); @@ -586,7 +586,7 @@ switch (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_ADAPTIVE_NP: - MUTEX_OBTAIN_FAILED(); + MUTEX_OBTAIN_FAILED(m); if (abstime) { if (abstime->tv_sec < 0 || abstime->tv_nsec < 0 || @@ -612,7 +612,7 @@ * What SS2 define as a 'normal' mutex. Intentionally * deadlock on attempts to get a lock you already own. */ - MUTEX_OBTAIN_FAILED(); + MUTEX_OBTAIN_FAILED(m); ret = 0; if (abstime) { @@ -640,7 +640,7 @@ ret = 0; } else { ret = EAGAIN; - MUTEX_OBTAIN_FAILED(); + MUTEX_OBTAIN_FAILED(m); } break; @@ -650,7 +650,7 @@ } if (ret == 0) { - MUTEX_OBTAIN_SUCCESS(); + MUTEX_OBTAIN_SUCCESS(m); } return (ret); Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Thu May 31 11:07:14 2012 (r236806) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Thu May 31 11:25:46 2012 (r236807) @@ -807,14 +807,14 @@ void _pthread_cancel_leave(int maycancel); #ifdef LOCK_PROFILING -#define MUTEX_OBTAIN_SUCCESS() \ +#define MUTEX_OBTAIN_SUCCESS(m) \ _mutex_obtain_success(m, file, line) -#define MUTEX_OBTAIN_FAILED() \ +#define MUTEX_OBTAIN_FAILED(m) \ _mutex_obtain_failed(m, file, line) #define MUTEX_RELEASE(m) _mutex_release(m) #else -#define MUTEX_OBTAIN_SUCCESS() do { } while (0) -#define MUTEX_OBTAIN_FAILED() do { } while (0) +#define MUTEX_OBTAIN_SUCCESS(m) do { } while (0) +#define MUTEX_OBTAIN_FAILED(m) do { } while (0) #define MUTEX_RELEASE(m) do { } while (0) #endif From owner-svn-soc-all@FreeBSD.ORG Thu May 31 11:43:44 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 0CCDA1065672 for ; Thu, 31 May 2012 11:43:42 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 11:43:42 +0000 Date: Thu, 31 May 2012 11:43:42 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531114342.0CCDA1065672@hub.freebsd.org> Cc: Subject: socsvn commit: r236808 - soc2012/gmiller/locking-head/lib/libthr/thread X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 11:43:44 -0000 Author: gmiller Date: Thu May 31 11:43:41 2012 New Revision: 236808 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236808 Log: Add the stubs that were missing from previous commits. Added: soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c Added: soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c Thu May 31 11:43:41 2012 (r236808) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2012 Greg Miller .. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 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 "thr_private.h" + +void +_mutex_obtain_success(struct pthread_mutex *m, const char *file, int line) +{ +} + +void +_mutex_obtain_failed(struct pthread_mutex *m, const char *file, int line) +{ +} + +void +_mutex_release(struct pthread_mutex *m) +{ +} From owner-svn-soc-all@FreeBSD.ORG Thu May 31 12:04:42 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 6BE0C106566C for ; Thu, 31 May 2012 12:04:40 +0000 (UTC) (envelope-from tzabal@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 12:04:40 +0000 Date: Thu, 31 May 2012 12:04:40 +0000 From: tzabal@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531120440.6BE0C106566C@hub.freebsd.org> Cc: Subject: socsvn commit: r236809 - soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 12:04:42 -0000 Author: tzabal Date: Thu May 31 12:04:39 2012 New Revision: 236809 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236809 Log: crashreport: Only root can execute the script and function error for messages to stderr has been added. Modified: soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport/crashreport.sh Modified: soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport/crashreport.sh ============================================================================== --- soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport/crashreport.sh Thu May 31 11:43:41 2012 (r236808) +++ soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport/crashreport.sh Thu May 31 12:04:39 2012 (r236809) @@ -1,22 +1,43 @@ #!/bin/sh +# +# Crashreport is a program that is responsible to locate, collect and send +# the debugging information of a FreeBSD kernel crash to a central machine +# that collects these reports for analysis from the FreeBSD community and +# the FreeBSD developers. +# . /etc/rc.conf +PROG=`/usr/bin/basename $0` print_usage() { - echo "usage: $(basename $0) [-d dumpdir] [-f file] [-e email]" + echo "usage: ${PROG} [-d dumpdir] [-f file] [-e email]" +} + +error() +{ + echo "${PROG}: ERROR: $*" 1>&2 } # Default dump directory DUMPDIR='/var/crash' -_dumpdir="" -_file="" -_email="" +_dumpdir= +_file= +_email= + + +## Check if the user that executes the script is root +user=`/usr/bin/id -u` +if [ "${user}" != "0" ]; then + error 'Only the superuser (uid 0) can use this program.' + exit 1 +fi +## Get positional parameters while getopts "d:f:e:" opt; do case "$opt" in d) @@ -30,7 +51,7 @@ ;; *) print_usage - exit 1 + exit 2 ;; esac done @@ -47,19 +68,19 @@ fi if [ ! -d "${_dumpdir}" ]; then - echo "crashreport: Dump directory ${_dumpdir} does not exist." - exit 1 + error "Dump directory ${_dumpdir} does not exist." + exit 3 fi if [ -z "`ls ${_dumpdir}`" ]; then - echo "crashreport: Dump directory ${_dumpdir} is empty." - exit 2 + error "Dump directory ${_dumpdir} is empty." + exit 4 fi ## Find the file that contains the debugging information -## It is either a core.txt.X or a textdump.tar.X -X="" +## Normally, it is either a core.txt.X or a textdump.tar.X +X= BOUNDS="${_dumpdir}/bounds" CORE="${_dumpdir}/core.txt" TEXTDUMP="${_dumpdir}/textdump.tar" @@ -82,8 +103,8 @@ fi if [ ! -f "${_dumpdir}/${_file}" ]; then - echo "crashreport: Unable to locate file with debugging information." - exit 3 + error 'Unable to locate file with debugging information.' + exit 5 fi @@ -94,8 +115,8 @@ fi if [ -z "$_email" ]; then - echo 'crashreport: No email address for contact is specified.' - exit 4 + error 'No email address for contact is specified.' + exit 6 fi # Check if the given email address is valid based on its format. @@ -103,8 +124,8 @@ > /dev/null if [ "$?" -ne "0" ]; then - echo "crashreport: Email address ${_email} is invalid." - exit 5 + error "Email address ${_email} is invalid." + exit 7 fi From owner-svn-soc-all@FreeBSD.ORG Thu May 31 13:51:23 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 45DBA1065670 for ; Thu, 31 May 2012 13:51:21 +0000 (UTC) (envelope-from scher@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 13:51:21 +0000 Date: Thu, 31 May 2012 13:51:21 +0000 From: scher@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531135121.45DBA1065670@hub.freebsd.org> Cc: Subject: socsvn commit: r236810 - soc2012/scher/par_ports/head X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 13:51:23 -0000 Author: scher Date: Thu May 31 13:51:20 2012 New Revision: 236810 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236810 Log: [docs] Modified: soc2012/scher/par_ports/head/README.txt soc2012/scher/par_ports/head/dev_env.mk Modified: soc2012/scher/par_ports/head/README.txt ============================================================================== --- soc2012/scher/par_ports/head/README.txt Thu May 31 12:04:39 2012 (r236809) +++ soc2012/scher/par_ports/head/README.txt Thu May 31 13:51:20 2012 (r236810) @@ -2,15 +2,25 @@ make -f dev_env.mk list_env_info It will change nothing, but list some necessary environment variables -The following files/directories are ignored: -db/pkg/* -db/ports/* -tmp/* -${WRKDIR} +_parv_WANT_PARALLEL_BUILD - assign this variable any value to enable parralel instalation +( e.g. make -D_parv_WANT_PARALLEL_BUILD install) -All new lines of code will bew surrounded by the following comment lines: +------------------------------------------------------ +All new lines of code will bew surrounded by the following comment lines: ############### PAR_PORTS SPECIFIC COMMENT LINE ############### ############### THIS ENTRY IS FOR DEBUGGING PURPOSE ############### +############### Detailed comment if necessary some code here -############### ENDF OF PAR_PORTS SPECIFIC COMMENT LINE ############### \ No newline at end of file +############### END OF PAR_PORTS SPECIFIC COMMENT LINE ############### + +Parallel specific output lines will be surrounded by the following, just to catch them from other output +=================_PAR_PORTS_SPECIFIC_OUTPUT_============== +==============_END_OF_PAR_PORTS_SPECIFIC_OUTPUT_============== + +------------------------------------------------------ + +Almost all global parallel specific variables are prefixed with "_parv_". Naturally this will be ommited at the end of development. + +All parallel specific debugging variables are prefixed with "_dparv_". + Modified: soc2012/scher/par_ports/head/dev_env.mk ============================================================================== --- soc2012/scher/par_ports/head/dev_env.mk Thu May 31 12:04:39 2012 (r236809) +++ soc2012/scher/par_ports/head/dev_env.mk Thu May 31 13:51:20 2012 (r236810) @@ -11,12 +11,12 @@ list_env_info: @echo "=== Configuring project environment" @echo "=== The following variables are necassary for debugging of the 'Parallelization in the ports collection project'" - @echo "=== Add the following lines to your ~/.cshrc file" + @echo "=== Add the following lines to your ~/.cshrc and /.cshrc files" @echo "${CSH_PREFIX_ENTRY}" @echo "${CSH_PORTSDIR_ENTRY}" @echo "${CSH_PKG_DBDIR_ENTRY}" @echo "${CSH_PORT_DBDIR_ENTRY}" - @echo "=== Add the following lines to your ~/.shrc file" + @echo "=== Add the following lines to your ~/.shrc and /.shrc files" @echo "${SH_PREFIX_ENTRY}" @echo "${SH_PORTSDIR_ENTRY}" @echo "${SH_PKG_DBDIR_ENTRY}" From owner-svn-soc-all@FreeBSD.ORG Thu May 31 13:51:27 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 528A81065679 for ; Thu, 31 May 2012 13:51:25 +0000 (UTC) (envelope-from tzabal@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 13:51:25 +0000 Date: Thu, 31 May 2012 13:51:25 +0000 From: tzabal@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531135125.528A81065679@hub.freebsd.org> Cc: Subject: socsvn commit: r236811 - soc2012/tzabal/client-side/akcrs-head/usr.sbin X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 13:51:27 -0000 Author: tzabal Date: Thu May 31 13:51:25 2012 New Revision: 236811 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236811 Log: Modify /usr.sbin/Makefile to include crashreport directory. Modified: soc2012/tzabal/client-side/akcrs-head/usr.sbin/Makefile Modified: soc2012/tzabal/client-side/akcrs-head/usr.sbin/Makefile ============================================================================== --- soc2012/tzabal/client-side/akcrs-head/usr.sbin/Makefile Thu May 31 13:51:20 2012 (r236810) +++ soc2012/tzabal/client-side/akcrs-head/usr.sbin/Makefile Thu May 31 13:51:25 2012 (r236811) @@ -15,6 +15,7 @@ ckdist \ clear_locks \ crashinfo \ + crashreport \ cron \ ctladm \ daemon \ From owner-svn-soc-all@FreeBSD.ORG Thu May 31 14:06:50 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id E3199106566B for ; Thu, 31 May 2012 14:06:48 +0000 (UTC) (envelope-from scher@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 14:06:48 +0000 Date: Thu, 31 May 2012 14:06:48 +0000 From: scher@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531140648.E3199106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236812 - soc2012/scher/par_ports/head/Mk X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 14:06:51 -0000 Author: scher Date: Thu May 31 14:06:48 2012 New Revision: 236812 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236812 Log: [fixed] PKG_DBDIR locking erased from fake-pkg target, not to spam bsd.port.mk fake-pkg target is surrounded by PKG_DBDIR locking targets Modified: soc2012/scher/par_ports/head/Mk/bsd.port.mk Modified: soc2012/scher/par_ports/head/Mk/bsd.port.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.port.mk Thu May 31 13:51:25 2012 (r236811) +++ soc2012/scher/par_ports/head/Mk/bsd.port.mk Thu May 31 14:06:48 2012 (r236812) @@ -4370,7 +4370,7 @@ post-install post-install-script add-plist-info \ add-plist-docs add-plist-examples add-plist-data \ add-plist-post fix-plist-sequence compress-man \ - install-ldconfig-file fake-pkg security-check + install-ldconfig-file lock-pkg-dbdir fake-pkg unlock-pkg-dbdir security-check _PACKAGE_DEP= install _PACKAGE_SEQ= package-message pre-package pre-package-script \ do-package post-package-script @@ -6010,11 +6010,6 @@ .if !target(fake-pkg) fake-pkg: .if !defined(NO_PKG_REGISTER) -############### PAR_PORTS SPECIFIC COMMENT LINE ############### -.if defined(_parv_WANT_PARALLEL_BUILD) - @( attempts=-1; ${_parv_PKG_DBDIR_LOCK_LOOP} ) -.endif -############### END OF PAR_PORTS SPECIFIC COMMENT LINE ############### @if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} ${PKG_DBDIR}; fi @${RM} -f /tmp/${PKGNAME}-required-by .if defined(FORCE_PKG_REGISTER) @@ -6060,11 +6055,6 @@ ${CAT} /tmp/${PKGNAME}-required-by >> ${PKG_DBDIR}/${PKGNAME}/+REQUIRED_BY; \ ${RM} -f /tmp/${PKGNAME}-required-by; \ fi -############### PAR_PORTS SPECIFIC COMMENT LINE ############### -.if defined(_parv_WANT_PARALLEL_BUILD) - @( ${_parv_PKG_DBDIR_DO_UNLOCK} ) -.endif -############### END OF PAR_PORTS SPECIFIC COMMENT LINE ############### .else @${DO_NADA} .endif From owner-svn-soc-all@FreeBSD.ORG Thu May 31 14:31:08 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 85A011065737 for ; Thu, 31 May 2012 14:31:07 +0000 (UTC) (envelope-from tzabal@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 14:31:07 +0000 Date: Thu, 31 May 2012 14:31:07 +0000 From: tzabal@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531143107.85A011065737@hub.freebsd.org> Cc: Subject: socsvn commit: r236813 - soc2012/tzabal/server-side X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 14:31:08 -0000 Author: tzabal Date: Thu May 31 14:31:06 2012 New Revision: 236813 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236813 Log: Added: soc2012/tzabal/server-side/ From owner-svn-soc-all@FreeBSD.ORG Thu May 31 14:48:02 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 288D7106566B for ; Thu, 31 May 2012 14:48:00 +0000 (UTC) (envelope-from gpf@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 14:48:00 +0000 Date: Thu, 31 May 2012 14:48:00 +0000 From: gpf@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531144800.288D7106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236814 - soc2012/gpf/misc X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 14:48:02 -0000 Author: gpf Date: Thu May 31 14:47:59 2012 New Revision: 236814 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236814 Log: Altered gleb's script to test how often cuckoo_insert fails (infinfinite loop) and the relationship between success rate and hash table size. Added: soc2012/gpf/misc/ck.py Added: soc2012/gpf/misc/ck.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/gpf/misc/ck.py Thu May 31 14:47:59 2012 (r236814) @@ -0,0 +1,92 @@ +#!/usr/bin/env python +# gpf: testing how often cuckoo_insert goes into infinite loop +# comments: +# This implementation uses 2 hash tables and 2 respective hash functions. +# The size of a hash table is the next mprime number of the total amount of elements +# So for 100 elements we will have 2 * 101 = 202 cells. +# observations: +# This way, success rate is around ~85%. +# If we increate the size of the tables by 10%, success rate goes to ~96% +# In this case, success rates increase as the number of total elements n increase. + +import random +import gmpy +from gmpy import mpz + +def hash1(elem, hts): + pos = elem % hts + return pos + +def hash2(elem, hts): + pos = (elem / hts) % hts + return pos + +def cuckoo_insert(elem, ht1, ht2, hts): + max_tries = hts + + for i in xrange(0, max_tries): + pos1 = hash1(elem, hts) + elem1 = ht1[pos1] + # do the cuckoo + ht1[pos1] = elem + if elem1 == 0: + return 0 + pos2 = hash2(elem1, hts) + elem2 = ht2[pos2] + # do the cuckoo + ht2[pos2] = elem1 + if elem2 == 0: + return 0 + else: + elem = elem2 + return 1 + +def build_cuckoo_table(R, hts): + ht1 = [ 0 for x in xrange(0, hts) ] + ht2 = [ 0 for x in xrange(0, hts) ] + + for i in xrange(0, len(R)): + r = R[i] + inf = cuckoo_insert(r, ht1, ht2, hts) + if inf == 1: + return 1 + + return 0 + +def generate_ht(n, tries, extra_space): + nextra = int(n * extra_space / 100) + hts = int(gmpy.next_prime(mpz(n + nextra))) + + print 'Items: %s' % (n,) + print 'Hash Table Sizes: ', hts + print 'Extra Space for each table: %.02f%%' % extra_space + + successful = 0 + for j in xrange(0, tries): + R = [ random.getrandbits(64) for i in xrange(0, n) ] + while len(R) != len(set(R)): + print 'Initial hash collisions, regenerating: %s/%s', len(set(R)), n + R = [ random.getrandbits(64) for i in xrange(0, n) ] + + res = build_cuckoo_table(R, hts) + if res == 0: + successful += 1 + #done = float(100) * j / tries + #if (done % 25) == 0: + #print 'Done: %.02f%%' % (done) + + succ_rate = float(100) * successful / tries + print 'Tries: ', tries + print 'Successful %d, Success rate %.02f%%' % (successful, succ_rate) + print '' + +# XXXgpf: better to lower the 2nd argument by 1/10 if you want results in a couple of mins +generate_ht(100, 10000, 0) +generate_ht(1000, 10000, 0) +generate_ht(10000, 10000, 0) +generate_ht(100000, 1000, 0) + +generate_ht(100, 10000, 10) +generate_ht(1000, 10000, 10) +generate_ht(10000, 10000, 10) +generate_ht(100000, 1000, 10) From owner-svn-soc-all@FreeBSD.ORG Thu May 31 14:51:24 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 221D51065780 for ; Thu, 31 May 2012 14:51:22 +0000 (UTC) (envelope-from gpf@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 14:51:22 +0000 Date: Thu, 31 May 2012 14:51:22 +0000 From: gpf@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531145122.221D51065780@hub.freebsd.org> Cc: Subject: socsvn commit: r236815 - soc2012/gpf/misc X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 14:51:24 -0000 Author: gpf Date: Thu May 31 14:51:21 2012 New Revision: 236815 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236815 Log: slight modification of comment header Modified: soc2012/gpf/misc/ck.py Modified: soc2012/gpf/misc/ck.py ============================================================================== --- soc2012/gpf/misc/ck.py Thu May 31 14:47:59 2012 (r236814) +++ soc2012/gpf/misc/ck.py Thu May 31 14:51:21 2012 (r236815) @@ -1,13 +1,17 @@ #!/usr/bin/env python -# gpf: testing how often cuckoo_insert goes into infinite loop +# gpf: testing how often cuckoo_insert goes into infinite loop and the releationship between +# success_rate and hash table size. # comments: # This implementation uses 2 hash tables and 2 respective hash functions. -# The size of a hash table is the next mprime number of the total amount of elements +# The size of a hash table is the next mprime number of the total amount of elements. # So for 100 elements we will have 2 * 101 = 202 cells. # observations: # This way, success rate is around ~85%. # If we increate the size of the tables by 10%, success rate goes to ~96% # In this case, success rates increase as the number of total elements n increase. +# TODO: +# Next step is to test with actual real life data (pefs namemacs) and maybe some +# modification of the vanilla cuckoo algorithm import random import gmpy From owner-svn-soc-all@FreeBSD.ORG Thu May 31 14:56:23 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 0A286106566B for ; Thu, 31 May 2012 14:56:21 +0000 (UTC) (envelope-from emc2@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 14:56:21 +0000 Date: Thu, 31 May 2012 14:56:21 +0000 From: emc2@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531145621.0A286106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236816 - in soc2012/emc2: experimental head/sys/boot/i386/efi X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 14:56:23 -0000 Author: emc2 Date: Thu May 31 14:56:20 2012 New Revision: 236816 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236816 Log: Added directory for experiments Added: soc2012/emc2/experimental/ soc2012/emc2/experimental/Makefile soc2012/emc2/experimental/helloworld.c soc2012/emc2/experimental/ldscript.i386 Modified: soc2012/emc2/head/sys/boot/i386/efi/Makefile Added: soc2012/emc2/experimental/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/emc2/experimental/Makefile Thu May 31 14:56:20 2012 (r236816) @@ -0,0 +1,18 @@ +CC=clang +CFLAGS=-O2 -m32 -I../head/sys/boot/efi/include/ -I../head/sys/boot/efi/include/i386 +OBJCOPY=objcopy +EFIFORMAT=efi-app-ia32 +LDSCRIPT=ldscript.i386 + +all: helloworld.efi + +helloworld.o: helloworld.c + ${CC} -c ${CFLAGS} helloworld.c + +helloworld: helloworld.o + ${LD} -T ${LDSCRIPT} -shared -symbolic -o helloworld helloworld.o + +helloworld.efi: helloworld + ${OBJCOPY} -j .data -j .dynamic -j .dynstr -j .dynsym -j .hash \ + -j .rel.dyn -j .reloc -j .sdata -j .text -j set_Xcommand_set \ + --target=${EFIFORMAT} ${.ALLSRC} helloworld.efi \ No newline at end of file Added: soc2012/emc2/experimental/helloworld.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/emc2/experimental/helloworld.c Thu May 31 14:56:20 2012 (r236816) @@ -0,0 +1,12 @@ +#include + +unsigned short str[] = + { 'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '\n', '\r', 0 }; + +EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE* systab) +{ + + systab->ConOut->OutputString(systab->ConOut, str); + + return EFI_SUCCESS; +} Added: soc2012/emc2/experimental/ldscript.i386 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/emc2/experimental/ldscript.i386 Thu May 31 14:56:20 2012 (r236816) @@ -0,0 +1,72 @@ +/* $FreeBSD: soc2012/emc2/head/sys/boot/i386/efi/ldscript.i386 206419 2010-04-07 18:16:05Z rpaulo $ */ +OUTPUT_FORMAT("elf32-i386-freebsd", "elf32-i386-freebsd", "elf32-i386-freebsd") +OUTPUT_ARCH(i386) +ENTRY(_start) +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = 0; + ImageBase = .; + . = SIZEOF_HEADERS; + . = ALIGN(4096); + .text : { + *(.text .stub .text.* .gnu.linkonce.t.*) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.plt) + } =0x00300000010070000002000001000400 + . = ALIGN(4096); + .data : { + *(.rodata .rodata.* .gnu.linkonce.r.*) + *(.rodata1) + *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) + *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) + *(.opd) + *(.data .data.* .gnu.linkonce.d.*) + *(.data1) + *(.plabel) + *(.dynbss) + *(.bss .bss.* .gnu.linkonce.b.*) + *(COMMON) + } + . = ALIGN(4096); + set_Xcommand_set : { + __start_set_Xcommand_set = .; + *(set_Xcommand_set) + __stop_set_Xcommand_set = .; + } + . = ALIGN(4096); + __gp = .; + .sdata : { + *(.got.plt .got) + *(.sdata .sdata.* .gnu.linkonce.s.*) + *(dynsbss) + *(.sbss .sbss.* .gnu.linkonce.sb.*) + *(.scommon) + } + . = ALIGN(4096); + .dynamic : { *(.dynamic) } + . = ALIGN(4096); + .rel.dyn : { + *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) + *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) + *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) + *(.rel.got) + *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) + *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) + *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) + *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) + *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) + *(.rel.plt) + *(.relset_*) + *(.rel.dyn .rel.dyn.*) + } + . = ALIGN(4096); + .reloc : { *(.reloc) } + . = ALIGN(4096); + .hash : { *(.hash) } + . = ALIGN(4096); + .dynsym : { *(.dynsym) } + . = ALIGN(4096); + .dynstr : { *(.dynstr) } +} Modified: soc2012/emc2/head/sys/boot/i386/efi/Makefile ============================================================================== --- soc2012/emc2/head/sys/boot/i386/efi/Makefile Thu May 31 14:51:21 2012 (r236815) +++ soc2012/emc2/head/sys/boot/i386/efi/Makefile Thu May 31 14:56:20 2012 (r236816) @@ -22,14 +22,15 @@ CFLAGS+= -I. LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.if ${MACHINE_CPUARCH} == "amd64" +.if ${TARGET_ARCH} == "amd64" SRCS+= elf64_freebsd.c EFIFORMAT= efi-app-x86_64 -.elif ${MACHINE_CPUARCH} == "i386" +.error Compiling for amd64! +.elif ${TARGET_ARCH} == "i386" SRCS+= elf32_freebsd.c EFIFORMAT= efi-app-ia32 .else -.error "MACHINE_CPUARCH is ${MACHINE_CPUARCH} (not amd64 or i386)" +.error "TARGET_ARCH is ${MACHINE_CPUARCH} (not amd64 or i386)" .endif # Include bcache code. HAVE_BCACHE= yes From owner-svn-soc-all@FreeBSD.ORG Thu May 31 15:25:57 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 18481106566B for ; Thu, 31 May 2012 15:25:55 +0000 (UTC) (envelope-from rudot@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 31 May 2012 15:25:55 +0000 Date: Thu, 31 May 2012 15:25:55 +0000 From: rudot@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120531152555.18481106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236820 - in soc2012/rudot: aux sys/kern sys/sys X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2012 15:25:57 -0000 Author: rudot Date: Thu May 31 15:25:53 2012 New Revision: 236820 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236820 Log: updated %cpu calculations for short-lived processes. I had to work around using floating point in the kernel. Added: soc2012/rudot/aux/check.sh (contents, props changed) Modified: soc2012/rudot/sys/kern/kern_racct.c soc2012/rudot/sys/kern/sched_4bsd.c soc2012/rudot/sys/sys/racct.h Added: soc2012/rudot/aux/check.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/rudot/aux/check.sh Thu May 31 15:25:53 2012 (r236820) @@ -0,0 +1,3 @@ +./user_pcpu.sh + +ps ax -O %cpu Modified: soc2012/rudot/sys/kern/kern_racct.c ============================================================================== --- soc2012/rudot/sys/kern/kern_racct.c Thu May 31 14:47:02 2012 (r236819) +++ soc2012/rudot/sys/kern/kern_racct.c Thu May 31 15:25:53 2012 (r236820) @@ -143,6 +143,152 @@ RACCT_IN_MILLIONS, [RACCT_PCTCPU] = RACCT_RECLAIMABLE | RACCT_DENIABLE }; +/* + * Contains intermediate values for %cpu calculations to avoid using floating + * point in the kernel. + * ccpu_exp[k] = FSCALE * exp(-k/20) + */ +fixpt_t ccpu_exp[] = { + [0] = FSCALE * 1, + [1] = FSCALE * 0.95122942450071400909, + [2] = FSCALE * 0.90483741803595957316, + [3] = FSCALE * 0.86070797642505780722, + [4] = FSCALE * 0.81873075307798185866, + [5] = FSCALE * 0.77880078307140486824, + [6] = FSCALE * 0.74081822068171786606, + [7] = FSCALE * 0.70468808971871343435, + [8] = FSCALE * 0.67032004603563930074, + [9] = FSCALE * 0.63762815162177329314, + [10] = FSCALE * 0.60653065971263342360, + [11] = FSCALE * 0.57694981038048669531, + [12] = FSCALE * 0.54881163609402643262, + [13] = FSCALE * 0.52204577676101604789, + [14] = FSCALE * 0.49658530379140951470, + [15] = FSCALE * 0.47236655274101470713, + [16] = FSCALE * 0.44932896411722159143, + [17] = FSCALE * 0.42741493194872666992, + [18] = FSCALE * 0.40656965974059911188, + [19] = FSCALE * 0.38674102345450120691, + [20] = FSCALE * 0.36787944117144232159, + [21] = FSCALE * 0.34993774911115535467, + [22] = FSCALE * 0.33287108369807955328, + [23] = FSCALE * 0.31663676937905321821, + [24] = FSCALE * 0.30119421191220209664, + [25] = FSCALE * 0.28650479686019010032, + [26] = FSCALE * 0.27253179303401260312, + [27] = FSCALE * 0.25924026064589150757, + [28] = FSCALE * 0.24659696394160647693, + [29] = FSCALE * 0.23457028809379765313, + [30] = FSCALE * 0.22313016014842982893, + [31] = FSCALE * 0.21224797382674305771, + [32] = FSCALE * 0.20189651799465540848, + [33] = FSCALE * 0.19204990862075411423, + [34] = FSCALE * 0.18268352405273465022, + [35] = FSCALE * 0.17377394345044512668, + [36] = FSCALE * 0.16529888822158653829, + [37] = FSCALE * 0.15723716631362761621, + [38] = FSCALE * 0.14956861922263505264, + [39] = FSCALE * 0.14227407158651357185, + [40] = FSCALE * 0.13533528323661269189, + [41] = FSCALE * 0.12873490358780421886, + [42] = FSCALE * 0.12245642825298191021, + [43] = FSCALE * 0.11648415777349695786, + [44] = FSCALE * 0.11080315836233388333, + [45] = FSCALE * 0.10539922456186433678, + [46] = FSCALE * 0.10025884372280373372, + [47] = FSCALE * 0.09536916221554961888, + [48] = FSCALE * 0.09071795328941250337, + [49] = FSCALE * 0.08629358649937051097, + [50] = FSCALE * 0.08208499862389879516, + [51] = FSCALE * 0.07808166600115315231, + [52] = FSCALE * 0.07427357821433388042, + [53] = FSCALE * 0.07065121306042958674, + [54] = FSCALE * 0.06720551273974976512, + [55] = FSCALE * 0.06392786120670757270, + [56] = FSCALE * 0.06081006262521796499, + [57] = FSCALE * 0.05784432087483846296, + [58] = FSCALE * 0.05502322005640722902, + [59] = FSCALE * 0.05233970594843239308, + [60] = FSCALE * 0.04978706836786394297, + [61] = FSCALE * 0.04735892439114092119, + [62] = FSCALE * 0.04504920239355780606, + [63] = FSCALE * 0.04285212686704017991, + [64] = FSCALE * 0.04076220397836621516, + [65] = FSCALE * 0.03877420783172200988, + [66] = FSCALE * 0.03688316740124000544, + [67] = FSCALE * 0.03508435410084502588, + [68] = FSCALE * 0.03337326996032607948, + [69] = FSCALE * 0.03174563637806794323, + [70] = FSCALE * 0.03019738342231850073, + [71] = FSCALE * 0.02872463965423942912, + [72] = FSCALE * 0.02732372244729256080, + [73] = FSCALE * 0.02599112877875534358, + [74] = FSCALE * 0.02472352647033939120, + [75] = FSCALE * 0.02351774585600910823, + [76] = FSCALE * 0.02237077185616559577, + [77] = FSCALE * 0.02127973643837716938, + [78] = FSCALE * 0.02024191144580438847, + [79] = FSCALE * 0.01925470177538692429, + [80] = FSCALE * 0.01831563888873418029, + [81] = FSCALE * 0.01742237463949351138, + [82] = FSCALE * 0.01657267540176124754, + [83] = FSCALE * 0.01576441648485449082, + [84] = FSCALE * 0.01499557682047770621, + [85] = FSCALE * 0.01426423390899925527, + [86] = FSCALE * 0.01356855901220093175, + [87] = FSCALE * 0.01290681258047986886, + [88] = FSCALE * 0.01227733990306844117, + [89] = FSCALE * 0.01167856697039544521, + [90] = FSCALE * 0.01110899653824230649, + [91] = FSCALE * 0.01056720438385265337, + [92] = FSCALE * 0.01005183574463358164, + [93] = FSCALE * 0.00956160193054350793, + [94] = FSCALE * 0.00909527710169581709, + [95] = FSCALE * 0.00865169520312063417, + [96] = FSCALE * 0.00822974704902002884, + [97] = FSCALE * 0.00782837754922577143, + [98] = FSCALE * 0.00744658307092434051, + [99] = FSCALE * 0.00708340892905212004, + [100] = FSCALE * 0.00673794699908546709, + [101] = FSCALE * 0.00640933344625638184, + [102] = FSCALE * 0.00609674656551563610, + [103] = FSCALE * 0.00579940472684214321, + [104] = FSCALE * 0.00551656442076077241, + [105] = FSCALE * 0.00524751839918138427, + [106] = FSCALE * 0.00499159390691021621, + [107] = FSCALE * 0.00474815099941147558, + [108] = FSCALE * 0.00451658094261266798, + [109] = FSCALE * 0.00429630469075234057, + [110] = FSCALE * 0.00408677143846406699, +}; + +#define CCPU_EXP_MAX 110 + +u_int +racct_getpcpu(struct proc *p) +{ + u_int swtime; + fixpt_t pctcpu; + struct thread *td; + + swtime = (ticks - p->p_swtick) / hz; + if ((swtime == 0) || ((p->p_flag & P_INMEM) == 0)) + return (0); + + pctcpu = 0; + FOREACH_THREAD_IN_PROC(p, td) { + thread_lock(td); + pctcpu += sched_pctcpu(td); + thread_unlock(td); + } + + if (swtime <= CCPU_EXP_MAX) { + return ((100 * pctcpu) / (FSCALE - ccpu_exp[swtime])); + } + + return ((100 * pctcpu) / FSCALE); +} + static void racct_add_racct(struct racct *dest, const struct racct *src) { @@ -702,8 +848,7 @@ struct proc *p; struct timeval wallclock; uint64_t runtime; - fixpt_t pctcpu; - int pct_human; + u_int pct; for (;;) { sx_slock(&allproc_lock); @@ -714,15 +859,10 @@ microuptime(&wallclock); timevalsub(&wallclock, &p->p_stats->p_start); - pctcpu = 0; PROC_LOCK(p); PROC_SLOCK(p); - FOREACH_THREAD_IN_PROC(p, td) { + FOREACH_THREAD_IN_PROC(p, td) ruxagg(p, td); - thread_lock(td); - pctcpu += sched_pctcpu(td); - thread_unlock(td); - } runtime = cputick2usec(p->p_rux.rux_runtime); PROC_SUNLOCK(p); #ifdef notyet @@ -733,14 +873,14 @@ runtime = p->p_prev_runtime; #endif p->p_prev_runtime = runtime; - pct_human = (100 * pctcpu) / FSCALE; mtx_lock(&racct_lock); + pct = racct_getpcpu(p); /* * I use _force_ here because we always want to have * the real value in the RACCT_PCTCPU resource * regardless of the limits set. */ - racct_set_force_locked(p, RACCT_PCTCPU, pct_human); + racct_set_force_locked(p, RACCT_PCTCPU, pct); racct_set_locked(p, RACCT_CPU, runtime); racct_set_locked(p, RACCT_WALLCLOCK, (uint64_t)wallclock.tv_sec * 1000000 + Modified: soc2012/rudot/sys/kern/sched_4bsd.c ============================================================================== --- soc2012/rudot/sys/kern/sched_4bsd.c Thu May 31 14:47:02 2012 (r236819) +++ soc2012/rudot/sys/kern/sched_4bsd.c Thu May 31 15:25:53 2012 (r236820) @@ -694,9 +694,7 @@ struct pcpuidlestat *stat; struct td_sched *ts; #ifdef RACCT - int pct_human; - fixpt_t pctcpu; - struct thread *tdp; + u_int pct; #endif THREAD_LOCK_ASSERT(td, MA_OWNED); @@ -722,17 +720,9 @@ stat->idlecalls = 0; #ifdef RACCT - pctcpu = sched_pctcpu(td); - FOREACH_THREAD_IN_PROC(td->td_proc, tdp) { - if (td == tdp) - continue; - thread_lock(tdp); - pctcpu += sched_pctcpu(tdp); - thread_unlock(tdp); - } - pct_human = (100 * pctcpu) / FSCALE; - racct_set_force(td->td_proc, RACCT_PCTCPU, pct_human); - if (pct_human >= racct_get_limit(td->td_proc, RACCT_PCTCPU)) { + pct = racct_getpcpu(td->td_proc); + racct_set_force(td->td_proc, RACCT_PCTCPU, pct); + if (pct >= racct_get_limit(td->td_proc, RACCT_PCTCPU)) { pause("racct", hz); } #endif Modified: soc2012/rudot/sys/sys/racct.h ============================================================================== --- soc2012/rudot/sys/sys/racct.h Thu May 31 14:47:02 2012 (r236819) +++ soc2012/rudot/sys/sys/racct.h Thu May 31 15:25:53 2012 (r236820) @@ -144,5 +144,6 @@ void racct_proc_ucred_changed(struct proc *p, struct ucred *oldcred, struct ucred *newcred); void racct_move(struct racct *dest, struct racct *src); +u_int racct_getpcpu(struct proc *p); #endif /* !_RACCT_H_ */ From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 01:34:27 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 91259106566B for ; Fri, 1 Jun 2012 01:34:26 +0000 (UTC) (envelope-from vchan@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 01:34:26 +0000 Date: Fri, 01 Jun 2012 01:34:26 +0000 From: vchan@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601013426.91259106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236834 - soc2012/vchan X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 01:34:27 -0000 Author: vchan Date: Fri Jun 1 01:34:25 2012 New Revision: 236834 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236834 Log: Added: soc2012/vchan/ From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 05:27:56 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 35E5E1065754 for ; Fri, 1 Jun 2012 05:26:42 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 05:26:42 +0000 Date: Fri, 01 Jun 2012 05:26:42 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601052642.35E5E1065754@hub.freebsd.org> Cc: Subject: socsvn commit: r236844 - soc2012/jhagewood/mdocml/mdocml-1.12.1 X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 05:27:56 -0000 Author: jhagewood Date: Fri Jun 1 05:26:41 2012 New Revision: 236844 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236844 Log: Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Fri Jun 1 04:42:52 2012 (r236843) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Fri Jun 1 05:26:41 2012 (r236844) @@ -768,7 +768,7 @@ static int mdoc_ns_pre(MDOC_ARGS) { - if(!roff_regisset(m->roff, REG_ns)) + if(!REG_ns) { if ( ! (MDOC_LINE & n->flags)) h->flags |= HTML_NOSPACE; Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Fri Jun 1 04:42:52 2012 (r236843) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Fri Jun 1 05:26:41 2012 (r236844) @@ -1148,7 +1148,7 @@ static int termp_ns_pre(DECL_ARGS) { - if (!roff_regisset(m->roff, REG_ns)) + if (!REG_ns) { if ( ! (MDOC_LINE & n->flags)) p->flags |= TERMP_NOSPACE; From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 05:29:39 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 724B21066901 for ; Fri, 1 Jun 2012 05:28:23 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 05:28:23 +0000 Date: Fri, 01 Jun 2012 05:28:23 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601052823.724B21066901@hub.freebsd.org> Cc: Subject: socsvn commit: r236845 - soc2012/jhagewood/mdocml/mdocml_patches X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 05:29:39 -0000 Author: jhagewood Date: Fri Jun 1 05:28:23 2012 New Revision: 236845 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236845 Log: Deleted: soc2012/jhagewood/mdocml/mdocml_patches/ From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 05:30:14 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id C8DA71068488 for ; Fri, 1 Jun 2012 05:28:53 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 05:28:53 +0000 Date: Fri, 01 Jun 2012 05:28:53 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601052853.C8DA71068488@hub.freebsd.org> Cc: Subject: socsvn commit: r236846 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 05:30:14 -0000 Author: jhagewood Date: Fri Jun 1 05:28:53 2012 New Revision: 236846 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236846 Log: Deleted: soc2012/jhagewood/mdocml/mdocml_test.sh From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 05:31:12 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 985441066D91 for ; Fri, 1 Jun 2012 05:29:51 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 05:29:51 +0000 Date: Fri, 01 Jun 2012 05:29:51 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601052951.985441066D91@hub.freebsd.org> Cc: Subject: socsvn commit: r236847 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 05:31:12 -0000 Author: jhagewood Date: Fri Jun 1 05:29:51 2012 New Revision: 236847 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236847 Log: Added: soc2012/jhagewood/mdocml/patch-config.txt soc2012/jhagewood/mdocml/patch-lib.in.txt soc2012/jhagewood/mdocml/patch-mdoc_validate.c soc2012/jhagewood/mdocml/patch-msec.in.txt Added: soc2012/jhagewood/mdocml/patch-config.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/patch-config.txt Fri Jun 1 05:29:51 2012 (r236847) @@ -0,0 +1,15 @@ +--- config.h.post.orig 2012-03-24 03:19:14.000000000 +0100 ++++ config.h.post 2012-03-24 07:38:50.000000000 +0100 +@@ -20,6 +20,12 @@ + # define betoh32(x) OSSwapBigToHostInt32(x) + # define htobe64(x) OSSwapHostToBigInt64(x) + # define betoh64(x) OSSwapBigToHostInt64(x) ++#elif defined(__FreeBSD__) ++/* FreeBSD doesn't have these for userland code, yet. */ ++# define betoh32(x) (x) ++# define betoh64(x) (x) ++# define htobe32(x) (x) ++# define htobe64(x) (x) + #elif defined(__linux__) + # define betoh32(x) be32toh(x) + # define betoh64(x) be64toh(x) Added: soc2012/jhagewood/mdocml/patch-lib.in.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/patch-lib.in.txt Fri Jun 1 05:29:51 2012 (r236847) @@ -0,0 +1,38 @@ +--- lib.in ++++ lib.in +@@ -23,10 +23,10 @@ + * Be sure to escape strings. + */ + +-LINE("libarchive", "Reading and Writing Streaming Archives Library (libarchive, \\-larchive)") ++LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)") + LINE("libarm", "ARM Architecture Library (libarm, \\-larm)") + LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)") +-LINE("libbluetooth", "Bluetooth Library (libbluetooth, \\-lbluetooth)") ++LINE("libbluetooth", "Bluetooth User Library (libbluetooth, \\-lbluetooth)") + LINE("libbsm", "Basic Security Module User Library (libbsm, \\-lbsm)") + LINE("libc", "Standard C Library (libc, \\-lc)") + LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)") +@@ -40,10 +40,11 @@ LINE("libcurses", "Curses Library (libcurses, \\-lcurses)") + LINE("libdevstat", "Device Statistics Library (libdevstat, \\-ldevstat)") + LINE("libdisk", "Interface to Slice and Partition Labels Library (libdisk, \\-ldisk)") + LINE("libdwarf", "DWARF Access Library (libdwarf, \\-ldwarf)") +-LINE("libedit", "Command Line Editor Library (libedit, \\-ledit)") ++LINE("libedit", "Line Editor and History Library (libedit, \\-ledit)") ++LINE("libefi", "EFI Runtime Services Library (libefi, \\-lefi)") + LINE("libelf", "ELF Access Library (libelf, \\-lelf)") + LINE("libevent", "Event Notification Library (libevent, \\-levent)") +-LINE("libfetch", "File Transfer Library for URLs (libfetch, \\-lfetch)") ++LINE("libfetch", "File Transfer Library (libfetch, \\-lfetch)") + LINE("libform", "Curses Form Library (libform, \\-lform)") + LINE("libgeom", "Userland API Library for kernel GEOM subsystem (libgeom, \\-lgeom)") + LINE("libgpib", "General-Purpose Instrument Bus (GPIB) library (libgpib, \\-lgpib)") +@@ -68,7 +69,7 @@ LINE("libossaudio", "OSS Audio Emulation Library (libossaudio, \\-lossaudio)") + LINE("libpam", "Pluggable Authentication Module Library (libpam, \\-lpam)") + LINE("libpcap", "Capture Library (libpcap, \\-lpcap)") + LINE("libpci", "PCI Bus Access Library (libpci, \\-lpci)") +-LINE("libpmc", "Performance Counters Library (libpmc, \\-lpmc)") ++LINE("libpmc", "Performance Monitoring Counters Interface Library (libpmc, \\-lpmc)") + LINE("libposix", "POSIX Compatibility Library (libposix, \\-lposix)") + LINE("libprop", "Property Container Object Library (libprop, \\-lprop)") + LINE("libpthread", "POSIX Threads Library (libpthread, \\-lpthread)") Added: soc2012/jhagewood/mdocml/patch-mdoc_validate.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/patch-mdoc_validate.c Fri Jun 1 05:29:51 2012 (r236847) @@ -0,0 +1,11 @@ +--- mdoc_validate.c ++++ mdoc_validate.c +@@ -2143,6 +2143,8 @@ post_os(POST_ARGS) + mdoc_nmsg(m, n, MANDOCERR_MEM); + return(0); + } ++ if (strncmp(utsname.sysname, "FreeBSD", sizeof("FreeBSD")) == 0) ++ strtok(utsname.release, "-"); + if (strlcat(buf, utsname.release, BUFSIZ) >= BUFSIZ) { + mdoc_nmsg(m, n, MANDOCERR_MEM); + return(0); Added: soc2012/jhagewood/mdocml/patch-msec.in.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/patch-msec.in.txt Fri Jun 1 05:29:51 2012 (r236847) @@ -0,0 +1,28 @@ +--- msec.in.orig 2009-07-20 22:05:54.000000000 +0200 ++++ msec.in 2009-07-20 22:07:03.000000000 +0200 +@@ -22,16 +22,16 @@ + * Be sure to escape strings. + */ + +-LINE("1", "General Commands Manual") +-LINE("2", "System Calls Manual") +-LINE("3", "Library Functions Manual") ++LINE("1", "FreeBSD General Commands Manual") ++LINE("2", "FreeBSD System Calls Manual") ++LINE("3", "FreeBSD Library Functions Manual") + LINE("3p", "Perl Library Functions Manual") +-LINE("4", "Kernel Interfaces Manual") +-LINE("5", "File Formats Manual") +-LINE("6", "Games Manual") +-LINE("7", "Miscellaneous Information Manual") +-LINE("8", "System Manager\'s Manual") +-LINE("9", "Kernel Developer\'s Manual") ++LINE("4", "FreeBSD Kernel Interfaces Manual") ++LINE("5", "FreeBSD File Formats Manual") ++LINE("6", "FreeBSD Games Manual") ++LINE("7", "FreeBSD Miscellaneous Information Manual") ++LINE("8", "FreeBSD System Manager\'s Manual") ++LINE("9", "FreeBSD Kernel Developer\'s Manual") + LINE("X11", "X11 Developer\'s Manual") + LINE("X11R6", "X11 Developer\'s Manual") + LINE("unass", "Unassociated") From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 05:31:43 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 193231066A1F for ; Fri, 1 Jun 2012 05:30:22 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 05:30:19 +0000 Date: Fri, 01 Jun 2012 05:30:19 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601053022.193231066A1F@hub.freebsd.org> Cc: Subject: socsvn commit: r236848 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 05:31:43 -0000 Author: jhagewood Date: Fri Jun 1 05:30:18 2012 New Revision: 236848 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236848 Log: Deleted: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 05:31:53 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 972FD1066FE3 for ; Fri, 1 Jun 2012 05:30:32 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 05:30:32 +0000 Date: Fri, 01 Jun 2012 05:30:32 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601053032.972FD1066FE3@hub.freebsd.org> Cc: Subject: socsvn commit: r236849 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 05:31:53 -0000 Author: jhagewood Date: Fri Jun 1 05:30:32 2012 New Revision: 236849 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236849 Log: Added: soc2012/jhagewood/mdocml/ From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 05:33:23 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 455B210687B0 for ; Fri, 1 Jun 2012 05:31:55 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 05:31:55 +0000 Date: Fri, 01 Jun 2012 05:31:55 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601053155.455B210687B0@hub.freebsd.org> Cc: Subject: socsvn commit: r236850 - in soc2012/jhagewood/mdocml: . mdocml-1.12.1 mdocml-1.12.1-orig ports-textproc-patches tests X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 05:33:23 -0000 Author: jhagewood Date: Fri Jun 1 05:31:54 2012 New Revision: 236850 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236850 Log: Added: soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/whatis.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/Makefile soc2012/jhagewood/mdocml/mdocml-1.12.1/TODO soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.c soc2012/jhagewood/mdocml/mdocml-1.12.1/apropos_db.h soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.c soc2012/jhagewood/mdocml/mdocml-1.12.1/arch.in soc2012/jhagewood/mdocml/mdocml-1.12.1/att.c soc2012/jhagewood/mdocml/mdocml-1.12.1/att.in soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/catman.c soc2012/jhagewood/mdocml/mdocml-1.12.1/cgi.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.c soc2012/jhagewood/mdocml/mdocml-1.12.1/chars.in soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/compat_strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.post soc2012/jhagewood/mdocml/mdocml-1.12.1/config.h.pre soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/demandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/eqn_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/example.style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/external.png (contents, props changed) soc2012/jhagewood/mdocml/mdocml-1.12.1/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/html.h soc2012/jhagewood/mdocml/mdocml-1.12.1/index.css soc2012/jhagewood/mdocml/mdocml-1.12.1/index.sgml soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.c soc2012/jhagewood/mdocml/mdocml-1.12.1/lib.in soc2012/jhagewood/mdocml/mdocml-1.12.1/libman.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libmdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/libroff.h soc2012/jhagewood/mdocml/mdocml-1.12.1/main.c soc2012/jhagewood/mdocml/mdocml-1.12.1/main.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man-cgi.css soc2012/jhagewood/mdocml/mdocml-1.12.1/man.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man.cgi.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/man.h soc2012/jhagewood/mdocml/mdocml-1.12.1/man_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.3 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mandoc_char.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.8 soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mandocdb.h soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.c soc2012/jhagewood/mdocml/mdocml-1.12.1/manpath.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc.h soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_argv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_hash.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_macro.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_man.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_validate.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.c soc2012/jhagewood/mdocml/mdocml-1.12.1/msec.in soc2012/jhagewood/mdocml/mdocml-1.12.1/out.c soc2012/jhagewood/mdocml/mdocml-1.12.1/out.h soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.1 soc2012/jhagewood/mdocml/mdocml-1.12.1/preconv.c soc2012/jhagewood/mdocml/mdocml-1.12.1/predefs.in soc2012/jhagewood/mdocml/mdocml-1.12.1/read.c soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.c soc2012/jhagewood/mdocml/mdocml-1.12.1/st.in soc2012/jhagewood/mdocml/mdocml-1.12.1/style.css soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.7 soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_data.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_layout.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_opts.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tbl_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term.h soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ascii.c soc2012/jhagewood/mdocml/mdocml-1.12.1/term_ps.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-fgetln.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-getsubopt.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-mmap.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcat.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strlcpy.c soc2012/jhagewood/mdocml/mdocml-1.12.1/test-strptime.c soc2012/jhagewood/mdocml/mdocml-1.12.1/tree.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.c soc2012/jhagewood/mdocml/mdocml-1.12.1/vol.in soc2012/jhagewood/mdocml/mdocml-1.12.1/whatis.1 soc2012/jhagewood/mdocml/ports-textproc-patches/ soc2012/jhagewood/mdocml/ports-textproc-patches/patch-config.txt soc2012/jhagewood/mdocml/ports-textproc-patches/patch-lib.in.txt soc2012/jhagewood/mdocml/ports-textproc-patches/patch-mdoc_validate.c soc2012/jhagewood/mdocml/ports-textproc-patches/patch-msec.in.txt soc2012/jhagewood/mdocml/tests/ soc2012/jhagewood/mdocml/tests/compile-man-pages.sh (contents, props changed) soc2012/jhagewood/mdocml/tests/mdocml-test.sh (contents, props changed) Added: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Fri Jun 1 05:31:54 2012 (r236850) @@ -0,0 +1,135 @@ +diff -rupN mdocml-1.12.1-orig/libmandoc.h mdocml-1.12.1/libmandoc.h +--- mdocml-1.12.1-orig/libmandoc.h 2012-05-31 07:34:22.000000000 -0400 ++++ mdocml-1.12.1/libmandoc.h 2012-05-31 07:34:23.000000000 -0400 +@@ -31,6 +31,7 @@ enum rofferr { + + enum regs { + REG_nS = 0, /* nS register */ ++ REG_ns = 0, /* ns register (no-space) */ + REG__MAX + }; + +diff -rupN mdocml-1.12.1-orig/mdoc_html.c mdocml-1.12.1/mdoc_html.c +--- mdocml-1.12.1-orig/mdoc_html.c 2012-05-31 07:34:22.000000000 -0400 ++++ mdocml-1.12.1/mdoc_html.c 2012-05-31 08:00:40.000000000 -0400 +@@ -28,6 +28,7 @@ + #include + + #include "mandoc.h" ++#include "libmandoc.h" + #include "out.h" + #include "html.h" + #include "mdoc.h" +@@ -767,10 +768,12 @@ mdoc_xr_pre(MDOC_ARGS) + static int + mdoc_ns_pre(MDOC_ARGS) + { +- +- if ( ! (MDOC_LINE & n->flags)) +- h->flags |= HTML_NOSPACE; +- return(1); ++ if(!roff_regisset(m->roff, REG_ns)) ++ { ++ if ( ! (MDOC_LINE & n->flags)) ++ h->flags |= HTML_NOSPACE; ++ return(1); ++ } + } + + +diff -rupN mdocml-1.12.1-orig/mdoc_term.c mdocml-1.12.1/mdoc_term.c +--- mdocml-1.12.1-orig/mdoc_term.c 2012-05-31 07:34:22.000000000 -0400 ++++ mdocml-1.12.1/mdoc_term.c 2012-05-31 08:00:51.000000000 -0400 +@@ -29,6 +29,7 @@ + #include + + #include "mandoc.h" ++#include "libmandoc.h" + #include "out.h" + #include "term.h" + #include "mdoc.h" +@@ -1147,9 +1148,12 @@ termp_an_post(DECL_ARGS) + static int + termp_ns_pre(DECL_ARGS) + { +- +- if ( ! (MDOC_LINE & n->flags)) +- p->flags |= TERMP_NOSPACE; ++ if (!roff_regisset(m->roff, REG_ns)) ++ { ++ if ( ! (MDOC_LINE & n->flags)) ++ p->flags |= TERMP_NOSPACE; ++ return(1); ++ } + return(1); + } + +diff -rupN mdocml-1.12.1-orig/roff.c mdocml-1.12.1/roff.c +--- mdocml-1.12.1-orig/roff.c 2012-05-31 07:34:22.000000000 -0400 ++++ mdocml-1.12.1/roff.c 2012-05-31 07:34:23.000000000 -0400 +@@ -55,6 +55,7 @@ enum rofft { + ROFF_ns, + ROFF_ps, + ROFF_rm, ++ ROFF_rs, + ROFF_so, + ROFF_ta, + ROFF_tr, +@@ -182,6 +183,7 @@ static const char *roff_getstrn(const st + const char *, size_t); + static enum rofferr roff_line_ignore(ROFF_ARGS); + static enum rofferr roff_nr(ROFF_ARGS); ++static enum rofferr roff_ns(ROFF_ARGS); + static void roff_openeqn(struct roff *, const char *, + int, int, const char *); + static enum rofft roff_parse(struct roff *, const char *, int *); +@@ -189,6 +191,7 @@ static enum rofferr roff_parsetext(char + static enum rofferr roff_res(struct roff *, + char **, size_t *, int, int); + static enum rofferr roff_rm(ROFF_ARGS); ++static enum rofferr roff_rs(ROFF_ARGS); + static void roff_setstr(struct roff *, + const char *, const char *, int); + static void roff_setstrn(struct roffkv **, const char *, +@@ -228,9 +231,10 @@ static struct roffmac roffs[ROFF_MAX] = + { "ne", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nh", roff_line_ignore, NULL, NULL, 0, NULL }, + { "nr", roff_nr, NULL, NULL, 0, NULL }, +- { "ns", roff_line_ignore, NULL, NULL, 0, NULL }, ++ { "ns", roff_ns, NULL, NULL, 0, NULL }, + { "ps", roff_line_ignore, NULL, NULL, 0, NULL }, + { "rm", roff_rm, NULL, NULL, 0, NULL }, ++ { "rs", roff_rs, NULL, NULL, 0, NULL }, + { "so", roff_so, NULL, NULL, 0, NULL }, + { "ta", roff_line_ignore, NULL, NULL, 0, NULL }, + { "tr", roff_tr, NULL, NULL, 0, NULL }, +@@ -1256,6 +1260,14 @@ roff_nr(ROFF_ARGS) + return(ROFF_IGN); + } + ++static enum rofferr ++roff_ns(ROFF_ARGS) ++{ ++ /* Sets no-space register to 1. (on) */ ++ REG_ns = 1; ++ return(ROFF_IGN); ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_rm(ROFF_ARGS) +@@ -1272,6 +1284,14 @@ roff_rm(ROFF_ARGS) + return(ROFF_IGN); + } + ++static enum rofferr ++roff_rs(ROFF_ARGS) ++{ ++ /* Sets no-space register to 0. */ ++ REG_ns = 0; ++ return(ROFF_IGN); ++} ++ + /* ARGSUSED */ + static enum rofferr + roff_TE(ROFF_ARGS) Added: soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/Makefile Fri Jun 1 05:31:54 2012 (r236850) @@ -0,0 +1,645 @@ +.PHONY: clean install installwww +.SUFFIXES: .sgml .html .md5 .h .h.html +.SUFFIXES: .1 .3 .7 .8 +.SUFFIXES: .1.txt .3.txt .7.txt .8.txt +.SUFFIXES: .1.pdf .3.pdf .7.pdf .8.pdf +.SUFFIXES: .1.ps .3.ps .7.ps .8.ps +.SUFFIXES: .1.html .3.html .7.html .8.html +.SUFFIXES: .1.xhtml .3.xhtml .7.xhtml .8.xhtml + +# 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 4.5\"" + +VERSION = 1.12.1 +VDATE = 23 March 2012 + +# 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 + +# If your system has manpath(1), uncomment this. This is most any +# system that's not OpenBSD or NetBSD. If uncommented, apropos(1), +# mandocdb(8), and man.cgi will popen(3) manpath(1) to get the MANPATH +# variable. +#CFLAGS += -DUSE_MANPATH + +# If your system supports static binaries only, uncomment this. This +# appears only to be BSD UNIX systems (Mac OS X has no support and Linux +# requires -pthreads for static libdb). +STATIC = -static + +CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\"" +CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings +PREFIX = /usr/local +WWWPREFIX = /var/www +HTDOCDIR = $(WWWPREFIX)/htdocs +CGIBINDIR = $(WWWPREFIX)/cgi-bin +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 0755 +INSTALL_DATA = $(INSTALL) -m 0444 +INSTALL_LIB = $(INSTALL) -m 0644 +INSTALL_SOURCE = $(INSTALL) -m 0644 +INSTALL_MAN = $(INSTALL_DATA) + +# Non-BSD systems (Linux, etc.) need -ldb to compile mandocdb and +# apropos. +# However, if you don't have -ldb at all (or it's not native), then +# comment out apropos and mandocdb. +# +#DBLIB = -ldb +DBBIN = apropos mandocdb man.cgi catman whatis +DBLN = llib-lapropos.ln llib-lmandocdb.ln llib-lman.cgi.ln llib-lcatman.ln + +all: mandoc preconv demandoc $(DBBIN) + +SRCS = Makefile \ + TODO \ + apropos.1 \ + apropos.c \ + apropos_db.c \ + apropos_db.h \ + arch.c \ + arch.in \ + att.c \ + att.in \ + catman.8 \ + catman.c \ + cgi.c \ + chars.c \ + chars.in \ + compat_fgetln.c \ + compat_getsubopt.c \ + compat_strlcat.c \ + compat_strlcpy.c \ + config.h.post \ + config.h.pre \ + demandoc.1 \ + demandoc.c \ + eqn.7 \ + eqn.c \ + eqn_html.c \ + eqn_term.c \ + example.style.css \ + external.png \ + html.c \ + html.h \ + index.css \ + index.sgml \ + lib.c \ + lib.in \ + libman.h \ + libmandoc.h \ + libmdoc.h \ + libroff.h \ + main.c \ + main.h \ + man.7 \ + man.c \ + man.cgi.7 \ + man-cgi.css \ + man.h \ + man_hash.c \ + man_html.c \ + man_macro.c \ + man_term.c \ + man_validate.c \ + mandoc.1 \ + mandoc.3 \ + mandoc.c \ + mandoc.h \ + mandoc_char.7 \ + mandocdb.8 \ + mandocdb.c \ + mandocdb.h \ + manpath.c \ + manpath.h \ + mdoc.7 \ + mdoc.c \ + mdoc.h \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_html.c \ + mdoc_macro.c \ + mdoc_man.c \ + mdoc_term.c \ + mdoc_validate.c \ + msec.c \ + msec.in \ + out.c \ + out.h \ + preconv.1 \ + preconv.c \ + predefs.in \ + read.c \ + roff.7 \ + roff.c \ + st.c \ + st.in \ + style.css \ + tbl.7 \ + tbl.c \ + tbl_data.c \ + tbl_html.c \ + tbl_layout.c \ + tbl_opts.c \ + tbl_term.c \ + term.c \ + term.h \ + term_ascii.c \ + term_ps.c \ + test-fgetln.c \ + test-getsubopt.c \ + test-mmap.c \ + test-strlcat.c \ + test-strlcpy.c \ + test-strptime.c \ + tree.c \ + vol.c \ + vol.in \ + whatis.1 + +LIBMAN_OBJS = man.o \ + man_hash.o \ + man_macro.o \ + man_validate.o +LIBMAN_LNS = man.ln \ + man_hash.ln \ + man_macro.ln \ + man_validate.ln + +LIBMDOC_OBJS = arch.o \ + att.o \ + lib.o \ + mdoc.o \ + mdoc_argv.o \ + mdoc_hash.o \ + mdoc_macro.o \ + mdoc_validate.o \ + st.o \ + vol.o +LIBMDOC_LNS = arch.ln \ + att.ln \ + lib.ln \ + mdoc.ln \ + mdoc_argv.ln \ + mdoc_hash.ln \ + mdoc_macro.ln \ + mdoc_validate.ln \ + st.ln \ + vol.ln + +LIBROFF_OBJS = eqn.o \ + roff.o \ + tbl.o \ + tbl_data.o \ + tbl_layout.o \ + tbl_opts.o +LIBROFF_LNS = eqn.ln \ + roff.ln \ + tbl.ln \ + tbl_data.ln \ + tbl_layout.ln \ + tbl_opts.ln + +LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ + $(LIBMDOC_OBJS) \ + $(LIBROFF_OBJS) \ + chars.o \ + mandoc.o \ + msec.o \ + read.o +LIBMANDOC_LNS = $(LIBMAN_LNS) \ + $(LIBMDOC_LNS) \ + $(LIBROFF_LNS) \ + chars.ln \ + mandoc.ln \ + msec.ln \ + read.ln + +COMPAT_OBJS = compat_fgetln.o \ + compat_getsubopt.o \ + compat_strlcat.o \ + compat_strlcpy.o +COMPAT_LNS = compat_fgetln.ln \ + compat_getsubopt.ln \ + compat_strlcat.ln \ + compat_strlcpy.ln + +arch.o arch.ln: arch.in +att.o att.ln: att.in +chars.o chars.ln: chars.in +lib.o lib.ln: lib.in +msec.o msec.ln: msec.in +roff.o roff.ln: predefs.in +st.o st.ln: st.in +vol.o vol.ln: vol.in + +$(LIBMAN_OBJS) $(LIBMAN_LNS): libman.h +$(LIBMDOC_OBJS) $(LIBMDOC_LNS): libmdoc.h +$(LIBROFF_OBJS) $(LIBROFF_LNS): libroff.h +$(LIBMANDOC_OBJS) $(LIBMANDOC_LNS): mandoc.h mdoc.h man.h libmandoc.h config.h + +$(COMPAT_OBJS) $(COMPAT_LNS): config.h + +MANDOC_HTML_OBJS = eqn_html.o \ + html.o \ + man_html.o \ + mdoc_html.o \ + tbl_html.o +MANDOC_HTML_LNS = eqn_html.ln \ + html.ln \ + man_html.ln \ + mdoc_html.ln \ + tbl_html.ln + +MANDOC_MAN_OBJS = mdoc_man.o +MANDOC_MAN_LNS = mdoc_man.ln + +MANDOC_TERM_OBJS = eqn_term.o \ + man_term.o \ + mdoc_term.o \ + term.o \ + term_ascii.o \ + term_ps.o \ + tbl_term.o +MANDOC_TERM_LNS = eqn_term.ln \ + man_term.ln \ + mdoc_term.ln \ + term.ln \ + term_ascii.ln \ + term_ps.ln \ + tbl_term.ln + +MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + main.o \ + out.o \ + tree.o +MANDOC_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + main.ln \ + out.ln \ + tree.ln + +$(MANDOC_HTML_OBJS) $(MANDOC_HTML_LNS): html.h +$(MANDOC_TERM_OBJS) $(MANDOC_TERM_LNS): term.h +$(MANDOC_OBJS) $(MANDOC_LNS): main.h mandoc.h mdoc.h man.h config.h out.h + +MANDOCDB_OBJS = mandocdb.o manpath.o +MANDOCDB_LNS = mandocdb.ln manpath.ln + +$(MANDOCDB_OBJS) $(MANDOCDB_LNS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h + +PRECONV_OBJS = preconv.o +PRECONV_LNS = preconv.ln + +$(PRECONV_OBJS) $(PRECONV_LNS): config.h + +APROPOS_OBJS = apropos.o apropos_db.o manpath.o +APROPOS_LNS = apropos.ln apropos_db.ln manpath.ln + +$(APROPOS_OBJS) $(APROPOS_LNS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + cgi.o \ + apropos_db.o \ + manpath.o \ + out.o \ + tree.o + +CGI_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + cgi.ln \ + apropos_db.ln \ + manpath.ln \ + out.ln \ + tree.ln + +$(CGI_OBJS) $(CGI_LNS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CATMAN_OBJS = catman.o manpath.o +CATMAN_LNS = catman.ln manpath.ln + +$(CATMAN_OBJS) $(CATMAN_LNS): config.h mandoc.h manpath.h mandocdb.h + +DEMANDOC_OBJS = demandoc.o +DEMANDOC_LNS = demandoc.ln + +$(DEMANDOC_OBJS) $(DEMANDOC_LNS): config.h + +INDEX_MANS = apropos.1.html \ + apropos.1.xhtml \ + apropos.1.ps \ + apropos.1.pdf \ + apropos.1.txt \ + catman.8.html \ + catman.8.xhtml \ + catman.8.ps \ + catman.8.pdf \ + catman.8.txt \ + demandoc.1.html \ + demandoc.1.xhtml \ + demandoc.1.ps \ + demandoc.1.pdf \ + demandoc.1.txt \ + mandoc.1.html \ + mandoc.1.xhtml \ + mandoc.1.ps \ + mandoc.1.pdf \ + mandoc.1.txt \ + whatis.1.html \ + whatis.1.xhtml \ + whatis.1.ps \ + whatis.1.pdf \ + whatis.1.txt \ + mandoc.3.html \ + mandoc.3.xhtml \ + mandoc.3.ps \ + mandoc.3.pdf \ + mandoc.3.txt \ + eqn.7.html \ + eqn.7.xhtml \ + eqn.7.ps \ + eqn.7.pdf \ + eqn.7.txt \ + man.7.html \ + man.7.xhtml \ + man.7.ps \ + man.7.pdf \ + man.7.txt \ + man.cgi.7.html \ + man.cgi.7.xhtml \ + man.cgi.7.ps \ + man.cgi.7.pdf \ + man.cgi.7.txt \ + mandoc_char.7.html \ + mandoc_char.7.xhtml \ + mandoc_char.7.ps \ + mandoc_char.7.pdf \ + mandoc_char.7.txt \ + mdoc.7.html \ + mdoc.7.xhtml \ + mdoc.7.ps \ + mdoc.7.pdf \ + mdoc.7.txt \ + preconv.1.html \ + preconv.1.xhtml \ + preconv.1.ps \ + preconv.1.pdf \ + preconv.1.txt \ + roff.7.html \ + roff.7.xhtml \ + roff.7.ps \ + roff.7.pdf \ + roff.7.txt \ + tbl.7.html \ + tbl.7.xhtml \ + tbl.7.ps \ + tbl.7.pdf \ + tbl.7.txt \ + mandocdb.8.html \ + mandocdb.8.xhtml \ + mandocdb.8.ps \ + mandocdb.8.pdf \ + mandocdb.8.txt + +$(INDEX_MANS): mandoc + +INDEX_OBJS = $(INDEX_MANS) \ + man.h.html \ + mandoc.h.html \ + mdoc.h.html \ + mdocml.tar.gz \ + mdocml.md5 + +www: index.html + +lint: llib-lmandoc.ln llib-lpreconv.ln llib-ldemandoc.ln $(DBLN) + +clean: + rm -f libmandoc.a $(LIBMANDOC_OBJS) + rm -f llib-llibmandoc.ln $(LIBMANDOC_LNS) + rm -f mandocdb $(MANDOCDB_OBJS) + rm -f llib-lmandocdb.ln $(MANDOCDB_LNS) + rm -f preconv $(PRECONV_OBJS) + rm -f llib-lpreconv.ln $(PRECONV_LNS) + rm -f apropos whatis $(APROPOS_OBJS) + rm -f llib-lapropos.ln $(APROPOS_LNS) + rm -f man.cgi $(CGI_OBJS) + rm -f llib-lman.cgi.ln $(CGI_LNS) + rm -f catman $(CATMAN_OBJS) + rm -f llib-lcatman.ln $(CATMAN_LNS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f llib-ldemandoc.ln $(DEMANDOC_LNS) + rm -f mandoc $(MANDOC_OBJS) + rm -f llib-lmandoc.ln $(MANDOC_LNS) + rm -f config.h config.log $(COMPAT_OBJS) $(COMPAT_LNS) + rm -f mdocml.tar.gz mdocml-win32.zip mdocml-win64.zip mdocml-macosx.zip + rm -f index.html $(INDEX_OBJS) + rm -rf test-fgetln.dSYM + rm -rf test-strlcpy.dSYM + rm -rf test-strlcat.dSYM + rm -rf test-strptime.dSYM + rm -rf test-mmap.dSYM + rm -rf test-getsubopt.dSYM + rm -rf apropos.dSYM + rm -rf catman.dSYM + rm -rf mandocdb.dSYM + rm -rf whatis.dSYM + +install: all + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(EXAMPLEDIR) + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_PROGRAM) mandoc preconv demandoc $(DESTDIR)$(BINDIR) + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) mandoc.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) + +installcgi: all + mkdir -p $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(HTDOCDIR) + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css + $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR) + +installwww: www + mkdir -p $(PREFIX)/snapshots + mkdir -p $(PREFIX)/binaries + $(INSTALL_DATA) index.html external.png index.css $(PREFIX) + $(INSTALL_DATA) $(INDEX_MANS) style.css $(PREFIX) + $(INSTALL_DATA) mandoc.h.html man.h.html mdoc.h.html $(PREFIX) + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots + $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots/mdocml-$(VERSION).tar.gz + $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots/mdocml-$(VERSION).md5 + +libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + +llib-llibmandoc.ln: $(COMPAT_LNS) $(LIBMANDOC_LNS) + $(LINT) $(LINTFLAGS) -Clibmandoc $(COMPAT_LNS) $(LIBMANDOC_LNS) + +mandoc: $(MANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a + +llib-lmandoc.ln: $(MANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandoc $(MANDOC_LNS) llib-llibmandoc.ln + +mandocdb: $(MANDOCDB_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB) + +llib-lmandocdb.ln: $(MANDOCDB_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandocdb $(MANDOCDB_LNS) llib-llibmandoc.ln + +preconv: $(PRECONV_OBJS) + $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS) + +llib-lpreconv.ln: $(PRECONV_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS) llib-llibmandoc.ln + +whatis: apropos + cp -f apropos whatis + +apropos: $(APROPOS_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) + +llib-lapropos.ln: $(APROPOS_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Capropos $(APROPOS_LNS) llib-llibmandoc.ln + +catman: $(CATMAN_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(CATMAN_OBJS) libmandoc.a $(DBLIB) + +llib-lcatman.ln: $(CATMAN_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Ccatman $(CATMAN_LNS) llib-llibmandoc.ln + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) + +llib-lman.cgi.ln: $(CGI_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cman.cgi $(CGI_LNS) llib-llibmandoc.ln + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a + +llib-ldemandoc.ln: $(DEMANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cdemandoc $(DEMANDOC_LNS) llib-llibmandoc.ln + +mdocml.md5: mdocml.tar.gz + md5 mdocml.tar.gz >$@ + +mdocml.tar.gz: $(SRCS) + mkdir -p .dist/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .dist/mdocml-$(VERSION) + ( cd .dist/ && tar zcf ../$@ ./ ) + rm -rf .dist/ + +mdocml-win32.zip: $(SRCS) + mkdir -p .win32/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win32 + cp .win32/Makefile .win32/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win32/Makefile.old >.win32/Makefile + ( cd .win32; \ + CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win32 + +mdocml-win64.zip: $(SRCS) + mkdir -p .win64/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .win64 + cp .win64/Makefile .win64/Makefile.old + egrep -v -e DUSE_WCHAR -e ^DBBIN .win64/Makefile.old >.win64/Makefile + ( cd .win64; \ + CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .win64 + +mdocml-macosx.zip: $(SRCS) + mkdir -p .macosx/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(SRCS) .macosx + ( cd .macosx; \ + CFLAGS="-arch i386 -arch x86_64 -arch ppc" LDFLAGS="-arch i386 -arch x86_64 -arch ppc" make; \ + make install PREFIX=mdocml-$(VERSION) ; \ + zip -r ../$@ mdocml-$(VERSION) ) + rm -rf .macosx + +index.html: $(INDEX_OBJS) + +config.h: config.h.pre config.h.post + rm -f config.log + ( cat config.h.pre; \ + echo; \ + if $(CC) $(CFLAGS) -Werror -o test-fgetln test-fgetln.c >> config.log 2>&1; then \ + echo '#define HAVE_FGETLN'; \ + rm test-fgetln; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strptime test-strptime.c >> config.log 2>&1; then \ + echo '#define HAVE_STRPTIME'; \ + rm test-strptime; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-getsubopt test-getsubopt.c >> config.log 2>&1; then \ + echo '#define HAVE_GETSUBOPT'; \ + rm test-getsubopt; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcat test-strlcat.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCAT'; \ + rm test-strlcat; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-mmap test-mmap.c >> config.log 2>&1; then \ + echo '#define HAVE_MMAP'; \ + rm test-mmap; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -o test-strlcpy test-strlcpy.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCPY'; \ + rm test-strlcpy; \ + fi; \ + echo; \ + cat config.h.post \ + ) > $@ + +.h.h.html: + highlight -I $< >$@ + +.1.1.txt .3.3.txt .7.7.txt .8.8.txt: + ./mandoc -Tascii -Wall,stop $< | col -b >$@ + +.1.1.html .3.3.html .7.7.html .8.8.html: + ./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@ + +.1.1.ps .3.3.ps .7.7.ps .8.8.ps: + ./mandoc -Tps -Wall,stop $< >$@ + +.1.1.xhtml .3.3.xhtml .7.7.xhtml .8.8.xhtml: + ./mandoc -Txhtml -Wall,stop -Ostyle=style.css,man=%N.%S.xhtml,includes=%I.html $< >$@ + +.1.1.pdf .3.3.pdf .7.7.pdf .8.8.pdf: + ./mandoc -Tpdf -Wall,stop $< >$@ + +.sgml.html: + validate --warn $< + sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@ Added: soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1-orig/TODO Fri Jun 1 05:31:54 2012 (r236850) @@ -0,0 +1,372 @@ +************************************************************************ +* Official mandoc TODO. +* $Id: TODO,v 1.129 2012/03/04 23:53:37 schwarze Exp $ +************************************************************************ + +************************************************************************ +* parser bugs +************************************************************************ + +- ".\}" on its own line gets translated to bare ".\&" + which forces pset() into man(7) + and then triggers an unknown macro error + reported by naddy@ Sun, 3 Jul 2011 21:52:24 +0200 + +************************************************************************ +* formatter bugs +************************************************************************ + +- tbl(7): Horizontal and vertical lines are formatted badly: + With the box option, there is too much white space at the end of cells. + Horizontal lines from "=" lines are a bit too long. + yuri dot pankov at gmail dot com Thu, 14 Apr 2011 05:45:26 +0400 + +************************************************************************ +* missing features +************************************************************************ + +--- missing roff features ---------------------------------------------- + +- The pod2man preamble wants \h'...' with quoted numerical arguments, + see for example AUTHORS in MooseX::Getopt.3p, p5-MooseX-Getopt. + reported by Andreas Voegele + Tue, 22 Nov 2011 15:34:47 +0100 on ports@ + +- .if n \{ + .br\} + should cause an extra space to be raised. + +- .ad (adjust margins) + .ad l -- adjust left margin only (flush left) + .ad r -- adjust right margin only (flush right) + .ad c -- center text on line + .ad b -- adjust both margins (alias: .ad n) + .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). + +- .it (line traps) occur in mysql(1), yasm_arch(7) + generated by DocBook XSL Stylesheets v1.71.1 + reported by brad@ Sat, 15 Jan 2011 15:48:18 -0500 + +- .ns (no-space mode) occurs in xine-config(1) + reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + +- xloadimage(1) wants .ti (temporary indent), rep by naddy@ + +- .ta (tab settings) occurs in ircbug(1) and probably gnats(1) + reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 + +- \c (interrupted text) occurs in chat(8) + +- using undefined strings or macros defines them to be empty + wl@ Mon, 14 Nov 2011 14:37:01 +0000 + +--- missing mdoc features ---------------------------------------------- + +- fix bad block nesting involving multiple identical explicit blocks + see the OpenBSD mdoc_macro.c 1.47 commit message + +- .Bl -column .Xo support is missing + ultimate goal: + restore .Xr and .Dv to + lib/libc/compat-43/sigvec.3 + lib/libc/gen/signal.3 + lib/libc/sys/sigaction.2 + +- 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 + +- \\ is now implemented correctly + * when defining strings and macros using .ds and .de + * when parsing roff(7) and man(7) macro arguments + It does not yet work in mdoc(7) macro arguments + because libmdoc does not yet use mandoc_getarg(). + Also check what happens in plain text, it must be identical to \e. + +- .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). + +- implement blank `Bl -column', such as + .Bl -column + .It foo Ta bar + .El + +- explicitly disallow nested `Bl -column', which would clobber internal + flags defined for struct mdoc_macro + +- 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 + ugly code from login.conf(5): + .Bl -column minpasswordlen program xetcxmotd + .It path Ta path Ta value of Dv _PATH_DEFPATH + .br + Default search path. + reported by Michal Mazurek + via jmc@ Thu, 7 Apr 2011 16:00:53 +0059 + +- inside `.Bl -column' phrases, punctuation is handled like normal + text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -." + +- inside `.Bl -column' phrases, TERMP_IGNDELIM handling by `Pf' + is not safe, e.g. `.Bl -column .It Pf a b .' gives "ab." + but should give "ab ." + +- set a meaningful default if no `Bl' list type is assigned + +- have a blank `It' head for `Bl -tag' not puke + +- prohibit `Nm' from having non-text HEAD children + (e.g., NetBSD mDNSShared/dns-sd.1) + (mdoc_html.c and mdoc_term.c `Nm' handlers can be slightly simplified) + +- 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 + macro, while mandoc treats it as a block macro and breaks the line. + No idea how the logic for distinguishing in-line and block instances + should be, needs investigation. + uqs@ Thu, 2 Jun 2011 11:03:51 +0200 + uqs@ Thu, 2 Jun 2011 11:33:35 +0200 + +--- missing man features ----------------------------------------------- + +- groff an-ext.tmac macros (.UR, .UE) occur in xine(5) + reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + +- -T[x]html doesn't stipulate non-collapsing spaces in literal mode + +--- missing tbl features ----------------------------------------------- + +- implement basic non-parametric .de to support e.g. sox(1) + reported by naddy@ Sat, 16 Oct 2010 23:51:57 +0200 + *** sox(1) still doesn't work, tbl(1) errors need investigation + +- 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 + +--- missing misc features ---------------------------------------------- + +- clean up escape sequence handling, creating three classes: + (1) fully implemented, or parsed and ignored without loss of content + (2) unimplemented, potentially causing loss of content + or serious mangling of formatting (e.g. \n) -> ERROR + see textproc/mgdiff(1) for nice examples + (3) undefined, just output the character -> perhaps WARNING + +- The \t escape sequence is the same as a literal tab, see for example + the ASCII table in hexdump(1) where + .Bl -column \&000_nu \&001_so \&002_st \&003_et \&004_eo + .It \&000\ nul\t001\ soh\t002\ stx\t003\ etx\t004\ eot\t005\ enq + produces + 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq + and the example in oldrdist(1) + +- 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. + For details, see http://docutils.sourceforge.net/rst.html + noted by stsp@ Sat, 24 Apr 2010 09:17:55 +0200 + reminded by nicm@ Mon, 3 May 2010 09:52:41 +0100 + +- check compatibility with Plan9: + http://swtch.com/usr/local/plan9/tmac/tmac.an + http://swtch.com/plan9port/man/man7/man.html + "Anthony J. Bentley" 28 Dec 2010 21:58:40 -0700 + +************************************************************************ +* formatting issues: ugly output +************************************************************************ + +- a column list with blank `Ta' cells triggers a spurrious + start-with-whitespace printing of a newline + +- double quotes inside double quotes are escaped by doubling them + implement this in mdoc(7), too + so far, we only have it in roff(7) and man(7) + reminded by millert@ Thu, 09 Dec 2010 17:29:52 -0500 + +- perl(1) SYNOPSIS looks bad; reported by deraadt@ + 1) man(7) seems to need SYNOPSIS .Nm blocks, too + +- In .Bl -column, + .It Em AuthenticationKey Length + 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 + +- 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 + +- .%T can have trailing punctuation. Currently, it puts the trailing + punctuation into a trailing MDOC_TEXT element inside its own scope. + That element should rather be outside its scope, such that the + punctuation does not get underlines. This is not trivial to + implement because .%T then needs some features of in_line_eoln() - + 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". *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 05:37:25 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 6A1961068037 for ; Fri, 1 Jun 2012 05:35:48 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 05:35:48 +0000 Date: Fri, 01 Jun 2012 05:35:48 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601053548.6A1961068037@hub.freebsd.org> Cc: Subject: socsvn commit: r236851 - soc2012/jhagewood/mdocml/tests X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 05:37:25 -0000 Author: jhagewood Date: Fri Jun 1 05:35:47 2012 New Revision: 236851 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236851 Log: Modified: soc2012/jhagewood/mdocml/tests/compile-man-pages.sh Modified: soc2012/jhagewood/mdocml/tests/compile-man-pages.sh ============================================================================== --- soc2012/jhagewood/mdocml/tests/compile-man-pages.sh Fri Jun 1 05:31:54 2012 (r236850) +++ soc2012/jhagewood/mdocml/tests/compile-man-pages.sh Fri Jun 1 05:35:47 2012 (r236851) @@ -4,7 +4,7 @@ #!/bin/sh -mkdir ~/Documents/man_pages +mkdir $HOME/Documents/man_pages cd $HOME/Documents/man_pages/ mkdir ./output/ find /usr/src/ \( -name "*.1" \) -type f >> ./manpaths.txt From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 05:45:53 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 745CE1065796 for ; Fri, 1 Jun 2012 05:45:51 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 05:45:51 +0000 Date: Fri, 01 Jun 2012 05:45:51 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601054551.745CE1065796@hub.freebsd.org> Cc: Subject: socsvn commit: r236852 - in soc2012/jhagewood/mdocml: . mdocml-1.12.1 X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 05:45:53 -0000 Author: jhagewood Date: Fri Jun 1 05:45:50 2012 New Revision: 236852 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236852 Log: Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- soc2012/jhagewood/mdocml/hagewood-mdocml.patch Fri Jun 1 05:35:47 2012 (r236851) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Fri Jun 1 05:45:50 2012 (r236852) @@ -1,6 +1,6 @@ diff -rupN mdocml-1.12.1-orig/libmandoc.h mdocml-1.12.1/libmandoc.h ---- mdocml-1.12.1-orig/libmandoc.h 2012-05-31 07:34:22.000000000 -0400 -+++ mdocml-1.12.1/libmandoc.h 2012-05-31 07:34:23.000000000 -0400 +--- mdocml-1.12.1-orig/libmandoc.h 2012-06-01 05:35:15.000000000 -0400 ++++ mdocml-1.12.1/libmandoc.h 2012-06-01 05:35:16.000000000 -0400 @@ -31,6 +31,7 @@ enum rofferr { enum regs { @@ -10,8 +10,8 @@ }; diff -rupN mdocml-1.12.1-orig/mdoc_html.c mdocml-1.12.1/mdoc_html.c ---- mdocml-1.12.1-orig/mdoc_html.c 2012-05-31 07:34:22.000000000 -0400 -+++ mdocml-1.12.1/mdoc_html.c 2012-05-31 08:00:40.000000000 -0400 +--- mdocml-1.12.1-orig/mdoc_html.c 2012-06-01 05:35:15.000000000 -0400 ++++ mdocml-1.12.1/mdoc_html.c 2012-06-01 05:35:16.000000000 -0400 @@ -28,6 +28,7 @@ #include @@ -28,7 +28,7 @@ - if ( ! (MDOC_LINE & n->flags)) - h->flags |= HTML_NOSPACE; - return(1); -+ if(!roff_regisset(m->roff, REG_ns)) ++ if(!REG_ns) + { + if ( ! (MDOC_LINE & n->flags)) + h->flags |= HTML_NOSPACE; @@ -38,8 +38,8 @@ diff -rupN mdocml-1.12.1-orig/mdoc_term.c mdocml-1.12.1/mdoc_term.c ---- mdocml-1.12.1-orig/mdoc_term.c 2012-05-31 07:34:22.000000000 -0400 -+++ mdocml-1.12.1/mdoc_term.c 2012-05-31 08:00:51.000000000 -0400 +--- mdocml-1.12.1-orig/mdoc_term.c 2012-06-01 05:35:15.000000000 -0400 ++++ mdocml-1.12.1/mdoc_term.c 2012-06-01 05:35:16.000000000 -0400 @@ -29,6 +29,7 @@ #include @@ -55,7 +55,7 @@ - - if ( ! (MDOC_LINE & n->flags)) - p->flags |= TERMP_NOSPACE; -+ if (!roff_regisset(m->roff, REG_ns)) ++ if (!REG_ns) + { + if ( ! (MDOC_LINE & n->flags)) + p->flags |= TERMP_NOSPACE; @@ -65,8 +65,8 @@ } diff -rupN mdocml-1.12.1-orig/roff.c mdocml-1.12.1/roff.c ---- mdocml-1.12.1-orig/roff.c 2012-05-31 07:34:22.000000000 -0400 -+++ mdocml-1.12.1/roff.c 2012-05-31 07:34:23.000000000 -0400 +--- mdocml-1.12.1-orig/roff.c 2012-06-01 05:35:15.000000000 -0400 ++++ mdocml-1.12.1/roff.c 2012-06-01 05:43:57.000000000 -0400 @@ -55,6 +55,7 @@ enum rofft { ROFF_ns, ROFF_ps, @@ -111,7 +111,7 @@ +roff_ns(ROFF_ARGS) +{ + /* Sets no-space register to 1. (on) */ -+ REG_ns = 1; ++ r->regs[(int)REG_ns].set = 1; + return(ROFF_IGN); +} + @@ -126,7 +126,7 @@ +roff_rs(ROFF_ARGS) +{ + /* Sets no-space register to 0. */ -+ REG_ns = 0; ++ r->regs[(int)REG_ns].set = 0; + return(ROFF_IGN); +} + Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c Fri Jun 1 05:35:47 2012 (r236851) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c Fri Jun 1 05:45:50 2012 (r236852) @@ -1264,7 +1264,7 @@ roff_ns(ROFF_ARGS) { /* Sets no-space register to 1. (on) */ - REG_ns = 1; + r->regs[(int)REG_ns].set = 1; return(ROFF_IGN); } @@ -1288,7 +1288,7 @@ roff_rs(ROFF_ARGS) { /* Sets no-space register to 0. */ - REG_ns = 0; + r->regs[(int)REG_ns].set = 0; return(ROFF_IGN); } From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 05:55:00 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 94D21106564A for ; Fri, 1 Jun 2012 05:54:58 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 05:54:58 +0000 Date: Fri, 01 Jun 2012 05:54:58 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601055458.94D21106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r236853 - in soc2012/jhagewood/mdocml: . mdocml-1.12.1 X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 05:55:00 -0000 Author: jhagewood Date: Fri Jun 1 05:54:57 2012 New Revision: 236853 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236853 Log: Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- soc2012/jhagewood/mdocml/hagewood-mdocml.patch Fri Jun 1 05:45:50 2012 (r236852) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Fri Jun 1 05:54:57 2012 (r236853) @@ -11,7 +11,7 @@ diff -rupN mdocml-1.12.1-orig/mdoc_html.c mdocml-1.12.1/mdoc_html.c --- mdocml-1.12.1-orig/mdoc_html.c 2012-06-01 05:35:15.000000000 -0400 -+++ mdocml-1.12.1/mdoc_html.c 2012-06-01 05:35:16.000000000 -0400 ++++ mdocml-1.12.1/mdoc_html.c 2012-06-01 05:54:40.000000000 -0400 @@ -28,6 +28,7 @@ #include @@ -20,23 +20,22 @@ #include "out.h" #include "html.h" #include "mdoc.h" -@@ -767,10 +768,12 @@ mdoc_xr_pre(MDOC_ARGS) +@@ -767,9 +768,12 @@ mdoc_xr_pre(MDOC_ARGS) static int mdoc_ns_pre(MDOC_ARGS) { - - if ( ! (MDOC_LINE & n->flags)) - h->flags |= HTML_NOSPACE; -- return(1); + if(!REG_ns) + { + if ( ! (MDOC_LINE & n->flags)) + h->flags |= HTML_NOSPACE; + return(1); + } + return(1); } - diff -rupN mdocml-1.12.1-orig/mdoc_term.c mdocml-1.12.1/mdoc_term.c --- mdocml-1.12.1-orig/mdoc_term.c 2012-06-01 05:35:15.000000000 -0400 +++ mdocml-1.12.1/mdoc_term.c 2012-06-01 05:35:16.000000000 -0400 Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Fri Jun 1 05:45:50 2012 (r236852) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Fri Jun 1 05:54:57 2012 (r236853) @@ -774,6 +774,7 @@ h->flags |= HTML_NOSPACE; return(1); } + return(1); } From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 06:21:48 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id A2598106566B for ; Fri, 1 Jun 2012 06:21:46 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 06:21:46 +0000 Date: Fri, 01 Jun 2012 06:21:46 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601062146.A2598106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236854 - soc2012/jhagewood/mdocml/tests X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 06:21:48 -0000 Author: jhagewood Date: Fri Jun 1 06:21:45 2012 New Revision: 236854 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236854 Log: Modified: soc2012/jhagewood/mdocml/tests/compile-man-pages.sh Modified: soc2012/jhagewood/mdocml/tests/compile-man-pages.sh ============================================================================== --- soc2012/jhagewood/mdocml/tests/compile-man-pages.sh Fri Jun 1 05:54:57 2012 (r236853) +++ soc2012/jhagewood/mdocml/tests/compile-man-pages.sh Fri Jun 1 06:21:45 2012 (r236854) @@ -26,3 +26,5 @@ done rm ./manpaths.txt + +exit From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 16:30:00 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id AE0B5106566B for ; Fri, 1 Jun 2012 16:29:59 +0000 (UTC) (envelope-from gpf@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 16:29:59 +0000 Date: Fri, 01 Jun 2012 16:29:59 +0000 From: gpf@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601162959.AE0B5106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236881 - soc2012/gpf/misc X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 16:30:00 -0000 Author: gpf Date: Fri Jun 1 16:29:59 2012 New Revision: 236881 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236881 Log: new version of test_checksum.c for the new version of .pefs.checksum that is created with cuckoo hashing. Modified: soc2012/gpf/misc/test_checksum.c Modified: soc2012/gpf/misc/test_checksum.c ============================================================================== --- soc2012/gpf/misc/test_checksum.c Fri Jun 1 15:52:41 2012 (r236880) +++ soc2012/gpf/misc/test_checksum.c Fri Jun 1 16:29:59 2012 (r236881) @@ -24,7 +24,7 @@ * SUCH DAMAGE. * */ - + #include __FBSDID("$FreeBSD$"); @@ -84,57 +84,40 @@ }; struct bucket { - struct file_header_head file_headers; - uint32_t offset_to_chain; - uint32_t nelements; - uint32_t elements_loaded; + struct file_header *fhp; }; -struct hash_table { - struct bucket *buckets; - uint32_t size; /* how many buckets */ +struct cuckoo_hash_table { + struct bucket *buckets1; + struct bucket *buckets2; + uint32_t size; /* how many buckets in each table */ uint32_t nelements; }; - static int -pefs_allocate_hash_table(struct hash_table *checksum_hash_tablep, uint32_t size) +pefs_allocate_hash_table(struct cuckoo_hash_table *chtp, uint32_t size) { uint32_t i; - checksum_hash_tablep->size = size; - checksum_hash_tablep->buckets = malloc (size * sizeof(struct bucket)); - - if (checksum_hash_tablep->buckets == NULL) { + chtp->size = size; + chtp->buckets1 = malloc (size * sizeof(struct bucket)); + if (chtp->buckets1 == NULL) { perror("memory allocation error"); return (ERROR); } - for (i = 0; i < checksum_hash_tablep->size; i++) { - checksum_hash_tablep->buckets[i].nelements = 0; - checksum_hash_tablep->buckets[i].elements_loaded = 0; - LIST_INIT(&(checksum_hash_tablep->buckets[i].file_headers)); + chtp->buckets2 = malloc (size * sizeof(struct bucket)); + if (chtp->buckets2 == NULL) { + perror("memory allocation error"); + return (ERROR); } - return (0); -} - -static void -pefs_add_to_bucket(struct bucket *bucketp, struct file_header *fhp) -{ - struct file_header *elementp; - struct file_header *last; - - if (bucketp->elements_loaded == 0) - LIST_INSERT_HEAD(&(bucketp->file_headers), fhp, bucket_entries); - else { - LIST_FOREACH(elementp, &(bucketp->file_headers), bucket_entries) { - last = elementp; - } - LIST_INSERT_AFTER(last, fhp, bucket_entries); + for (i = 0; i < chtp->size; i++) { + chtp->buckets1[i].fhp = NULL; + chtp->buckets2[i].fhp = NULL; } - bucketp->elements_loaded++; + return (0); } static void @@ -143,24 +126,41 @@ TAILQ_INSERT_TAIL(&(fhp->checksums), csp, checksum_entries); } -/* for debugging purposes */ static void -pefs_print_hash_table(struct hash_table *checksum_hash_tablep, uint8_t hash_len) +pefs_print_hash_table(struct cuckoo_hash_table *chtp, uint8_t hash_len) { struct file_header *fhp; struct checksum *csp; uint32_t i,j; - printf("\n+++Printing Hash Table+++\n\n"); - for (i = 0; i < checksum_hash_tablep->size; i++) { - printf("\nbucket %d with elements: %u\n", i, checksum_hash_tablep->buckets[i].nelements); - LIST_FOREACH(fhp, &(checksum_hash_tablep->buckets[i].file_headers), bucket_entries) { - printf("\tid = %llu!\tnhashes = %d\n", fhp->file_id, fhp->nhashes); + dprintf(("\n+++Printing Hash Table 1+++\n\n")); + for (i = 0; i < chtp->size; i++) { + fhp = chtp->buckets1[i].fhp; + dprintf(("\nbucket %d with element: %d\n", i, fhp == NULL ? 0 : 1)); + if (fhp != NULL) { + //dprintf(("\tpath=%s\tid = %llu\tnhashes = %d\n", fhp->path, fhp->file_id, fhp->nhashes)); + dprintf(("\tid = %llu\tnhashes = %d\n", fhp->file_id, fhp->nhashes)); + TAILQ_FOREACH(csp, &(fhp->checksums), checksum_entries) { + dprintf(("\t\tdigest=")); + for (j = 0; j < hash_len; j++) + dprintf(("%02x", csp->hash[j])); + dprintf(("\n")); + } + } + } + + dprintf(("\n+++Printing Hash Table 2+++\n\n")); + for (i = 0; i < chtp->size; i++) { + fhp = chtp->buckets2[i].fhp; + dprintf(("\nbucket %d with element: %d\n", i, fhp == NULL ? 0 : 1)); + if (fhp != NULL) { + //dprintf(("\tpath=%s\tid = %llu\tnhashes = %d\n", fhp->path, fhp->file_id, fhp->nhashes)); + dprintf(("\tid = %llu\tnhashes = %d\n", fhp->file_id, fhp->nhashes)); TAILQ_FOREACH(csp, &(fhp->checksums), checksum_entries) { - printf("\t\tdigest="); + dprintf(("\t\tdigest=")); for (j = 0; j < hash_len; j++) - printf("%02x", csp->hash[j]); - printf("\n"); + dprintf(("%02x", csp->hash[j])); + dprintf(("\n")); } } } @@ -216,70 +216,68 @@ } static int -pefs_read_bucket(int fdin, struct bucket *bp, uint32_t *buckets_offset) -{ - uint32_t offset_to_chain, nelements; - int bytes; - - //dprintf(("bucket offset = %d\n", *buckets_offset)); - - bytes = pread(fdin, &offset_to_chain, sizeof(offset_to_chain), *buckets_offset); - if (bytes != sizeof(offset_to_chain)) { - perror("error reading from .pefs.checksum"); - return (ERROR); - } - bp->offset_to_chain = le32toh(offset_to_chain); - (*buckets_offset)+= sizeof(offset_to_chain); - - bytes = pread(fdin, &nelements, sizeof(nelements), *buckets_offset); - if (bytes != sizeof(nelements)) { - perror("error reading from .pefs.checksum"); - return (ERROR); - } - bp->nelements = le32toh(nelements); - (*buckets_offset)+= sizeof(nelements); - - //dprintf(("\n++priting bucket info++\n")); - //dprintf(("offset to chain %d\nnelements %d\n", bp->offset_to_chain, bp->nelements)); - - return (0); -} - -static int -pefs_read_file_header(int fdin, struct file_header *fhp, uint32_t *fh_offset) +pefs_read_file_header(int fdin, struct file_header *fhp, uint32_t *buckets_offset) { uint64_t file_id; uint32_t nhashes, offset_to_checksums; int bytes; - bytes = pread(fdin, &nhashes, sizeof(nhashes), *fh_offset); + bytes = pread(fdin, &nhashes, sizeof(nhashes), *buckets_offset); if (bytes != sizeof(nhashes)) { perror("error reading from .pefs.checksum"); return (ERROR); } fhp->nhashes = le32toh(nhashes); - (*fh_offset)+= sizeof(nhashes); + (*buckets_offset)+= sizeof(nhashes); - bytes = pread(fdin, &offset_to_checksums, sizeof(offset_to_checksums), *fh_offset); + bytes = pread(fdin, &offset_to_checksums, sizeof(offset_to_checksums), *buckets_offset); if (bytes != sizeof(offset_to_checksums)) { perror("error reading from .pefs.checksum"); return (ERROR); } fhp->offset_to_checksums = le32toh(offset_to_checksums); - (*fh_offset)+= sizeof(offset_to_checksums); - - bytes = pread(fdin, &file_id, sizeof(file_id), *fh_offset); + (*buckets_offset)+= sizeof(offset_to_checksums); + + bytes = pread(fdin, &file_id, sizeof(file_id), *buckets_offset); if (bytes != sizeof(file_id)) { perror("error reading from .pefs.checksum"); return (ERROR); } fhp->file_id = le64toh(file_id); - (*fh_offset)+= sizeof(file_id); - + (*buckets_offset)+= sizeof(file_id); + //dprintf(("\nfile header offset = %d\n", *fh_offset)); //dprintf(("\n++priting file header info++\n")); - //dprintf(("nhashes %d\noffset_to_checksums %d\n", fhp->nhashes, fhp->offset_to_checksums)); - //dprintf(("file id %d\n", (int)fhp->file_id)); + //dprintf(("nhashes %d\noffset_to_checksums %u\n", fhp->nhashes, fhp->offset_to_checksums)); + //dprintf(("file id %llu\n", fhp->file_id)); + + return (0); +} + +static int +pefs_read_bucket(int fdin, struct bucket *bp, uint32_t *buckets_offset) +{ + struct file_header *fhp; + int error; + + //dprintf(("bucket offset = %d\n", *buckets_offset)); + fhp = malloc(sizeof(struct file_header)); + if (fhp == NULL) { + perror("malloc"); + return (ERROR); + } + + error = pefs_read_file_header(fdin, fhp, buckets_offset); + if (error != 0) + return (error); + + if (fhp->nhashes == 0) { + free(fhp); + fhp = NULL; + } + bp->fhp = fhp; + + //dprintf(("\n++priting bucket info++\n")); return (0); } @@ -295,7 +293,7 @@ return (ERROR); } (*hashes_offset)+= hash_len; - + //dprintf(("hashes offset = %d\n", *hashes_offset)); //dprintf(("hash %s\n", csp->hash)); @@ -303,12 +301,12 @@ } static int -pefs_read_checksum_file(int fdin, struct checksum_file_header *cfhp, struct hash_table *chtp) +pefs_read_checksum_file(int fdin, struct checksum_file_header *cfhp, struct cuckoo_hash_table *chtp) { struct bucket *bp; struct checksum *csp; struct file_header *fhp; - uint32_t i, j, k, buckets_offset, fh_offset, hashes_offset; + uint32_t i, k, buckets_offset, hashes_offset; int error; error = pefs_read_checksum_file_header(fdin, cfhp); @@ -323,27 +321,47 @@ buckets_offset = cfhp->offset_to_hash_table; for (i = 0; i < chtp->size; i++) { - bp = &chtp->buckets[i]; + bp = &chtp->buckets1[i]; error = pefs_read_bucket(fdin, bp, &buckets_offset); if (error != 0) return (error); - fh_offset = bp->offset_to_chain; + fhp = bp->fhp; + if (fhp != NULL) { + TAILQ_INIT(&(fhp->checksums)); + hashes_offset = fhp->offset_to_checksums; + + for (k = 0; k < fhp->nhashes; k++) { + csp = malloc(sizeof(struct checksum)); + if (csp == NULL) { + perror("malloc"); + return (ERROR); + } + csp->hash = malloc(cfhp->hash_len); + if (csp->hash == NULL) { + perror("malloc"); + return (ERROR); + } - for (j = 0; j < bp->nelements; j++) { - fhp = malloc(sizeof(struct file_header)); - if (fhp == NULL) { - perror("malloc"); - return (ERROR); + error = pefs_read_hash(fdin, csp, &hashes_offset, cfhp->hash_len); + if (error != 0) + return (error); + + pefs_add_to_file_header(fhp, csp); } + } + } - error = pefs_read_file_header(fdin, fhp, &fh_offset); - if (error != 0) - return (ERROR); + for (i = 0; i < chtp->size; i++) { + bp = &chtp->buckets2[i]; + error = pefs_read_bucket(fdin, bp, &buckets_offset); + if (error != 0) + return (error); + fhp = bp->fhp; + if (fhp != NULL) { TAILQ_INIT(&(fhp->checksums)); hashes_offset = fhp->offset_to_checksums; - pefs_add_to_bucket(bp, fhp); for (k = 0; k < fhp->nhashes; k++) { csp = malloc(sizeof(struct checksum)); @@ -360,7 +378,7 @@ error = pefs_read_hash(fdin, csp, &hashes_offset, cfhp->hash_len); if (error != 0) return (error); - + pefs_add_to_file_header(fhp, csp); } } @@ -377,15 +395,14 @@ /* * XXXgpf: Purpose of code is to test validity of a .pefs.checksum file. - * Output from this program's pefs_print_hash_table() is checked against + * Output from this program's pefs_print_hash_table() is checked against * output from sbin/pefs' pefs_print_hash_table(). They should match. - * */ int main(int argc, char *argv[]) { char checksum_path[MAXPATHLEN]; - struct hash_table checksum_hash_table; + struct cuckoo_hash_table checksum_hash_table; struct checksum_file_header cfh; int error, fdin; @@ -404,7 +421,8 @@ error = pefs_read_checksum_file(fdin, &cfh, &checksum_hash_table); /* this output should be the same as the one from sbin/pefs */ - pefs_print_hash_table(&checksum_hash_table, cfh.hash_len); + if (error == 0) + pefs_print_hash_table(&checksum_hash_table, cfh.hash_len); close(fdin); From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 16:30:53 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id BD4AD106566B for ; Fri, 1 Jun 2012 16:30:51 +0000 (UTC) (envelope-from gpf@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 16:30:51 +0000 Date: Fri, 01 Jun 2012 16:30:51 +0000 From: gpf@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601163051.BD4AD106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236882 - soc2012/gpf/pefs_kmod/sbin/pefs X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 16:30:53 -0000 Author: gpf Date: Fri Jun 1 16:30:51 2012 New Revision: 236882 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236882 Log: replace simple separate hashing with cuckoo hashing for .pefs.checksum. Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.h Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c ============================================================================== --- soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c Fri Jun 1 16:29:59 2012 (r236881) +++ soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c Fri Jun 1 16:30:51 2012 (r236882) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -61,13 +62,12 @@ #define PEFS_CHECKSUM_FILE_VERSION 0xDD #define PEFS_HASH_BYTE_ALIGNMENT 512 +#define PEFS_EXTRA_TABLE_SIZE 0.15 -LIST_HEAD(file_header_head, file_header); TAILQ_HEAD(checksum_head, checksum); #define PEFS_CFH_SIZE 16 #define PEFS_FH_SIZE 16 -#define PEFS_BUCKET_SIZE 8 /* XXXgpf: unions for on disk structs and move to a different header? */ struct checksum_file_header { @@ -95,18 +95,49 @@ }; struct bucket { - struct file_header_head file_headers; - uint32_t offset_to_chain; - uint32_t nelements; + struct file_header * fhp; }; -struct hash_table { - struct bucket *buckets; - uint32_t size; /* how many buckets */ +/* + * This cuckoo hashing implementation requires 2 tables, each + * with his one hash function: pefs_hash1() & pefs_hash2() + */ +struct cuckoo_hash_table { + struct bucket *buckets1; + struct bucket *buckets2; + uint32_t size; /* how many buckets in each table */ uint32_t nelements; }; static int +pefs_is_prime(uint32_t num) +{ + int i; + + if (num == 0) + return 1; + + /* XXXgpf: [TODO] Take a look at arithmetics, comparisons between signed/unsigned etc */ + for (i = 2; i <= sqrt(num); i++) { + if (num % i == 0) + return 0; + } + + return 1; +} + +static int +pefs_next_prime(uint32_t num) +{ + uint32_t i; + + for (i = num;; i++) { + if (pefs_is_prime(i)) + return i; + } +} + +static int pefs_compute_file_checksums(struct file_header *fhp, const EVP_MD *md, uint8_t hash_len) { @@ -127,6 +158,7 @@ return (PEFS_ERR_SYS); } + /* XXXgpf: shouldn't we also check for empty files? */ resid = sb.st_size; fd = open(fhp->path, O_RDONLY); @@ -158,9 +190,9 @@ EVP_DigestUpdate(&mdctx, xsct.pxsct_ctext, xsct.pxsct_ctext_len); dprintf(("read %d bytes from kernel\n\n", bytes_to_read)); - dprintf(("printing contents of buffer:")); - for (i=0; i < (int)bytes_to_read; i++) dprintf(("%c", xsct.pxsct_ctext[i])); - dprintf(("!\n")); + //dprintf(("printing contents of buffer:")); + //for (i=0; i < (int)bytes_to_read; i++) dprintf(("%c", xsct.pxsct_ctext[i])); + //dprintf(("!\n")); csp = malloc(sizeof(struct checksum)); if (csp == NULL) { @@ -201,6 +233,7 @@ nfiles = 0; while (fgets(buf, sizeof(buf), fpin) != NULL) { + /* XXXgpf: [TODO] check for numeric overflow */ nfiles++; } @@ -216,127 +249,205 @@ } static void -pefs_init_hash_table(struct hash_table *checksum_hash_tablep) +pefs_init_hash_table(struct cuckoo_hash_table *chtp) { - checksum_hash_tablep->size = 0; - checksum_hash_tablep->nelements = 0; - checksum_hash_tablep->buckets = NULL; + chtp->size = 0; + chtp->nelements = 0; + chtp->buckets1 = NULL; + chtp->buckets2 = NULL; } static int -pefs_allocate_hash_table(struct hash_table *checksum_hash_tablep, uint32_t nelements) +pefs_allocate_hash_table(struct cuckoo_hash_table *chtp, uint32_t nelements) { uint32_t i; - /* - * XXXgpf: needs optimization + /* + * spending 15% more space for each table lowers the chance to fall into an + * infinite loop during cuckoo insertion to about 1.5%. */ - checksum_hash_tablep->size = nelements; - checksum_hash_tablep->nelements = nelements; - checksum_hash_tablep->buckets = malloc (nelements * sizeof(struct bucket)); + chtp->size = pefs_next_prime(nelements + (nelements * PEFS_EXTRA_TABLE_SIZE)); + chtp->nelements = nelements; + if (chtp->size < chtp->nelements) { + pefs_warn("numeric overflow while computing hash table size"); + return (PEFS_ERR_GENERIC); + } + dprintf(("hash table elem:%u\tsize: %u\n", chtp->nelements, chtp->size)); - if (checksum_hash_tablep->buckets == NULL) { + chtp->buckets1 = malloc (chtp->size * sizeof(struct bucket)); + if (chtp->buckets1 == NULL) { pefs_warn("memory allocation error"); return (PEFS_ERR_SYS); } - for (i = 0; i < checksum_hash_tablep->size; i++) { - checksum_hash_tablep->buckets[i].nelements = 0; - LIST_INIT(&(checksum_hash_tablep->buckets[i].file_headers)); + for (i = 0; i < chtp->size; i++) + chtp->buckets1[i].fhp = NULL; + + chtp->buckets2 = malloc (chtp->size * sizeof(struct bucket)); + if (chtp->buckets2 == NULL) { + pefs_warn("memory allocation error"); + return (PEFS_ERR_SYS); } + for (i = 0; i < chtp->size; i++) + chtp->buckets2[i].fhp = NULL; + return (0); } static void -pefs_free_hash_table(struct hash_table *checksum_hash_tablep) +pefs_free_hash_table(struct cuckoo_hash_table *chtp) { struct bucket *bp; - struct file_header *fhp, *tfhp; + struct file_header *fhp; struct checksum *csp, *tcsp; uint32_t i; - if (checksum_hash_tablep->buckets != NULL) { - for (i = 0; i < checksum_hash_tablep->size; i++) { - bp = &checksum_hash_tablep->buckets[i]; - LIST_FOREACH_SAFE(fhp, &(bp->file_headers), bucket_entries, tfhp) { + if (chtp->buckets1 != NULL) { + for (i = 0; i < chtp->size; i++) { + bp = &chtp->buckets1[i]; + fhp = bp->fhp; + if (fhp != NULL) { + TAILQ_FOREACH_SAFE(csp, &(fhp->checksums), checksum_entries, tcsp) { + TAILQ_REMOVE(&(fhp->checksums), csp, checksum_entries); + if (csp->hash != NULL) + free(csp->hash); + free(csp); + } + free(fhp); + } + } + free(chtp->buckets1); + } + + if (chtp->buckets2 != NULL) { + for (i = 0; i < chtp->size; i++) { + bp = &chtp->buckets2[i]; + fhp = bp->fhp; + if (fhp != NULL) { TAILQ_FOREACH_SAFE(csp, &(fhp->checksums), checksum_entries, tcsp) { TAILQ_REMOVE(&(fhp->checksums), csp, checksum_entries); if (csp->hash != NULL) free(csp->hash); free(csp); } - LIST_REMOVE(fhp, bucket_entries); free(fhp); } } - free(checksum_hash_tablep->buckets); + free(chtp->buckets2); } } -static int -pefs_add_to_bucket(struct bucket *bucketp, struct file_header *fhp) +static uint32_t +pefs_hash1(struct cuckoo_hash_table *chtp, struct file_header *fhp) { - struct file_header *elementp; - uint32_t i; - - i = 1; + uint32_t nbucket; - if (bucketp->nelements == 0) - LIST_INSERT_HEAD(&(bucketp->file_headers), fhp, bucket_entries); - else - LIST_FOREACH(elementp, &(bucketp->file_headers), bucket_entries) { - if (elementp->file_id == fhp->file_id) { - warn("file identifier collision detected between files: %s & %s", - fhp->path, elementp->path); - return (PEFS_ERR_EXIST); - } + nbucket = fhp->file_id % chtp->size; + dprintf(("hash1: goto bucket %d\n", nbucket)); + return (nbucket); +} - if (fhp->file_id < elementp->file_id) { - LIST_INSERT_BEFORE(elementp, fhp, bucket_entries); - break; - } - else if (i++ == bucketp->nelements) { - LIST_INSERT_AFTER(elementp, fhp, bucket_entries); - break; - } - } +static uint32_t +pefs_hash2(struct cuckoo_hash_table *chtp, struct file_header *fhp) +{ + uint32_t nbucket; - bucketp->nelements++; - return (0); + nbucket = (fhp->file_id / chtp->size) % chtp->size; + dprintf(("hash2: goto bucket %d\n", nbucket)); + return (nbucket); } -static struct bucket * -pefs_find_bucket(struct hash_table *checksum_hash_tablep, struct file_header *fhp) +static int +pefs_cuckoo_insert(struct cuckoo_hash_table *chtp, + struct file_header *fhp) { - uint32_t nbucket; + struct file_header *elem, *elem1, *elem2; + uint32_t i, max_tries, pos1, pos2; + + max_tries = chtp->size; + elem = fhp; - nbucket = fhp->file_id % checksum_hash_tablep->size; - dprintf(("goto bucket %d\n", nbucket)); - return (&(checksum_hash_tablep->buckets[nbucket])); + /* file_id collision check */ + pos1 = pefs_hash1(chtp, elem); + elem1 = chtp->buckets1[pos1].fhp; + pos2 = pefs_hash2(chtp, elem); + elem2 = chtp->buckets2[pos2].fhp; + if (elem1 != NULL) { + if (elem1->file_id == fhp->file_id) { + pefs_warn("file identifier collision detected between files: %s & %s", + fhp->path, elem1->path); + return (PEFS_ERR_EXIST); + } + } + + if (elem2 != NULL) { + if (elem2->file_id == fhp->file_id) { + pefs_warn("file identifier collision detected between files: %s & %s", + fhp->path, elem2->path); + return (PEFS_ERR_EXIST); + } + } + + for (i = 0; i < max_tries; i++) { + pos1 = pefs_hash1(chtp, elem); + elem1 = chtp->buckets1[pos1].fhp; + /* do the cuckoo! */ + chtp->buckets1[pos1].fhp = elem; + if (elem1 == NULL) + return 0; + pos2 = pefs_hash2(chtp, elem1); + elem2 = chtp->buckets2[pos2].fhp; + /* do the cuckoo! */ + chtp->buckets2[pos2].fhp = elem1; + if (elem2 == NULL) + return 0; + else + elem = elem2; + } + + pefs_warn("cuckoo_insert resulted in infinite loop!"); + return (PEFS_ERR_CUCKOO_LOOP); } static int -pefs_add_to_hash_table(struct hash_table *checksum_hash_tablep, +pefs_add_to_hash_table(struct cuckoo_hash_table *chtp, struct file_header *fhp) { - return (pefs_add_to_bucket(pefs_find_bucket(checksum_hash_tablep, fhp), fhp)); + return (pefs_cuckoo_insert(chtp, fhp)); } /* for debugging purposes */ static void -pefs_print_hash_table(struct hash_table *checksum_hash_tablep, uint8_t hash_len) +pefs_print_hash_table(struct cuckoo_hash_table *chtp, uint8_t hash_len) { struct file_header *fhp; struct checksum *csp; uint32_t i,j; - dprintf(("\n+++Printing Hash Table+++\n\n")); - for (i = 0; i < checksum_hash_tablep->size; i++) { - dprintf(("\nbucket %d with elements: %u\n", i, checksum_hash_tablep->buckets[i].nelements)); - LIST_FOREACH(fhp, &(checksum_hash_tablep->buckets[i].file_headers), bucket_entries) { - //printf(("\tpath=%s!\t id = %d!\tnhashes = %d\n", fhp->path, (int)fhp->file_id, fhp->nhashes)); - dprintf(("\tid = %llu!\tnhashes = %d\n", fhp->file_id, fhp->nhashes)); + dprintf(("\n+++Printing Hash Table 1+++\n\n")); + for (i = 0; i < chtp->size; i++) { + fhp = chtp->buckets1[i].fhp; + dprintf(("\nbucket %d with element: %d\n", i, fhp == NULL ? 0 : 1)); + if (fhp != NULL) { + //dprintf(("\tpath=%s\tid = %llu\tnhashes = %d\n", fhp->path, fhp->file_id, fhp->nhashes)); + dprintf(("\tid = %llu\tnhashes = %d\n", fhp->file_id, fhp->nhashes)); + TAILQ_FOREACH(csp, &(fhp->checksums), checksum_entries) { + dprintf(("\t\tdigest=")); + for (j = 0; j < hash_len; j++) + dprintf(("%02x", csp->hash[j])); + dprintf(("\n")); + } + } + } + + dprintf(("\n+++Printing Hash Table 2+++\n\n")); + for (i = 0; i < chtp->size; i++) { + fhp = chtp->buckets2[i].fhp; + dprintf(("\nbucket %d with element: %d\n", i, fhp == NULL ? 0 : 1)); + if (fhp != NULL) { + //dprintf(("\tpath=%s\tid = %llu\tnhashes = %d\n", fhp->path, fhp->file_id, fhp->nhashes)); + dprintf(("\tid = %llu\tnhashes = %d\n", fhp->file_id, fhp->nhashes)); TAILQ_FOREACH(csp, &(fhp->checksums), checksum_entries) { dprintf(("\t\tdigest=")); for (j = 0; j < hash_len; j++) @@ -477,7 +588,7 @@ */ static int pefs_create_in_memory_db(FILE *fpin, const EVP_MD *md, uint8_t hash_len, - struct hash_table *checksum_hash_tablep, char *fsroot) + struct cuckoo_hash_table *chtp, char *fsroot) { struct statfs fs; struct file_header *fhp; @@ -493,7 +604,7 @@ if (error != 0) return (error); - error = pefs_allocate_hash_table(checksum_hash_tablep, nfiles); + error = pefs_allocate_hash_table(chtp, nfiles); if (error != 0) return (error); @@ -510,12 +621,12 @@ if (error != 0) return (error); - error = pefs_add_to_hash_table(checksum_hash_tablep, fhp); + error = pefs_add_to_hash_table(chtp, fhp); if (error != 0) return (error); } - pefs_print_hash_table(checksum_hash_tablep, hash_len); + pefs_print_hash_table(chtp, hash_len); return (error); } @@ -568,69 +679,65 @@ return (0); } -static int -pefs_write_bucket(int fdout, struct bucket *bp, uint32_t *buckets_offset) -{ - uint32_t offset_to_chain, nelements; - int bytes; - - offset_to_chain = htole32(bp->offset_to_chain); - bytes = pwrite(fdout, &offset_to_chain, sizeof(offset_to_chain), *buckets_offset); - if (bytes != sizeof(offset_to_chain)) { - warn("error writing to .pefs.checksum"); - return (PEFS_ERR_IO); - } - (*buckets_offset)+= sizeof(offset_to_chain); - - nelements = htole32(bp->nelements); - bytes = pwrite(fdout, &nelements, sizeof(nelements), *buckets_offset); - if (bytes != sizeof(nelements)) { - warn("error writing to .pefs.checksum"); - return (PEFS_ERR_IO); - } - (*buckets_offset)+= sizeof(nelements); - - return (0); -} - /* * XXXgpf: [TODO] take a look at chained offsets */ static int -pefs_write_file_header(int fdout, struct file_header *fhp, uint32_t *fh_offset) +pefs_write_file_header(int fdout, struct file_header *fhp, uint32_t *buckets_offset) { uint64_t file_id; uint32_t nhashes, offset_to_checksums; int bytes; nhashes = htole32(fhp->nhashes); - bytes = pwrite(fdout, &nhashes, sizeof(nhashes), *fh_offset); + bytes = pwrite(fdout, &nhashes, sizeof(nhashes), *buckets_offset); if (bytes != sizeof(nhashes)) { warn("error writing to .pefs.checksum"); return (PEFS_ERR_IO); } - (*fh_offset)+= sizeof(nhashes); + (*buckets_offset)+= sizeof(nhashes); offset_to_checksums = htole32(fhp->offset_to_checksums); - bytes = pwrite(fdout, &offset_to_checksums, sizeof(offset_to_checksums), *fh_offset); + bytes = pwrite(fdout, &offset_to_checksums, sizeof(offset_to_checksums), *buckets_offset); if (bytes != sizeof(offset_to_checksums)) { warn("error writing to .pefs.checksum"); return (PEFS_ERR_IO); } - (*fh_offset)+= sizeof(offset_to_checksums); + (*buckets_offset)+= sizeof(offset_to_checksums); file_id = htole64(fhp->file_id); - bytes = pwrite(fdout, &file_id, sizeof(file_id), *fh_offset); + bytes = pwrite(fdout, &file_id, sizeof(file_id), *buckets_offset); if (bytes != sizeof(file_id)) { warn("error writing to .pefs.checksum"); return (PEFS_ERR_IO); } - (*fh_offset)+= sizeof(file_id); + (*buckets_offset)+= sizeof(file_id); return (0); } static int +pefs_write_bucket(int fdout, struct bucket *bp, uint32_t *buckets_offset) +{ + struct file_header emptyfh; + struct file_header *fhp; + + fhp = bp->fhp; + if (fhp == NULL) { + /* + * XXXgpf: empty files are not allowed so nhashes == 0 symbolizes an empty bucket. + * perhaps a bitmap would be better? or we could steal a bit from some data member? + */ + emptyfh.nhashes = 0; + emptyfh.file_id = 0; + emptyfh.offset_to_checksums = 0; + fhp = &emptyfh; + } + + return (pefs_write_file_header(fdout, fhp, buckets_offset)); +} + +static int pefs_write_hash(int fdout, struct checksum *csp, uint32_t *hashes_offset, uint8_t hash_len) { int bytes; @@ -649,16 +756,32 @@ * All data member writes are done separately so as to avoid alignment problems. * Writes are always in little endian byte order. * - * XXXgpf: [TODO] more comments about internal structure of file. This should probably - * be done after design crystalizes (cuckoo hashing? embed? etc). + * First 16 bytes of .pefs.checksum are filled with .pefs.checksum's file header. + * Right after this header lies the 'index' part of our database. This index is later + * kept in kernel memory. + * + * Index: + * Both hash tables of cuckoo algorithm are written to the file sequentially. The + * first hash table corresponds to hash1() and the second hash table to hash2(). + * Each bucket (cell) of a hash table contains at most one entry(=file_header). + * The size of an entry is 16 bytes. + * + * hash table entries end at the following offset: + * 16 + hash_table_size * 2 * 16 + * + * Checksums: + * The last part of .pefs.checksum is filled with the actual checksums. + * The offset where the first checksum starts is a 512 aligned address. + * Each hash table file header entry contains an offset that points to the beginning + * of a chain of checksums for that particular file's 4k blocks. */ static int -pefs_write_checksum_file(int fdout, struct checksum_file_header *cfhp, struct hash_table *chtp) +pefs_write_checksum_file(int fdout, struct checksum_file_header *cfhp, struct cuckoo_hash_table *chtp) { struct bucket *bp; struct checksum *csp; struct file_header *fhp; - uint32_t i, buckets_offset, fh_offset, hashes_offset; + uint32_t i, buckets_offset, hashes_offset; int error; error = pefs_write_checksum_file_header(fdout, cfhp); @@ -668,29 +791,40 @@ /* this points to where the buckets start */ buckets_offset = cfhp->offset_to_hash_table; - /* this points to where the buckets stop and the file headers start */ - fh_offset = buckets_offset; - fh_offset+= chtp->size * PEFS_BUCKET_SIZE; - - /* this points to where the file headers stop and the checksums start */ - hashes_offset = fh_offset; - hashes_offset+= chtp->nelements * PEFS_FH_SIZE; + /* this points to where the buckets stop and the checksums start */ + hashes_offset = buckets_offset; + hashes_offset+= chtp->size * PEFS_FH_SIZE * 2; if (hashes_offset % PEFS_HASH_BYTE_ALIGNMENT != 0) hashes_offset+= PEFS_HASH_BYTE_ALIGNMENT - (hashes_offset % PEFS_HASH_BYTE_ALIGNMENT); for (i = 0; i < chtp->size; i++) { - bp = &chtp->buckets[i]; - bp->offset_to_chain = fh_offset; + bp = &chtp->buckets1[i]; + if (bp->fhp != NULL) + bp->fhp->offset_to_checksums = hashes_offset; error = pefs_write_bucket(fdout, bp, &buckets_offset); if (error != 0) return (error); - LIST_FOREACH(fhp, &(chtp->buckets[i].file_headers), bucket_entries) { - fhp->offset_to_checksums = hashes_offset; - error = pefs_write_file_header(fdout, fhp, &fh_offset); - if (error != 0) - return (error); + fhp = bp->fhp; + if (fhp != NULL) { + TAILQ_FOREACH(csp, &(fhp->checksums), checksum_entries) { + error = pefs_write_hash(fdout, csp, &hashes_offset, cfhp->hash_len); + if (error != 0) + return (error); + } + } + } + for (i = 0; i < chtp->size; i++) { + bp = &chtp->buckets2[i]; + if (bp->fhp != NULL) + bp->fhp->offset_to_checksums = hashes_offset; + error = pefs_write_bucket(fdout, bp, &buckets_offset); + if (error != 0) + return (error); + + fhp = bp->fhp; + if (fhp != NULL) { TAILQ_FOREACH(csp, &(fhp->checksums), checksum_entries) { error = pefs_write_hash(fdout, csp, &hashes_offset, cfhp->hash_len); if (error != 0) @@ -704,7 +838,7 @@ static void pefs_init_checksum_file_header(struct checksum_file_header *cfhp, const char *algo, - uint8_t hash_len, struct hash_table *chtp) + uint8_t hash_len, struct cuckoo_hash_table *chtp) { cfhp->hash_len = hash_len; cfhp->hash_table_size = chtp->size; @@ -761,7 +895,7 @@ int pefs_create_checksum_file(FILE *fpin, char *fsroot, char *csm_path, const char *algo) { - struct hash_table checksum_hash_table; + struct cuckoo_hash_table checksum_hash_table; struct checksum_file_header cfh; const EVP_MD *md; int error, fdout; @@ -784,6 +918,11 @@ error = pefs_create_in_memory_db(fpin, md, hash_len, &checksum_hash_table, fsroot); + /* + * XXXgpf: [TODO] Properly handle PEFS_ERR_CUCKOO_LOOP by retrying with + * larger tables (next prime number?). We shouldn't have to reread all + * file entries btw. + */ if (error != 0) goto out; Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.h ============================================================================== --- soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.h Fri Jun 1 16:29:59 2012 (r236881) +++ soc2012/gpf/pefs_kmod/sbin/pefs/pefs_ctl.h Fri Jun 1 16:30:51 2012 (r236882) @@ -61,6 +61,7 @@ #define PEFS_ERR_NOENT 5 #define PEFS_ERR_EXIST 6 #define PEFS_ERR_INVALID 7 +#define PEFS_ERR_CUCKOO_LOOP 8 #define PEFS_FS_IGNORE_TYPE 0x0001 From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 16:33:46 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 81BA81065674 for ; Fri, 1 Jun 2012 16:33:45 +0000 (UTC) (envelope-from gpf@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 16:33:45 +0000 Date: Fri, 01 Jun 2012 16:33:45 +0000 From: gpf@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601163345.81BA81065674@hub.freebsd.org> Cc: Subject: socsvn commit: r236883 - soc2012/gpf/pefs_kmod/sbin/pefs X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 16:33:46 -0000 Author: gpf Date: Fri Jun 1 16:33:45 2012 New Revision: 236883 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236883 Log: fix typo Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c Modified: soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c ============================================================================== --- soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c Fri Jun 1 16:30:51 2012 (r236882) +++ soc2012/gpf/pefs_kmod/sbin/pefs/pefs_checksum.c Fri Jun 1 16:33:45 2012 (r236883) @@ -100,7 +100,7 @@ /* * This cuckoo hashing implementation requires 2 tables, each - * with his one hash function: pefs_hash1() & pefs_hash2() + * with his own hash function: pefs_hash1() & pefs_hash2() */ struct cuckoo_hash_table { struct bucket *buckets1; From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 16:36:42 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 747B01065670 for ; Fri, 1 Jun 2012 16:36:40 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 16:36:40 +0000 Date: Fri, 01 Jun 2012 16:36:40 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601163640.747B01065670@hub.freebsd.org> Cc: Subject: socsvn commit: r236884 - in soc2012/gmiller/locking-head: include lib/libthr/thread X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 16:36:42 -0000 Author: gmiller Date: Fri Jun 1 16:36:40 2012 New Revision: 236884 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236884 Log: Modify the build to produce a linker error when linking code compiled with LOCK_PROFILING with libthr, and make libthr_profile compatible with code compiled without LOCK_PROFILING. Modified: soc2012/gmiller/locking-head/include/pthread.h soc2012/gmiller/locking-head/lib/libthr/thread/thr_cond.c soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c Modified: soc2012/gmiller/locking-head/include/pthread.h ============================================================================== --- soc2012/gmiller/locking-head/include/pthread.h Fri Jun 1 16:33:45 2012 (r236883) +++ soc2012/gmiller/locking-head/include/pthread.h Fri Jun 1 16:36:40 2012 (r236884) @@ -179,12 +179,6 @@ __pthread_cleanup_pop_imp(execute); \ } -#ifdef LOCK_PROFILING -#define _PTHREAD_PROFILE_PARMS , const char *, int -#else -#define _PTHREAD_PROFILE_PARMS /* */ -#endif - int pthread_condattr_destroy(pthread_condattr_t *); int pthread_condattr_getclock(const pthread_condattr_t *, clockid_t *); @@ -198,10 +192,9 @@ const pthread_condattr_t *); int pthread_cond_signal(pthread_cond_t *); int pthread_cond_timedwait(pthread_cond_t *, - pthread_mutex_t *, const struct timespec * - _PTHREAD_PROFILE_PARMS); -int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t * - _PTHREAD_PROFILE_PARMS); + pthread_mutex_t *, + const struct timespec *); +int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); int pthread_create(pthread_t *, const pthread_attr_t *, void *(*) (void *), void *); int pthread_detach(pthread_t); @@ -223,10 +216,10 @@ int pthread_mutex_destroy(pthread_mutex_t *); int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *); -int pthread_mutex_lock(pthread_mutex_t * _PTHREAD_PROFILE_PARMS); -int pthread_mutex_trylock(pthread_mutex_t * _PTHREAD_PROFILE_PARMS); +int pthread_mutex_lock(pthread_mutex_t *); +int pthread_mutex_trylock(pthread_mutex_t *); int pthread_mutex_timedlock(pthread_mutex_t *, - const struct timespec * _PTHREAD_PROFILE_PARMS); + const struct timespec *); int pthread_mutex_unlock(pthread_mutex_t *); int pthread_once(pthread_once_t *, void (*) (void)); int pthread_rwlock_destroy(pthread_rwlock_t *); @@ -304,22 +297,39 @@ #ifdef LOCK_PROFILING -#ifndef pthread_mutex_lock +int _pthread_cond_timedwait_profiled(pthread_cond_t *, + pthread_mutex_t *, + const struct timespec *, + const char *, int); +int _pthread_cond_wait_profiled(pthread_cond_t *, + pthread_mutex_t *, + const char *, + int); +int _pthread_mutex_lock_profiled(pthread_mutex_t *, + const char *, + int); +int _pthread_mutex_trylock_profiled(pthread_mutex_t *, + const char *, + int); +int _pthread_mutex_timedlock_profiled(pthread_mutex_t *, + const struct timespec *, + const char *, + int); + +#ifdef pthread_mutex_lock + +#undef pthread_mutex_lock +#undef pthread_mutex_trylock +#undef pthread_mutex_timedlock + +#endif + #define pthread_mutex_lock(m) \ - pthread_mutex_lock (m, __FILE__, __LINE__) + _pthread_mutex_lock(m, __FILE__, __LINE__) #define pthread_mutex_trylock(m) \ - pthread_mutex_trylock (m, __FILE__, __LINE__) + _pthread_mutex_trylock(m, __FILE__, __LINE__) #define pthread_mutex_timedlock(m, t) \ - pthread_mutex_timedlock (m, t, __FILE__, __LINE__) -#endif - -#define _pthread_mutex_lock(m) \ - _pthread_mutex_lock (m, __FILE__, __LINE__) -#define _pthread_mutex_trylock(m) \ - _pthread_mutex_trylock (m, __FILE__, __LINE__) -#define _pthread_mutex_timedlock(m, t) \ - _pthread_mutex_timedlock (m, t, __FILE__, __LINE__) - + _pthread_mutex_timedlock(m, t, __FILE__, __LINE__) #endif #endif Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_cond.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_cond.c Fri Jun 1 16:33:45 2012 (r236883) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_cond.c Fri Jun 1 16:36:40 2012 (r236884) @@ -39,15 +39,28 @@ /* * Prototypes */ -int __pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex _PROFILE_PARMS); +int __pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex); int __pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec * abstime _PROFILE_PARMS); + const struct timespec *abstime); static int cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); static int cond_wait_common(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec *abstime, int cancel _PROFILE_PARMS); + const struct timespec *abstime, int cancel + _PROFILE_PARMS); static int cond_signal_common(pthread_cond_t *cond); static int cond_broadcast_common(pthread_cond_t *cond); +#ifdef LOCK_PROFILING +int __pthread_cond_wait_profiled(pthread_cond_t *cond, + pthread_mutex_t *mutex, + const char *file, + int line); +int __pthread_cond_timedwait_profiled(pthread_cond_t *cond, + pthread_mutex_t *mutex, + const struct timespec * abstime, + const char *file, + int line); +#endif + /* * Double underscore versions are cancellation points. Single underscore * versions are not and are provided for libc internal usage (which @@ -300,14 +313,36 @@ } int -_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex _PROFILE_PARMS) +_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) +#ifdef LOCK_PROFILING +{ + return (_pthread_cond_wait_profiled(cond, mutex, __FILE__, __LINE__)); +} + +int +_pthread_cond_wait_profiled(pthread_cond_t *cond, + pthread_mutex_t *mutex, + const char *file, + int line) +#endif { return (cond_wait_common(cond, mutex, NULL, 0 _PROFILE_PASS)); } int -__pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex _PROFILE_PARMS) +__pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) +#ifdef LOCK_PROFILING +{ + return (__pthread_cond_wait_profiled(cond, mutex, __FILE__, __LINE__)); +} + +int +__pthread_cond_wait_profiled(pthread_cond_t *cond, + pthread_mutex_t *mutex, + const char *file, + int line) +#endif { return (cond_wait_common(cond, mutex, NULL, 1 _PROFILE_PASS)); @@ -315,7 +350,19 @@ int _pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec * abstime _PROFILE_PARMS) + const struct timespec *abstime) +#ifdef LOCK_PROFILING +{ + return (_pthread_cond_timedwait_profiled(cond, mutex, abstime, + __FILE__, __LINE__)); +} + +int +_pthread_cond_timedwait_profiled(pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime, + const char *file, + int line) +#endif { if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 || @@ -327,7 +374,19 @@ int __pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec *abstime _PROFILE_PARMS) + const struct timespec *abstime) +#ifdef LOCK_PROFILING +{ + return (__pthread_cond_timedwait_profiled(cond, mutex, abstime, + __FILE__, __LINE__)); +} + +int +__pthread_cond_timedwait_profiled(pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime, + const char *file, + int line) +#endif { if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 || Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c Fri Jun 1 16:33:45 2012 (r236883) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c Fri Jun 1 16:36:40 2012 (r236884) @@ -76,10 +76,10 @@ */ int __pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *mutex_attr); -int __pthread_mutex_trylock(pthread_mutex_t *mutex _PROFILE_PARMS); -int __pthread_mutex_lock(pthread_mutex_t *mutex _PROFILE_PARMS); +int __pthread_mutex_trylock(pthread_mutex_t *mutex); +int __pthread_mutex_lock(pthread_mutex_t *mutex); int __pthread_mutex_timedlock(pthread_mutex_t *mutex, - const struct timespec *abstime _PROFILE_PARMS); + const struct timespec *abstime); int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex, void *(calloc_cb)(size_t, size_t)); int _pthread_mutex_getspinloops_np(pthread_mutex_t *mutex, int *count); @@ -96,6 +96,19 @@ static int mutex_lock_sleep(struct pthread *, pthread_mutex_t, const struct timespec * _PROFILE_PARMS); +#ifdef LOCK_PROFILING +int __pthread_mutex_trylock_profiled(pthread_mutex_t *mutex, + const char *file, + int line); +int __pthread_mutex_lock_profiled(pthread_mutex_t *mutex, + const char *file, + int line); +int __pthread_mutex_timedlock_profiled(pthread_mutex_t *mutex, + const struct timespec *abstime, + const char *file, + int line); +#endif + __weak_reference(__pthread_mutex_init, pthread_mutex_init); __strong_reference(__pthread_mutex_init, _pthread_mutex_init); __weak_reference(__pthread_mutex_lock, pthread_mutex_lock); @@ -340,7 +353,17 @@ } int -__pthread_mutex_trylock(pthread_mutex_t *mutex _PROFILE_PARMS) +__pthread_mutex_trylock(pthread_mutex_t *mutex) +#ifdef LOCK_PROFILING +{ + return (__pthread_mutex_trylock_profiled(mutex, __FILE__, __LINE__)); +} + +int +__pthread_mutex_trylock_profiled(pthread_mutex_t *mutex, + const char *file, + int line) +#endif { struct pthread_mutex *m; @@ -444,7 +467,17 @@ } int -__pthread_mutex_lock(pthread_mutex_t *mutex _PROFILE_PARMS) +__pthread_mutex_lock(pthread_mutex_t *mutex) +#ifdef LOCK_PROFILING +{ + return (__pthread_mutex_lock_profiled(mutex, __FILE__, __LINE__)); +} + +int +__pthread_mutex_lock_profiled(pthread_mutex_t *mutex, + const char *file, + int line) +#endif { struct pthread_mutex *m; @@ -456,7 +489,20 @@ } int -__pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abstime _PROFILE_PARMS) +__pthread_mutex_timedlock(pthread_mutex_t *mutex, + const struct timespec *abstime) +#ifdef LOCK_PROFILING +{ + return (__pthread_mutex_timedlock_profiled(mutex, abstime, + __FILE__, __LINE__)); +} + +int +__pthread_mutex_timedlock_profiled(pthread_mutex_t *mutex, + const struct timespec *abstime, + const char *file, + int line) +#endif { struct pthread_mutex *m; From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 21:06:42 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 52334106566C for ; Fri, 1 Jun 2012 21:06:40 +0000 (UTC) (envelope-from aleek@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 21:06:40 +0000 Date: Fri, 01 Jun 2012 21:06:40 +0000 From: aleek@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601210640.52334106566C@hub.freebsd.org> Cc: Subject: socsvn commit: r236899 - in soc2012/aleek/beaglexm-armv6/sys: arm/conf arm/ti arm/ti/am37x arm/ti/am37xx arm/ti/omap3 conf X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 21:06:42 -0000 Author: aleek Date: Fri Jun 1 21:06:39 2012 New Revision: 236899 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236899 Log: added gptimer and timer for soc Added: soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/ soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_gptimer.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_gptimer.h soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_timer.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/files.am37x soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/files.beagleboardxm soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/std.am37x soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/std.beagleboardxm soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/files.omap3 soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/std.omap3 Deleted: soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37xx/ soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/files.omap35xx soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap35xx.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_intr.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_prcm_clks.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_scm_padconf.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/std.omap35xx soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/std.omap37xx soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/uart_bus_omap3.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/uart_cpu_omap3.c Modified: soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_timer.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_cpuid.h soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_machdep.c soc2012/aleek/beaglexm-armv6/sys/conf/options.arm Modified: soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM ============================================================================== --- soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM Fri Jun 1 19:26:38 2012 (r236898) +++ soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM Fri Jun 1 21:06:39 2012 (r236899) @@ -26,7 +26,7 @@ #hints "BEAGLEBOARD.hints" -include "../ti/omap3/std.omap35xx" +include "../ti/am37x/std.beagleboardxm" #To statically compile in device wiring instead of /boot/device.hints makeoptions MODULES_OVERRIDE="" @@ -37,7 +37,7 @@ options HZ=100 options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking +#options INET #InterNETworking #options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support @@ -72,14 +72,14 @@ device loop #device ether #device mii -device smc -device smcphy -device uart -device uart_ns8250 +#device smc +#device smcphy +#device uart +#device uart_ns8250 device pty -device gpio +#device gpio # Debugging for use in -current options VERBOSE_SYSINIT #Enable verbose sysinit messages @@ -114,3 +114,7 @@ #device axe # ASIX Electronics USB Ethernet +# Flattened Device Tree +#options FDT +#options FDT_DTB_STATIC +#makeoptions FDT_DTS_FILE=beaglebone.dts Added: soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_gptimer.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_gptimer.c Fri Jun 1 21:06:39 2012 (r236899) @@ -0,0 +1,1077 @@ +/* + * Copyright (c) 2010 + * Ben Gray . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +#define MAX_NUM_TIMERS 12 + +#define OMAP_GPTIMER_PROFILE_UNKNOWN -1 +#define OMAP_GPTIMER_PROFILE_OMAP3 3 +#define OMAP_GPTIMER_PROFILE_OMAP4 4 + + +/* Standard registers for OMAP3 and some OMAP4 devices */ +#define OMAP_GPT_TIDR 0x0000 +#define OMAP_GPT_TIOCP_CFG 0x0010 +#define OMAP_GPT_TISTAT 0x0014 +#define OMAP_GPT_TISR 0x0018 +#define OMAP_GPT_TIER 0x001C +#define OMAP_GPT_TWER 0x0020 +#define OMAP_GPT_TCLR 0x0024 +#define OMAP_GPT_TCRR 0x0028 +#define OMAP_GPT_TLDR 0x002C +#define OMAP_GPT_TTGR 0x0030 +#define OMAP_GPT_TWPS 0x0034 +#define OMAP_GPT_TMAR 0x0038 +#define OMAP_GPT_TCAR1 0x003C +#define OMAP_GPT_TSICR 0x0040 +#define OMAP_GPT_TCAR2 0x0044 +#define OMAP_GPT_TPIR 0x0048 +#define OMAP_GPT_TNIR 0x004C +#define OMAP_GPT_TCVR 0x0050 +#define OMAP_GPT_TOCR 0x0054 +#define OMAP_GPT_TOWR 0x0058 + +/* Register set for OMAP4 timers 3,4,5,6,7,8,9 & 11 */ +#define OMAP4_GPT_IRQSTATUS_RAW 0x0024 +#define OMAP4_GPT_IRQSTATUS 0x0028 +#define OMAP4_GPT_IRQENABLE_SET 0x002C +#define OMAP4_GPT_IRQENABLE_CLR 0x0030 +#define OMAP4_GPT_IRQWAKEEN 0x0034 +#define OMAP4_GPT_TCLR 0x0038 +#define OMAP4_GPT_TCRR 0x003C +#define OMAP4_GPT_TLDR 0x0040 +#define OMAP4_GPT_TTGR 0x0044 +#define OMAP4_GPT_TWPS 0x0048 +#define OMAP4_GPT_TMAR 0x004C +#define OMAP4_GPT_TCAR1 0x0050 +#define OMAP4_GPT_TSICR 0x0054 +#define OMAP4_GPT_TCAR2 0x0058 + + + +/* GPT_TCLR Register bit fields */ +#define TCLR_GPO_CFG (0x1 << 14) +#define TCLR_CAPT_MODE (0x1 << 13) +#define TCLR_PT (0x1 << 12) +#define TCLR_TRG_MASK (0x3 << 10) +#define TCLR_TCM_MASK (0x3 << 8) +#define TCLR_SCPWM (0x1 << 7) +#define TCLR_CE (0x1 << 6) +#define TCLR_PRE (0x1 << 5) +#define TCLR_PTV_MASK (0x7 << 2) +#define TCLR_AR (0x1 << 1) +#define TCLR_ST (0x1 << 0) + +/* The interrupt/status bits used in the timer registers. */ +#define TCAR (0x1 << 2) +#define OVF (0x1 << 1) +#define MAT (0x1 << 0) + + + + +struct omap_gptimer_dev { + /* The profile of the timer */ + int profile; + + /* The source clock to use */ + unsigned int source; + + /* The register offsets of these key registers */ + uint32_t tclr; + uint32_t tcrr; + uint32_t tldr; +}; + + + +/** + * Data structure per Timer. + * + * + */ +struct omap_gptimer { + + /* Flags indicating current and configured status */ + unsigned int flags; + +#define OMAP_GPTIMER_AVAILABLE_FLAG 0x01000000 +#define OMAP_GPTIMER_ACTIVATED_FLAG 0x02000000 + + /* Lock taken when configuring the registers */ + struct mtx mtx; + + /* The memory resource for the timer register set */ + struct resource* mem_res; + + /* The IRQ resource and handle (if installed) for the timer */ + struct resource* irq_res; + void* irq_h; + + /* Callback function used when an interrupt is tripped on the given channel */ + void (*callback)(void *data); + + /* Callback data passed in the callback ... duh */ + void* callback_data; + + /* The profile of the timer, basically defines the register layout */ + unsigned int profile; + + /* The source clock to use */ + unsigned int source; + + /* Stores the address of the registers, needed because different version + * of the timer have different register offsets. + */ + uint32_t tclr; + uint32_t tcrr; + uint32_t tldr; + +}; + + +/** + * Macros for driver mutex locking + */ +#define OMAP_GPTIMER_LOCK(_tmr) mtx_lock(&(_tmr)->mtx) +#define OMAP_GPTIMER_UNLOCK(_tmr) mtx_unlock(&(_tmr)->mtx) +#define OMAP_GPTIMER_ASSERT_LOCKED(_tmr) mtx_assert(&(_tmr)->mtx, MA_OWNED); +#define OMAP_GPTIMER_ASSERT_UNLOCKED(_tmr) mtx_assert(&(_tmr)->mtx, MA_NOTOWNED); + + + +/** + * Timer driver context, allocated and stored globally, this driver is not + * intended to ever be unloaded (see g_omap_gptimer_sc). + * + */ +struct omap_gptimer_softc { + device_t sc_dev; + unsigned int sc_num_timers; + struct omap_gptimer sc_timers[MAX_NUM_TIMERS]; + struct omap_gptimer *sc_tick_timer; + +}; + +static struct omap_gptimer_softc *g_omap_gptimer_sc = NULL; + + + + + + +/** + * omap_gptimer_readl - reads a 32-bit value from one of the timer registers + * @timer: Timer device context + * @off: The offset of a register from the timer register address range + * + * + * RETURNS: + * 32-bit value read from the register. + */ +static inline uint32_t +omap_gptimer_readl(struct omap_gptimer *timer, bus_size_t off) +{ + return (bus_read_4(timer->mem_res, off)); +} + +/** + * omap_gptimer_writel - writes a 32-bit value to one of the timer registers + * @timer: Timer device context + * @off: The offset of a register from the timer register address range + * @val: The value to write into the register + * + * + * RETURNS: + * nothing + */ +static inline void +omap_gptimer_writel(struct omap_gptimer *timer, bus_size_t off, uint32_t val) +{ + bus_write_4(timer->mem_res, off, val); +} + + + + +/** + * omap_gptimer_intr - interrupt handler for the timers + * @arg: pointer to the timer structure + * + * Interrupt handler for all the timer interrupts, invovkes the callback + * function supplied when the timer was activated. + * + * + * RETURNS: + * Nothing + */ +static void +omap_gptimer_intr(void *arg) +{ + struct omap_gptimer *timer = (struct omap_gptimer *) arg; + void (*callback)(void *data); + void* callback_data; + uint32_t stat = 0x0000; + + OMAP_GPTIMER_LOCK(timer); + + /* Read the interrupt status flag and clear it */ + if (timer->profile == OMAP_GPTIMER_PROFILE_OMAP3) { + + /* Read the status and it with the enable flag */ + stat = omap_gptimer_readl(timer, OMAP_GPT_TISR); + stat &= omap_gptimer_readl(timer, OMAP_GPT_TIER); + + /* Clear the status flag */ + omap_gptimer_writel(timer, OMAP_GPT_TISR, stat); + } + else if (timer->profile == OMAP_GPTIMER_PROFILE_OMAP4) { + + /* Read the status */ + stat = omap_gptimer_readl(timer, OMAP4_GPT_IRQSTATUS); + + /* Clear the status flag */ + omap_gptimer_writel(timer, OMAP4_GPT_IRQENABLE_CLR, stat); + } + + /* Store the callback details before releasing the lock */ + callback = timer->callback; + callback_data = timer->callback_data; + + OMAP_GPTIMER_UNLOCK(timer); + + /* Check if an actual overflow interrupt */ + if ((stat & OVF) && (callback != NULL)) + callback(timer->callback_data); + + +} + + + +/** + * omap_gptimer_intr_filter_ack - acknowledges a timer interrupt + * @n: the number of the timer (first timer is number 1) + * + * This function should only be called from filter interrupt handler installed + * by calling the omap_gptimer_set_intr_filter() function. + * + * RETURNS: + * Nothing + */ +void +omap_gptimer_intr_filter_ack(unsigned int n) +{ + struct omap_gptimer_softc *sc = g_omap_gptimer_sc; + struct omap_gptimer *timer; + uint32_t stat; + + /* Get a pointer to the individual timer struct */ + timer = &sc->sc_timers[n-1]; + + OMAP_GPTIMER_LOCK(timer); + + /* Read the interrupt status flag and clear it */ + if (timer->profile == OMAP_GPTIMER_PROFILE_OMAP3) { + + /* Read the status and it with the enable flag */ + stat = omap_gptimer_readl(timer, OMAP_GPT_TISR); + stat &= omap_gptimer_readl(timer, OMAP_GPT_TIER); + + /* Clear the status flag */ + omap_gptimer_writel(timer, OMAP_GPT_TISR, stat); + } + else if (timer->profile == OMAP_GPTIMER_PROFILE_OMAP4) { + + /* Read the status */ + stat = omap_gptimer_readl(timer, OMAP4_GPT_IRQSTATUS); + + /* Clear the status flag */ + omap_gptimer_writel(timer, OMAP4_GPT_IRQENABLE_CLR, stat); + } + + OMAP_GPTIMER_UNLOCK(timer); +} + + + +/** + * omap_gptimer_set_intr_filter - sets a filter + * @n: the number of the timer (first timer is number 1) + * + * + * RETURNS: + * Returns 0 on success, otherwise an error code + */ +int +omap_gptimer_set_intr_filter(unsigned int n, driver_filter_t filter) +{ + struct omap_gptimer_softc *sc = g_omap_gptimer_sc; + struct omap_gptimer *timer; + uint32_t val; + + /* Sanity checks */ + if (sc == NULL) + return (ENOMEM); + if ((n == 0) || (n > sc->sc_num_timers)) + return (EINVAL); + + /* Get a pointer to the individual timer struct */ + timer = &sc->sc_timers[n-1]; + + OMAP_GPTIMER_LOCK(timer); + + /* If a callback is already installed this won't work */ + if (timer->callback != NULL) { + OMAP_GPTIMER_UNLOCK(timer); + return(EINVAL); + } + + /* Sanity check the timer is already activated and periodic type */ + if ((timer->flags & (OMAP_GPTIMER_ACTIVATED_FLAG | OMAP_GPTIMER_PERIODIC_FLAG)) + != (OMAP_GPTIMER_ACTIVATED_FLAG | OMAP_GPTIMER_PERIODIC_FLAG)) { + OMAP_GPTIMER_UNLOCK(timer); + return(EINVAL); + } + + + /* Attempt to activate the interrupt for the tick */ + if (bus_setup_intr(sc->sc_dev, timer->irq_res, INTR_TYPE_CLK, + filter, NULL, NULL, &timer->irq_h)) { + device_printf(sc->sc_dev, "Error: failed to activate interrupt\n"); + OMAP_GPTIMER_UNLOCK(timer); + return(EINVAL); + } + + + /* Enable the overflow interrupts */ + if (timer->profile == OMAP_GPTIMER_PROFILE_OMAP3) { + val = omap_gptimer_readl(timer, OMAP_GPT_TIER); + val |= OVF; + omap_gptimer_writel(timer, OMAP_GPT_TIER, val); + } + else if (timer->profile == OMAP_GPTIMER_PROFILE_OMAP4) { + omap_gptimer_writel(timer, OMAP4_GPT_IRQENABLE_SET, OVF); + } + + OMAP_GPTIMER_UNLOCK(timer); + + return(0); +} + + + + + +/** + * omap_gptimer_activate - configures the timer + * @n: the number of the timer (first timer is number 1) + * @flags: defines the type of timer to turn on + * @time_ns: the period of the timer in nanoseconds + * @callback: if defined this function will be called when the timer overflows + * @data: data value to pass to the callback + * + * + * RETURNS: + * Returns 0 on success, otherwise an error code + */ +int +omap_gptimer_activate(unsigned int n, unsigned int flags, unsigned int time_us, + void (*callback)(void *data), void *data) +{ + struct omap_gptimer_softc *sc = g_omap_gptimer_sc; + struct omap_gptimer *timer; + uint32_t val; + uint64_t tickcount; + unsigned int freq; + uint64_t freq64; + uint32_t prescaler; + uint32_t startcount; + + + /* Sanity checks */ + if (sc == NULL) + return (ENOMEM); + if ((n == 0) || (n > sc->sc_num_timers)) + return (EINVAL); + + /* Get a pointer to the individual timer struct */ + timer = &sc->sc_timers[n-1]; + + /* Sanity check the timer is availabe and not activated */ + if (!(timer->flags & OMAP_GPTIMER_AVAILABLE_FLAG)) { + device_printf(sc->sc_dev, "Error: timer %d not available\n", n); + return (EINVAL); + } + if (timer->flags & OMAP_GPTIMER_ACTIVATED_FLAG) { + device_printf(sc->sc_dev, "Error: timer %d already activated\n", n); + return (EINVAL); + } + + /* Set up system clock information */ + if (ti_prcm_clk_valid(timer->source) != 0) { + device_printf(sc->sc_dev, "Error: failed to find source clock\n"); + return (EINVAL); + } + + + OMAP_GPTIMER_LOCK(timer); + + /* Enable the functional and interface clock */ + if (flags & OMAP_GPTIMER_32KCLK_FLAG) + ti_prcm_clk_set_source(timer->source, F32KHZ_CLK); + else + ti_prcm_clk_set_source(timer->source, SYSCLK_CLK); + + ti_prcm_clk_enable(timer->source); + + + /* Store the flags in the timer context */ + timer->flags &= 0xFF000000; + timer->flags |= (0x00FFFFFF & flags); + + + /* Reset the timer and poll on the reset complete flag */ + if (timer->profile == OMAP_GPTIMER_PROFILE_OMAP3) { + omap_gptimer_writel(timer, OMAP_GPT_TIOCP_CFG, 0x2); + /* TODO: add a timeout */ + while ((omap_gptimer_readl(timer, OMAP_GPT_TISTAT) & 0x01) == 0x00) + continue; + + /* Clear the interrupt status */ + omap_gptimer_writel(timer, OMAP_GPT_TISR, TCAR | OVF | MAT); + } + + else if (timer->profile == OMAP_GPTIMER_PROFILE_OMAP4) { + omap_gptimer_writel(timer, OMAP_GPT_TIOCP_CFG, 0x1); + /* TODO: add a timeout */ + while ((omap_gptimer_readl(timer, OMAP_GPT_TIOCP_CFG) & 0x01) == 0x01) + continue; + + /* Clear the interrupt status */ + omap_gptimer_writel(timer, OMAP4_GPT_IRQSTATUS, TCAR | OVF | MAT); + } + + + /* If the user supplied a zero value we set a free running timer */ + if (time_us == 0) { + + /* Set the initial value and roll over value to 0 */ + startcount = 0x00000000; + + } else { + + /* We need to calculate the number of timer ticks in either the reload + * value (for periodic timers) or the overflow + */ + ti_prcm_clk_get_source_freq(timer->source, &freq); + freq64 = freq; + + /* Calculate the period of the timer, 64 bit calculations used to + * prevent rollover. + */ + tickcount = (freq64 * (uint64_t)time_us) / 1000000; + + /* Must have a count of at least 1 */ + if (tickcount == 0) + tickcount = 1; + + /* If the number is too large then see if by enabling the prescaler it + * will fit, otherwise just set the max count we can do. + */ + if (tickcount > 0xFFFFFFFFULL) { + + /* Try and find a prescaler that will match */ + for (prescaler = 0; prescaler < 7; prescaler++) { + if (tickcount < (0x1ULL << (32 + prescaler))) { + break; + } + } + + /* Adjust the count and apply the prescaler */ + tickcount >>= (prescaler + 1); + + val = omap_gptimer_readl(timer, timer->tclr); + val &= ~TCLR_PTV_MASK; + val |= TCLR_PRE | (prescaler << 2); + omap_gptimer_writel(timer, timer->tclr, val); + } + + /* Calculate the start value */ + startcount = 0xFFFFFFFFUL - (uint32_t)(tickcount & 0xFFFFFFFFUL); + +printf("[BRG] %s, %d : freq64=%llu : tickcount=%llu : startcount=%u : time_us=%u\n", + __func__, __LINE__, freq64, tickcount, startcount, time_us); + } + + /* Load the start value into the count register */ + omap_gptimer_writel(timer, timer->tcrr, startcount); + + + + /* Enable autoload mode if configuring a periodic timer or system tick + * timer. Also set the reload count to match the period tick count. + */ + if (flags & OMAP_GPTIMER_PERIODIC_FLAG) { + /* Enable auto reload */ + val = omap_gptimer_readl(timer, timer->tclr); + val |= TCLR_AR; + omap_gptimer_writel(timer, timer->tclr, val); + + /* Set the reload value */ + omap_gptimer_writel(timer, timer->tldr, startcount); + } + + + /* If a callback function has been supplied setup a overflow interrupt */ + if (callback != NULL) { + + /* Save the callback function and the data for it */ + timer->callback = callback; + timer->callback_data = data; + + /* Activate the interrupt */ + if (bus_setup_intr(sc->sc_dev, timer->irq_res, + INTR_TYPE_MISC | INTR_MPSAFE, NULL, omap_gptimer_intr, + (void*)timer, &timer->irq_h)) { + device_printf(sc->sc_dev, "Error: failed to activate interrupt\n"); + } + + /* Enable the overflow interrupts. */ + if (timer->profile == OMAP_GPTIMER_PROFILE_OMAP3) { + val = omap_gptimer_readl(timer, OMAP_GPT_TIER); + val |= OVF; + omap_gptimer_writel(timer, OMAP_GPT_TIER, val); + } + else if (timer->profile == OMAP_GPTIMER_PROFILE_OMAP4) { + omap_gptimer_writel(timer, OMAP4_GPT_IRQENABLE_SET, OVF); + } + } + + + /* Finally set the activated flag */ + timer->flags |= OMAP_GPTIMER_ACTIVATED_FLAG; + + OMAP_GPTIMER_UNLOCK(timer); + +printf("[BRG] %s, %d\n", __func__, __LINE__); + + return (0); +} + + + +/** + * omap_gptimer_deactivate - deactivates an individual timer + * @n: the number of the timer (first timer is number 1) + * + * + * RETURNS: + * Returns 0 on success, otherwise an error code + */ +int +omap_gptimer_deactivate(unsigned int n) +{ + struct omap_gptimer_softc *sc = g_omap_gptimer_sc; + struct omap_gptimer *timer; + uint32_t val; + + /* Sanity checks */ + if (sc == NULL) + return (ENOMEM); + if ((n == 0) || (n > MAX_NUM_TIMERS)) + return (EINVAL); + + /* Get a pointer to the individual timer struct */ + timer = &sc->sc_timers[n-1]; + if (!(timer->flags & OMAP_GPTIMER_ACTIVATED_FLAG)) + return (EINVAL); + + + /* Stop the timer if running */ + val = omap_gptimer_readl(timer, timer->tclr); + val &= ~TCLR_ST; + omap_gptimer_writel(timer, timer->tclr, val); + + + /* Uninstall the interrupt handler (if installed) */ + if (timer->irq_h) { + bus_teardown_intr(sc->sc_dev, timer->irq_res, timer->irq_h); + timer->irq_h = NULL; + } + + /* Disable the functional and interface clock */ + ti_prcm_clk_disable(timer->source); + + + /* Finally clear the active flag */ + timer->flags &= ~OMAP_GPTIMER_ACTIVATED_FLAG; + + return (0); +} + + +/** + * omap_gptimer_start - starts a one-shot or periodic timer + * @n: the number of the timer (first timer is number 1) + * + * + * RETURNS: + * Returns 0 on success, otherwise an error code + */ +int +omap_gptimer_start(unsigned int n) +{ + struct omap_gptimer_softc *sc = g_omap_gptimer_sc; + struct omap_gptimer *timer; + uint32_t val; + + /* Sanity checks */ + if (sc == NULL) + return (ENOMEM); + if ((n == 0) || (n > MAX_NUM_TIMERS)) + return (EINVAL); + + /* Get a pointer to the individual timer struct */ + timer = &sc->sc_timers[n-1]; + if (!(timer->flags & OMAP_GPTIMER_ACTIVATED_FLAG)) + return (EINVAL); + + OMAP_GPTIMER_LOCK(timer); + + val = omap_gptimer_readl(timer, timer->tclr); + val |= TCLR_ST; + omap_gptimer_writel(timer, timer->tclr, val); + + OMAP_GPTIMER_UNLOCK(timer); + + return (0); +} + + +/** + * omap_gptimer_stop - stops a one-shot or periodic timer + * @n: the number of the timer (first timer is number 1) + * + * + * RETURNS: + * Returns 0 on success, otherwise an error code + */ +int +omap_gptimer_stop(unsigned int n) +{ + struct omap_gptimer_softc *sc = g_omap_gptimer_sc; + struct omap_gptimer *timer; + uint32_t val; + + /* Sanity checks */ + if (sc == NULL) + return (ENOMEM); + if ((n == 0) || (n > MAX_NUM_TIMERS)) + return (EINVAL); + + /* Get a pointer to the individual timer struct */ + timer = &sc->sc_timers[n-1]; + if (!(timer->flags & OMAP_GPTIMER_ACTIVATED_FLAG)) + return (EINVAL); + + OMAP_GPTIMER_LOCK(timer); + + val = omap_gptimer_readl(timer, timer->tclr); + val &= ~TCLR_ST; + omap_gptimer_writel(timer, timer->tclr, val); + + OMAP_GPTIMER_UNLOCK(timer); + + return (0); +} + + + +/** + * omap_gptimer_read_count - reads the current timer value + * @n: the number of the timer (first timer is number 1) + * @cnt: + * + * + * RETURNS: + * Returns 0 on success, otherwise an error code + */ +int +omap_gptimer_read_count(unsigned int n, uint32_t *cnt) +{ + struct omap_gptimer_softc *sc = g_omap_gptimer_sc; + struct omap_gptimer *timer; + int ret; + + /* Sanity checks */ + if (sc == NULL) + return (ENOMEM); + if ((n == 0) || (n > sc->sc_num_timers)) + return (EINVAL); + + /* Get a pointer to the individual timer struct */ + timer = &sc->sc_timers[n-1]; + + OMAP_GPTIMER_LOCK(timer); + + if (!(timer->flags & OMAP_GPTIMER_ACTIVATED_FLAG)) { + ret = EINVAL; + } else { + *cnt = omap_gptimer_readl(timer, timer->tcrr); + ret = 0; + } + + OMAP_GPTIMER_UNLOCK(timer); + + return (ret); +} + + +/** + * omap_gptimer_write_count - writes a value into the current count + * @n: the number of the timer (first timer is number 1) + * @cnt: the value to put in the count register + * + * + * + * RETURNS: + * Returns 0 on success, otherwise an error code + */ +int +omap_gptimer_write_count(unsigned int n, uint32_t cnt) +{ + struct omap_gptimer_softc *sc = g_omap_gptimer_sc; + struct omap_gptimer *timer; + + /* Sanity checks */ + if (sc == NULL) + return (ENOMEM); + if ((n == 0) || (n > MAX_NUM_TIMERS)) + return (EINVAL); + + /* Get a pointer to the individual timer struct */ + timer = &sc->sc_timers[n-1]; + if (!(timer->flags & OMAP_GPTIMER_ACTIVATED_FLAG)) + return (EINVAL); + + OMAP_GPTIMER_LOCK(timer); + + omap_gptimer_writel(timer, timer->tcrr, cnt); + + OMAP_GPTIMER_UNLOCK(timer); + + return (0); +} + + + +/** + * omap_gptimer_set_reload - sets the reload value for the driver if periodic + * timer + * @n: the number of the timer (first timer is number 1) + * @reload: the value to put in the reload register + * + * + * + * RETURNS: + * Returns 0 on success, otherwise an error code + */ +int +omap_gptimer_set_reload(unsigned int n, uint32_t reload) +{ + struct omap_gptimer_softc *sc = g_omap_gptimer_sc; + struct omap_gptimer *timer; + + /* Sanity checks */ + if (sc == NULL) + return (ENOMEM); + if ((n == 0) || (n > MAX_NUM_TIMERS)) + return (EINVAL); + + /* Get a pointer to the individual timer struct */ + timer = &sc->sc_timers[n-1]; + if (!(timer->flags & OMAP_GPTIMER_ACTIVATED_FLAG)) + return (EINVAL); + + OMAP_GPTIMER_LOCK(timer); + + omap_gptimer_writel(timer, timer->tldr, reload); + + OMAP_GPTIMER_UNLOCK(timer); + + return (0); +} + + + + +/** + * omap_gptimer_get_freq - gets the frequency of an activated timer + * @n: the number of the timer (first timer is number 1) + * @freq: unpon return will contain the current freq + * + * The timer must be activated, if not this function will return EINVAL. + * + * RETURNS: + * Returns 0 on success, otherwise an error code + */ +int +omap_gptimer_get_freq(unsigned int n, uint32_t *freq) +{ + struct omap_gptimer_softc *sc = g_omap_gptimer_sc; + struct omap_gptimer *timer; + unsigned int src_freq; + unsigned int tmr_freq; + unsigned int prescaler; + uint32_t tclr, tldr; + int rc; + + /* Sanity checks */ + if (sc == NULL) + return (ENOMEM); + if ((n == 0) || (n > MAX_NUM_TIMERS)) + return (EINVAL); + if (freq == NULL) + return (EINVAL); + + /* Get a pointer to the individual timer struct */ + timer = &sc->sc_timers[n-1]; + if (!(timer->flags & OMAP_GPTIMER_ACTIVATED_FLAG)) + return (EINVAL); + + /* We get the frequency by first reading the source frequency */ + if ((rc = ti_prcm_clk_get_source_freq(timer->source, &src_freq)) != 0) + return (rc); + + + OMAP_GPTIMER_LOCK(timer); + + /* Determine if the pre-scalar is enabled and if so the prescaler value */ + tclr = omap_gptimer_readl(timer, timer->tclr); + if (tclr & TCLR_PRE) + prescaler = 1UL << (((tclr & TCLR_PTV_MASK) >> 2) + 1); + else + prescaler = 1; + + /* Get the reload count */ + tldr = omap_gptimer_readl(timer, timer->tldr); + + OMAP_GPTIMER_UNLOCK(timer); + + + /* Calculate the tick freq */ + tmr_freq = (src_freq / prescaler); + + /* If auto-reload mode is set and the reload count is not zero then the + * frequency is the period between overflows. + */ + if ((tclr & TCLR_AR) && (tldr != 0x00000000)) { + tmr_freq /= ((0xffffffff - tldr) + 1); + } + + + if (freq != NULL) + *freq = tmr_freq; + + return (0); +} + + + +/** + * omap_gptimer_probe - driver probe function + * @dev: timer device handle + * + * + * + * RETURNS: + * Always returns 0. + */ +static int +omap_gptimer_probe(device_t dev) +{ + + device_set_desc(dev, "TI OMAP General Purpose Timers"); + return (0); +} + + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Fri Jun 1 23:56:09 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id E99E0106566B for ; Fri, 1 Jun 2012 23:56:06 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Fri, 01 Jun 2012 23:56:06 +0000 Date: Fri, 01 Jun 2012 23:56:06 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120601235606.E99E0106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236904 - soc2012/gmiller/locking-head/lib/libthr/thread X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 23:56:09 -0000 Author: gmiller Date: Fri Jun 1 23:56:06 2012 New Revision: 236904 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236904 Log: Add thread exit lock profiling calls. Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_exit.c soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_exit.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_exit.c Fri Jun 1 21:33:33 2012 (r236903) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_exit.c Fri Jun 1 23:56:06 2012 (r236904) @@ -263,6 +263,8 @@ { struct pthread *curthread = _get_curthread(); + LOCK_PROFILE_EXIT_THREAD(curthread); + /* Check if there is thread specific data: */ if (curthread->specific != NULL) { /* Run the thread-specific data destructors: */ Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Fri Jun 1 21:33:33 2012 (r236903) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Fri Jun 1 23:56:06 2012 (r236904) @@ -747,6 +747,7 @@ __hidden; void _mutex_obtain_success(struct pthread_mutex *, const char *, int) __hidden; +void _lock_profile_exit_thread(struct pthread *curthread) __hidden; void _mutex_release(struct pthread_mutex *) __hidden; void _libpthread_init(struct pthread *) __hidden; struct pthread *_thr_alloc(struct pthread *) __hidden; @@ -807,15 +808,22 @@ void _pthread_cancel_leave(int maycancel); #ifdef LOCK_PROFILING + +#define LOCK_PROFILE_EXIT_THREAD(t) \ + _lock_profile_exit_thread(t) #define MUTEX_OBTAIN_SUCCESS(m) \ _mutex_obtain_success(m, file, line) #define MUTEX_OBTAIN_FAILED(m) \ _mutex_obtain_failed(m, file, line) #define MUTEX_RELEASE(m) _mutex_release(m) + #else + +#define LOCK_PROFILE_EXIT_THREAD(t) do { } while (0) #define MUTEX_OBTAIN_SUCCESS(m) do { } while (0) #define MUTEX_OBTAIN_FAILED(m) do { } while (0) #define MUTEX_RELEASE(m) do { } while (0) + #endif /* #include */ Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c Fri Jun 1 21:33:33 2012 (r236903) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c Fri Jun 1 23:56:06 2012 (r236904) @@ -41,3 +41,8 @@ _mutex_release(struct pthread_mutex *m) { } + +void +_lock_profile_exit_thread(struct pthread *t) +{ +} From owner-svn-soc-all@FreeBSD.ORG Sat Jun 2 06:20:28 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id F134A106566C for ; Sat, 2 Jun 2012 06:20:25 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Sat, 02 Jun 2012 06:20:25 +0000 Date: Sat, 02 Jun 2012 06:20:25 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120602062025.F134A106566C@hub.freebsd.org> Cc: Subject: socsvn commit: r236917 - in soc2012/jhagewood/mdocml: . mdocml-1.12.1 X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2012 06:20:28 -0000 Author: jhagewood Date: Sat Jun 2 06:20:25 2012 New Revision: 236917 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236917 Log: Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- soc2012/jhagewood/mdocml/hagewood-mdocml.patch Sat Jun 2 05:46:04 2012 (r236916) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Sat Jun 2 06:20:25 2012 (r236917) @@ -1,6 +1,6 @@ diff -rupN mdocml-1.12.1-orig/libmandoc.h mdocml-1.12.1/libmandoc.h --- mdocml-1.12.1-orig/libmandoc.h 2012-06-01 05:35:15.000000000 -0400 -+++ mdocml-1.12.1/libmandoc.h 2012-06-01 05:35:16.000000000 -0400 ++++ mdocml-1.12.1/libmandoc.h 2012-06-02 06:16:40.000000000 -0400 @@ -31,6 +31,7 @@ enum rofferr { enum regs { @@ -9,9 +9,63 @@ REG__MAX }; +diff -rupN mdocml-1.12.1-orig/man_html.c mdocml-1.12.1/man_html.c +--- mdocml-1.12.1-orig/man_html.c 2012-06-01 05:35:15.000000000 -0400 ++++ mdocml-1.12.1/man_html.c 2012-06-02 06:13:49.000000000 -0400 +@@ -27,6 +27,7 @@ + #include + + #include "mandoc.h" ++#include "libmandoc.h" + #include "out.h" + #include "html.h" + #include "man.h" +@@ -134,7 +135,8 @@ print_bvspace(struct html *h, const stru + if (MAN_ROOT == n->parent->type || MAN_RS != n->parent->tok) + if (NULL == n->prev) + return; +- ++ if (REG_ns) ++ return; + print_otag(h, TAG_P, 0, NULL); + } + +diff -rupN mdocml-1.12.1-orig/man_term.c mdocml-1.12.1/man_term.c +--- mdocml-1.12.1-orig/man_term.c 2012-06-01 05:35:15.000000000 -0400 ++++ mdocml-1.12.1/man_term.c 2012-06-02 06:14:07.000000000 -0400 +@@ -28,6 +28,7 @@ + #include + + #include "mandoc.h" ++#include "libmandoc.h" + #include "out.h" + #include "man.h" + #include "term.h" +@@ -455,13 +456,14 @@ pre_sp(DECL_ARGS) + len = n->child ? a2height(p, n->child->string) : 1; + break; + } +- +- if (0 == len) +- term_newln(p); +- for (i = 0; i < len; i++) +- term_vspace(p); +- +- return(0); ++ if (!REG_ns) ++ { ++ if (0 == len) ++ term_newln(p); ++ for (i = 0; i < len; i++) ++ term_vspace(p); ++ } ++ return(0); + } + + diff -rupN mdocml-1.12.1-orig/mdoc_html.c mdocml-1.12.1/mdoc_html.c --- mdocml-1.12.1-orig/mdoc_html.c 2012-06-01 05:35:15.000000000 -0400 -+++ mdocml-1.12.1/mdoc_html.c 2012-06-01 05:54:40.000000000 -0400 ++++ mdocml-1.12.1/mdoc_html.c 2012-06-02 06:08:47.000000000 -0400 @@ -28,6 +28,7 @@ #include @@ -20,25 +74,58 @@ #include "out.h" #include "html.h" #include "mdoc.h" -@@ -767,9 +768,12 @@ mdoc_xr_pre(MDOC_ARGS) +@@ -1614,27 +1615,29 @@ mdoc_pp_pre(MDOC_ARGS) static int - mdoc_ns_pre(MDOC_ARGS) + mdoc_sp_pre(MDOC_ARGS) { -- -- if ( ! (MDOC_LINE & n->flags)) -- h->flags |= HTML_NOSPACE; -+ if(!REG_ns) +- struct roffsu su; +- struct htmlpair tag; ++ if (!REG_ns) + { -+ if ( ! (MDOC_LINE & n->flags)) -+ h->flags |= HTML_NOSPACE; -+ return(1); ++ struct roffsu su; ++ struct htmlpair tag; ++ ++ SCALE_VS_INIT(&su, 1); ++ ++ if (MDOC_sp == n->tok) { ++ if (NULL != (n = n->child)) ++ if ( ! a2roffsu(n->string, &su, SCALE_VS)) ++ SCALE_VS_INIT(&su, atoi(n->string)); ++ } else ++ su.scale = 0; + +- SCALE_VS_INIT(&su, 1); +- +- if (MDOC_sp == n->tok) { +- if (NULL != (n = n->child)) +- if ( ! a2roffsu(n->string, &su, SCALE_VS)) +- SCALE_VS_INIT(&su, atoi(n->string)); +- } else +- su.scale = 0; +- +- bufinit(h); +- bufcat_su(h, "height", &su); +- PAIR_STYLE_INIT(&tag, h); +- print_otag(h, TAG_DIV, 1, &tag); +- +- /* So the div isn't empty: */ +- print_text(h, "\\~"); ++ bufinit(h); ++ bufcat_su(h, "height", &su); ++ PAIR_STYLE_INIT(&tag, h); ++ print_otag(h, TAG_DIV, 1, &tag); + +- return(0); ++ /* So the div isn't empty: */ ++ print_text(h, "\\~"); + } - return(1); ++ return(0); + } diff -rupN mdocml-1.12.1-orig/mdoc_term.c mdocml-1.12.1/mdoc_term.c --- mdocml-1.12.1-orig/mdoc_term.c 2012-06-01 05:35:15.000000000 -0400 -+++ mdocml-1.12.1/mdoc_term.c 2012-06-01 05:35:16.000000000 -0400 ++++ mdocml-1.12.1/mdoc_term.c 2012-06-02 06:05:44.000000000 -0400 @@ -29,6 +29,7 @@ #include @@ -47,25 +134,29 @@ #include "out.h" #include "term.h" #include "mdoc.h" -@@ -1147,9 +1148,12 @@ termp_an_post(DECL_ARGS) - static int - termp_ns_pre(DECL_ARGS) - { +@@ -1882,12 +1883,13 @@ termp_sp_pre(DECL_ARGS) + len = 1; + break; + } +- +- if (0 == len) +- term_newln(p); +- for (i = 0; i < len; i++) +- term_vspace(p); - -- if ( ! (MDOC_LINE & n->flags)) -- p->flags |= TERMP_NOSPACE; + if (!REG_ns) + { -+ if ( ! (MDOC_LINE & n->flags)) -+ p->flags |= TERMP_NOSPACE; -+ return(1); ++ if (0 == len) ++ term_newln(p); ++ for (i = 0; i < len; i++) ++ term_vspace(p); + } - return(1); + return(0); } diff -rupN mdocml-1.12.1-orig/roff.c mdocml-1.12.1/roff.c --- mdocml-1.12.1-orig/roff.c 2012-06-01 05:35:15.000000000 -0400 -+++ mdocml-1.12.1/roff.c 2012-06-01 05:43:57.000000000 -0400 ++++ mdocml-1.12.1/roff.c 2012-06-02 06:18:39.000000000 -0400 @@ -55,6 +55,7 @@ enum rofft { ROFF_ns, ROFF_ps, @@ -125,7 +216,7 @@ +roff_rs(ROFF_ARGS) +{ + /* Sets no-space register to 0. */ -+ r->regs[(int)REG_ns].set = 0; ++ roff_regunset(r, REG_ns); + return(ROFF_IGN); +} + Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c Sat Jun 2 05:46:04 2012 (r236916) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c Sat Jun 2 06:20:25 2012 (r236917) @@ -27,6 +27,7 @@ #include #include "mandoc.h" +#include "libmandoc.h" #include "out.h" #include "html.h" #include "man.h" @@ -134,7 +135,8 @@ if (MAN_ROOT == n->parent->type || MAN_RS != n->parent->tok) if (NULL == n->prev) return; - + if (REG_ns) + return; print_otag(h, TAG_P, 0, NULL); } Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c Sat Jun 2 05:46:04 2012 (r236916) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c Sat Jun 2 06:20:25 2012 (r236917) @@ -28,6 +28,7 @@ #include #include "mandoc.h" +#include "libmandoc.h" #include "out.h" #include "man.h" #include "term.h" @@ -455,13 +456,14 @@ len = n->child ? a2height(p, n->child->string) : 1; break; } - - if (0 == len) - term_newln(p); - for (i = 0; i < len; i++) - term_vspace(p); - - return(0); + if (!REG_ns) + { + if (0 == len) + term_newln(p); + for (i = 0; i < len; i++) + term_vspace(p); + } + return(0); } Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Sat Jun 2 05:46:04 2012 (r236916) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Sat Jun 2 06:20:25 2012 (r236917) @@ -768,12 +768,9 @@ static int mdoc_ns_pre(MDOC_ARGS) { - if(!REG_ns) - { - if ( ! (MDOC_LINE & n->flags)) - h->flags |= HTML_NOSPACE; - return(1); - } + + if ( ! (MDOC_LINE & n->flags)) + h->flags |= HTML_NOSPACE; return(1); } @@ -1618,27 +1615,29 @@ static int mdoc_sp_pre(MDOC_ARGS) { - struct roffsu su; - struct htmlpair tag; - - SCALE_VS_INIT(&su, 1); + if (!REG_ns) + { + struct roffsu su; + struct htmlpair tag; - if (MDOC_sp == n->tok) { - if (NULL != (n = n->child)) - if ( ! a2roffsu(n->string, &su, SCALE_VS)) - SCALE_VS_INIT(&su, atoi(n->string)); - } else - su.scale = 0; + SCALE_VS_INIT(&su, 1); - bufinit(h); - bufcat_su(h, "height", &su); - PAIR_STYLE_INIT(&tag, h); - print_otag(h, TAG_DIV, 1, &tag); + if (MDOC_sp == n->tok) { + if (NULL != (n = n->child)) + if ( ! a2roffsu(n->string, &su, SCALE_VS)) + SCALE_VS_INIT(&su, atoi(n->string)); + } else + su.scale = 0; - /* So the div isn't empty: */ - print_text(h, "\\~"); + bufinit(h); + bufcat_su(h, "height", &su); + PAIR_STYLE_INIT(&tag, h); + print_otag(h, TAG_DIV, 1, &tag); - return(0); + /* So the div isn't empty: */ + print_text(h, "\\~"); + } + return(0); } Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Sat Jun 2 05:46:04 2012 (r236916) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Sat Jun 2 06:20:25 2012 (r236917) @@ -1148,12 +1148,9 @@ static int termp_ns_pre(DECL_ARGS) { - if (!REG_ns) - { - if ( ! (MDOC_LINE & n->flags)) - p->flags |= TERMP_NOSPACE; - return(1); - } + + if ( ! (MDOC_LINE & n->flags)) + p->flags |= TERMP_NOSPACE; return(1); } @@ -1886,12 +1883,13 @@ len = 1; break; } - - if (0 == len) - term_newln(p); - for (i = 0; i < len; i++) - term_vspace(p); - + if (!REG_ns) + { + if (0 == len) + term_newln(p); + for (i = 0; i < len; i++) + term_vspace(p); + } return(0); } Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c Sat Jun 2 05:46:04 2012 (r236916) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c Sat Jun 2 06:20:25 2012 (r236917) @@ -1288,7 +1288,7 @@ roff_rs(ROFF_ARGS) { /* Sets no-space register to 0. */ - r->regs[(int)REG_ns].set = 0; + roff_regunset(r, REG_ns); return(ROFF_IGN); } From owner-svn-soc-all@FreeBSD.ORG Sat Jun 2 06:24:39 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id C584F106566B for ; Sat, 2 Jun 2012 06:24:37 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Sat, 02 Jun 2012 06:24:37 +0000 Date: Sat, 02 Jun 2012 06:24:37 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120602062437.C584F106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r236918 - soc2012/jhagewood/mdocml X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2012 06:24:39 -0000 Author: jhagewood Date: Sat Jun 2 06:24:37 2012 New Revision: 236918 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236918 Log: Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- soc2012/jhagewood/mdocml/hagewood-mdocml.patch Sat Jun 2 06:20:25 2012 (r236917) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Sat Jun 2 06:24:37 2012 (r236918) @@ -1,6 +1,6 @@ -diff -rupN mdocml-1.12.1-orig/libmandoc.h mdocml-1.12.1/libmandoc.h ---- mdocml-1.12.1-orig/libmandoc.h 2012-06-01 05:35:15.000000000 -0400 -+++ mdocml-1.12.1/libmandoc.h 2012-06-02 06:16:40.000000000 -0400 +diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/libmandoc.h jhagewood/mdocml/mdocml-1.12.1/libmandoc.h +--- jhagewood/mdocml/mdocml-1.12.1-orig/libmandoc.h 2012-06-01 05:35:15.000000000 -0400 ++++ jhagewood/mdocml/mdocml-1.12.1/libmandoc.h 2012-06-02 06:16:40.000000000 -0400 @@ -31,6 +31,7 @@ enum rofferr { enum regs { @@ -9,9 +9,9 @@ REG__MAX }; -diff -rupN mdocml-1.12.1-orig/man_html.c mdocml-1.12.1/man_html.c ---- mdocml-1.12.1-orig/man_html.c 2012-06-01 05:35:15.000000000 -0400 -+++ mdocml-1.12.1/man_html.c 2012-06-02 06:13:49.000000000 -0400 +diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c jhagewood/mdocml/mdocml-1.12.1/man_html.c +--- jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c 2012-06-01 05:35:15.000000000 -0400 ++++ jhagewood/mdocml/mdocml-1.12.1/man_html.c 2012-06-02 06:13:49.000000000 -0400 @@ -27,6 +27,7 @@ #include @@ -30,9 +30,9 @@ print_otag(h, TAG_P, 0, NULL); } -diff -rupN mdocml-1.12.1-orig/man_term.c mdocml-1.12.1/man_term.c ---- mdocml-1.12.1-orig/man_term.c 2012-06-01 05:35:15.000000000 -0400 -+++ mdocml-1.12.1/man_term.c 2012-06-02 06:14:07.000000000 -0400 +diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c jhagewood/mdocml/mdocml-1.12.1/man_term.c +--- jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c 2012-06-01 05:35:15.000000000 -0400 ++++ jhagewood/mdocml/mdocml-1.12.1/man_term.c 2012-06-02 06:14:07.000000000 -0400 @@ -28,6 +28,7 @@ #include @@ -63,9 +63,9 @@ } -diff -rupN mdocml-1.12.1-orig/mdoc_html.c mdocml-1.12.1/mdoc_html.c ---- mdocml-1.12.1-orig/mdoc_html.c 2012-06-01 05:35:15.000000000 -0400 -+++ mdocml-1.12.1/mdoc_html.c 2012-06-02 06:08:47.000000000 -0400 +diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c +--- jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c 2012-06-01 05:35:15.000000000 -0400 ++++ jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c 2012-06-02 06:08:47.000000000 -0400 @@ -28,6 +28,7 @@ #include @@ -123,9 +123,9 @@ } -diff -rupN mdocml-1.12.1-orig/mdoc_term.c mdocml-1.12.1/mdoc_term.c ---- mdocml-1.12.1-orig/mdoc_term.c 2012-06-01 05:35:15.000000000 -0400 -+++ mdocml-1.12.1/mdoc_term.c 2012-06-02 06:05:44.000000000 -0400 +diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c +--- jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c 2012-06-01 05:35:15.000000000 -0400 ++++ jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c 2012-06-02 06:05:44.000000000 -0400 @@ -29,6 +29,7 @@ #include @@ -154,9 +154,9 @@ return(0); } -diff -rupN mdocml-1.12.1-orig/roff.c mdocml-1.12.1/roff.c ---- mdocml-1.12.1-orig/roff.c 2012-06-01 05:35:15.000000000 -0400 -+++ mdocml-1.12.1/roff.c 2012-06-02 06:18:39.000000000 -0400 +diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/roff.c jhagewood/mdocml/mdocml-1.12.1/roff.c +--- jhagewood/mdocml/mdocml-1.12.1-orig/roff.c 2012-06-01 05:35:15.000000000 -0400 ++++ jhagewood/mdocml/mdocml-1.12.1/roff.c 2012-06-02 06:18:39.000000000 -0400 @@ -55,6 +55,7 @@ enum rofft { ROFF_ns, ROFF_ps, From owner-svn-soc-all@FreeBSD.ORG Sat Jun 2 06:51:30 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id A8E7D106564A for ; Sat, 2 Jun 2012 06:51:28 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Sat, 02 Jun 2012 06:51:28 +0000 Date: Sat, 02 Jun 2012 06:51:28 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120602065128.A8E7D106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r236919 - in soc2012/jhagewood/mdocml: . mdocml-1.12.1 X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2012 06:51:30 -0000 Author: jhagewood Date: Sat Jun 2 06:51:27 2012 New Revision: 236919 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236919 Log: Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch ============================================================================== --- soc2012/jhagewood/mdocml/hagewood-mdocml.patch Sat Jun 2 06:24:37 2012 (r236918) +++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Sat Jun 2 06:51:27 2012 (r236919) @@ -11,7 +11,7 @@ diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c jhagewood/mdocml/mdocml-1.12.1/man_html.c --- jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c 2012-06-01 05:35:15.000000000 -0400 -+++ jhagewood/mdocml/mdocml-1.12.1/man_html.c 2012-06-02 06:13:49.000000000 -0400 ++++ jhagewood/mdocml/mdocml-1.12.1/man_html.c 2012-06-02 06:45:04.000000000 -0400 @@ -27,6 +27,7 @@ #include @@ -32,7 +32,7 @@ diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c jhagewood/mdocml/mdocml-1.12.1/man_term.c --- jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c 2012-06-01 05:35:15.000000000 -0400 -+++ jhagewood/mdocml/mdocml-1.12.1/man_term.c 2012-06-02 06:14:07.000000000 -0400 ++++ jhagewood/mdocml/mdocml-1.12.1/man_term.c 2012-06-02 06:51:05.000000000 -0400 @@ -28,6 +28,7 @@ #include @@ -65,7 +65,7 @@ diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c --- jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c 2012-06-01 05:35:15.000000000 -0400 -+++ jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c 2012-06-02 06:08:47.000000000 -0400 ++++ jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c 2012-06-02 06:46:47.000000000 -0400 @@ -28,6 +28,7 @@ #include @@ -74,35 +74,31 @@ #include "out.h" #include "html.h" #include "mdoc.h" -@@ -1614,27 +1615,29 @@ mdoc_pp_pre(MDOC_ARGS) +@@ -1614,27 +1615,27 @@ mdoc_pp_pre(MDOC_ARGS) static int mdoc_sp_pre(MDOC_ARGS) { - struct roffsu su; - struct htmlpair tag; -+ if (!REG_ns) -+ { + struct roffsu su; + struct htmlpair tag; -+ -+ SCALE_VS_INIT(&su, 1); -+ -+ if (MDOC_sp == n->tok) { -+ if (NULL != (n = n->child)) -+ if ( ! a2roffsu(n->string, &su, SCALE_VS)) -+ SCALE_VS_INIT(&su, atoi(n->string)); -+ } else -+ su.scale = 0; - SCALE_VS_INIT(&su, 1); -- ++ SCALE_VS_INIT(&su, 1); + - if (MDOC_sp == n->tok) { - if (NULL != (n = n->child)) - if ( ! a2roffsu(n->string, &su, SCALE_VS)) - SCALE_VS_INIT(&su, atoi(n->string)); - } else - su.scale = 0; -- ++ if (MDOC_sp == n->tok) { ++ if (NULL != (n = n->child)) ++ if ( ! a2roffsu(n->string, &su, SCALE_VS)) ++ SCALE_VS_INIT(&su, atoi(n->string)); ++ } else ++ su.scale = 0; + - bufinit(h); - bufcat_su(h, "height", &su); - PAIR_STYLE_INIT(&tag, h); @@ -113,19 +109,19 @@ + bufinit(h); + bufcat_su(h, "height", &su); + PAIR_STYLE_INIT(&tag, h); -+ print_otag(h, TAG_DIV, 1, &tag); ++ if (!REG_ns) ++ print_otag(h, TAG_DIV, 1, &tag); - return(0); + /* So the div isn't empty: */ + print_text(h, "\\~"); -+ } + return(0); } diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c --- jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c 2012-06-01 05:35:15.000000000 -0400 -+++ jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c 2012-06-02 06:05:44.000000000 -0400 ++++ jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c 2012-06-02 06:47:03.000000000 -0400 @@ -29,6 +29,7 @@ #include @@ -156,7 +152,7 @@ diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/roff.c jhagewood/mdocml/mdocml-1.12.1/roff.c --- jhagewood/mdocml/mdocml-1.12.1-orig/roff.c 2012-06-01 05:35:15.000000000 -0400 -+++ jhagewood/mdocml/mdocml-1.12.1/roff.c 2012-06-02 06:18:39.000000000 -0400 ++++ jhagewood/mdocml/mdocml-1.12.1/roff.c 2012-06-02 06:51:16.000000000 -0400 @@ -55,6 +55,7 @@ enum rofft { ROFF_ns, ROFF_ps, Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c ============================================================================== --- soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Sat Jun 2 06:24:37 2012 (r236918) +++ soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Sat Jun 2 06:51:27 2012 (r236919) @@ -1615,8 +1615,6 @@ static int mdoc_sp_pre(MDOC_ARGS) { - if (!REG_ns) - { struct roffsu su; struct htmlpair tag; @@ -1632,11 +1630,11 @@ bufinit(h); bufcat_su(h, "height", &su); PAIR_STYLE_INIT(&tag, h); - print_otag(h, TAG_DIV, 1, &tag); + if (!REG_ns) + print_otag(h, TAG_DIV, 1, &tag); /* So the div isn't empty: */ print_text(h, "\\~"); - } return(0); } From owner-svn-soc-all@FreeBSD.ORG Sat Jun 2 09:38:01 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id BD5001065672 for ; Sat, 2 Jun 2012 09:37:59 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Sat, 02 Jun 2012 09:37:59 +0000 Date: Sat, 02 Jun 2012 09:37:59 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120602093759.BD5001065672@hub.freebsd.org> Cc: Subject: socsvn commit: r236922 - in soc2012/gmiller/locking-head: include lib/libthr/thread X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2012 09:38:01 -0000 Author: gmiller Date: Sat Jun 2 09:37:59 2012 New Revision: 236922 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236922 Log: Instrument rwlocks. Modified: soc2012/gmiller/locking-head/include/pthread.h soc2012/gmiller/locking-head/lib/libthr/thread/thr_cond.c soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c soc2012/gmiller/locking-head/lib/libthr/thread/thr_rwlock.c Modified: soc2012/gmiller/locking-head/include/pthread.h ============================================================================== --- soc2012/gmiller/locking-head/include/pthread.h Sat Jun 2 08:47:26 2012 (r236921) +++ soc2012/gmiller/locking-head/include/pthread.h Sat Jun 2 09:37:59 2012 (r236922) @@ -315,21 +315,66 @@ const struct timespec *, const char *, int); +int pthread_rwlock_rdlock_profiled(pthread_rwlock_t *, + const char *, + int); +int pthread_rwlock_timedrdlock_profiled(pthread_rwlock_t *, + const struct timespec *, + const char *, + int); +int pthread_rwlock_timedwrlock_profiled(pthread_rwlock_t *, + const struct timespec *, + const char *, + int); +int pthread_rwlock_tryrdlock_profiled(pthread_rwlock_t *, + const char *, + int); +int pthread_rwlock_trywrlock_profiled(pthread_rwlock_t *, + const char *, + int); +int pthread_rwlock_wrlock_profiled(pthread_rwlock_t *, + const char *, + int); #ifdef pthread_mutex_lock #undef pthread_mutex_lock #undef pthread_mutex_trylock #undef pthread_mutex_timedlock +#undef pthread_cond_wait +#undef pthread_cond_timedwait +#undef pthread_rwlock_rdlock +#undef pthread_rwlock_wrlock +#undef pthread_rwlock_timedrdlock +#undef pthread_rwlock_timedwrlock +#undef pthread_rwlock_tryrdlock +#undef pthread_rwlock_trywrlock #endif #define pthread_mutex_lock(m) \ - _pthread_mutex_lock(m, __FILE__, __LINE__) + _pthread_mutex_lock_profiled(m, __FILE__, __LINE__) #define pthread_mutex_trylock(m) \ - _pthread_mutex_trylock(m, __FILE__, __LINE__) + _pthread_mutex_trylock_profiled(m, __FILE__, __LINE__) #define pthread_mutex_timedlock(m, t) \ - _pthread_mutex_timedlock(m, t, __FILE__, __LINE__) + _pthread_mutex_timedlock_profiled(m, t, __FILE__, __LINE__) +#define pthread_cond_wait(c, m) \ + _pthread_cond_wait_profiled(c, m, __FILE__, __LINE__) +#define pthread_cond_timedwait(c, m, t) \ + _pthread_cond_timedwait_profiled(c, m, t, __FILE__, __LINE__) +#define pthread_rwlock_rdlock(l) \ + _pthread_rwlock_rdlock_profiled(l, __FILE__, __LINE__) +#define pthread_rwlock_wrlock(l) \ + _pthread_rwlock_wrlock_profiled(l, __FILE__, __LINE__) +#define pthread_rwlock_timedrdlock(l, t) \ + _pthread_rwlock_timedrdlock_profiled(l, t, __FILE__, __LINE__) +#define pthread_rwlock_timedwrlock(l, t) \ + _pthread_rwlock(timedwrlock_profiled(l, t, __FILE__, __LINE__) +#define pthread_rwlock_tryrdlock(l, t) \ + _pthread_rwlock_tryrdlock_profiled(l, t, __FILE__, __LINE__) +#define pthread_rwlock_trywrlock(l, t) \ + _pthread_rwlock_trywrlock_profiled(l, t, __FILE__, __LINE__) + #endif #endif Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_cond.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_cond.c Sat Jun 2 08:47:26 2012 (r236921) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_cond.c Sat Jun 2 09:37:59 2012 (r236922) @@ -49,18 +49,6 @@ static int cond_signal_common(pthread_cond_t *cond); static int cond_broadcast_common(pthread_cond_t *cond); -#ifdef LOCK_PROFILING -int __pthread_cond_wait_profiled(pthread_cond_t *cond, - pthread_mutex_t *mutex, - const char *file, - int line); -int __pthread_cond_timedwait_profiled(pthread_cond_t *cond, - pthread_mutex_t *mutex, - const struct timespec * abstime, - const char *file, - int line); -#endif - /* * Double underscore versions are cancellation points. Single underscore * versions are not and are provided for libc internal usage (which @@ -74,6 +62,20 @@ __weak_reference(_pthread_cond_signal, pthread_cond_signal); __weak_reference(_pthread_cond_broadcast, pthread_cond_broadcast); +#ifdef LOCK_PROFILING + +int __pthread_cond_wait_profiled(pthread_cond_t *cond, + pthread_mutex_t *mutex, + const char *file, + int line); +int __pthread_cond_timedwait_profiled(pthread_cond_t *cond, + pthread_mutex_t *mutex, + const struct timespec * abstime, + const char *file, + int line); + +#endif + #define CV_PSHARED(cvp) (((cvp)->__flags & USYNC_PROCESS_SHARED) != 0) static int Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c Sat Jun 2 08:47:26 2012 (r236921) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_mutex.c Sat Jun 2 09:37:59 2012 (r236922) @@ -96,19 +96,6 @@ static int mutex_lock_sleep(struct pthread *, pthread_mutex_t, const struct timespec * _PROFILE_PARMS); -#ifdef LOCK_PROFILING -int __pthread_mutex_trylock_profiled(pthread_mutex_t *mutex, - const char *file, - int line); -int __pthread_mutex_lock_profiled(pthread_mutex_t *mutex, - const char *file, - int line); -int __pthread_mutex_timedlock_profiled(pthread_mutex_t *mutex, - const struct timespec *abstime, - const char *file, - int line); -#endif - __weak_reference(__pthread_mutex_init, pthread_mutex_init); __strong_reference(__pthread_mutex_init, _pthread_mutex_init); __weak_reference(__pthread_mutex_lock, pthread_mutex_lock); @@ -135,6 +122,27 @@ __weak_reference(_pthread_mutex_getyieldloops_np, pthread_mutex_getyieldloops_np); __weak_reference(_pthread_mutex_isowned_np, pthread_mutex_isowned_np); +#ifdef LOCK_PROFILING +int __pthread_mutex_trylock_profiled(pthread_mutex_t *mutex, + const char *file, + int line); +int __pthread_mutex_lock_profiled(pthread_mutex_t *mutex, + const char *file, + int line); +int __pthread_mutex_timedlock_profiled(pthread_mutex_t *mutex, + const struct timespec *abstime, + const char *file, + int line); + +__strong_reference(__pthread_mutex_lock_profiled, + _pthread_mutex_lock_profiled); +__strong_reference(__pthread_mutex_trylock_profiled, + _pthread_mutex_trylock_profiled); +__strong_reference(__pthread_mutex_timedlock_profiled, + _pthread_mutex_timedlock_profiled); + +#endif + static int mutex_init(pthread_mutex_t *mutex, const struct pthread_mutex_attr *mutex_attr, Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Sat Jun 2 08:47:26 2012 (r236921) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Sat Jun 2 09:37:59 2012 (r236922) @@ -748,6 +748,16 @@ void _mutex_obtain_success(struct pthread_mutex *, const char *, int) __hidden; void _lock_profile_exit_thread(struct pthread *curthread) __hidden; +void _rwlock_obtain_read_success(struct pthread_rwlock *, const char *file, + int line) __hidden; +void _rwlock_obtain_read_failed(struct pthread_rwlock *, const char *file, + int line) __hidden; +void _rwlock_obtain_write_success(struct pthread_rwlock *, const char *file, + int line) __hidden; +void _rwlock_obtain_write_failed(struct pthread_rwlock *, const char *file, + int line) __hidden; +void _rwlock_release_read(struct pthread_rwlock *) __hidden; +void _rwlock_release_write(struct pthread_rwlock *) __hidden; void _mutex_release(struct pthread_mutex *) __hidden; void _libpthread_init(struct pthread *) __hidden; struct pthread *_thr_alloc(struct pthread *) __hidden; @@ -816,13 +826,29 @@ #define MUTEX_OBTAIN_FAILED(m) \ _mutex_obtain_failed(m, file, line) #define MUTEX_RELEASE(m) _mutex_release(m) +#define RWLOCK_OBTAIN_READ_SUCCESS(l) \ + _rwlock_obtain_read_success(l, file, line) +#define RWLOCK_OBTAIN_READ_FAILED(l) \ + _rwlock_obtain_read_failed(l, file, line) +#define RWLOCK_OBTAIN_WRITE_SUCCESS(l) \ + _rwlock_obtain_write_success(l, file, line) +#define RWLOCK_OBTAIN_WRITE_FAILED(l) \ + _rwlock_obtain_write_failed(l, file, line) +#define RWLOCK_RELEASE_READ(l) _rwlock_release_read(l) +#define RWLOCK_RELEASE_WRITE(l) _rwlock_release_write(l) #else -#define LOCK_PROFILE_EXIT_THREAD(t) do { } while (0) -#define MUTEX_OBTAIN_SUCCESS(m) do { } while (0) -#define MUTEX_OBTAIN_FAILED(m) do { } while (0) -#define MUTEX_RELEASE(m) do { } while (0) +#define LOCK_PROFILE_EXIT_THREAD(t) do { } while (0) +#define MUTEX_OBTAIN_SUCCESS(m) do { } while (0) +#define MUTEX_OBTAIN_FAILED(m) do { } while (0) +#define MUTEX_RELEASE(m) do { } while (0) +#define RWLOCK_OBTAIN_READ_SUCCESS(l) do { } while (0) +#define RWLOCK_OBTAIN_READ_FAILED(l) do { } while (0) +#define RWLOCK_OBTAIN_WRITE_SUCCESS(l) do { } while (0) +#define RWLOCK_OBTAIN_WRITE_FAILED(l) do { } while (0) +#define RWLOCK_RELEASE_READ(l) do { } while (0) +#define RWLOCK_RELEASE_WRITE(l) do { } while (0) #endif Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c Sat Jun 2 08:47:26 2012 (r236921) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c Sat Jun 2 09:37:59 2012 (r236922) @@ -25,6 +25,8 @@ * */ +#ifdef LOCK_PROFILING + #include "thr_private.h" void @@ -46,3 +48,39 @@ _lock_profile_exit_thread(struct pthread *t) { } + +void +_rwlock_obtain_read_success(struct pthread_rwlock *l, const char *file, + int line) +{ +} + +void +_rwlock_obtain_read_failed(struct pthread_rwlock *l, const char *file, + int line) +{ +} + +void +_rwlock_obtain_write_success(struct pthread_rwlock *l, const char *file, + int line) +{ +} + +void +_rwlock_obtain_write_failed(struct pthread_rwlock *l, const char *file, + int line) +{ +} + +void +_rwlock_release_read(struct pthread_rwlock *l) +{ +} + +void +_rwlock_release_write(struct pthread_rwlock *l) +{ +} + +#endif Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_rwlock.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_rwlock.c Sat Jun 2 08:47:26 2012 (r236921) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_rwlock.c Sat Jun 2 09:37:59 2012 (r236922) @@ -61,6 +61,30 @@ /* * Prototypes */ +#ifdef LOCK_PROFILING + +int _pthread_rwlock_rdlock_profiled(pthread_rwlock_t *rwlock, + const char *file, + int line); +int _pthread_rwlock_wrlock_profiled(pthread_rwlock_t *rwlock, + const char *file, + int line); +int _pthread_rwlock_timedrdlock_profiled(pthread_rwlock_t *rwlock, + const struct timespec *abstime, + const char *file, + int line); +int _pthread_rwlock_timedwrlock_profiled(pthread_rwlock_t *rwlock, + const struct timespec *abstime, + const char *file, + int line); +int _pthread_rwlock_tryrdlock_profiled(pthread_rwlock_t *rwlock, + const char *file, + int line); +int _pthread_rwlock_trywrlock_profiled(pthread_rwlock_t *rwlock, + const char *file, + int line); + +#endif static int rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr __unused) @@ -119,7 +143,8 @@ } static int -rwlock_rdlock_common(pthread_rwlock_t *rwlock, const struct timespec *abstime) +rwlock_rdlock_common(pthread_rwlock_t *rwlock, const struct timespec *abstime + _PROFILE_PARMS) { struct pthread *curthread = _get_curthread(); pthread_rwlock_t prwlock; @@ -153,9 +178,14 @@ ret = _thr_rwlock_tryrdlock(&prwlock->lock, flags); if (ret == 0) { curthread->rdlock_count++; + + RWLOCK_OBTAIN_READ_SUCCESS(*rwlock); + return (ret); } + RWLOCK_OBTAIN_READ_FAILED(*rwlock); + if (__predict_false(abstime && (abstime->tv_nsec >= 1000000000 || abstime->tv_nsec < 0))) return (EINVAL); @@ -172,26 +202,59 @@ break; } } - if (ret == 0) + if (ret == 0) { curthread->rdlock_count++; + RWLOCK_OBTAIN_READ_SUCCESS(*rwlock); + } + return (ret); } int -_pthread_rwlock_rdlock (pthread_rwlock_t *rwlock) +_pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) +#ifdef LOCK_PROFILING +{ + return (_pthread_rwlock_rdlock_profiled(rwlock, __FILE__, __LINE__)); +} + +int +_pthread_rwlock_rdlock_profiled(pthread_rwlock_t *rwlock, const char *file, + int line) +#endif { - return (rwlock_rdlock_common(rwlock, NULL)); + return (rwlock_rdlock_common(rwlock, NULL _PROFILE_PASS)); } int -_pthread_rwlock_timedrdlock (pthread_rwlock_t *rwlock, - const struct timespec *abstime) +_pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock, + const struct timespec *abstime) +#ifdef LOCK_PROFILING { - return (rwlock_rdlock_common(rwlock, abstime)); + return (_pthread_rwlock_timedrdlock_profiled(rwlock, abstime, __FILE__, + __LINE__)); } int -_pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock) +_pthread_rwlock_timedrdlock_profiled(pthread_rwlock_t *rwlock, + const struct timespec *abstime, + const char *file, int line) +#endif +{ + return (rwlock_rdlock_common(rwlock, abstime _PROFILE_PASS)); +} + +int +_pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock) +#ifdef LOCK_PROFILING +{ + return (_pthread_rwlock_tryrdlock_profiled(rwlock, __FILE__, + __LINE__)); +} + +int +_pthread_rwlock_tryrdlock_profiled(pthread_rwlock_t *rwlock, + const char *file, int line) +#endif { struct pthread *curthread = _get_curthread(); pthread_rwlock_t prwlock; @@ -219,13 +282,26 @@ } ret = _thr_rwlock_tryrdlock(&prwlock->lock, flags); - if (ret == 0) + if (ret == 0) { curthread->rdlock_count++; + RWLOCK_OBTAIN_READ_SUCCESS(*rwlock); + } else { + RWLOCK_OBTAIN_READ_FAILED(*rwlock); + } return (ret); } int -_pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock) +_pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock) +#ifdef LOCK_PROFILING +{ + return (_pthread_rwlock_trywrlock_profiled(rwlock, __FILE__, __LINE__)); +} + +int +_pthread_rwlock_trywrlock_profiled(pthread_rwlock_t *rwlock, const char *file, + int line) +#endif { struct pthread *curthread = _get_curthread(); pthread_rwlock_t prwlock; @@ -234,13 +310,18 @@ CHECK_AND_INIT_RWLOCK ret = _thr_rwlock_trywrlock(&prwlock->lock); - if (ret == 0) + if (ret == 0) { prwlock->owner = curthread; + RWLOCK_OBTAIN_WRITE_SUCCESS(*rwlock); + } else { + RWLOCK_OBTAIN_WRITE_FAILED(*rwlock); + } return (ret); } static int -rwlock_wrlock_common (pthread_rwlock_t *rwlock, const struct timespec *abstime) +rwlock_wrlock_common(pthread_rwlock_t *rwlock, const struct timespec *abstime + _PROFILE_PARMS) { struct pthread *curthread = _get_curthread(); pthread_rwlock_t prwlock; @@ -255,9 +336,14 @@ ret = _thr_rwlock_trywrlock(&prwlock->lock); if (ret == 0) { prwlock->owner = curthread; + + RWLOCK_OBTAIN_WRITE_SUCCESS(*rwlock); + return (ret); } + RWLOCK_OBTAIN_WRITE_FAILED(*rwlock); + if (__predict_false(abstime && (abstime->tv_nsec >= 1000000000 || abstime->tv_nsec < 0))) return (EINVAL); @@ -280,20 +366,47 @@ break; } } + + if (ret == 0) { + RWLOCK_OBTAIN_WRITE_SUCCESS(*rwlock); + } else { + RWLOCK_OBTAIN_WRITE_FAILED(*rwlock); + } + return (ret); } int -_pthread_rwlock_wrlock (pthread_rwlock_t *rwlock) +_pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) +#ifdef LOCK_PROFILING +{ + return (_pthread_rwlock_wrlock_profiled(rwlock, __FILE__, __LINE__)); +} + +int +_pthread_rwlock_wrlock_profiled(pthread_rwlock_t *rwlock, const char *file, + int line) +#endif { - return (rwlock_wrlock_common (rwlock, NULL)); + return (rwlock_wrlock_common(rwlock, NULL _PROFILE_PASS)); } int -_pthread_rwlock_timedwrlock (pthread_rwlock_t *rwlock, - const struct timespec *abstime) +_pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock, + const struct timespec *abstime) +#ifdef LOCK_PROFILING { - return (rwlock_wrlock_common (rwlock, abstime)); + return (_pthread_rwlock_timedwrlock_profiled(rwlock, abstime, __FILE__, + __LINE__)); +} + +int +_pthread_rwlock_timedwrlock_profiled(pthread_rwlock_t *rwlock, + const struct timespec *abstime, + const char *file, int line) +#endif +{ + return (rwlock_wrlock_common(rwlock, abstime _PROFILE_PASS)); } int @@ -317,8 +430,12 @@ } ret = _thr_rwlock_unlock(&prwlock->lock); - if (ret == 0 && (state & URWLOCK_WRITE_OWNER) == 0) + if (ret == 0 && (state & URWLOCK_WRITE_OWNER) == 0) { curthread->rdlock_count--; + RWLOCK_RELEASE_READ(*rwlock); + } else if (ret == 0) { + RWLOCK_RELEASE_WRITE(*rwlock); + } return (ret); } From owner-svn-soc-all@FreeBSD.ORG Sat Jun 2 12:00:58 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 60814106589D for ; Sat, 2 Jun 2012 12:00:56 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Sat, 02 Jun 2012 12:00:56 +0000 Date: Sat, 02 Jun 2012 12:00:56 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120602120056.60814106589D@hub.freebsd.org> Cc: Subject: socsvn commit: r236931 - in soc2012/gmiller/locking-head: include lib/libthr/thread X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2012 12:00:58 -0000 Author: gmiller Date: Sat Jun 2 12:00:56 2012 New Revision: 236931 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236931 Log: Instrument POSIX spinlocks for lock profiling. Modified: soc2012/gmiller/locking-head/include/pthread.h soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c soc2012/gmiller/locking-head/lib/libthr/thread/thr_pspinlock.c Modified: soc2012/gmiller/locking-head/include/pthread.h ============================================================================== --- soc2012/gmiller/locking-head/include/pthread.h Sat Jun 2 11:44:50 2012 (r236930) +++ soc2012/gmiller/locking-head/include/pthread.h Sat Jun 2 12:00:56 2012 (r236931) @@ -335,6 +335,12 @@ int pthread_rwlock_wrlock_profiled(pthread_rwlock_t *, const char *, int); +int pthread_spin_lock_profiled(pthread_spinlock_t *, + const char *, + int); +int pthread_spin_trylock_profiled(pthread_spinlock_t *, + const char *, + int); #ifdef pthread_mutex_lock @@ -349,6 +355,8 @@ #undef pthread_rwlock_timedwrlock #undef pthread_rwlock_tryrdlock #undef pthread_rwlock_trywrlock +#undef pthread_spin_lock +#undef pthread_spin_trylock #endif @@ -374,6 +382,10 @@ _pthread_rwlock_tryrdlock_profiled(l, t, __FILE__, __LINE__) #define pthread_rwlock_trywrlock(l, t) \ _pthread_rwlock_trywrlock_profiled(l, t, __FILE__, __LINE__) +#define pthread_spin_lock(s) \ + _pthread_spin_lock(s, __FILE__, __LINE__) +#define pthread_spin_trylock(s) \ + _pthread_spin_trylock(s, __FILE__, __LINE__) #endif Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Sat Jun 2 11:44:50 2012 (r236930) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_private.h Sat Jun 2 12:00:56 2012 (r236931) @@ -759,6 +759,11 @@ void _rwlock_release_read(struct pthread_rwlock *) __hidden; void _rwlock_release_write(struct pthread_rwlock *) __hidden; void _mutex_release(struct pthread_mutex *) __hidden; +void _spin_obtain_success(struct pthread_spinlock *, const char *file, + int line) __hidden; +void _spin_obtain_failed(struct pthread_spinlock *, const char *file, + int line) __hidden; +void _spin_release(struct pthread_spinlock *) __hidden; void _libpthread_init(struct pthread *) __hidden; struct pthread *_thr_alloc(struct pthread *) __hidden; void _thread_exit(const char *, int, const char *) __hidden __dead2; @@ -836,6 +841,12 @@ _rwlock_obtain_write_failed(l, file, line) #define RWLOCK_RELEASE_READ(l) _rwlock_release_read(l) #define RWLOCK_RELEASE_WRITE(l) _rwlock_release_write(l) +#define SPIN_OBTAIN_SUCCESS(s) \ + _spin_obtain_success(s, file, line) +#define SPIN_OBTAIN_FAILED(s) \ + _spin_obtain_failed(s, file, line) +#define SPIN_RELEASE(s) \ + _spin_release(s) #else @@ -849,6 +860,9 @@ #define RWLOCK_OBTAIN_WRITE_FAILED(l) do { } while (0) #define RWLOCK_RELEASE_READ(l) do { } while (0) #define RWLOCK_RELEASE_WRITE(l) do { } while (0) +#define SPIN_OBTAIN_SUCCESS(s) do { } while (0) +#define SPIN_OBTAIN_FAILED(s) do { } while (0) +#define SPIN_RELEASE(s) do { } while (0) #endif Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c Sat Jun 2 11:44:50 2012 (r236930) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_profile.c Sat Jun 2 12:00:56 2012 (r236931) @@ -83,4 +83,19 @@ { } +void +_spin_obtain_success(struct pthread_spinlock *s, const char *file, int line) +{ +} + +void +_spin_obtain_failed(struct pthread_spinlock *s, const char *file, int line) +{ +} + +void +_spin_release(struct pthread_spinlock *s) +{ +} + #endif Modified: soc2012/gmiller/locking-head/lib/libthr/thread/thr_pspinlock.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libthr/thread/thr_pspinlock.c Sat Jun 2 11:44:50 2012 (r236930) +++ soc2012/gmiller/locking-head/lib/libthr/thread/thr_pspinlock.c Sat Jun 2 12:00:56 2012 (r236931) @@ -42,6 +42,15 @@ __weak_reference(_pthread_spin_lock, pthread_spin_lock); __weak_reference(_pthread_spin_unlock, pthread_spin_unlock); +#ifdef LOCK_PROFILING + +int _pthread_spin_trylock_profiled(pthread_spinlock_t *lock, + const char *file, int line); +int _pthread_spin_lock_profiled(pthread_spinlock_t *lock, + const char *file, int line); + +#endif + int _pthread_spin_init(pthread_spinlock_t *lock, int pshared) { @@ -79,6 +88,15 @@ int _pthread_spin_trylock(pthread_spinlock_t *lock) +#ifdef LOCK_PROFILING +{ + return (_pthread_spin_trylock_profiled(lock, __FILE__, __LINE__)); +} + +int +_pthread_spin_trylock_profiled(pthread_spinlock_t *lock, const char *file, + int line) +#endif { struct pthread *curthread = _get_curthread(); struct pthread_spinlock *lck; @@ -86,23 +104,47 @@ if (lock == NULL || (lck = *lock) == NULL) ret = EINVAL; - else + else { ret = THR_UMUTEX_TRYLOCK(curthread, &lck->s_lock); + if (ret == 0) { + SPIN_OBTAIN_SUCCESS(lck); + } else { + SPIN_OBTAIN_FAILED(lck); + } + } + return (ret); } int _pthread_spin_lock(pthread_spinlock_t *lock) +#ifdef LOCK_PROFILING +{ + return (_pthread_spin_lock_profiled(lock, __FILE__, __LINE__)); +} + +int +_pthread_spin_lock_profiled(pthread_spinlock_t *lock, const char *file, + int line) +#endif { struct pthread *curthread = _get_curthread(); struct pthread_spinlock *lck; int ret, count; - +#ifdef LOCK_PROFILING + int spin_needed = 0; +#endif if (lock == NULL || (lck = *lock) == NULL) ret = EINVAL; else { count = SPIN_COUNT; while ((ret = THR_UMUTEX_TRYLOCK(curthread, &lck->s_lock)) != 0) { +#ifdef LOCK_PROFILING + if (!spin_needed) { + spin_needed = 1; + SPIN_OBTAIN_FAILED(lck); + } +#endif while (lck->s_lock.m_owner) { if (!_thr_is_smp) { _pthread_yield(); @@ -117,6 +159,7 @@ } } ret = 0; + SPIN_OBTAIN_SUCCESS(lck); } return (ret); @@ -133,6 +176,9 @@ ret = EINVAL; else { ret = THR_UMUTEX_UNLOCK(curthread, &lck->s_lock); + if (ret == 0) { + SPIN_RELEASE(lck); + } } return (ret); } From owner-svn-soc-all@FreeBSD.ORG Sat Jun 2 13:22:32 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 859661065672 for ; Sat, 2 Jun 2012 13:22:30 +0000 (UTC) (envelope-from aleek@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Sat, 02 Jun 2012 13:22:30 +0000 Date: Sat, 02 Jun 2012 13:22:30 +0000 From: aleek@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120602132230.859661065672@hub.freebsd.org> Cc: Subject: socsvn commit: r236934 - in soc2012/aleek/beaglexm-armv6/sys/arm/ti: am37x omap3 X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2012 13:22:32 -0000 Author: aleek Date: Sat Jun 2 13:22:29 2012 New Revision: 236934 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=236934 Log: importing general purpose timer code for omap35x and am37x ti arm Added: soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_intr.c Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_gptimer.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_timer.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/std.am37x soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/files.omap3 Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_gptimer.c ============================================================================== --- soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_gptimer.c Sat Jun 2 12:26:14 2012 (r236933) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_gptimer.c Sat Jun 2 13:22:29 2012 (r236934) @@ -23,6 +23,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * gptimers are exact the same in am37x and omap35x */ #include Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_timer.c ============================================================================== --- soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_timer.c Sat Jun 2 12:26:14 2012 (r236933) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/am37x_timer.c Sat Jun 2 13:22:29 2012 (r236934) @@ -59,10 +59,10 @@ #include #include -#include +#include #include -#include +#include #include //#define CPU_CLOCKSPEED 500000000 @@ -255,7 +255,7 @@ tc_init(&g_omap3_timecounter); /* Calibrate the delay loop */ - omap3_calibrate_delay_loop(&g_omap3_timecounter); + //omap3_calibrate_delay_loop(&g_omap3_timecounter); /* Restore interrupt state */ restore_interrupts(oldirqstate); @@ -272,6 +272,7 @@ * RETURNS: * nothing */ +#if 0 void DELAY(int usec) { @@ -283,8 +284,8 @@ } } +#endif -#if 0 void DELAY(int n) { @@ -346,9 +347,8 @@ first = last; } } -#endif - +#if 0 /** * cpu_startprofclock - Starts the profile clock * @@ -375,3 +375,4 @@ { /* TODO: implement */ } +#endif Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/std.am37x ============================================================================== --- soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/std.am37x Sat Jun 2 12:26:14 2012 (r236933) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/am37x/std.am37x Sat Jun 2 13:22:29 2012 (r236934) @@ -1,6 +1,7 @@ # Omap3 generic configuration #$FreeBSD$ files "../ti/am37x/files.am37x" +files "../ti/omap3/files.omap3" include "../ti/std.ti" makeoption ARM_LITTLE_ENDIAN Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/files.omap3 ============================================================================== --- soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/files.omap3 Sat Jun 2 12:26:14 2012 (r236933) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/files.omap3 Sat Jun 2 13:22:29 2012 (r236934) @@ -1,3 +1,3 @@ #$FreeBSD$ -arm/ti/omap3/omap3_timer.c standard +arm/ti/omap3/omap3_intr.c standard Added: soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_intr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_intr.c Sat Jun 2 13:22:29 2012 (r236934) @@ -0,0 +1,233 @@ +/*- + * Copyright (c) 2011 + * Ben Gray . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include + + + +/* + * There are a number of ways that interrupt handling is implemented in + * the various ARM platforms, the PXA has the neatest way, it creates another + * device driver that handles everything. However IMO this is rather heavy- + * weight for playing with IRQs which should be quite fast ... so I've + * gone for something similar to the IXP425, which just directly plays with + * registers. This assumes that the interrupt control registers are already + * mapped in virtual memory at a fixed virtual address ... simplies. + * + * The intcps (OMAP3 interrupt controller) has some nice registers, were + * you write a bit to clear or set the mask register ... I think in theory + * that means that you don't need to disable interrupts while doing this, + * because it is an atomic operation. + * + * TODO: check this. + * + */ + +//these registers are the same for am37x - aleek + +#define INTCPS_SYSCONFIG 0x10 +#define INTCPS_SYSSTATUS 0x14 +#define INTCPS_SIR_IRQ 0x40 +#define INTCPS_SIR_FIQ 0x44 +#define INTCPS_CONTROL 0x48 +#define INTCPS_PROTECTION 0x4C +#define INTCPS_IDLE 0x50 +#define INTCPS_IRQ_PRIORITY 0x60 +#define INTCPS_FIQ_PRIORITY 0x64 +#define INTCPS_THRESHOLD 0x68 +#define INTCPS_ITR(n) (0x80 + (0x20 * (n))) +#define INTCPS_MIR(n) (0x84 + (0x20 * (n))) +#define INTCPS_MIR_CLEAR(n) (0x88 + (0x20 * (n))) +#define INTCPS_MIR_SET(n) (0x8C + (0x20 * (n))) +#define INTCPS_ISR_SET(n) (0x90 + (0x20 * (n))) +#define INTCPS_ISR_CLEAR(n) (0x94 + (0x20 * (n))) +#define INTCPS_PENDING_IRQ(n) (0x98 + (0x20 * (n))) +#define INTCPS_PENDING_FIQ(n) (0x9C + (0x20 * (n))) +#define INTCPS_ILR(m) (0x100 + (0x4 * (m))) + + + + +/** + * omap3_post_filter_intr - called after the IRQ has been filtered + * @arg: the IRQ number + * + * Called after the interrupt handler has done it's stuff, can be used to + * clean up interrupts that haven't been handled properly. + * + * + * RETURNS: + * nothing + */ +void +omap3_post_filter_intr(void *arg) +{ + /* uintptr_t irq = (uintptr_t) arg; */ + + /* data synchronization barrier */ + cpu_drain_writebuf(); +} + + + + + +/** + * arm_mask_irq - masks an IRQ (disables it) + * @nb: the number of the IRQ to mask (disable) + * + * Disables the interrupt at the HW level. + * + * + * RETURNS: + * nothing + */ +void +arm_mask_irq(uintptr_t nb) +{ + bus_space_write_4(g_omap3_softc->sc_iotag, g_omap3_softc->sc_intcps_ioh, + INTCPS_MIR_SET(nb >> 5), 1UL << (nb & 0x1F)); +} + + +/** + * arm_unmask_irq - unmasks an IRQ (enables it) + * @nb: the number of the IRQ to unmask (enable) + * + * Enables the interrupt at the HW level. + * + * + * RETURNS: + * nothing + */ +void +arm_unmask_irq(uintptr_t nb) +{ + // printf("[BRG] unmasking IRQ %d (off %d, bit %d)\n", nb, (nb >> 5), (nb & 0x1F)); + + bus_space_write_4(g_omap3_softc->sc_iotag, g_omap3_softc->sc_intcps_ioh, + INTCPS_MIR_CLEAR(nb >> 5), 1UL << (nb & 0x1F)); +} + + + +/** + * arm_get_next_irq - gets the next tripped interrupt + * @last_irq: the number of the last IRQ processed + * + * Enables the interrupt at the HW level. + * + * + * RETURNS: + * nothing + */ +int +arm_get_next_irq(int last_irq) +{ + uint32_t active_irq; + + /* clean-up the last IRQ */ + if (last_irq != -1) { + + /* clear the interrupt status flag */ + bus_space_write_4(g_omap3_softc->sc_iotag, g_omap3_softc->sc_intcps_ioh, + INTCPS_ISR_CLEAR(last_irq >> 5), + 1UL << (last_irq & 0x1F)); + + /* tell the interrupt logic we've dealt with the interrupt */ + bus_space_write_4(g_omap3_softc->sc_iotag, g_omap3_softc->sc_intcps_ioh, + INTCPS_CONTROL, 1); + } + + /* Get the next active interrupt */ + active_irq = bus_space_read_4(g_omap3_softc->sc_iotag, + g_omap3_softc->sc_intcps_ioh, INTCPS_SIR_IRQ); + + /* Check for spurious interrupt */ + if ((active_irq & 0xffffff80) == 0xffffff80) { + device_printf(g_omap3_softc->sc_dev, "Spurious interrupt detected " + "(0x%08x)\n", active_irq); + return -1; + } + + /* Just get the active IRQ part */ + active_irq &= 0x7F; + + /* Return the new IRQ if it is different from the previous */ + if (active_irq != last_irq) + return active_irq; + else + return -1; +} + + +/** + * omap3_setup_intr_controller - configures and enables the OMAP3 interrupt + * controller (INTCPS) + * + * + * + * RETURNS: + * nothing + */ +int +omap3_setup_intr_controller(struct omap3_softc *sc, const const int *irqs) +{ + uint32_t syscfg; + uint32_t i; + + if (sc != g_omap3_softc) + panic("Invalid omap3 soft context\n"); + + + /* Reset the interrupt controller */ + bus_space_write_4(g_omap3_softc->sc_iotag, g_omap3_softc->sc_intcps_ioh, + INTCPS_SYSCONFIG, 0x2); + + /* Loop a number of times to check if the INTCPS has come out of reset */ + for (i = 0; i < 10000; i++) { + syscfg = bus_space_read_4(g_omap3_softc->sc_iotag, + g_omap3_softc->sc_intcps_ioh, INTCPS_SYSCONFIG); + if (syscfg & 0x1UL) + break; + } + + + + return 0; +} +