3 # Author: Aaron Bockover
4 # Licensed under MIT/X11
7 if [ "x$1" = "x--help" ]; then
8 echo "Usage: $0 [--show-only-mono]"
10 echo "This script prints a sorted list of GLib functions used in Mono"
11 echo "that have not yet been implemented in EGlib."
13 echo "If --show-only-mono is passed, then the script will print all"
14 echo "GLib functions used in Mono, whether or not they have been"
15 echo "implemented in EGlib yet."
17 echo "This script relies on the MONO_CHECKOUT environment variable."
18 echo "MONO_CHECKOUT should be set to the location of a mono checkout."
23 IGNORE_FUNCTIONS
="g_hash_table_lookup_node g_hash_table_foreach_remove_or_steal g_hash_table_resize"
25 if [ -z $MONO_CHECKOUT ]; then
26 if [ -e ..
/..
/mono.pc.
in ]; then
29 MONO_CHECKOUT
=~
/cvs
/mono
/mono
33 if [ ! -d $MONO_CHECKOUT ]; then
34 echo "Cannot find mono checkout; set MONO_CHECKOUT"
38 MONO_CHECKOUT
="$MONO_CHECKOUT/mono"
41 (for i
in `find $MONO_CHECKOUT -iregex \.*.c$`; do
42 grep -oP "[ \t\(\)]+g_[a-z_]+[ ]{0,1}\([A-Za-z_\&\*\,\(\) ]+\)" $i |
43 awk 'BEGIN { FS="(" } { print $1 }' |
44 sed -e 's/[^A-Za-z_]//g'
48 if [ ! "x$1" = "x--show-only-mono" ]; then
49 IMPLEMENTED_FUNCTIONS
=`grep -oP "g_[a-z_]+[ ]{0,1}" ../src/glib.h | awk 'BEGIN { FS="(" } { print $1 }'`
51 rm -f $RESULTS_FILE.tmp
53 for mono_function
in `cat $RESULTS_FILE`; do
55 for implemented_function
in $IMPLEMENTED_FUNCTIONS; do
56 if [ "x$mono_function" = "x$implemented_function" ]; then
62 for ignore_function
in $IGNORE_FUNCTIONS; do
63 if [ "x$ignore_function" = "x$mono_function" ]; then
69 if [ "x$matched" = "xno" ]; then
70 echo $mono_function >> $RESULTS_FILE.tmp
74 mv $RESULTS_FILE.tmp
$RESULTS_FILE
77 (for i
in `cat $RESULTS_FILE | sort -u`; do
78 echo "`grep -c $i $RESULTS_FILE` $i";