blob: ff55d7870d09e3752bb7d375e7cded0004898624 [file] [log] [blame]
Wichert Akkermane2613b42001-03-17 17:29:43 +00001#include <stdio.h>
2#include <stdlib.h>
3
4#include <asm/ioctl.h>
5#include <linux/types.h>
6
7#include "ioctldefs.h"
8#include <linux/atmioc.h>
9
10struct ioctlent {
11 const char* header;
12 const char* name;
13 unsigned long code;
14};
15
16struct ioctlent ioctls[] = {
17#include "ioctls.h"
18};
19
20int nioctls = sizeof(ioctls) / sizeof(ioctls[0]);
21
22
23int compare(const void* a, const void* b) {
24 unsigned long code1 = ((struct ioctlent *) a)->code;
25 unsigned long code2 = ((struct ioctlent *) b)->code;
26 return (code1 > code2) ? 1 : (code1 < code2) ? -1 : 0;
27}
28
29
30int main(int argc, char** argv) {
31 int i;
32
33 qsort(ioctls, nioctls, sizeof(ioctls[0]), compare);
34 for (i = 0; i < nioctls; i++)
35 printf("\t{\"%s\",\t\"%s\",\t%#lx},\n",
36 ioctls[i].header, ioctls[i].name, ioctls[i].code);
37
38 return 0;
39}
40
41