This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #include <sys/types.h>
19 #include <fcntl.h>
20 #include <unistd.h>
21 #include <string.h>
22 #include <stdio.h>
23 #include <err.h>
24 #include <dev/pci/neoreg.h>
25
26 #include "neo-coeff.h"
27
28 #define FILENAME "neo-coefficients"
29
30 int
31 main(int argc, char *argv[])
32 {
33 ssize_t rlen;
34 struct neo_firmware nf;
35 int fd;
36
37 fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644);
38 if (fd == -1)
39 err(1, FILENAME);
40
41 bcopy(coefficientSizes, &nf.coefficientSizes,
42 sizeof nf.coefficientSizes);
43 bcopy(coefficients, &nf.coefficients,
44 sizeof nf.coefficients);
45
46 rlen = write(fd, &nf, sizeof nf);
47 if (rlen == -1)
48 err(1, "%s", FILENAME);
49 if (rlen != sizeof nf)
50 errx(1, "%s: short write", FILENAME);
51 printf("created %s length %d\n", FILENAME, sizeof nf);
52 close(fd);
53 return (0);
54 }