home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / lib / Xaw / genlist.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1990-02-26  |  929 b   |  42 lines

  1. #!/bin/sh
  2.  
  3. tmp=/tmp/gl.$$
  4. nm $* | egrep '(Widget|Obj|Object)Class' | \
  5. awk '{ if ($2 == "D" || $2 == "G") print $3; }' | sed -e 's/^_//' | \
  6. (cat - ; echo "objectClass") | sort -u | egrep -v 'ClassRec$' | \
  7. egrep -v 'vPanedWidgetClass$' | \
  8. egrep -v 'ascii(Disk|String)WidgetClass$' | \
  9. awk '
  10. {
  11.     printf "extern WidgetClass %s;\n", $1;
  12.     printf "{ \"%s\", &%s },\n", $1, $1;
  13. }' | sed -e 's/WidgetClass"/"/' -e 's/ObjClass"/"/' \
  14.      -e 's/ObjectClass"/"/' -e 's/objectClass"/object"/' \
  15.      -e 's/widgetClass"/widget"/' >$tmp
  16.  
  17. cat <<EOF
  18. /*
  19.  * This file is generated by the genlist.sh script and contains an array of
  20.  * all the widgets in Athena widget set.
  21.  *
  22.  * \$XConsortium\$
  23.  */
  24. #include <X11/IntrinsicP.h>
  25. #include <X11/Xmu/WidgetNode.h>
  26.  
  27. EOF
  28. egrep '^extern WidgetClass' $tmp
  29. echo ""
  30. cat <<EOF
  31. XmuWidgetNode XawWidgetArray[] = {
  32. EOF
  33. egrep '^{' $tmp
  34. cat <<EOF
  35. };
  36.  
  37. int XawWidgetCount = XtNumber(XawWidgetArray);
  38.  
  39. EOF
  40.  
  41. rm $tmp
  42.