MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / cf_CloseLibrary

Function cf_CloseLibrary

cfile/cfile.cpp:181–194  ·  view source on GitHub ↗

* Closes a library file. * @param handle the handle returned by cf_OpenLibrary() */

Source from the content-addressed store, hash-verified

179 * @param handle the handle returned by cf_OpenLibrary()
180 */
181void 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.
197void cf_Close() {

Callers 5

TESTFunction · 0.85
PPic_InitDatabaseFunction · 0.85
PPic_CloseDatabaseFunction · 0.85
mn3_GetInfoFunction · 0.85
mn3_CloseFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68