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

Function OpenHandleFile

outdated/sys/mac/macfile.c:67–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67static int
68OpenHandleFile(const unsigned char *name, long fileType)
69{
70 int i;
71 Handle h;
72 Str255 s;
73
74 for (i = 0; i < MAX_HF; i++) {
75 if (theHandleFiles[i].data == 0L)
76 break;
77 }
78
79 if (i >= MAX_HF)
80 return -1;
81
82 h = GetNamedResource(fileType, name);
83 if (!h)
84 return (-1);
85
86 theHandleFiles[i].data = h;
87 theHandleFiles[i].size = GetHandleSize(h);
88 GetResInfo(h, &theHandleFiles[i].id, (void *) &theHandleFiles[i].type, s);
89 theHandleFiles[i].mark = 0L;
90
91 return (i + FIRST_HF);
92}
93
94static int
95CloseHandleFile(int fd)

Callers 2

macopenFunction · 0.85
rsrc_dlb_fopenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected