#!/bin/sh


find . \( -name "*.[ch]" \
	-o -name "*.cc" -o -name "*.hh" \
	-o -name "*.cpp" \) \
	! -type l \
	| while read i
do
	tmp=tmp$$
	sed -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CONFIG_CONFIG_H\(.*\)$@\1#\2include\3<freetype/config/ftconfig.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_FREETYPE_H\(.*\)$@\1#\2include\3<freetype/freetype.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CONFIG_STANDARD_LIBRARY_H\(.*\)$@\1#\2include\3<freetype/config/ftstdlib.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CONFIG_OPTIONS_H\(.*\)$@\1#\2include\3<freetype/config/ftoption.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CONFIG_MODULES_H\(.*\)$@\1#\2include\3<freetype/config/ftmodule.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_ERRORS_H\(.*\)$@\1#\2include\3<freetype/fterrors.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_MODULE_ERRORS_H\(.*\)$@\1#\2include\3<freetype/ftmoderr.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SYSTEM_H\(.*\)$@\1#\2include\3<freetype/ftsystem.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_IMAGE_H\(.*\)$@\1#\2include\3<freetype/ftimage.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_TYPES_H\(.*\)$@\1#\2include\3<freetype/fttypes.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_LIST_H\(.*\)$@\1#\2include\3<freetype/ftlist.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_OUTLINE_H\(.*\)$@\1#\2include\3<freetype/ftoutln.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SIZES_H\(.*\)$@\1#\2include\3<freetype/ftsizes.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_MODULE_H\(.*\)$@\1#\2include\3<freetype/ftmodapi.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_RENDER_H\(.*\)$@\1#\2include\3<freetype/ftrender.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_AUTOHINTER_H\(.*\)$@\1#\2include\3<freetype/ftautoh.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CFF_DRIVER_H\(.*\)$@\1#\2include\3<freetype/ftcffdrv.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_TRUETYPE_DRIVER_H\(.*\)$@\1#\2include\3<freetype/ftttdrv.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_PCF_DRIVER_H\(.*\)$@\1#\2include\3<freetype/ftpcfdrv.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_TYPE1_TABLES_H\(.*\)$@\1#\2include\3<freetype/t1tables.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_TRUETYPE_IDS_H\(.*\)$@\1#\2include\3<freetype/ttnameid.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_TRUETYPE_TABLES_H\(.*\)$@\1#\2include\3<freetype/tttables.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_TRUETYPE_TAGS_H\(.*\)$@\1#\2include\3<freetype/tttags.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_BDF_H\(.*\)$@\1#\2include\3<freetype/ftbdf.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CID_H\(.*\)$@\1#\2include\3<freetype/ftcid.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_GZIP_H\(.*\)$@\1#\2include\3<freetype/ftgzip.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_LZW_H\(.*\)$@\1#\2include\3<freetype/ftlzw.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_BZIP2_H\(.*\)$@\1#\2include\3<freetype/ftbzip2.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_WINFONTS_H\(.*\)$@\1#\2include\3<freetype/ftwinfnt.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_GLYPH_H\(.*\)$@\1#\2include\3<freetype/ftglyph.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_BITMAP_H\(.*\)$@\1#\2include\3<freetype/ftbitmap.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_BBOX_H\(.*\)$@\1#\2include\3<freetype/ftbbox.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CACHE_H\(.*\)$@\1#\2include\3<freetype/ftcache.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CACHE_IMAGE_H\(.*\)$@\1#\2include\3<freetype/ftcache.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CACHE_SMALL_BITMAPS_H\(.*\)$@\1#\2include\3<freetype/ftcache.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CACHE_CHARMAP_H\(.*\)$@\1#\2include\3<freetype/ftcache.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_MAC_H\(.*\)$@\1#\2include\3<freetype/ftmac.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_MULTIPLE_MASTERS_H\(.*\)$@\1#\2include\3<freetype/ftmm.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SFNT_NAMES_H\(.*\)$@\1#\2include\3<freetype/ftsnames.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_OPENTYPE_VALIDATE_H\(.*\)$@\1#\2include\3<freetype/ftotval.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_GX_VALIDATE_H\(.*\)$@\1#\2include\3<freetype/ftgxval.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_PFR_H\(.*\)$@\1#\2include\3<freetype/ftpfr.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_STROKER_H\(.*\)$@\1#\2include\3<freetype/ftstroke.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SYNTHESIS_H\(.*\)$@\1#\2include\3<freetype/ftsynth.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_FONT_FORMATS_H\(.*\)$@\1#\2include\3<freetype/ftfntfmt.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_XFREE86_H\(.*\)$@\1#\2include\3<freetype/ftxf86.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_TRIGONOMETRY_H\(.*\)$@\1#\2include\3<freetype/fttrigon.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_LCD_FILTER_H\(.*\)$@\1#\2include\3<freetype/ftlcdfil.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_UNPATENTED_HINTING_H\(.*\)$@\1#\2include\3<freetype/ttunpat.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INCREMENTAL_H\(.*\)$@\1#\2include\3<freetype/ftincrem.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_GASP_H\(.*\)$@\1#\2include\3<freetype/ftgasp.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_ADVANCES_H\(.*\)$@\1#\2include\3<freetype/ftadvanc.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_ERROR_DEFINITIONS_H\(.*\)$@\1#\2include\3<freetype/fterrdef.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CACHE_MANAGER_H\(.*\)$@\1#\2include\3<freetype/ftcache.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CACHE_INTERNAL_MRU_H\(.*\)$@\1#\2include\3<freetype/ftcache.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CACHE_INTERNAL_MANAGER_H\(.*\)$@\1#\2include\3<freetype/ftcache.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CACHE_INTERNAL_CACHE_H\(.*\)$@\1#\2include\3<freetype/ftcache.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CACHE_INTERNAL_GLYPH_H\(.*\)$@\1#\2include\3<freetype/ftcache.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CACHE_INTERNAL_IMAGE_H\(.*\)$@\1#\2include\3<freetype/ftcache.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_CACHE_INTERNAL_SBITS_H\(.*\)$@\1#\2include\3<freetype/ftcache.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INCREMENTAL_H\(.*\)$@\1#\2include\3<freetype/ftincrem.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_TRUETYPE_UNPATENTED_H\(.*\)$@\1#\2include\3<freetype/ttunpat.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_INTERNAL_H\(.*\)$@\1#\2include\3<freetype/internal/internal.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_OBJECTS_H\(.*\)$@\1#\2include\3<freetype/internal/ftobjs.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_PIC_H\(.*\)$@\1#\2include\3<freetype/internal/ftpic.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_STREAM_H\(.*\)$@\1#\2include\3<freetype/internal/ftstream.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_MEMORY_H\(.*\)$@\1#\2include\3<freetype/internal/ftmemory.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_DEBUG_H\(.*\)$@\1#\2include\3<freetype/internal/ftdebug.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_CALC_H\(.*\)$@\1#\2include\3<freetype/internal/ftcalc.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_HASH_H\(.*\)$@\1#\2include\3<freetype/internal/fthash.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_DRIVER_H\(.*\)$@\1#\2include\3<freetype/internal/ftdriver.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_TRACE_H\(.*\)$@\1#\2include\3<freetype/internal/fttrace.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_GLYPH_LOADER_H\(.*\)$@\1#\2include\3<freetype/internal/ftgloadr.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_SFNT_H\(.*\)$@\1#\2include\3<freetype/internal/sfnt.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_SERVICE_H\(.*\)$@\1#\2include\3<freetype/internal/ftserv.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_RFORK_H\(.*\)$@\1#\2include\3<freetype/internal/ftrfork.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_VALIDATE_H\(.*\)$@\1#\2include\3<freetype/internal/ftvalid.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_TRUETYPE_TYPES_H\(.*\)$@\1#\2include\3<freetype/internal/tttypes.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_TYPE1_TYPES_H\(.*\)$@\1#\2include\3<freetype/internal/t1types.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_POSTSCRIPT_AUX_H\(.*\)$@\1#\2include\3<freetype/internal/psaux.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_POSTSCRIPT_HINTS_H\(.*\)$@\1#\2include\3<freetype/internal/pshints.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_POSTSCRIPT_GLOBALS_H\(.*\)$@\1#\2include\3<freetype/internal/psglobal.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_INTERNAL_AUTOHINT_H\(.*\)$@\1#\2include\3<freetype/internal/autohint.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_BDF_H\(.*\)$@\1#\2include\3<freetype/internal/services/svbdf.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_CID_H\(.*\)$@\1#\2include\3<freetype/internal/services/svcid.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_GLYPH_DICT_H\(.*\)$@\1#\2include\3<freetype/internal/services/svgldict.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_GX_VALIDATE_H\(.*\)$@\1#\2include\3<freetype/internal/services/svgxval.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_KERNING_H\(.*\)$@\1#\2include\3<freetype/internal/services/svkern.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_METRICS_VARIATIONS_H\(.*\)$@\1#\2include\3<freetype/internal/services/svmetric.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_MULTIPLE_MASTERS_H\(.*\)$@\1#\2include\3<freetype/internal/services/svmm.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_OPENTYPE_VALIDATE_H\(.*\)$@\1#\2include\3<freetype/internal/services/svotval.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_PFR_H\(.*\)$@\1#\2include\3<freetype/internal/services/svpfr.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_POSTSCRIPT_CMAPS_H\(.*\)$@\1#\2include\3<freetype/internal/services/svpscmap.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_POSTSCRIPT_INFO_H\(.*\)$@\1#\2include\3<freetype/internal/services/svpsinfo.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_POSTSCRIPT_NAME_H\(.*\)$@\1#\2include\3<freetype/internal/services/svpostnm.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_PROPERTIES_H\(.*\)$@\1#\2include\3<freetype/internal/services/svprop.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_SFNT_H\(.*\)$@\1#\2include\3<freetype/internal/services/svsfnt.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_TRUETYPE_ENGINE_H\(.*\)$@\1#\2include\3<freetype/internal/services/svtteng.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_TT_CMAP_H\(.*\)$@\1#\2include\3<freetype/internal/services/svttcmap.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_WINFNT_H\(.*\)$@\1#\2include\3<freetype/internal/services/svwinfnt.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_XFREE86_NAME_H\(.*\)$@\1#\2include\3<freetype/internal/services/svxf86nm.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_FONT_FORMAT_H\(.*\)$@\1#\2include\3<freetype/internal/services/svfntfmt.h>\4@' \
	    -e 's@\(^[ \t]*\)#\([ \t]*\)include\([ \t]*\)FT_SERVICE_TRUETYPE_GLYF_H\(.*\)$@\1#\2include\3<freetype/internal/services/svttglyf.h>\4@' \
	    $i > $tmp
	if ! diff -q $i $tmp; then
		mv $i $i.orig
		mv $tmp $i
		echo patched $i
	fi
	rm -f $tmp
done
