summaryrefslogtreecommitdiffstats
path: root/opengl/libs/tools
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:31:44 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:31:44 -0800
commit9066cfe9886ac131c34d59ed0e2d287b0e3c0087 (patch)
treed88beb88001f2482911e3d28e43833b50e4b4e97 /opengl/libs/tools
parentd83a98f4ce9cfa908f5c54bbd70f03eec07e7553 (diff)
downloadframeworks_base-9066cfe9886ac131c34d59ed0e2d287b0e3c0087.zip
frameworks_base-9066cfe9886ac131c34d59ed0e2d287b0e3c0087.tar.gz
frameworks_base-9066cfe9886ac131c34d59ed0e2d287b0e3c0087.tar.bz2
auto import from //depot/cupcake/@135843
Diffstat (limited to 'opengl/libs/tools')
-rw-r--r--opengl/libs/tools/enumextract.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/opengl/libs/tools/enumextract.sh b/opengl/libs/tools/enumextract.sh
new file mode 100644
index 0000000..5707302
--- /dev/null
+++ b/opengl/libs/tools/enumextract.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+awk '
+/^#define GL_/ {
+ names[count] = $2;
+ values[count] = $3;
+ sort[count] = $3 + 0;
+ count++;
+}
+END {
+ for (i = 1; i < count; i++) {
+ for (j = 0; j < i; j++) {
+ if (sort[i] < sort[j]) {
+ tn = names[i];
+ tv = values[i];
+ ts = sort[i];
+ names[i] = names[j];
+ values[i] = values[j];
+ sort[i] = sort[j];
+ names[j] = tn;
+ values[j] = tv;
+ sort[j] = ts;
+ }
+ }
+ }
+
+ for (i = 0; i < count; i++) {
+ printf("GLENUM(%s, %s)\n", names[i], values[i]);
+ }
+}
+' < $1
+