1 | #include "EXTERN.h" |
1 | #include "EXTERN.h" |
2 | #include "perl.h" |
2 | #include "perl.h" |
3 | #include "XSUB.h" |
3 | #include "XSUB.h" |
4 | |
4 | |
|
|
5 | #include <string.h> |
5 | #include <setjmp.h> |
6 | #include <setjmp.h> |
6 | |
7 | |
7 | #include <jpeglib.h> |
8 | #include <jpeglib.h> |
8 | #include <gdk-pixbuf/gdk-pixbuf.h> |
9 | #include <gdk-pixbuf/gdk-pixbuf.h> |
9 | |
10 | |
… | |
… | |
268 | |
269 | |
269 | ############################################################################# |
270 | ############################################################################# |
270 | |
271 | |
271 | MODULE = Gtk2::CV PACKAGE = Gtk2::CV::Schnauzer |
272 | MODULE = Gtk2::CV PACKAGE = Gtk2::CV::Schnauzer |
272 | |
273 | |
|
|
274 | SV * |
|
|
275 | foldcase (SV *pathsv) |
|
|
276 | PROTOTYPE: $ |
|
|
277 | CODE: |
|
|
278 | { |
|
|
279 | STRLEN plen; |
|
|
280 | U8 *path = SvPVutf8 (pathsv, plen); |
|
|
281 | U8 *pend = path + plen; |
|
|
282 | U8 dst [plen * 6 * 3], *dstp = dst; |
|
|
283 | |
|
|
284 | while (path < pend) |
|
|
285 | { |
|
|
286 | U8 ch = *path; |
|
|
287 | |
|
|
288 | if (ch >= 'a' && ch <= 'z') |
|
|
289 | *dstp++ = *path++; |
|
|
290 | else if (ch >= '0' && ch <= '9') |
|
|
291 | { |
|
|
292 | STRLEN el, nl = 0; |
|
|
293 | while (*path >= '0' && *path <= '9' && path < pend) |
|
|
294 | path++, nl++; |
|
|
295 | |
|
|
296 | for (el = nl; el < 6; el++) |
|
|
297 | *dstp++ = '0'; |
|
|
298 | |
|
|
299 | memcpy (dstp, path - nl, nl); |
|
|
300 | dstp += nl; |
|
|
301 | } |
|
|
302 | else |
|
|
303 | { |
|
|
304 | STRLEN cl; |
|
|
305 | to_utf8_fold (path, dstp, &cl); |
|
|
306 | dstp += cl; |
|
|
307 | path += is_utf8_char (path); |
|
|
308 | } |
|
|
309 | } |
|
|
310 | |
|
|
311 | RETVAL = newSVpvn (dst, dstp - dst); |
|
|
312 | } |
|
|
313 | OUTPUT: |
|
|
314 | RETVAL |
|
|
315 | |
273 | GdkPixbuf_noinc * |
316 | GdkPixbuf_noinc * |
274 | p7_to_pb (int w, int h, guchar *src) |
317 | p7_to_pb (int w, int h, guchar *src) |
275 | CODE: |
318 | CODE: |
276 | { |
319 | { |
277 | int x, y; |
320 | int x, y; |