cache1d: Add kfileparent().

git-svn-id: https://svn.eduke32.com/eduke32@5443 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-11-25 12:08:00 +00:00
parent 9f2911e773
commit af5f47797d
2 changed files with 11 additions and 0 deletions

View file

@ -45,6 +45,7 @@ int32_t ktell(int32_t handle);
void kclose(int32_t handle); void kclose(int32_t handle);
void krename(int32_t crcval, int32_t filenum, const char *newname); void krename(int32_t crcval, int32_t filenum, const char *newname);
char const * kfileparent(int32_t handle);
typedef struct { intptr_t *hand; int32_t leng; char *lock ; } cactype; typedef struct { intptr_t *hand; int32_t leng; char *lock ; } cactype;

View file

@ -1100,6 +1100,16 @@ void krename(int32_t crcval, int32_t filenum, const char *newname)
} }
} }
char const * kfileparent(int32_t const handle)
{
int32_t const groupnum = filegrp[handle];
if ((unsigned)groupnum >= MAXGROUPFILES || groupfil[groupnum] == -1)
return NULL;
return groupname[groupnum];
}
int32_t kopen4load(const char *filename, char searchfirst) int32_t kopen4load(const char *filename, char searchfirst)
{ {
int32_t newhandle = MAXOPENFILES-1; int32_t newhandle = MAXOPENFILES-1;