| 1096 | // |
| 1097 | |
| 1098 | int32_t llama_split_path( |
| 1099 | char * split_path, |
| 1100 | size_t maxlen, |
| 1101 | const char * path_prefix, |
| 1102 | int32_t split_no, |
| 1103 | int32_t split_count) { |
| 1104 | |
| 1105 | static const char * const SPLIT_PATH_FORMAT = "%s-%05d-of-%05d.gguf"; |
| 1106 | |
| 1107 | const int written = snprintf( |
| 1108 | split_path, |
| 1109 | maxlen, |
| 1110 | SPLIT_PATH_FORMAT, |
| 1111 | path_prefix, |
| 1112 | split_no + 1, |
| 1113 | split_count |
| 1114 | ); |
| 1115 | |
| 1116 | if (written < 0 || (size_t) written >= maxlen) { |
| 1117 | return 0; |
| 1118 | } |
| 1119 | |
| 1120 | return (int32_t) written; |
| 1121 | } |
| 1122 | |
| 1123 | int32_t llama_split_prefix( |
| 1124 | char * split_prefix, |
no outgoing calls
no test coverage detected