source: libcaca/trunk/caca/driver/null.c @ 4148

Last change on this file since 4148 was 3621, checked in by Sam Hocevar, 11 years ago

Include <stdio.h> in the null driver to get NULL.

  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1/*
2 *  libcaca       Colour ASCII-Art library
3 *  Copyright (c) 2002-2009 Sam Hocevar <sam@hocevar.net>
4 *                All Rights Reserved
5 *
6 *  $Id: null.c 3621 2009-08-03 23:19:41Z sam $
7 *
8 *  This library is free software. It comes without any warranty, to
9 *  the extent permitted by applicable law. You can redistribute it
10 *  and/or modify it under the terms of the Do What The Fuck You Want
11 *  To Public License, Version 2, as published by Sam Hocevar. See
12 *  http://sam.zoy.org/wtfpl/COPYING for more details.
13 */
14
15/*
16 *  This file contains a null libcaca input and output driver
17 */
18
19#include "config.h"
20
21#if !defined(__KERNEL__)
22
23#include <stdio.h>
24
25#include "caca.h"
26#include "caca_internals.h"
27
28static int null_init_graphics(caca_display_t *dp)
29{
30    return 0;
31}
32
33static int null_end_graphics(caca_display_t *dp)
34{
35    return 0;
36}
37
38static int null_set_display_title(caca_display_t *dp, char const *title)
39{
40    return -1;
41}
42
43static int null_get_display_width(caca_display_t const *dp)
44{
45    return 0;
46}
47
48static int null_get_display_height(caca_display_t const *dp)
49{
50    return 0;
51}
52
53static void null_display(caca_display_t *dp)
54{
55    ;
56}
57
58static void null_handle_resize(caca_display_t *dp)
59{
60    ;
61}
62
63static int null_get_event(caca_display_t *dp, caca_privevent_t *ev)
64{
65    ev->type = CACA_EVENT_NONE;
66    return 0;
67}
68
69/*
70 * Driver initialisation
71 */
72
73int null_install(caca_display_t *dp)
74{
75    dp->drv.id = CACA_DRIVER_NULL;
76    dp->drv.driver = "null";
77
78    dp->drv.init_graphics = null_init_graphics;
79    dp->drv.end_graphics = null_end_graphics;
80    dp->drv.set_display_title = null_set_display_title;
81    dp->drv.get_display_width = null_get_display_width;
82    dp->drv.get_display_height = null_get_display_height;
83    dp->drv.display = null_display;
84    dp->drv.handle_resize = null_handle_resize;
85    dp->drv.get_event = null_get_event;
86    dp->drv.set_mouse = NULL;
87    dp->drv.set_cursor = NULL;
88
89    return 0;
90}
91
92#endif /* !__KERNEL__ */
Note: See TracBrowser for help on using the repository browser.