| 2344 | }; |
| 2345 | |
| 2346 | static void |
| 2347 | camel_convert(gchar *str) |
| 2348 | { |
| 2349 | gint state = CAMEL_OTHER; |
| 2350 | |
| 2351 | if (str == NULL) return; |
| 2352 | while (*str) |
| 2353 | { |
| 2354 | if (*str == '_') *str = ' '; |
| 2355 | switch (state) |
| 2356 | { |
| 2357 | case CAMEL_OTHER: |
| 2358 | { |
| 2359 | if (*str >= 'A' && *str <= 'Z') |
| 2360 | state = CAMEL_FIRST_UPPER; |
| 2361 | else |
| 2362 | state = CAMEL_OTHER; |
| 2363 | |
| 2364 | } break; |
| 2365 | case CAMEL_FIRST_UPPER: |
| 2366 | default: |
| 2367 | { |
| 2368 | if (*str >= 'A' && *str <= 'Z') |
| 2369 | *str = *str - 'A' + 'a'; |
| 2370 | else |
| 2371 | state = CAMEL_OTHER; |
| 2372 | } break; |
| 2373 | } |
| 2374 | str++; |
| 2375 | } |
| 2376 | } |
| 2377 | |
| 2378 | static gchar* |
| 2379 | get_file_label(const gchar *filename) |
no outgoing calls
no test coverage detected