| 5435 | } |
| 5436 | |
| 5437 | static bool split_published_generation(const char *generation, char uid[18], |
| 5438 | unsigned long long *mutation) { |
| 5439 | if (!generation || strlen(generation) < 19 || generation[0] != 'u' || generation[17] != 'g') { |
| 5440 | return false; |
| 5441 | } |
| 5442 | memcpy(uid, generation, 17); |
| 5443 | uid[17] = '\0'; |
| 5444 | char *end = NULL; |
| 5445 | unsigned long long parsed = strtoull(generation + 18, &end, 10); |
| 5446 | if (!end || end == generation + 18 || *end != '\0') { |
| 5447 | return false; |
| 5448 | } |
| 5449 | *mutation = parsed; |
| 5450 | return true; |
| 5451 | } |
| 5452 | |
| 5453 | /* Every published database must carry cursor-generation metadata. A complete |
| 5454 | * replacement gets a fresh database identity; an isolated delta clones the |