headers.awk at [8b0f7d0ccd]

File headers.awk artifact 41fecd6817 part of check-in 8b0f7d0ccd


/^# [0-9][0-9]* /{
	file = $3;

	gsub(/^"/, "", file);
	gsub(/"$/, "", file);

	while(sub(/\/\/*[^\/]*\/\.\.\/\/*/, "/", file)) {}

	destfile = file;
	if (!gsub(/^.*\/gcc\/.*\/include\//, "gcc/", destfile)) {
		if (!gsub(/^.*\/include\//, "", destfile)) {
			if (!gsub(/^.*\/include-fixed\//, "fix/", destfile)) {
				next
			}
		}
	}

	if (file ~ /</) {
		next;
	}

	if (file !~ /\.h$/) {
		next;
	}

	copy[file] = destfile;
}

END{
	for (key in copy) {
		print key, copy[key];
	}
}