Mercurial > pidgin.yaz
view fix-casts.sh @ 32080:08dccf527457
Adding contacts normally and via search-results works slightly differently
in MXit. The 'Invite' button on the search-results window pops-up the standard
"Add Buddy" window, and so the prpl doesn't know what type of invite to
perform.
To get around this problem for now, we'll encode this in the search-results
userId and the prpl can detect this and perform the right type of invite.
author | andrew.victor@mxit.com |
---|---|
date | Tue, 03 May 2011 20:29:59 +0000 |
parents | c3ca613ab550 |
children |
line wrap: on
line source
#!/bin/sh if [ $# -eq 0 ]; then echo "Usage: `basename "$0"` PurpleFoo..." echo echo "This script searches the *current working directory* and replaces casts" echo "with GObject-style type checking and casting macros." echo 'For example, "(PurpleBuddy *)b" becomes "PURPLE_BUDDY(b)".' exit 0 fi for struct in $* ; do cast=`echo $struct | sed "s|[A-Z]|_\0|g" | tr "a-z" "A-Z" | sed "s|^_||"` for file in `grep -rl "([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)" . --include=*.c --exclude=purple-client-bindings.c` ; do sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*(|$cast(|g" $file sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*\([^(][^,);]*\)|$cast(\1)|g" $file done done