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 | if (*path >= '0' && *path <= '9') |
|
|
287 | { |
|
|
288 | STRLEN el, nl = 0; |
|
|
289 | while (*path >= '0' && *path <= '9') |
|
|
290 | path++, nl++; |
|
|
291 | |
|
|
292 | for (el = nl; el < 6; el++) |
|
|
293 | *dstp++ = '0'; |
|
|
294 | |
|
|
295 | memcpy (dstp, path - nl, nl); |
|
|
296 | dstp += nl; |
|
|
297 | } |
|
|
298 | else |
|
|
299 | { |
|
|
300 | STRLEN cl; |
|
|
301 | to_utf8_fold (path, dstp, &cl); |
|
|
302 | dstp += cl; |
|
|
303 | path += is_utf8_char (path); |
|
|
304 | } |
|
|
305 | } |
|
|
306 | |
|
|
307 | RETVAL = newSVpvn (dst, dstp - dst); |
|
|
308 | } |
|
|
309 | OUTPUT: |
|
|
310 | RETVAL |
|
|
311 | |
273 | GdkPixbuf_noinc * |
312 | GdkPixbuf_noinc * |
274 | p7_to_pb (int w, int h, guchar *src) |
313 | p7_to_pb (int w, int h, guchar *src) |
275 | CODE: |
314 | CODE: |
276 | { |
315 | { |
277 | int x, y; |
316 | int x, y; |