Add QFile_GetHandle()

This allows other rua builtins to make use of ruamoko files.
This commit is contained in:
Bill Currie 2010-11-24 13:10:25 +09:00
parent 857f8eb6e4
commit defc2a264b
2 changed files with 9 additions and 0 deletions

View file

@ -56,6 +56,7 @@ void RUA_String_Init (struct progs_s *pr, int secure);
void RUA_QFile_Init (struct progs_s *pr, int secure);
int QFile_AllocHandle (struct progs_s *pr, QFile *file);
QFile *QFile_GetFile (struct progs_s *pr, int handle);
void RUA_QFS_Init (struct progs_s *pr, int secure);

View file

@ -174,6 +174,14 @@ get_handle (progs_t *pr, const char *name, int handle)
return h;
}
QFile *
QFile_GetFile (progs_t *pr, int handle)
{
qfile_t *h = get_handle (pr, __FUNCTION__, handle);
return h->file;
}
static void
bi_Qclose (progs_t *pr)
{