/[classpath]/classpath/scripts/check_jni_methods.sh
ViewVC logotype

Diff of /classpath/scripts/check_jni_methods.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by mark, Sat Aug 13 18:00:14 2005 UTC revision 1.9 by mark, Wed Aug 17 10:15:51 2005 UTC
# Line 18  grep -h '^JNIEXPORT .* Java_' include/*. Line 18  grep -h '^JNIEXPORT .* Java_' include/*.
18  # Find all methods in the JNI C source files.  # Find all methods in the JNI C source files.
19  find native/jni -name \*.c | \  find native/jni -name \*.c | \
20          xargs grep -h '^Java_' | \          xargs grep -h '^Java_' | \
21          LC_ALL=C sed -e 's,^\(Java_[a-z_A-Z0-9]*\) *(.*$,\1,' | \          LC_ALL=C sed -e 's,^\(Java_[a-z_A-Z0-9]*\) *(.*$,\1,' > $TMPFILE2
22          sort > $TMPFILE2  # Or in the the C++ files. (Note that cpp doesn't follow gnu conventions atm)
23    # So we try to match both GNU style and some other style.
24    find native/jni -name \*.cpp | \
25            xargs grep -h '^Java_' | \
26            LC_ALL=C sed -e 's,^\(Java_[a-z_A-Z0-9]*\) *(.*$,\1,' >> $TMPFILE2
27    find native/jni -name \*.cpp | \
28            xargs egrep -h '^(JNIEXPORT .* JNICALL )?Java_' | \
29            cut -f4 -d\  | \
30            LC_ALL=C sed -e 's,^\JNIEXPORT .* JNICALL \(Java_[a-z_A-Z0-9]*\) *(.*$,\1,' >> $TMPFILE2
31    mv $TMPFILE2 $TMPFILE3
32    sort $TMPFILE3 > $TMPFILE2
33    rm $TMPFILE3
34    
35  # Write temporary ignore file.  # Write temporary ignore file.
36  cat > $TMPFILE3 << EOF  cat > $TMPFILE3 << EOF
# Line 29  cat > $TMPFILE3 << EOF Line 40  cat > $TMPFILE3 << EOF
40  EOF  EOF
41    
42  # Compare again silently.  # Compare again silently.
43  if diff -ub -0 $TMPFILE $TMPFILE2 | grep '^[+-]Java' | grep -q -v -f $TMPFILE3;  if diff -b -U 0 $TMPFILE $TMPFILE2 | grep '^[+-]Java' | grep -q -v -f $TMPFILE3;
44  then  then
45    PROBLEM=1    PROBLEM=1
46    echo "Found a problem with the JNI methods declared and implemented."    echo "Found a problem with the JNI methods declared and implemented."
47    echo "(-) missing in implementation, (+) missing in header files"    echo "(-) missing in implementation, (+) missing in header files"
48    
49    # Compare the found method lists.    # Compare the found method lists.
50    diff -ub -0 $TMPFILE $TMPFILE2  | grep '^[+-]Java' | grep -v -f $TMPFILE3    diff -b -U 0 $TMPFILE $TMPFILE2  | grep '^[+-]Java' | grep -v -f $TMPFILE3
51  fi  fi
52    
53  # Cleanup.  # Cleanup.

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26