source: mainline/uspace/lib/c/include/io/con_srv.h@ cd1e3fc0

Last change on this file since cd1e3fc0 was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[5d94b16c]1/*
[d7f7a4a]2 * SPDX-FileCopyrightText: 2021 Jiri Svoboda
[5d94b16c]3 *
[d7f7a4a]4 * SPDX-License-Identifier: BSD-3-Clause
[5d94b16c]5 */
6
7/** @addtogroup libc
8 * @{
9 */
10/** @file
11 */
12
[4805495]13#ifndef _LIBC_CON_SRV_H_
14#define _LIBC_CON_SRV_H_
[5d94b16c]15
16#include <adt/list.h>
17#include <async.h>
18#include <fibril_synch.h>
[68a552f]19#include <io/charfield.h>
[5d94b16c]20#include <io/color.h>
21#include <io/concaps.h>
[902f0906]22#include <io/cons_event.h>
[5d94b16c]23#include <io/pixel.h>
24#include <io/style.h>
[3e6a98c5]25#include <stdbool.h>
[bd41ac52]26#include <time.h>
[8d2dd7f2]27#include <stddef.h>
[5d94b16c]28
29typedef struct con_ops con_ops_t;
30
[b48e680f]31#define CON_CAPTION_MAXLEN 255
32
[5d94b16c]33/** Service setup (per sevice) */
34typedef struct {
35 con_ops_t *ops;
36 void *sarg;
37 /** Period to check for abort */
[bd41ac52]38 usec_t abort_timeout;
[5d94b16c]39 bool aborted;
40} con_srvs_t;
41
42/** Server structure (per client session) */
43typedef struct {
44 con_srvs_t *srvs;
45 async_sess_t *client_sess;
46 void *carg;
47} con_srv_t;
48
[55edba0]49struct con_ops {
[b7fd2a0]50 errno_t (*open)(con_srvs_t *, con_srv_t *);
51 errno_t (*close)(con_srv_t *);
52 errno_t (*read)(con_srv_t *, void *, size_t, size_t *);
53 errno_t (*write)(con_srv_t *, void *, size_t, size_t *);
[5d94b16c]54 void (*sync)(con_srv_t *);
55 void (*clear)(con_srv_t *);
56 void (*set_pos)(con_srv_t *, sysarg_t col, sysarg_t row);
[b7fd2a0]57 errno_t (*get_pos)(con_srv_t *, sysarg_t *, sysarg_t *);
58 errno_t (*get_size)(con_srv_t *, sysarg_t *, sysarg_t *);
59 errno_t (*get_color_cap)(con_srv_t *, console_caps_t *);
[5d94b16c]60 void (*set_style)(con_srv_t *, console_style_t);
61 void (*set_color)(con_srv_t *, console_color_t, console_color_t,
62 console_color_attr_t);
63 void (*set_rgb_color)(con_srv_t *, pixel_t, pixel_t);
64 void (*set_cursor_visibility)(con_srv_t *, bool);
[b48e680f]65 errno_t (*set_caption)(con_srv_t *, const char *);
[b7fd2a0]66 errno_t (*get_event)(con_srv_t *, cons_event_t *);
[68a552f]67 errno_t (*map)(con_srv_t *, sysarg_t, sysarg_t, charfield_t **);
68 void (*unmap)(con_srv_t *);
69 void (*update)(con_srv_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
[55edba0]70};
[5d94b16c]71
72extern void con_srvs_init(con_srvs_t *);
73
[984a9ba]74extern errno_t con_conn(ipc_call_t *, con_srvs_t *);
[5d94b16c]75
76#endif
77
78/** @}
79 */
Note: See TracBrowser for help on using the repository browser.