#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gd.h" #include "gdhelpers.h" #include <stdlib.h> #include <string.h> /* TBB: gd_strtok_r is not portable; provide an implementation */ #define SEP_TEST (separators[*((unsigned char *) s)]) char * gd_strtok_r (char *s, char *sep, char **state) { char separators[256]; char *start; char *result = 0; memset (separators, 0, sizeof (separators)); while (*sep) { separators[*((unsigned char *) sep)] = 1; sep++; } if (!s) { /* Pick up where we left off */ s = *state; } start = s; /* 1. EOS */ if (!(*s)) { *state = s; return 0; } /* 2. Leading separators, if any */ if (SEP_TEST) { do { s++; } while (SEP_TEST); /* 2a. EOS after separators only */ if (!(*s)) { *state = s; return 0; } } /* 3. A token */ result = s; do { /* 3a. Token at end of string */ if (!(*s)) { *state = s; return result; } s++; } while (!SEP_TEST); /* 4. Terminate token and skip trailing separators */ *s = '\0'; do { s++; } while (SEP_TEST); /* 5. Return token */ *state = s; return result; }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
gd.c | File | 72.75 KB | 0644 |
|
gd.h | File | 32.2 KB | 0644 |
|
gd_arc.c | File | 1.66 KB | 0644 |
|
gd_color.c | File | 1.5 KB | 0644 |
|
gd_crop.c | File | 9.04 KB | 0644 |
|
gd_filter.c | File | 10.3 KB | 0644 |
|
gd_gd.c | File | 5.2 KB | 0644 |
|
gd_gd2.c | File | 19.73 KB | 0644 |
|
gd_gif_in.c | File | 13.89 KB | 0644 |
|
gd_gif_out.c | File | 20.54 KB | 0644 |
|
gd_interpolation.c | File | 71.93 KB | 0644 |
|
gd_io.c | File | 2.69 KB | 0644 |
|
gd_io.h | File | 963 B | 0644 |
|
gd_io_dp.c | File | 6.93 KB | 0644 |
|
gd_io_file.c | File | 2.31 KB | 0644 |
|
gd_io_ss.c | File | 2.66 KB | 0644 |
|
gd_jpeg.c | File | 26.21 KB | 0644 |
|
gd_matrix.c | File | 7.78 KB | 0644 |
|
gd_pixelate.c | File | 1.33 KB | 0644 |
|
gd_png.c | File | 22 KB | 0644 |
|
gd_rotate.c | File | 12.98 KB | 0644 |
|
gd_security.c | File | 671 B | 0644 |
|
gd_ss.c | File | 1.08 KB | 0644 |
|
gd_topal.c | File | 63.08 KB | 0644 |
|
gd_transform.c | File | 1.27 KB | 0644 |
|
gd_wbmp.c | File | 5.17 KB | 0644 |
|
gd_webp.c | File | 5.04 KB | 0644 |
|
gdcache.c | File | 4.99 KB | 0644 |
|
gdcache.h | File | 2.68 KB | 0644 |
|
gdfontg.c | File | 113.25 KB | 0644 |
|
gdfontg.h | File | 529 B | 0644 |
|
gdfontl.c | File | 108.5 KB | 0644 |
|
gdfontl.h | File | 527 B | 0644 |
|
gdfontmb.c | File | 79.24 KB | 0644 |
|
gdfontmb.h | File | 495 B | 0644 |
|
gdfonts.c | File | 69.46 KB | 0644 |
|
gdfonts.h | File | 491 B | 0644 |
|
gdfontt.c | File | 38.49 KB | 0644 |
|
gdfontt.h | File | 522 B | 0644 |
|
gdft.c | File | 32.57 KB | 0644 |
|
gdhelpers.c | File | 1.19 KB | 0644 |
|
gdhelpers.h | File | 1.32 KB | 0644 |
|
gdkanji.c | File | 12.11 KB | 0644 |
|
gdtables.c | File | 5.45 KB | 0644 |
|
gdxpm.c | File | 3.21 KB | 0644 |
|
wbmp.c | File | 6.76 KB | 0644 |
|
wbmp.h | File | 1.25 KB | 0644 |
|
webpimg.c | File | 28.33 KB | 0644 |
|
webpimg.h | File | 7.04 KB | 0644 |
|
xbm.c | File | 5.3 KB | 0644 |
|