[ruamoko] Retrieve a plitem_t from PropertyList

And also internally for cross-builtin use.
This commit is contained in:
Bill Currie 2021-12-22 00:24:14 +09:00
parent 5e273a3693
commit 23e3b4c2e5
4 changed files with 14 additions and 0 deletions

View file

@ -51,6 +51,7 @@ void RUA_QFS_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);
struct plitem_s *Plist_GetItem (struct progs_s *pr, int handle);
void RUA_Input_Init (struct progs_s *pr, int secure);
void RUA_Mersenne_Init (struct progs_s *pr, int secure);

View file

@ -422,6 +422,13 @@ bi_PL_Free (progs_t *pr)
plist_free_handle (res, plist);
}
plitem_t *
Plist_GetItem (progs_t *pr, int handle)
{
bi_plist_t *plist = get_plist (pr, __FUNCTION__, handle);
return plist->plitem;
}
static uintptr_t
plist_get_hash (const void *key, void *unused)
{

View file

@ -40,6 +40,7 @@
- initWithItem:(plitem_t *) item;
- initWithOwnItem:(plitem_t *) item;
- (plitem_t *) item;
- (string) write;
- (pltype_t) type;
- (int) line;

View file

@ -84,6 +84,11 @@
[super dealloc];
}
- (plitem_t *) item
{
return item;
}
- (string) write
{
return PL_WritePropertyList (item);