+echo "# Updating options.cpp..."
+tmp="options.cpp.new.$$"
+trap "rm -f $tmp" EXIT
+
+awk -vname="${name}" '
+/^#include "loba_/ {
+ if (!include_line) {
+ h_file = "\"loba_" name ".h\"";
+ include_line = "#include " h_file;
+ }
+ if (!included && $2 >= h_file) {
+ if ($2 != h_file)
+ print "#include " h_file;
+ included = 1;
+ }
+ print;
+ next;
+}
+
+!included && include_line {
+ print include_line;
+ included = 1;
+}
+
+/loba_algorithms_type::loba_algorithms_type\(\)/ {
+ nol_compare = "NOL_INSERT(\"" name "\","
+ nol_string = " " nol_compare " \"describe your algorithm here...\",\n";
+ nol_string = nol_string " loba_" name ");"
+ nol_insert = 1;
+}
+
+nol_insert && $1 ~ /\}/ {
+ if (!nol_inserted)
+ print nol_string;
+ nol_insert = 0;
+}
+
+nol_insert && !nol_inserted && /NOL_INSERT/ {
+ if ($1 >= nol_compare) {
+ if ($1 > nol_compare)
+ print nol_string;
+ nol_inserted = 1;
+ }
+}
+
+{ print }
+' options.cpp > $tmp
+
+if [ "$create_files" = "1" ]; then
+ mv options.cpp options.cpp~
+ mv $tmp options.cpp
+else
+ if type colordiff &> /dev/null; then
+ diff -u options.cpp $tmp | colordiff
+ else
+ diff -u options.cpp $tmp
+ fi
+fi
+