You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

70 rivejä
1.4 KiB

  1. /*
  2. * import libcaca importers test program
  3. * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the Do What The Fuck You Want To
  10. * Public License, Version 2, as published by Sam Hocevar. See
  11. * http://sam.zoy.org/wtfpl/COPYING for more details.
  12. */
  13. #include "config.h"
  14. #include "common.h"
  15. #if !defined(__KERNEL__)
  16. # if defined(HAVE_INTTYPES_H)
  17. # include <inttypes.h>
  18. # endif
  19. # include <stdio.h>
  20. # include <stdlib.h>
  21. #endif
  22. #include "cucul.h"
  23. #include "caca.h"
  24. int main(int argc, char *argv[])
  25. {
  26. cucul_canvas_t *cv;
  27. cucul_buffer_t *b;
  28. caca_display_t *dp;
  29. if(argc < 2)
  30. {
  31. fprintf(stderr, "%s: missing argument (filename).\n", argv[0]);
  32. return 1;
  33. }
  34. b = cucul_load_file(argv[1]);
  35. if(!b)
  36. {
  37. fprintf(stderr, "%s: could not open `%s'.\n", argv[0], argv[1]);
  38. return 1;
  39. }
  40. cv = cucul_import_canvas(b, "");
  41. if(!cv)
  42. {
  43. fprintf(stderr, "%s: could not import `%s'.\n", argv[0], argv[1]);
  44. return 1;
  45. }
  46. cucul_free_buffer(b);
  47. dp = caca_create_display(cv);
  48. caca_refresh_display(dp);
  49. caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1);
  50. caca_free_display(dp);
  51. cucul_free_canvas(cv);
  52. return 0;
  53. }