Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] (PR#12876) rename some map/tile functions
Home

[Freeciv-Dev] (PR#12876) rename some map/tile functions

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12876) rename some map/tile functions
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 23 Apr 2005 00:51:25 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12876 >

This patch renames a bunch of map_xxx functions to tile_xxx ones.  See
also PR#12774.

The functions renamed are:

map_get_owner
map_set_owner
map_get_city
map_set_city
map_get_terrain
map_set_terrain
map_get_special
map_set_special
map_clear_special
map_clear_all_specials
map_get_continent
map_set_continent

there may be some others that should be renamed but these are the
obvious ones.

Also attached is the script used for doing the replacement.  It is
simple search-and-replace.

-jason

Attachment: map.diff.gz
Description: Unix tar archive

#! /bin/bash

replace map_get_owner tile_get_owner
replace map_set_owner tile_set_owner
replace map_get_city tile_get_city
replace map_set_city tile_set_city
replace map_get_terrain tile_get_terrain
replace map_set_terrain tile_set_terrain
replace map_get_special tile_get_special
replace map_set_special tile_set_special
replace map_clear_special tile_clear_special
replace map_clear_all_specials tile_clear_all_specials
replace map_get_continent tile_get_continent
replace map_set_continent tile_set_continent
#!/bin/bash

files=`find . -name "*.[ch]"`
#files=pango.diff
#files=`find . -type f -name "Makefile.am"`
#files=`find . -type f| grep -v CVS`
#files=`find . -name "*.ruleset"`

echo Replacing \"$1\" with \"$2\".

for file in $files; do
    cat $file \
        | sed "s/$1/$2/g" \
        > $file.$$

    cmp $file $file.$$ >/dev/null \
        || (mv $file.$$ $file && echo "  $file")
    rm -f $file.$$
done

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12876) rename some map/tile functions, Jason Short <=