blob: 570730215f179aaf39cecdbf969975087547fe17 [file] [log] [blame]
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -07001#!/bin/sh
2
3awk '
4/^#define GL_/ {
5 names[count] = $2;
6 values[count] = $3;
7 sort[count] = $3 + 0;
8 count++;
9}
10END {
11 for (i = 1; i < count; i++) {
12 for (j = 0; j < i; j++) {
13 if (sort[i] < sort[j]) {
14 tn = names[i];
15 tv = values[i];
16 ts = sort[i];
17 names[i] = names[j];
18 values[i] = values[j];
19 sort[i] = sort[j];
20 names[j] = tn;
21 values[j] = tv;
22 sort[j] = ts;
23 }
24 }
25 }
26
27 for (i = 0; i < count; i++) {
28 printf("GLENUM(%s, %s)\n", names[i], values[i]);
29 }
30}
31' < $1
32