view help/help_check.sh @ 34956:69cc06c49125

Generally enable parsing for audio streams. The formats I know of that do not need it (e.g. raw audio) do not have a parser anyway.
author reimar
date Thu, 26 Jul 2012 20:32:34 +0000
parents 4df5cb727be4
children cb9975cda4bc
line wrap: on
line source

#!/bin/sh
# Check help message header files.

CHECK=checkhelp

trap "rm -f ${CHECK}.c ${CHECK}.o" EXIT

CC=$1
shift

for h in "$@"; do
  cat <<EOF > ${CHECK}.c
#include <inttypes.h>
#include <string.h>
#include "config.h"
#include "$h"
void $CHECK () {
EOF
  sed -n "s:^[ \t]*#define[ \t]\+\([0-9A-Za-z_]\+\)[ \t].*:strdup(\1);:p" "$h" >> ${CHECK}.c
  echo "}" >> ${CHECK}.c
  $CC -Werror -c -o ${CHECK}.o ${CHECK}.c || exit
done