summaryrefslogtreecommitdiff
path: root/util/cairo-api-update
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2005-05-06 21:59:10 +0000
committerCarl Worth <cworth@cworth.org>2005-05-06 21:59:10 +0000
commit750cc8143dda4e6194880dfc314a296424b325e5 (patch)
treed1a102fb0b44283832c30467a3381b0cc790aaa8 /util/cairo-api-update
parent10c88d424485c7f001e9e03c121aa7c3b55336cc (diff)
downloadcairo-750cc8143dda4e6194880dfc314a296424b325e5.tar.gz
Make idempotent substitutions that extend old names:
cairo_select_font -> cairo_select_font_face cairo_pattern_add_color_stop -> cairo_pattern_add_color_stop_rgba by only substituting if the old name is not immediately followed by an underscore. Tweak the substitution slightly to allow the script to be run on the cairo source itself, (eg. avoid changing the REPLACED_BY and DEPRECATED_BY macros that must mention the old names).
Diffstat (limited to 'util/cairo-api-update')
-rwxr-xr-xutil/cairo-api-update7
1 files changed, 4 insertions, 3 deletions
diff --git a/util/cairo-api-update b/util/cairo-api-update
index e9752d4a8..4db30113d 100755
--- a/util/cairo-api-update
+++ b/util/cairo-api-update
@@ -14,7 +14,7 @@ cairo_api_update() {
backup=$file.bak
cp $file $backup
- sed -e '
+ sed -e '/\(DEPRECATED\|REPLACED\)_BY/! {
s/cairo_current_font_extents/cairo_font_extents/g
s/cairo_get_font_extents/cairo_font_extents/g
s/cairo_current_operator/cairo_get_operator/g
@@ -31,7 +31,7 @@ cairo_api_update() {
s/cairo_get_status_string/cairo_status_string/g
s/cairo_concat_matrix/cairo_transform/g
s/cairo_scale_font/cairo_set_font_size/g
- s/cairo_select_font/cairo_select_font_face/g
+ s/cairo_select_font\([^_]\)/cairo_select_font_face\1/g
s/cairo_transform_font/cairo_set_font_matrix/g
s/cairo_transform_point/cairo_user_to_device/g
s/cairo_transform_distance/cairo_user_to_device_distance/g
@@ -42,7 +42,7 @@ cairo_api_update() {
s/cairo_default_matrix/cairo_identity_matrix/g
s/cairo_matrix_set_affine/cairo_matrix_init/g
s/cairo_matrix_set_identity/cairo_matrix_init_identity/g
- s/cairo_pattern_add_color_stop/cairo_pattern_add_color_stop_rgba/g
+ s/\([^_]\)cairo_pattern_add_color_stop\([^_]\)/\1cairo_pattern_add_color_stop_rgba\2/g
s/cairo_set_rgb_color/cairo_set_source_rgb/g
s/cairo_set_pattern/cairo_set_source/g
s/CAIRO_OPERATOR_SRC/CAIRO_OPERATOR_SOURCE/g
@@ -52,6 +52,7 @@ cairo_api_update() {
s/CAIRO_OPERATOR_OUT_REVERSE/CAIRO_OPERATOR_DEST_OUT/g
s/CAIRO_OPERATOR_ATOP_REVERSE/CAIRO_OPERATOR_DEST_ATOP/g
s/^#\([ ]*\)ifdef[ ]*CAIRO_HAS/#\1if CAIRO_HAS/g
+ }
' $backup > $file
}