Mercurial > pidgin.yaz
annotate fix-casts.sh @ 25343:b38cbefca6ad
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
network is available, even if NetworkManager (or Windows) says it isn't.
This is useful for offline development with nullprpl. If you don't like
-f for this and would just like to keep the long option, I'm fine with that.
Also, remove a -x/--nocrash option in Pidgin that doesn't seem to do anything.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Fri, 28 Nov 2008 06:06:35 +0000 |
parents | c3ca613ab550 |
children |
rev | line source |
---|---|
25317
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1 #!/bin/sh |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
2 |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
3 if [ $# -eq 0 ]; then |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
4 echo "Usage: `basename "$0"` PurpleFoo..." |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
5 echo |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
6 echo "This script searches the *current working directory* and replaces casts" |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
7 echo "with GObject-style type checking and casting macros." |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
8 echo 'For example, "(PurpleBuddy *)b" becomes "PURPLE_BUDDY(b)".' |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
9 exit 0 |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
10 fi |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
11 |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
12 for struct in $* ; do |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
13 cast=`echo $struct | sed "s|[A-Z]|_\0|g" | tr "a-z" "A-Z" | sed "s|^_||"` |
25319
c3ca613ab550
Minor fixes to the cast changing script.
Richard Laager <rlaager@wiktel.com>
parents:
25317
diff
changeset
|
14 for file in `grep -rl "([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)" . --include=*.c --exclude=purple-client-bindings.c` ; do |
c3ca613ab550
Minor fixes to the cast changing script.
Richard Laager <rlaager@wiktel.com>
parents:
25317
diff
changeset
|
15 sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*(|$cast(|g" $file |
c3ca613ab550
Minor fixes to the cast changing script.
Richard Laager <rlaager@wiktel.com>
parents:
25317
diff
changeset
|
16 sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*\([^(][^,);]*\)|$cast(\1)|g" $file |
25317
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
17 done |
d1a4088528ce
Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
18 done |