MCPcopy Create free account
hub / github.com/NetHack/NetHack / open_library

Function open_library

src/dlb.c:200–215  ·  view source on GitHub ↗

* Open the library of the given name and fill in the given library * structure. Return TRUE if successful, FALSE otherwise. */

Source from the content-addressed store, hash-verified

198 * structure. Return TRUE if successful, FALSE otherwise.
199 */
200boolean
201open_library(const char *lib_name, library *lp)
202{
203 boolean status = FALSE;
204
205 lp->fdata = fopen_datafile(lib_name, RDBMODE, DATAPREFIX);
206 if (lp->fdata) {
207 if (readlibdir(lp)) {
208 status = TRUE;
209 } else {
210 (void) fclose(lp->fdata);
211 lp->fdata = (FILE *) 0;
212 }
213 }
214 return status;
215}
216
217void
218close_library(library *lp)

Callers 2

lib_dlb_initFunction · 0.85
mainFunction · 0.85

Calls 3

readlibdirFunction · 0.85
fcloseFunction · 0.85
fopen_datafileFunction · 0.70

Tested by

no test coverage detected