• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* sane - Scanner Access Now Easy.
2 
3    Copyright (C) 2002 Sergey Vlasov <vsu@altlinux.ru>
4 
5    This file is part of the SANE package.
6 
7    This program is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License as
9    published by the Free Software Foundation; either version 2 of the
10    License, or (at your option) any later version.
11 
12    This program is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <https://www.gnu.org/licenses/>.
19 
20    As a special exception, the authors of SANE give permission for
21    additional uses of the libraries contained in this release of SANE.
22 
23    The exception is that, if you link a SANE library with other files
24    to produce an executable, this does not by itself cause the
25    resulting executable to be covered by the GNU General Public
26    License.  Your use of that executable is in no way restricted on
27    account of linking the SANE library code into it.
28 
29    This exception does not, however, invalidate any other reasons why
30    the executable file might be covered by the GNU General Public
31    License.
32 
33    If you submit changes to SANE to the maintainers to be included in
34    a subsequent release, you agree by submitting the changes that
35    those changes may be distributed with this exception intact.
36 
37    If you write modifications of your own for SANE, it is your choice
38    whether to permit this exception to apply to your modifications.
39    If you do not wish that, delete this exception notice.
40 */
41 
42 #ifndef GT68XX_SHM_CHANNEL_H
43 #define GT68XX_SHM_CHANNEL_H
44 
45 /** @file
46  * @brief Shared memory channel support.
47  */
48 
49 #include "../include/sane/sane.h"
50 
51 typedef struct Shm_Channel Shm_Channel;
52 
53 static SANE_Status
54 shm_channel_new (SANE_Int buf_size,
55 		 SANE_Int buf_count, Shm_Channel ** shm_channel_return);
56 
57 static SANE_Status shm_channel_free (Shm_Channel * shm_channel);
58 
59 
60 static SANE_Status shm_channel_writer_init (Shm_Channel * shm_channel);
61 
62 static SANE_Status
63 shm_channel_writer_get_buffer (Shm_Channel * shm_channel,
64 			       SANE_Int * buffer_id_return,
65 			       SANE_Byte ** buffer_addr_return);
66 
67 static SANE_Status
68 shm_channel_writer_put_buffer (Shm_Channel * shm_channel,
69 			       SANE_Int buffer_id, SANE_Int buffer_bytes);
70 
71 static SANE_Status shm_channel_writer_close (Shm_Channel * shm_channel);
72 
73 
74 static SANE_Status shm_channel_reader_init (Shm_Channel * shm_channel);
75 
76 #if 0
77 static SANE_Status
78 shm_channel_reader_set_io_mode (Shm_Channel * shm_channel,
79 				SANE_Bool non_blocking);
80 
81 static SANE_Status
82 shm_channel_reader_get_select_fd (Shm_Channel * shm_channel,
83 				  SANE_Int * fd_return);
84 
85 #endif
86 
87 static SANE_Status shm_channel_reader_start (Shm_Channel * shm_channel);
88 
89 static SANE_Status
90 shm_channel_reader_get_buffer (Shm_Channel * shm_channel,
91 			       SANE_Int * buffer_id_return,
92 			       SANE_Byte ** buffer_addr_return,
93 			       SANE_Int * buffer_bytes_return);
94 
95 static SANE_Status
96 shm_channel_reader_put_buffer (Shm_Channel * shm_channel, SANE_Int buffer_id);
97 
98 #if 0
99 static SANE_Status shm_channel_reader_close (Shm_Channel * shm_channel);
100 #endif
101 
102 #endif /* not GT68XX_SHM_CHANNEL_H */
103 
104 /* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */
105