| 22185 | |
| 22186 | #ifndef _WIN32 |
| 22187 | static void idx773_write_py_repo(const char *dir, int files, int variant) { |
| 22188 | for (int i = 0; i < files; i++) { |
| 22189 | char path[CBM_SZ_512]; |
| 22190 | snprintf(path, sizeof(path), "%s/mod_%d_%03d.py", dir, variant, i); |
| 22191 | FILE *f = fopen(path, "w"); |
| 22192 | if (!f) { |
| 22193 | continue; |
| 22194 | } |
| 22195 | fprintf(f, |
| 22196 | "class Handler%d:\n" |
| 22197 | " def run(self, x):\n" |
| 22198 | " return self.helper(x) + %d\n" |
| 22199 | " def helper(self, x):\n" |
| 22200 | " for i in range(10):\n" |
| 22201 | " x += i\n" |
| 22202 | " return x\n" |
| 22203 | "\n" |
| 22204 | "def main_%d(x):\n" |
| 22205 | " return Handler%d().run(x)\n", |
| 22206 | i, i, i, i); |
| 22207 | fclose(f); |
| 22208 | } |
| 22209 | } |
| 22210 | |
| 22211 | static int idx773_double_index_check(const char *dir_a, const char *dir_b) { |
| 22212 | cbm_setenv("CBM_INDEX_SUPERVISOR", "0", 1); |