File: fbsplash-test.c

package info (click to toggle)
uswsusp 1.0+20120915-6.2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,572 kB
  • sloc: ansic: 7,164; sh: 566; makefile: 223; perl: 65
file content (70 lines) | stat: -rw-r--r-- 1,553 bytes parent folder | download | duplicates (4)
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
/*
 * fbsplash.c
 *
 * fbsplash (framebuffer splash) splash method support
 *
 * Copyright (C) 2007 Alon Bar-Lev <alon.barlev@gmail.com>
 *
 * This file is released under the GPLv2.
 *
 */

#include "config.h"

#include <string.h>
#include <stdio.h>
#include <linux/types.h>
#include <syscall.h>

#include "swsusp.h"
#include "splash.h"
#include "fbsplash_funcs.h"

char fbsplash_theme[] = "";

int main (void)
{
	char c;
	int r;
	int i;
	printf("fbsplashfuncs_open...\n");
	r = fbsplashfuncs_open(SPL_SUSPEND);
	printf("fbsplashfuncs_open=%d\n", r);
	if (r) {
		return 1;
	}

	for (i=0; i<=100; i+=10) {
		printf("fbsplashfuncs_progress (%d)...\n", i);
		fbsplashfuncs_progress(i);
		sleep(1);
		if (i == 50) {
			printf("fbsplashfuncs_dialog()...\n");
			printf("fbsplashfuncs_dialog=%c\n", fbsplashfuncs_dialog ("Hello world!\nPlease press a key: "));
		}
#ifdef CONFIG_ENCRYPT
		else if (i==60) {
			char pass[PASS_SIZE];
			printf("fbsplashfuncs_read_password(,0)..\n");
			fbsplashfuncs_read_password(pass, 0);
			printf("fbsplashfuncs_read_password=%s\n", pass);
		}
		else if (i==80) {
			char pass[PASS_SIZE];
			printf("fbsplashfuncs_read_password(,1)..\n");
			fbsplashfuncs_read_password(pass, 1);
			printf("fbsplashfuncs_read_password=%s\n", pass);
		}
#endif
		c = fbsplashfuncs_key_pressed();
		if (c) {
			char buffer[SPLASH_GENERIC_MESSAGE_SIZE];
			sprintf(buffer, "Key %c (%02x) pressed", c, (unsigned char)c);
			fbsplashfuncs_set_caption(buffer);
		}
	}

	printf("fbsplashfuncs_finish...\n");
	fbsplashfuncs_finish();
	return 0;
}