From edbf3b6af777b721cd2a1ef461947e51e88241e1 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Tue, 3 Mar 2009 19:31:44 -0800 Subject: auto import from //depot/cupcake/@135843 --- opengl/libs/tools/enumextract.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 opengl/libs/tools/enumextract.sh (limited to 'opengl/libs/tools') 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 + -- cgit v1.1