~ubuntu-branches/ubuntu/trusty/haskell-bindings-sane/trusty-proposed

« back to all changes in this revision

Viewing changes to Bindings/SANE.hsc

  • Committer: Package Import Robot
  • Author(s): Clint Adams
  • Date: 2012-09-13 20:15:35 UTC
  • Revision ID: package-import@ubuntu.com-20120913201535-qnglylmjtyy6ilpp
Tags: upstream-0.0
Import upstream version 0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{-# LANGUAGE ForeignFunctionInterface #-}
 
2
 
 
3
-- Copyright © 2012  Clint Adams
 
4
 
 
5
-- This program is free software: you can redistribute it and/or
 
6
-- modify it under the terms of the GNU Lesser General Public
 
7
-- License as published by the Free Software Foundation, either
 
8
-- version 3 of the License, or (at your option) any later version.
 
9
--
 
10
-- This program is distributed in the hope that it will be useful,
 
11
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
-- Lesser General Public License for more details.
 
14
--
 
15
-- You should have received a copy of the GNU Lesser General Public
 
16
-- License along with this program.  If not, see
 
17
-- <http://www.gnu.org/licenses/>.
 
18
 
 
19
#include <bindings.dsl.h>
 
20
#include <sane/sane.h>
 
21
 
 
22
module Bindings.SANE where
 
23
#strict_import
 
24
 
 
25
#num SANE_CURRENT_MAJOR
 
26
#num SANE_CURRENT_MINOR
 
27
 
 
28
#cinline SANE_VERSION_CODE , <SANE_Int> -> <SANE_Int> -> <SANE_Int> -> <SANE_Int>
 
29
 
 
30
#cinline SANE_VERSION_MAJOR , <SANE_Int> -> <SANE_Int>
 
31
#cinline SANE_VERSION_MINOR , <SANE_Int> -> <SANE_Int>
 
32
#cinline SANE_VERSION_BUILD , <SANE_Int> -> <SANE_Int>
 
33
 
 
34
#num SANE_FALSE
 
35
#num SANE_TRUE
 
36
 
 
37
#integral_t SANE_Byte
 
38
#integral_t SANE_Word
 
39
#integral_t SANE_Bool
 
40
#integral_t SANE_Int
 
41
#synonym_t SANE_Char , CChar
 
42
#synonym_t SANE_String , CString
 
43
#synonym_t SANE_String_Const , CString
 
44
#synonym_t SANE_Handle, Ptr ()
 
45
#integral_t SANE_Fixed
 
46
 
 
47
#num SANE_FIXED_SCALE_SHIFT
 
48
#cinline SANE_FIX , CDouble -> <SANE_Fixed>
 
49
#cinline SANE_UNFIX , <SANE_Fixed> -> CDouble
 
50
 
 
51
#integral_t SANE_Status
 
52
#num SANE_STATUS_GOOD
 
53
#num SANE_STATUS_UNSUPPORTED
 
54
#num SANE_STATUS_CANCELLED
 
55
#num SANE_STATUS_DEVICE_BUSY
 
56
#num SANE_STATUS_INVAL
 
57
#num SANE_STATUS_EOF
 
58
#num SANE_STATUS_JAMMED
 
59
#num SANE_STATUS_NO_DOCS
 
60
#num SANE_STATUS_COVER_OPEN
 
61
#num SANE_STATUS_IO_ERROR
 
62
#num SANE_STATUS_NO_MEM
 
63
#num SANE_STATUS_ACCESS_DENIED
 
64
 
 
65
#integral_t SANE_Value_Type
 
66
#num SANE_TYPE_BOOL
 
67
#num SANE_TYPE_INT
 
68
#num SANE_TYPE_FIXED
 
69
#num SANE_TYPE_STRING
 
70
#num SANE_TYPE_BUTTON
 
71
#num SANE_TYPE_GROUP
 
72
 
 
73
#integral_t SANE_Unit
 
74
#num SANE_UNIT_NONE
 
75
#num SANE_UNIT_PIXEL
 
76
#num SANE_UNIT_BIT
 
77
#num SANE_UNIT_MM
 
78
#num SANE_UNIT_DPI
 
79
#num SANE_UNIT_PERCENT
 
80
#num SANE_UNIT_MICROSECOND
 
81
 
 
82
#starttype SANE_Device
 
83
#field name , <SANE_String_Const>
 
84
#field vendor , <SANE_String_Const>
 
85
#field model , <SANE_String_Const>
 
86
#field type , <SANE_String_Const>
 
87
#stoptype
 
88
 
 
89
#num SANE_CAP_SOFT_SELECT
 
90
#num SANE_CAP_HARD_SELECT
 
91
#num SANE_CAP_SOFT_DETECT
 
92
#num SANE_CAP_EMULATED
 
93
#num SANE_CAP_AUTOMATIC
 
94
#num SANE_CAP_INACTIVE
 
95
#num SANE_CAP_ADVANCED
 
96
 
 
97
#cinline SANE_OPTION_IS_ACTIVE , CInt -> CInt
 
98
#cinline SANE_OPTION_IS_SETTABLE , CInt -> CInt
 
99
 
 
100
#num SANE_INFO_INEXACT
 
101
#num SANE_INFO_RELOAD_OPTIONS
 
102
#num SANE_INFO_RELOAD_PARAMS
 
103
 
 
104
#integral_t SANE_Constraint_Type
 
105
#num SANE_CONSTRAINT_NONE
 
106
#num SANE_CONSTRAINT_RANGE
 
107
#num SANE_CONSTRAINT_WORD_LIST
 
108
#num SANE_CONSTRAINT_STRING_LIST
 
109
 
 
110
#starttype SANE_Range
 
111
#field min , <SANE_Word>
 
112
#field max , <SANE_Word>
 
113
#field quant , <SANE_Word>
 
114
#stoptype
 
115
 
 
116
#starttype SANE_Option_Descriptor
 
117
#field name , <SANE_String_Const>
 
118
#field title , <SANE_String_Const>
 
119
#field desc , <SANE_String_Const>
 
120
#field type , <SANE_Value_Type>
 
121
#field unit , <SANE_Unit>
 
122
#field size , <SANE_Int>
 
123
#field cap , <SANE_Int>
 
124
#field constraint_type , <SANE_Constraint_Type>
 
125
#union_field constraint.string_list , Ptr <SANE_String_Const>
 
126
#union_field constraint.word_list , Ptr <SANE_Word>
 
127
#union_field constraint.range , Ptr <SANE_Range>
 
128
#stoptype
 
129
 
 
130
#integral_t SANE_Action
 
131
#num SANE_ACTION_GET_VALUE
 
132
#num SANE_ACTION_SET_VALUE
 
133
#num SANE_ACTION_SET_AUTO
 
134
 
 
135
#integral_t SANE_Frame
 
136
#num SANE_FRAME_GRAY
 
137
#num SANE_FRAME_RGB
 
138
#num SANE_FRAME_RED
 
139
#num SANE_FRAME_GREEN
 
140
#num SANE_FRAME_BLUE
 
141
 
 
142
#starttype SANE_Parameters
 
143
#field format , <SANE_Frame>
 
144
#field last_frame , <SANE_Bool>
 
145
#field bytes_per_line , <SANE_Int>
 
146
#field pixels_per_line , <SANE_Int>
 
147
#field lines , <SANE_Int>
 
148
#field depth , <SANE_Int>
 
149
#stoptype
 
150
 
 
151
#opaque_t struct SANE_Auth_Data
 
152
 
 
153
#num SANE_MAX_USERNAME_LEN
 
154
#num SANE_MAX_PASSWORD_LEN
 
155
 
 
156
#callback SANE_Auth_Callback , <SANE_String_Const> -> Ptr <SANE_Char> -> Ptr <SANE_Char> -> IO ()
 
157
 
 
158
#ccall sane_init , Ptr <SANE_Int> -> <SANE_Auth_Callback> -> IO <SANE_Status>
 
159
#ccall sane_exit , IO ()
 
160
#ccall sane_get_devices , Ptr (Ptr (Ptr <SANE_Device>)) -> <SANE_Bool> -> IO <SANE_Status>
 
161
#ccall sane_open , <SANE_String_Const> -> Ptr <SANE_Handle> -> IO <SANE_Status>
 
162
#ccall sane_close , <SANE_Handle> -> IO ()
 
163
#ccall sane_get_option_descriptor , <SANE_Handle> -> <SANE_Int> -> IO (Ptr <SANE_Option_Descriptor>)
 
164
#ccall sane_control_option , <SANE_Handle> -> <SANE_Int> -> <SANE_Action> -> Ptr () -> Ptr <SANE_Int> -> IO <SANE_Status>
 
165
#ccall sane_get_parameters , <SANE_Handle> -> Ptr <SANE_Parameters> -> IO <SANE_Status>
 
166
#ccall sane_start , <SANE_Handle> -> IO <SANE_Status>
 
167
#ccall sane_read , <SANE_Handle> -> Ptr <SANE_Byte> -> <SANE_Int> -> Ptr <SANE_Int> -> IO <SANE_Status>
 
168
#ccall sane_cancel , <SANE_Handle> -> IO ()
 
169
#ccall sane_set_io_mode , <SANE_Handle> -> <SANE_Bool> -> IO <SANE_Status>
 
170
#ccall sane_get_select_fd , <SANE_Handle> -> Ptr <SANE_Int> -> IO <SANE_Status>
 
171
#ccall sane_strstatus , <SANE_Status> -> IO <SANE_String_Const>
 
172