From 23e3b4c2e5fcb994951eda95d3870dcf96d5f412 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 22 Dec 2021 00:24:14 +0900 Subject: [PATCH] [ruamoko] Retrieve a plitem_t from PropertyList And also internally for cross-builtin use. --- include/rua_internal.h | 1 + libs/ruamoko/rua_plist.c | 7 +++++++ ruamoko/include/PropertyList.h | 1 + ruamoko/lib/PropertyList.r | 5 +++++ 4 files changed, 14 insertions(+) diff --git a/include/rua_internal.h b/include/rua_internal.h index d2119157a..24e16cc6e 100644 --- a/include/rua_internal.h +++ b/include/rua_internal.h @@ -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); diff --git a/libs/ruamoko/rua_plist.c b/libs/ruamoko/rua_plist.c index afccba62e..2899eec5f 100644 --- a/libs/ruamoko/rua_plist.c +++ b/libs/ruamoko/rua_plist.c @@ -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) { diff --git a/ruamoko/include/PropertyList.h b/ruamoko/include/PropertyList.h index 051fc98dd..c61b16ef6 100644 --- a/ruamoko/include/PropertyList.h +++ b/ruamoko/include/PropertyList.h @@ -40,6 +40,7 @@ - initWithItem:(plitem_t *) item; - initWithOwnItem:(plitem_t *) item; +- (plitem_t *) item; - (string) write; - (pltype_t) type; - (int) line; diff --git a/ruamoko/lib/PropertyList.r b/ruamoko/lib/PropertyList.r index 6e7eccb4c..6197ec325 100644 --- a/ruamoko/lib/PropertyList.r +++ b/ruamoko/lib/PropertyList.r @@ -84,6 +84,11 @@ [super dealloc]; } +- (plitem_t *) item +{ + return item; +} + - (string) write { return PL_WritePropertyList (item);