libcaca 0.99.beta19
[git/cygwin-packages/libcaca.git] / 0.99.18-python-errno.patch
CommitLineData
5b59a15d
YS
1--- origsrc/libcaca-0.99.beta18/python/caca/__init__.py 2012-04-06 13:46:08.000000000 -0500
2+++ src/libcaca-0.99.beta18/python/caca/__init__.py 2012-08-26 22:34:31.236536600 -0500
3@@ -25,6 +25,7 @@ if find_library('caca') is not None:
4 else:
5 raise ImportError(
6 "Can't find shared library, you need to install libcaca in your path !")
7+_libc = ctypes.cdll.LoadLibrary(find_library('c'))
8
9 #functions to handle string/bytes in python3+
10 if sys.version_info[0:2] >= (3, 0):
11--- origsrc/libcaca-0.99.beta18/python/caca/canvas.py 2012-04-06 13:46:08.000000000 -0500
12+++ src/libcaca-0.99.beta18/python/caca/canvas.py 2012-08-26 22:41:39.773047500 -0500
13@@ -17,7 +17,7 @@
14 import ctypes
15 import errno
16
17-from caca import _lib, utf8_to_utf32, utf32_to_utf8
18+from caca import _lib, _libc, utf8_to_utf32, utf32_to_utf8
19 from caca import _PYTHON3, _str_to_bytes, _bytes_to_str
20 from caca.font import _Font
21
22@@ -70,7 +70,7 @@ class Canvas(_Canvas):
23 raise CanvasError("Specified width or height is invalid")
24 else:
25 if self._cv == 0:
26- err = ctypes.c_int.in_dll(_lib, "errno")
27+ err = ctypes.c_int.in_dll(_libc, "__errno")
28 if err.value == errno.EINVAL:
29 raise CanvasError("Specified width or height is"
30 " invalid")
31@@ -110,7 +110,7 @@ class Canvas(_Canvas):
32 raise CanvasError("Specified width or height is invalid")
33 else:
34 if ret == -1:
35- err = ctypes.c_int.in_dll(_lib, "errno")
36+ err = ctypes.c_int.in_dll(_libc, "__errno")
37 if err.value == errno.EINVAL:
38 raise CanvasError("Specified width or height is invalid")
39 elif err.value == errno.EBUSY:
40@@ -363,7 +363,7 @@ class Canvas(_Canvas):
41 raise CanvasError("Specified coordinate X or Y is invalid")
42 else:
43 if ret == -1:
44- err = ctypes.c_int.in_dll(_lib, "errno")
45+ err = ctypes.c_int.in_dll(_libc, "__errno")
46 if err.value == errno.EINVAL:
47 raise CanvasError("A mask was specified but the mask size"
48 " and source canvas size do not match")
49@@ -389,7 +389,7 @@ class Canvas(_Canvas):
50 raise CanvasError("Specified coordinate or size is invalid")
51 else:
52 if ret == -1:
53- err = ctypes.c_int.in_dll(_lib, "errno")
54+ err = ctypes.c_int.in_dll(_libc, "__errno")
55 if err.value == errno.EINVAL:
56 raise CanvasError("Specified width or height is invalid")
57 elif err.value == errno.EBUSY:
58@@ -417,7 +417,7 @@ class Canvas(_Canvas):
59
60 ret = _lib.caca_enable_dirty_rect(self)
61 if ret == -1:
62- err = ctypes.c_int.in_dll(_lib, "errno")
63+ err = ctypes.c_int.in_dll(_libc, "__errno")
64 if err.value == errno.EINVAL:
65 raise CanvasError("Dirty rectangles were not disabled")
66 else:
67@@ -456,7 +456,7 @@ class Canvas(_Canvas):
68 raise CanvasError("Specified rectangle index is invalid")
69 else:
70 if ret == -1:
71- err = ctypes.c_int.in_dll(_lib, "errno")
72+ err = ctypes.c_int.in_dll(_libc, "__errno")
73 if err.value == errno.EINVAL:
74 raise CanvasError("Specified rectangle index is out of"
75 " bounds")
76@@ -487,7 +487,7 @@ class Canvas(_Canvas):
77 raise CanvasError("Specified coordinate or size is invalid")
78 else:
79 if ret == -1:
80- err = ctypes.c_int.in_dll(_lib, "errno")
81+ err = ctypes.c_int.in_dll(_libc, "__errno")
82 if err.value == errno.EINVAL:
83 raise CanvasError("Specified rectangle coordinates are out"
84 " of bounds")
85@@ -514,7 +514,7 @@ class Canvas(_Canvas):
86 raise CanvasError("Specified coordinate or size is invalid")
87 else:
88 if ret == -1:
89- err = ctypes.c_int.in_dll(_lib, "errno")
90+ err = ctypes.c_int.in_dll(_libc, "__errno")
91 if err.value == errno.EINVAL:
92 raise CanvasError("Specified rectangle coordinates are out"
93 " of bounds")
94@@ -569,7 +569,7 @@ class Canvas(_Canvas):
95
96 ret = _lib.caca_rotate_left(self)
97 if ret == -1:
98- err = ctypes.c_int.in_dll(_lib, "errno")
99+ err = ctypes.c_int.in_dll(_libc, "__errno")
100 if err.value == errno.EBUSY:
101 raise CanvasError("The canvas is in use by a display driver"
102 " and cannot be rotated")
103@@ -587,7 +587,7 @@ class Canvas(_Canvas):
104
105 ret = _lib.caca_rotate_right(self)
106 if ret == -1:
107- err = ctypes.c_int.in_dll(_lib, "errno")
108+ err = ctypes.c_int.in_dll(_libc, "__errno")
109 if err.value == errno.EBUSY:
110 raise CanvasError("The canvas is in use by a display driver"
111 " and cannot be rotated")
112@@ -605,7 +605,7 @@ class Canvas(_Canvas):
113
114 ret = _lib.caca_stretch_left(self)
115 if ret == -1:
116- err = ctypes.c_int.in_dll(_lib, "errno")
117+ err = ctypes.c_int.in_dll(_libc, "__errno")
118 if err.value == errno.EBUSY:
119 raise CanvasError("The canvas is in use by a display driver"
120 " and cannot be rotated")
121@@ -623,7 +623,7 @@ class Canvas(_Canvas):
122
123 ret = _lib.caca_stretch_right(self)
124 if ret == -1:
125- err = ctypes.c_int.in_dll(_lib, "errno")
126+ err = ctypes.c_int.in_dll(_libc, "__errno")
127 if err.value == errno.EBUSY:
128 raise CanvasError("The canvas is in use by a display driver"
129 " and cannot be rotated")
130@@ -730,7 +730,7 @@ class Canvas(_Canvas):
131 raise CanvasError("At least one of the colour values is invalid")
132 else:
133 if ret == -1:
134- err = ctypes.c_int.in_dll(_lib, "errno")
135+ err = ctypes.c_int.in_dll(_libc, "__errno")
136 if err.value == errno.EINVAL:
137 raise CanvasError("At least one of the colour values"
138 " is invalid")
139@@ -1223,7 +1223,7 @@ class Canvas(_Canvas):
140 except ctypes.ArgumentError:
141 raise CanvasError("specified index is invalid")
142 else:
143- err = ctypes.c_int.in_dll(_lib, "errno")
144+ err = ctypes.c_int.in_dll(_libc, "__errno")
145 if err.value == errno.EINVAL:
146 raise CanvasError("Requested frame is out of range")
147 else:
148@@ -1256,7 +1256,7 @@ class Canvas(_Canvas):
149 except ctypes.ArgumentError:
150 raise CanvasError("Specified name is invalid")
151 else:
152- err = ctypes.c_int.in_dll(_lib, "errno")
153+ err = ctypes.c_int.in_dll(_libc, "__errno")
154 if err.value == errno.ENOMEM:
155 raise CanvasError("Not enough memory to allocate new frame")
156 else:
157@@ -1275,7 +1275,7 @@ class Canvas(_Canvas):
158 except ctypes.ArgumentError:
159 raise CanvasError("specified index is invalid")
160 else:
161- err = ctypes.c_int.in_dll(_lib, "errno")
162+ err = ctypes.c_int.in_dll(_libc, "__errno")
163 if err.value == errno.ENOMEM:
164 raise CanvasError("Not enough memory to allocate new frame")
165 else:
166@@ -1294,7 +1294,7 @@ class Canvas(_Canvas):
167 except ctypes.ArgumentError:
168 raise CanvasError("specified index is invalid")
169 else:
170- err = ctypes.c_int.in_dll(_lib, "errno")
171+ err = ctypes.c_int.in_dll(_libc, "__errno")
172 if err.value == errno.EINVAL:
173 raise CanvasError("Requested frame is out of range, or attempt"
174 " to delete the last frame of the canvas")
175@@ -1334,7 +1334,7 @@ class Canvas(_Canvas):
176 except ctypes.ArgumentError:
177 raise CanvasError("Given data are invalid")
178 else:
179- err = ctypes.c_int.in_dll(_lib, "errno")
180+ err = ctypes.c_int.in_dll(_libc, "__errno")
181 if ret == -1:
182 if err.value == errno.ENOMEM:
183 raise CanvasError("Not enough memory to allocate canvas")
184@@ -1371,7 +1371,7 @@ class Canvas(_Canvas):
185 except ctypes.ArgumentError:
186 raise CanvasError("Specified filename is invalid")
187 else:
188- err = ctypes.c_int.in_dll(_lib, "errno")
189+ err = ctypes.c_int.in_dll(_libc, "__errno")
190 if ret == -1:
191 if err.value == errno.ENOSYS:
192 raise CanvasError("File access is not implemented on this"
193@@ -1419,7 +1419,7 @@ class Canvas(_Canvas):
194 raise CanvasError("Specified coordinate X or Y is invalid")
195 else:
196 if ret == -1:
197- err = ctypes.c_int.in_dll(_lib, "errno")
198+ err = ctypes.c_int.in_dll(_libc, "__errno")
199 if err.value == errno.EINVAL:
200 raise CanvasError("Unsupported format requested or"
201 " invalid coordinates")
202@@ -1460,7 +1460,7 @@ class Canvas(_Canvas):
203 raise CanvasError("Specified coordinate X or Y is invalid")
204 else:
205 if ret == -1:
206- err = ctypes.c_int.in_dll(_lib, "errno")
207+ err = ctypes.c_int.in_dll(_libc, "__errno")
208 if err.value == errno.ENOSYS:
209 raise CanvasError("File access is not implemented on this"
210 " system")
211@@ -1506,7 +1506,7 @@ class Canvas(_Canvas):
212 raise CanvasError("Invalid format requested")
213 else:
214 if not ret:
215- err = ctypes.c_int.in_dll(_lib, "errno")
216+ err = ctypes.c_int.in_dll(_libc, "__errno")
217 if err.value == errno.EINVAL:
218 raise CanvasError("Invalid format requested")
219 elif err.value == errno.ENOMEM:
220@@ -1558,7 +1558,7 @@ class Canvas(_Canvas):
221 raise CanvasError("Requested area coordinate is invalid")
222 else:
223 if not ret:
224- err = ctypes.c_int.in_dll(_lib, "errno")
225+ err = ctypes.c_int.in_dll(_libc, "__errno")
226 if err.value == errno.EINVAL:
227 raise CanvasError("Invalid format requested")
228 elif err.value == errno.ENOMEM:
229--- origsrc/libcaca-0.99.beta18/python/caca/font.py 2012-04-06 13:46:08.000000000 -0500
230+++ src/libcaca-0.99.beta18/python/caca/font.py 2012-08-26 22:41:44.365310200 -0500
231@@ -17,7 +17,7 @@
232 import ctypes
233 import errno
234
235-from caca import _lib, _PYTHON3, _str_to_bytes
236+from caca import _lib, _libc, _PYTHON3, _str_to_bytes
237
238 class _Font(object):
239 """ Model for Font object.
240@@ -69,7 +69,7 @@ class Font(_Font):
241
242 self._font = _lib.caca_load_font(font, size)
243 if self._font == 0:
244- err = ctypes.c_int.in_dll(_lib, "errno")
245+ err = ctypes.c_int.in_dll(_libc, "__errno")
246 if err.value == errno.ENOENT:
247 raise FontError("Requested built-in font does not exist")
248 elif err.value == errno.EINVAL:
This page took 0.047919 seconds and 5 git commands to generate.