-
Notifications
You must be signed in to change notification settings - Fork 20
/
test_gbs.c
44 lines (39 loc) · 866 Bytes
/
test_gbs.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
/*
* gbsplay is a Gameboy sound player
*
* 2011-2021 (C) by Tobias Diedrich <[email protected]>
* Christian Garbs <[email protected]>
*
* Licensed under GNU GPL v1 or, at your option, any later version.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#include "common.h"
#include "libgbs.h"
#include "util.h"
int main(int argc, char **argv)
{
struct gbs *gbs;
i18n_init();
if (argc < 2) {
fprintf(stderr, "Usage: %s <outfile>\n", argv[0]);
exit(1);
}
gbs = gbs_open("examples/nightmode.gbs");
if (gbs == NULL) {
fprintf(stderr, "%s: gbs_open failed\n", argv[0]);
exit(2);
}
if (!gbs_write(gbs, argv[1])) {
fprintf(stderr, "%s: gbs_write failed\n", argv[0]);
unlink(argv[1]);
exit(3);
}
unlink(argv[1]);
return 0;
}