* Closes a library file. * @param handle the handle returned by cf_OpenLibrary() */
| 179 | * @param handle the handle returned by cf_OpenLibrary() |
| 180 | */ |
| 181 | void cf_CloseLibrary(int handle) { |
| 182 | std::shared_ptr<library> lib, prev; |
| 183 | for (lib = Libraries; lib; prev = lib, lib = lib->next) { |
| 184 | if (lib->handle == handle) { |
| 185 | if (prev) |
| 186 | prev->next = lib->next; |
| 187 | else |
| 188 | Libraries = lib->next; |
| 189 | if (lib->file) |
| 190 | fclose(lib->file); |
| 191 | return; // successful close |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | // Closes down the CFILE system, freeing up all data, etc. |
| 197 | void cf_Close() { |
no outgoing calls