File: test.c

package info (click to toggle)
wildmidi 0.4.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,376 kB
  • sloc: ansic: 15,109; makefile: 378
file content (16 lines) | stat: -rw-r--r-- 556 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* tiny, minimal C source for testing, e.g. running under valgrind. */
#include <stdio.h>
#include <wildmidi_lib.h>
midi *song;
int main (int argc, char **argv) {
    if (argc != 2) return 1;
    if (WildMidi_Init("wildmidi.cfg", 44100, 0) != 0) return 1;
    song = WildMidi_Open (argv[1]);
#if defined(LIBWILDMIDI_VERSION) && (LIBWILDMIDI_VERSION-0 >= 0x000400L)
    if (!song) fprintf(stderr, "%s\n", WildMidi_GetError());
#endif
    WildMidi_MasterVolume (100);
    if (song) WildMidi_Close(song);
    WildMidi_Shutdown();
    return (song == NULL);
}