Changeset f03d1308 in mainline for uspace/app/terminal/main.c


Ignore:
Timestamp:
2020-10-28T12:42:11Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8009dc27
Parents:
d284ce9
git-author:
Jiri Svoboda <jiri@…> (2020-10-28 12:41:11)
git-committer:
Jiri Svoboda <jiri@…> (2020-10-28 12:42:11)
Message:

Convert terminal to using ui_window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/terminal/main.c

    rd284ce9 rf03d1308  
    11/*
    2  * Copyright (c) 2019 Jiri Svoboda
     2 * Copyright (c) 2020 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3333 */
    3434
    35 #include <display.h>
    3635#include <stdio.h>
    3736#include <task.h>
     37#include <ui/ui.h>
    3838#include "terminal.h"
    3939
     
    4343static void print_syntax(void)
    4444{
    45         printf("Syntax: %s [-d <display>]\n", NAME);
     45        printf("Syntax: %s [-d <display-spec>]\n", NAME);
    4646}
    4747
    4848int main(int argc, char *argv[])
    4949{
    50         const char *display_svc = DISPLAY_DEFAULT;
    51         display_t *display = NULL;
     50        const char *display_spec = UI_DISPLAY_DEFAULT;
    5251        terminal_t *terminal = NULL;
    5352        errno_t rc;
     
    6463                        }
    6564
    66                         display_svc = argv[i++];
     65                        display_spec = argv[i++];
    6766                } else {
    6867                        printf("Invalid option '%s'.\n", argv[i]);
     
    7776        }
    7877
    79         rc = display_open(display_svc, &display);
    80         if (rc != EOK) {
    81                 printf("%s: Error opening display.\n", NAME);
     78        rc = terminal_create(display_spec, 640, 480, &terminal);
     79        if (rc != EOK)
    8280                return 1;
    83         }
    84 
    85         rc = terminal_create(display, 640, 480, &terminal);
    86         if (rc != EOK) {
    87                 display_close(display);
    88                 return 1;
    89         }
    9081
    9182        task_retval(0);
Note: See TracChangeset for help on using the changeset viewer.