From af5f47797d901167cc8f24bd7fbaa8a7c82076c2 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 25 Nov 2015 12:08:00 +0000 Subject: [PATCH] cache1d: Add kfileparent(). git-svn-id: https://svn.eduke32.com/eduke32@5443 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/cache1d.h | 1 + polymer/eduke32/build/src/cache1d.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/polymer/eduke32/build/include/cache1d.h b/polymer/eduke32/build/include/cache1d.h index 8cd89910b..b23e822cd 100644 --- a/polymer/eduke32/build/include/cache1d.h +++ b/polymer/eduke32/build/include/cache1d.h @@ -45,6 +45,7 @@ int32_t ktell(int32_t handle); void kclose(int32_t handle); 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; diff --git a/polymer/eduke32/build/src/cache1d.c b/polymer/eduke32/build/src/cache1d.c index f05690b21..fbddd27b0 100644 --- a/polymer/eduke32/build/src/cache1d.c +++ b/polymer/eduke32/build/src/cache1d.c @@ -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 newhandle = MAXOPENFILES-1;