Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
spk_types.h
Go to the documentation of this file.
1 #ifndef SPEAKUP_TYPES_H
2 #define SPEAKUP_TYPES_H
3 
4 /*
5  * This file includes all of the typedefs and structs used in speakup.
6  */
7 
8 #include <linux/types.h>
9 #include <linux/fs.h>
10 #include <linux/errno.h>
11 #include <linux/delay.h>
12 #include <linux/wait.h> /* for wait_queue */
13 #include <linux/init.h> /* for __init */
14 #include <linux/module.h>
15 #include <linux/vt_kern.h>
16 #include <linux/spinlock.h>
17 #include <linux/mutex.h>
18 #include <linux/io.h> /* for inb_p, outb_p, inb, outb, etc... */
19 
20 enum var_type_t {
21  VAR_NUM = 0,
25 };
26 
27 enum {
28  E_DEFAULT = 0,
33 };
34 
35 enum var_id_t {
40  DELAY, TRIGGER, JIFFY, FULL, /* all timers must be together */
48 };
49 
50 typedef int (*special_func)(struct vc_data *vc, u_char type, u_char ch,
51  u_short key);
52 
53 #define COLOR_BUFFER_SIZE 160
54 
56  /* Count of each background color */
57  unsigned int bgcount[8];
58  /* Buffer for characters drawn with each background color */
60  /* Current index into highbuf */
61  unsigned int highsize[8];
62  /* Reading Position for each color */
63  u_long rpos[8], rx[8], ry[8];
64  /* Real Cursor Y Position */
66 };
67 
68 struct st_spk_t {
76  char parked, shut_up;
79 };
80 
81 /* now some defines to make these easier to use. */
82 #define spk_shut_up (speakup_console[vc->vc_num]->shut_up)
83 #define spk_killed (speakup_console[vc->vc_num]->shut_up & 0x40)
84 #define spk_x (speakup_console[vc->vc_num]->reading_x)
85 #define spk_cx (speakup_console[vc->vc_num]->cursor_x)
86 #define spk_y (speakup_console[vc->vc_num]->reading_y)
87 #define spk_cy (speakup_console[vc->vc_num]->cursor_y)
88 #define spk_pos (speakup_console[vc->vc_num]->reading_pos)
89 #define spk_cp (speakup_console[vc->vc_num]->cursor_pos)
90 #define goto_pos (speakup_console[vc->vc_num]->go_pos)
91 #define goto_x (speakup_console[vc->vc_num]->go_x)
92 #define win_top (speakup_console[vc->vc_num]->w_top)
93 #define win_bottom (speakup_console[vc->vc_num]->w_bottom)
94 #define win_left (speakup_console[vc->vc_num]->w_left)
95 #define win_right (speakup_console[vc->vc_num]->w_right)
96 #define win_start (speakup_console[vc->vc_num]->w_start)
97 #define win_enabled (speakup_console[vc->vc_num]->w_enabled)
98 #define spk_attr (speakup_console[vc->vc_num]->reading_attr)
99 #define spk_old_attr (speakup_console[vc->vc_num]->old_attr)
100 #define spk_parked (speakup_console[vc->vc_num]->parked)
101 
103  char *name;
106  void *p_val; /* ptr to programs variable to store value */
107  void *data; /* ptr to the vars data */
108 };
109 
110 struct num_var_t {
111  char *synth_fmt;
113  int low;
114  int high;
115  short offset, multiplier; /* for fiddling rates etc. */
116  char *out_str; /* if synth needs char representation of number */
117  int value; /* current value */
118 };
119 
120 struct punc_var_t {
122  short value;
123 };
124 
125 struct string_var_t {
126  char *default_val;
127 };
128 
129 struct var_t {
131  union {
132  struct num_var_t n;
133  struct string_var_t s;
134  } u;
135 };
136 
137 struct st_bits_data { /* punc, repeats, word delim bits */
138  char *name;
139  char *value;
140  short mask;
141 };
142 
144  char *command;
145  unsigned char lowindex;
146  unsigned char highindex;
147  unsigned char currindex;
148 };
149 
150 struct spk_synth {
151  const char *name;
152  const char *version;
153  const char *long_name;
154  const char *init;
156  char clear;
157  int delay;
158  int trigger;
159  int jiffies;
160  int full;
161  int ser;
162  short flags;
163  short startup;
164  const int checkval; /* for validating a proper synth module */
165  struct var_t *vars;
168  int (*probe)(struct spk_synth *synth);
170  const char *(*synth_immediate)(struct spk_synth *synth, const char *buff);
172  void (*flush)(struct spk_synth *synth);
174  int (*synth_adjust)(struct st_var_header *var);
176  unsigned char (*get_index)(void);
178  int alive;
180 };
181 
184  int port_tts;
185  int flushing;
186 };
187 
188 struct bleep {
189  short freq;
190  unsigned long jiffies;
191  int active;
192 };
193 #endif