/* * cacaplay caca file player * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * * $Id$ * * This program is free software; you can redistribute it and/or * modify it under the terms of the Do What The Fuck You Want To * Public License, Version 2, as published by Sam Hocevar. See * http://sam.zoy.org/wtfpl/COPYING for more details. */ #include "config.h" #include "common.h" #if !defined(__KERNEL__) #include #include #endif #include "cucul.h" #include "caca.h" int main(int argc, char **argv) { caca_event_t ev; cucul_canvas_t *cv; caca_display_t *dp; if(argc < 2) { fprintf(stderr, "%s: missing argument (filename).\n", argv[0]); return 1; } cv = cucul_create_canvas(0, 0); if(cucul_import_file(cv, argv[1], "caca") < 0) { fprintf(stderr, "%s: could not import file %s.\n", argv[0], argv[1]); return 1; } dp = caca_create_display(cv); caca_refresh_display(dp); while(caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1)) { if(ev.data.key.ch == CACA_KEY_ESCAPE) break; } /* Clean up */ caca_free_display(dp); cucul_free_canvas(cv); return 0; }