3 This file is part of gldbg
4 Copyright © 2009 Mikko Rasa, Mikkosoft Productions
5 Distributed under the GPL
16 int main(int argc, char **argv)
27 fprintf(stderr, "Usage: %s <dumpfile>\n", argv[0]);
31 fd = open(argv[1], O_RDONLY);
38 addr = (char *)mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
39 end = addr+st.st_size;
42 dec = glprint_new(NULL, 0);
47 ret = gldecoder_decode(dec, ptr, end-ptr);
50 fprintf(stderr, "Decode error with %d bytes left\n", end-ptr);
54 printf("%s\n", glprint_get_buffer(dec));
56 munmap(addr, st.st_size);
58 gldecoder_delete(dec);