| 84 | } |
| 85 | |
| 86 | static int cbfs_module_init(void) |
| 87 | { |
| 88 | struct cbfile *f; |
| 89 | int index = 0; |
| 90 | |
| 91 | header = *(void **)HEADER_ADDR; |
| 92 | if (header->magic != ntohl(HEADER_MAGIC)) { |
| 93 | header = NULL; |
| 94 | return 0; |
| 95 | } |
| 96 | |
| 97 | for (f = firstfile(); f; f = nextfile(f)) |
| 98 | filecount++; |
| 99 | |
| 100 | filenames = malloc(filecount * sizeof(char *)); |
| 101 | if (filenames == NULL) |
| 102 | return 0; |
| 103 | |
| 104 | for (f = firstfile(); f; f = nextfile(f)) |
| 105 | filenames[index++] = strdup((const char *)f->filename); |
| 106 | |
| 107 | return 0; |
| 108 | } |
| 109 | |
| 110 | static int cbfs_module_redraw(WINDOW * win) |
| 111 | { |