~ubuntu-branches/debian/stretch/uswsusp/stretch

« back to all changes in this revision

Viewing changes to fbsplash-test.c

  • Committer: Bazaar Package Importer
  • Author(s): Christian Perrier
  • Date: 2008-08-20 09:09:13 UTC
  • mfrom: (0.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080820090913-0eahue1zo8egcxls
Tags: 0.8-1.1
* Non-maintainer upload to fix pending l10n issues.
* Remove extra and useless debian/po/ff/ directory
* Debconf translation updates:
  - Japanese. Closes: #489939
  - German. Closes: #493747
  - French. Closes: #493771
  - Romanian. Closes: #493772
  - Galician. Closes: #494050
  - Finnish. Closes: #494087
  - Italian. Closes: #494096
  - Basque. Closes: #494277
  - Basque. Closes: #494277
  - Czech. Closes: #494410
  - Swedish. Closes: #494412
  - Russian. Closes: #495412
  - Portuguese. Closes: #495451
  - Spanish. Closes: #495499
  - Slovak. Closes: #495516

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * fbsplash.c
 
3
 *
 
4
 * fbsplash (framebuffer splash) splash method support
 
5
 *
 
6
 * Copyright (C) 2007 Alon Bar-Lev <alon.barlev@gmail.com>
 
7
 *
 
8
 * This file is released under the GPLv2.
 
9
 *
 
10
 */
 
11
 
 
12
#include "config.h"
 
13
 
 
14
#include <string.h>
 
15
#include <stdio.h>
 
16
#include <linux/types.h>
 
17
#include <syscall.h>
 
18
 
 
19
#include "swsusp.h"
 
20
#include "splash.h"
 
21
#include "fbsplash_funcs.h"
 
22
 
 
23
char fbsplash_theme[] = "";
 
24
 
 
25
int main (void)
 
26
{
 
27
        char c;
 
28
        int r;
 
29
        int i;
 
30
        printf("fbsplashfuncs_open...\n");
 
31
        r = fbsplashfuncs_open(SPL_SUSPEND);
 
32
        printf("fbsplashfuncs_open=%d\n", r);
 
33
        if (r) {
 
34
                return 1;
 
35
        }
 
36
 
 
37
        for (i=0; i<=100; i+=10) {
 
38
                printf("fbsplashfuncs_progress (%d)...\n", i);
 
39
                fbsplashfuncs_progress(i);
 
40
                sleep(1);
 
41
                if (i == 50) {
 
42
                        printf("fbsplashfuncs_dialog()...\n");
 
43
                        printf("fbsplashfuncs_dialog=%c\n", fbsplashfuncs_dialog ("Hello world!\nPlease press a key: "));
 
44
                }
 
45
#ifdef CONFIG_ENCRYPT
 
46
                else if (i==60) {
 
47
                        char pass[PASS_SIZE];
 
48
                        printf("fbsplashfuncs_read_password(,0)..\n");
 
49
                        fbsplashfuncs_read_password(pass, 0);
 
50
                        printf("fbsplashfuncs_read_password=%s\n", pass);
 
51
                }
 
52
                else if (i==80) {
 
53
                        char pass[PASS_SIZE];
 
54
                        printf("fbsplashfuncs_read_password(,1)..\n");
 
55
                        fbsplashfuncs_read_password(pass, 1);
 
56
                        printf("fbsplashfuncs_read_password=%s\n", pass);
 
57
                }
 
58
#endif
 
59
                c = fbsplashfuncs_key_pressed();
 
60
                if (c) {
 
61
                        char buffer[SPLASH_GENERIC_MESSAGE_SIZE];
 
62
                        sprintf(buffer, "Key %c (%02x) pressed", c, (unsigned char)c);
 
63
                        fbsplashfuncs_set_caption(buffer);
 
64
                }
 
65
        }
 
66
 
 
67
        printf("fbsplashfuncs_finish...\n");
 
68
        fbsplashfuncs_finish();
 
69
        return 0;
 
70
}