Stéphane Marchesin | ae37e6c | 2014-08-08 18:19:40 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2014 The Chromium OS Authors. All rights reserved. |
| 3 | * Use of this source code is governed by a BSD-style license that can be |
| 4 | * found in the LICENSE file. |
| 5 | */ |
| 6 | |
| 7 | #include <libtsm.h> |
| 8 | #include <stdio.h> |
| 9 | #include <stdlib.h> |
| 10 | #include <unistd.h> |
| 11 | |
| 12 | #include "font.h" |
| 13 | #include "input.h" |
| 14 | #include "term.h" |
| 15 | #include "video.h" |
| 16 | |
| 17 | int main() |
| 18 | { |
| 19 | int32_t width, height, pitch; |
| 20 | int ret; |
| 21 | |
| 22 | ret = video_init(&width, &height, &pitch); |
| 23 | if (ret) { |
| 24 | printf("Video init failed\n"); |
| 25 | return EXIT_FAILURE; |
| 26 | } |
| 27 | |
| 28 | ret = input_init(); |
| 29 | if (ret) { |
| 30 | printf("Input init failed\n"); |
| 31 | video_close(); |
| 32 | return EXIT_FAILURE; |
| 33 | } |
| 34 | |
| 35 | ret = term_init(width, height, pitch); |
| 36 | if (ret) { |
| 37 | printf("Term init failed\n"); |
| 38 | input_close(); |
| 39 | video_close(); |
| 40 | return EXIT_FAILURE; |
| 41 | } |
| 42 | |
| 43 | ret = term_run(); |
| 44 | |
| 45 | input_close(); |
| 46 | term_close(); |
| 47 | video_close(); |
| 48 | |
| 49 | return ret; |
| 50 | } |