diff options
Diffstat (limited to 'devel/c2mdoc/files')
-rw-r--r-- | devel/c2mdoc/files/c2mdoc | 15 | ||||
-rw-r--r-- | devel/c2mdoc/files/c2mdoc.awk | 13 |
2 files changed, 28 insertions, 0 deletions
diff --git a/devel/c2mdoc/files/c2mdoc b/devel/c2mdoc/files/c2mdoc new file mode 100644 index 000000000000..245e8687b054 --- /dev/null +++ b/devel/c2mdoc/files/c2mdoc @@ -0,0 +1,15 @@ +#!/bin/sh +# +# c2mdoc -- Front-end which abuses the cproto parser to spit out +# mdoc(7) format prototypes for use in FreeBSD documentation. +# + +AWKSCRIPT="%%LIBEXECDIR%%/c2mdoc.awk" +CPROTO='-P"int\tf\t(\ta\t,\tb\t)" -pq -f3' +CPROTO_BIN=cproto +export CPROTO + +${CPROTO_BIN} $1 | \ + grep -v '/\*.*\*/' | \ + sed -e 's/[,();]//g' | \ + ${AWKSCRIPT} diff --git a/devel/c2mdoc/files/c2mdoc.awk b/devel/c2mdoc/files/c2mdoc.awk new file mode 100644 index 000000000000..5bf92fecbc11 --- /dev/null +++ b/devel/c2mdoc/files/c2mdoc.awk @@ -0,0 +1,13 @@ +#!/usr/bin/awk -f +# +# c2mdoc.awk -- Takes tabulated output from cproto(1) and turns it into +# mdoc(7) markup. +# +BEGIN { FS="\t" } +{ + printf ".Fa %s\n", $1 ; + printf ".Fn %s", $2 ; + for (i = 4; i < NF; i++) + printf " \"%s\"", $i + printf "\n" ; +} |