blob: 9da57ead17cbe309890640e76899acd54e7e804d [file] [log] [blame]
Greg Kroah-Hartman64969222018-01-11 11:08:40 +01001/* SPDX-License-Identifier: GPL-2.0+ */
William Hubbsc6e3fd22010-10-07 13:20:02 -05002/* spk_priv.h
Cristina Moraru7ea87782015-10-14 23:28:29 +03003 * review functions for the speakup screen review package.
4 * originally written by: Kirk Reiser and Andy Berdan.
5 *
6 * extensively modified by David Borowski.
7 *
8 * Copyright (C) 1998 Kirk Reiser.
9 * Copyright (C) 2003 David Borowski.
Cristina Moraru7ea87782015-10-14 23:28:29 +030010 */
William Hubbsc6e3fd22010-10-07 13:20:02 -050011#ifndef _SPEAKUP_PRIVATE_H
12#define _SPEAKUP_PRIVATE_H
13
Sam Muhammed1c31a132020-03-22 10:33:22 -040014#include <linux/printk.h>
15
William Hubbsc6e3fd22010-10-07 13:20:02 -050016#include "spk_types.h"
17#include "spk_priv_keyinfo.h"
18
William Hubbsc6e3fd22010-10-07 13:20:02 -050019#define V_LAST_VAR { MAXVARS }
20#define SPACE 0x20
21#define SYNTH_CHECK 20030716 /* today's date ought to do for check value */
22/* synth flags, for odd synths */
23#define SF_DEC 1 /* to fiddle puncs in alpha strings so it doesn't spell */
24#ifdef MODULE
25#define SYNTH_START 1
26#else
27#define SYNTH_START 0
28#endif
29
30#define KT_SPKUP 15
Okash Khawaja6b9ad1c2017-05-15 18:45:35 +010031#define SPK_SYNTH_TIMEOUT 100000 /* in micro-seconds */
Okash Khawajaa5525dc2017-06-25 19:40:01 +010032#define SYNTH_DEFAULT_DEV "ttyS0"
33#define SYNTH_DEFAULT_SER 0
William Hubbsc6e3fd22010-10-07 13:20:02 -050034
Katie Dunne13d932f2015-02-26 18:42:36 -080035const struct old_serial_port *spk_serial_init(int index);
36void spk_stop_serial_interrupt(void);
Samuel Thibault1941ab12021-01-26 23:21:44 +010037void spk_serial_release(struct spk_synth *synth);
38void spk_ttyio_release(struct spk_synth *synth);
Okash Khawaja9f8dced2017-07-16 17:18:25 +010039void spk_ttyio_register_ldisc(void);
40void spk_ttyio_unregister_ldisc(void);
William Hubbsc6e3fd22010-10-07 13:20:02 -050041
Samuel Thibault89fc2ae2017-03-04 15:01:55 +010042void synth_buffer_skip_nonlatin1(void);
43u16 synth_buffer_getc(void);
44u16 synth_buffer_peek(void);
Katie Dunne13d932f2015-02-26 18:42:36 -080045int synth_buffer_empty(void);
46struct var_t *spk_get_var(enum var_id_t var_id);
47ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr,
48 char *buf);
49ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr,
50 const char *buf, size_t count);
William Hubbsc6e3fd22010-10-07 13:20:02 -050051
Katie Dunne13d932f2015-02-26 18:42:36 -080052int spk_serial_synth_probe(struct spk_synth *synth);
Okash Khawaja1ab92da2017-05-15 18:45:33 +010053int spk_ttyio_synth_probe(struct spk_synth *synth);
Ioannis Valasakis28437192018-11-06 02:29:10 +000054const char *spk_serial_synth_immediate(struct spk_synth *synth,
55 const char *buff);
56const char *spk_ttyio_synth_immediate(struct spk_synth *synth,
57 const char *buff);
Katie Dunne13d932f2015-02-26 18:42:36 -080058void spk_do_catch_up(struct spk_synth *synth);
Samuel Thibault65fa72d2018-03-10 11:56:27 +010059void spk_do_catch_up_unicode(struct spk_synth *synth);
Katie Dunne13d932f2015-02-26 18:42:36 -080060void spk_synth_flush(struct spk_synth *synth);
Okash Khawajaca693dc2017-04-29 20:52:58 +010061unsigned char spk_synth_get_index(struct spk_synth *synth);
Katie Dunne13d932f2015-02-26 18:42:36 -080062int spk_synth_is_alive_nop(struct spk_synth *synth);
63int spk_synth_is_alive_restart(struct spk_synth *synth);
Joe Perchesae8784f2017-03-04 08:13:11 -080064__printf(1, 2)
Katie Dunne13d932f2015-02-26 18:42:36 -080065void synth_printf(const char *buf, ...);
Samuel Thibault89fc2ae2017-03-04 15:01:55 +010066void synth_putwc(u16 wc);
67void synth_putwc_s(u16 wc);
68void synth_putws(const u16 *buf);
69void synth_putws_s(const u16 *buf);
Derek Robsoncb23ebd2017-02-04 17:49:00 +130070int synth_request_region(unsigned long start, unsigned long n);
71int synth_release_region(unsigned long start, unsigned long n);
Katie Dunne13d932f2015-02-26 18:42:36 -080072int synth_add(struct spk_synth *in_synth);
73void synth_remove(struct spk_synth *in_synth);
Samuel Thibault45ac7b32019-03-07 23:06:57 +010074struct spk_synth *synth_current(void);
William Hubbsc6e3fd22010-10-07 13:20:02 -050075
76extern struct speakup_info_t speakup_info;
77
78extern struct var_t synth_time_vars[];
79
Okash Khawaja1e441592017-03-14 13:41:53 +000080extern struct spk_io_ops spk_serial_io_ops;
Okash Khawaja1ab92da2017-05-15 18:45:33 +010081extern struct spk_io_ops spk_ttyio_ops;
Okash Khawaja1e441592017-03-14 13:41:53 +000082
William Hubbsc6e3fd22010-10-07 13:20:02 -050083#endif