File: null.c

package info (click to toggle)
libcaca 0.99.beta18-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,936 kB
  • sloc: ansic: 22,177; python: 2,316; cs: 1,213; cpp: 1,107; java: 916; objc: 836; makefile: 636; sh: 381; ruby: 193; asm: 65
file content (90 lines) | stat: -rw-r--r-- 1,918 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
 *  libcaca       Colour ASCII-Art library
 *  Copyright (c) 2002-2010 Sam Hocevar <sam@hocevar.net>
 *                All Rights Reserved
 *
 *  This library is free software. It comes without any warranty, to
 *  the extent permitted by applicable law. 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.
 */

/*
 *  This file contains a null libcaca input and output driver
 */

#include "config.h"

#if !defined(__KERNEL__)

#include <stdio.h>

#include "caca.h"
#include "caca_internals.h"

static int null_init_graphics(caca_display_t *dp)
{
    return 0;
}

static int null_end_graphics(caca_display_t *dp)
{
    return 0;
}

static int null_set_display_title(caca_display_t *dp, char const *title)
{
    return -1;
}

static int null_get_display_width(caca_display_t const *dp)
{
    return 0;
}

static int null_get_display_height(caca_display_t const *dp)
{
    return 0;
}

static void null_display(caca_display_t *dp)
{
    ;
}

static void null_handle_resize(caca_display_t *dp)
{
    ;
}

static int null_get_event(caca_display_t *dp, caca_privevent_t *ev)
{
    ev->type = CACA_EVENT_NONE;
    return 0;
}

/*
 * Driver initialisation
 */

int null_install(caca_display_t *dp)
{
    dp->drv.id = CACA_DRIVER_NULL;
    dp->drv.driver = "null";

    dp->drv.init_graphics = null_init_graphics;
    dp->drv.end_graphics = null_end_graphics;
    dp->drv.set_display_title = null_set_display_title;
    dp->drv.get_display_width = null_get_display_width;
    dp->drv.get_display_height = null_get_display_height;
    dp->drv.display = null_display;
    dp->drv.handle_resize = null_handle_resize;
    dp->drv.get_event = null_get_event;
    dp->drv.set_mouse = NULL;
    dp->drv.set_cursor = NULL;

    return 0;
}

#endif /* !__KERNEL__ */