| 480 | // |
| 481 | |
| 482 | int32_t llama_split_path( |
| 483 | char * split_path, |
| 484 | size_t maxlen, |
| 485 | const char * path_prefix, |
| 486 | int32_t split_no, |
| 487 | int32_t split_count) { |
| 488 | |
| 489 | static const char * const SPLIT_PATH_FORMAT = "%s-%05d-of-%05d.gguf"; |
| 490 | |
| 491 | const int written = snprintf( |
| 492 | split_path, |
| 493 | maxlen, |
| 494 | SPLIT_PATH_FORMAT, |
| 495 | path_prefix, |
| 496 | split_no + 1, |
| 497 | split_count |
| 498 | ); |
| 499 | |
| 500 | if (written < 0 || (size_t) written >= maxlen) { |
| 501 | return 0; |
| 502 | } |
| 503 | |
| 504 | return (int32_t) written; |
| 505 | } |
| 506 | |
| 507 | int32_t llama_split_prefix( |
| 508 | char * split_prefix, |
no outgoing calls
no test coverage detected