-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrundsp.c
52 lines (43 loc) · 784 Bytes
/
rundsp.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <memory.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include "armdsp.h"
void
usage (void)
{
fprintf (stderr, "usage: rundsp prog\n");
exit (1);
}
int
main (int argc, char **argv)
{
int c;
char *progname;
char *err;
while ((c = getopt (argc, argv, "")) != EOF) {
switch (c) {
default:
usage ();
}
}
if (optind >= argc)
usage ();
progname = argv[optind++];
if (optind != argc)
usage ();
if ((err = armdsp_init (1)) != NULL) {
fprintf (stderr, "armdsp_init error: %s\n", err);
exit (1);
}
if ((err = armdsp_run (progname)) != NULL) {
fprintf (stderr, "armdsp_run error: %s\n", err);
exit (1);
}
return (0);
}