#!/bin/sh SRC_DIR='../../src' PAS='ffmpeg_pas.pas' C='ffmpeg_c.c' types=$(find $SRC_DIR -path "$SRC_DIR/lib" -prune -o -name "*.pas" -print0|xargs -0 grep --files-with-match '\bavcodec\b'|xargs grep --no-filename --only-matching '\b[PT]AV\w\+'|sed 's/^P/T/'|sort|uniq) # swscale doesn't seem to contain noteworthy types, thus it's not considered cat >$PAS <>$PAS done cat >>$PAS <$C <>$C done cat >>$C <