DONT=false
STOPARGS=false
COMMENTS=false
+DEBUG=""
# for this exercise, we want to force the openssl style, so we roll
# our own indent profile, which is at a well known location
-c) COMMENTS="true";
INDENT_ARGS="-fc1 -fca -cdb -sc";
continue;;
+ -nc) COMMENTS="true";
+ continue;;
+ -d) DEBUG='eval tee "$j.pre" |'
+ continue;;
esac
fi
case `basename $j` in
# the list of files that indent is unable to handle correctly
# that we simply leave alone for manual formatting now
- obj_dat.h|aes_core.c|aes_x86core.c)
+ obj_dat.h|aes_core.c|aes_x86core.c|ecp_nistz256.c)
echo "skipping $j"
;;
*)
-e 's/^((DECLARE|IMPLEMENT)_(EXTERN_ASN1|ASN1|ADB|STACK_OF|PKCS12_STACK_OF).*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
-e 's/^([ \t]*(make_dh|make_dh_bn|make_rfc5114_td)\(.*\)[ \t,]*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
-e 's/^(ASN1_ADB_TEMPLATE\(.*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
- -e 's/^((ASN1|ADB)_.*_END\(.*[\){=,;]+[ \t]*)$/$1\n\/**INDENT-ON**\//;' \
+ -e 's/^((ASN1|ADB)_.*_(end|END)\(.*[\){=,;]+[ \t]*)$/$1\n\/**INDENT-ON**\//;' \
-e '/ASN1_(ITEM_ref|ITEM_ptr|ITEM_rptr|PCTX)/ || s/^((ASN1|ADB)_[^\*]*[){=,]+[ \t]*)$/\/**INDENT-OFF**\/\n$1/;' \
-e 's/^(} (ASN1|ADB)_[^\*]*[\){=,;]+)$/$1\n\/**INDENT-ON**\//;' \
| \
- indent $INDENT_ARGS | \
+ $DEBUG indent $INDENT_ARGS | \
perl -np \
-e 's/^([ \t]*)\/\*-(.*)\*\/[ \t]*$/$1\/*$2*\//;' \
-e 's/^\/\*-((Copyright|=|----).*)$/\/* $1/;' \