Added initial psplash sources
[profile/ivi/psplash.git] / psplash.h
1 /* 
2  *  pslash - a lightweight framebuffer splashscreen for embedded devices. 
3  *
4  *  Copyright (c) 2006 Matthew Allum <mallum@o-hand.com>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2, or (at your option)
9  *  any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  */
17
18 #ifndef _HAVE_PSPLASH_H
19 #define _HAVE_PSPLASH_H
20
21 #define _GNU_SOURCE 1
22 #include <assert.h>
23 #include <errno.h>
24 #include <fcntl.h>
25 #include <limits.h>
26 #include <linux/fb.h>
27 #include <linux/kd.h>
28 #include <linux/vt.h>
29 #include <signal.h>
30 #include <stdarg.h>
31 #include <stdio.h>
32 #include <stdlib.h>
33 #include <string.h>
34 #if defined(__i386__) || defined(__alpha__)
35 #include <sys/io.h>
36 #endif
37 #include <sys/ioctl.h>
38 #include <sys/mman.h>
39 #include <sys/stat.h>
40 #include <sys/time.h>
41 #include <sys/types.h>
42 #include <termios.h>
43 #include <unistd.h>
44
45 typedef unsigned char  uint8;
46 typedef unsigned short uint16;
47
48 #define PSPLASH_FIFO "psplash_fifo"
49
50 #define CLAMP(x, low, high) \
51    (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
52
53 #define DEBUG 1
54
55 #if DEBUG
56 #define DBG(x, a...) \
57    { printf ( __FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a); }
58 #else
59 #define DBG(x, a...) do {} while (0)
60 #endif
61
62 #include "psplash-fb.h"
63 #include "psplash-console.h"
64
65 #endif