--- rpl/modules/motif/definitions.sh 2017/07/04 12:32:03 1.1 +++ rpl/modules/motif/definitions.sh 2017/10/10 20:25:32 1.6 @@ -3,7 +3,7 @@ #2 -> $(top_builddir) #3 -> $(motif_srcdir) -echo "#define variables(value, arg) \\" > $1/variables.h +echo "#define XmN_constants(value, arg) \\" > $1/variables.h echo "do { if (0) { } else \\" >> $1/variables.h $2/rplawk/rplawk 'BEGIN { c = 0; } \ /\/\*/ { c = 1; } @@ -13,6 +13,22 @@ $2/rplawk/rplawk 'BEGIN { c = 0; } \ { arg = %s; } else \\\n", $2, $2); } } \ END { printf("{ executionError(\"Unknown directive\"); } } \\\ while(0)\n"); }' \ - $3/lib/Xm/XmStrDefs.h >> $1/variables.h + $3/Xm/XmStrDefs.h >> $1/variables.h + +echo "#define Xm_widgets_classes(value, arg) \\" >> $1/variables.h +cpp -E /usr/include/X11/Shell.h | sed 's/;/ /g' | \ + $2/rplawk/rplawk 'BEGIN { printf("{ "); } \ + /^[\t ]*WidgetClass.*WidgetClass[\t ]*$/ \ + { printf("if (strcmp(\"%s\", value) == 0) \\\ + { arg = %s; } else \\\n", $2, $2); } ' >> $1/variables.h +cpp -E $3/Xm/XmAll.h -I $3 | sed 's/;/ /g' | \ + $2/rplawk/rplawk '/^[\t ]*WidgetClass xm.*[\t ]*$/ \ + { printf("if (strcmp(\"%s\", value) == 0) \\\ + { arg = %s; } else \\\n", $2, $2); } \ + /^[\t ]*extern WidgetClass xm.*[\t ]*$/ \ + { printf("if (strcmp(\"%s\", value) == 0) \\\ + { arg = %s; } else \\\n", $3, $3); } \ + END { printf("{ executionError(\"Class not found\"); } } \\\ + while(0)\n"); }' >> $1/variables.h exit 0