File: brl_driver.h

package info (click to toggle)
brltty 5.2~20141018-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, jessie-kfreebsd-proposed-updates
  • size: 22,640 kB
  • sloc: ansic: 108,275; sh: 6,339; java: 4,473; xml: 2,650; makefile: 1,841; tcl: 1,478; awk: 599; ml: 293; python: 250
file content (110 lines) | stat: -rw-r--r-- 3,007 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
 * BRLTTY - A background process providing access to the console screen (when in
 *          text mode) for a blind person using a refreshable braille display.
 *
 * Copyright (C) 1995-2014 by The BRLTTY Developers.
 *
 * BRLTTY comes with ABSOLUTELY NO WARRANTY.
 *
 * This is free software, placed under the terms of the
 * GNU General Public License, as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any
 * later version. Please see the file LICENSE-GPL for details.
 *
 * Web Page: http://mielke.cc/brltty/
 *
 * This software is maintained by Dave Mielke <dave@mielke.cc>.
 */

#ifndef BRLTTY_INCLUDED_BRL_DRIVER
#define BRLTTY_INCLUDED_BRL_DRIVER

#include <stdio.h>

#include "brl_types.h"
#include "brl_cmds.h"
#include "brl_utils.h"
#include "brl_base.h"
#include "status_types.h"
#include "io_generic.h"
#include "cmd_enqueue.h"

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#ifdef BRLPARMS
static const char *const brl_parameters[] = {BRLPARMS, NULL};
#else /* BRLPARMS */
#define brl_parameters NULL
#endif /* BRLPARMS */

#ifdef BRL_STATUS_FIELDS
static const unsigned char brl_statusFields[] = {BRL_STATUS_FIELDS, sfEnd};
#else /* BRL_STATUS_FIELDS */
#define brl_statusFields NULL
#endif /* BRL_STATUS_FIELDS */

static int brl_construct (BrailleDisplay *brl, char **parameters, const char *device);
static void brl_destruct (BrailleDisplay *brl);

static int brl_readCommand (BrailleDisplay *brl, KeyTableCommandContext context);
static int brl_writeWindow (BrailleDisplay *brl, const wchar_t *characters);

#ifdef BRL_HAVE_STATUS_CELLS
static int brl_writeStatus (BrailleDisplay *brl, const unsigned char *cells);
#else /* BRL_HAVE_STATUS_CELLS */
#define brl_writeStatus NULL
#endif /* BRL_HAVE_STATUS_CELLS */

#ifdef BRL_HAVE_PACKET_IO
static ssize_t brl_readPacket (BrailleDisplay *brl, void *buffer, size_t size);
static ssize_t brl_writePacket (BrailleDisplay *brl, const void *buffer, size_t size);
static int brl_reset (BrailleDisplay *brl);
#else /* BRL_HAVE_PACKET_IO */
#define brl_readPacket NULL
#define brl_writePacket NULL
#define brl_reset NULL
#endif /* BRL_HAVE_PACKET_IO */

#ifdef BRL_HAVE_KEY_CODES
static int brl_readKey (BrailleDisplay *brl);
static int brl_keyToCommand (BrailleDisplay *brl, KeyTableCommandContext context, int key);
#else /* BRL_HAVE_KEY_CODES */
#define brl_readKey NULL
#define brl_keyToCommand NULL
#endif /* BRL_HAVE_KEY_CODES */

#ifndef BRLSYMBOL
#define BRLSYMBOL CONCATENATE(brl_driver_,DRIVER_CODE)
#endif /* BRLSYMBOL */

extern const BrailleDriver BRLSYMBOL;
const BrailleDriver BRLSYMBOL = {
  DRIVER_DEFINITION_INITIALIZER,

  brl_parameters,
  brl_statusFields,

  brl_construct,
  brl_destruct,

  brl_readCommand,
  brl_writeWindow,
  brl_writeStatus,

  brl_readPacket,
  brl_writePacket,
  brl_reset,

  brl_readKey,
  brl_keyToCommand
};

DRIVER_VERSION_DECLARATION(brl);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* BRLTTY_INCLUDED_BRL_DRIVER */