5 PREFIX
= 'EGL_ENTRYPOINT('
9 def check_entrypoint_sorted(entrypoints
):
10 print('Checking that EGL API entrypoints are sorted...')
12 for i
, _
in enumerate(entrypoints
):
13 # Can't compare the first one with the previous
16 if entrypoints
[i
- 1] > entrypoints
[i
]:
17 print('ERROR: ' + entrypoints
[i
] + ' should come before ' + entrypoints
[i
- 1])
24 parser
= argparse
.ArgumentParser()
25 parser
.add_argument('header')
26 args
= parser
.parse_args()
28 with
open(args
.header
) as header
:
29 lines
= header
.readlines()
34 if line
.startswith(PREFIX
):
35 assert line
.endswith(SUFFIX
)
36 entrypoints
.append(line
[len(PREFIX
):-len(SUFFIX
)])
38 check_entrypoint_sorted(entrypoints
)
40 if __name__
== '__main__':