2 # $Id: strings.sh,v 1.1 2009/03/06 14:13:47 kristaps Exp $
4 # strings.sh [-o output] name input
6 # Generate the file of strings. This will contain the following
10 # mdoc_a2NAME(const char *);
12 # The input file must be tab-delimited as follows:
14 # attnam0 A longer description
15 # attnam1 Another longer description
22 echo "usage: $0 [-o output] name input" 1>&2
32 output
="$2" ; shift; shift ;;
40 if [ -z "$name" ]; then
41 echo "usage: $0 [-o output] name input" 1>&2
47 if [ "$output" ]; then
57 * DO NOT EDIT
! Automatically generated by
$0.
64 mdoc_a2
${name}(const char
*p
)
70 key
=`printf "%s\n" "$in" | cut -f 1`
71 val
=`printf "%s\n" "$in" | cut -f 2- | sed 's!^[ ]*!!'`
73 if (xstrcmp
(p
, "$key"))