diff --git a/libs/ruamoko/rua_plist.c b/libs/ruamoko/rua_plist.c index b71af2ead..d45ee1b8d 100644 --- a/libs/ruamoko/rua_plist.c +++ b/libs/ruamoko/rua_plist.c @@ -229,6 +229,15 @@ bi_PL_Type (progs_t *pr) R_INT (pr) = PL_Type (plist->plitem); } +static void +bi_PL_Line (progs_t *pr) +{ + int handle = P_INT (pr, 0); + bi_plist_t *plist = get_plist (pr, __FUNCTION__, handle); + + R_INT (pr) = PL_Line (plist->plitem); +} + static void bi_PL_String (progs_t *pr) { @@ -432,6 +441,7 @@ static builtin_t builtins[] = { {"PL_GetPropertyList", bi_PL_GetPropertyList, -1}, {"PL_WritePropertyList", bi_PL_WritePropertyList, -1}, {"PL_Type", bi_PL_Type, -1}, + {"PL_Line", bi_PL_Line, -1}, {"PL_String", bi_PL_String, -1}, {"PL_ObjectForKey", bi_PL_ObjectForKey, -1}, {"PL_RemoveObjectForKey", bi_PL_RemoveObjectForKey, -1}, diff --git a/ruamoko/include/PropertyList.h b/ruamoko/include/PropertyList.h index c0c4bed35..d2494a94a 100644 --- a/ruamoko/include/PropertyList.h +++ b/ruamoko/include/PropertyList.h @@ -42,6 +42,7 @@ - initWithOwnItem:(plitem_t) item; - (string) write; - (pltype_t) type; +- (int) line; @end @interface PLDictionary: PLItem diff --git a/ruamoko/include/plist.h b/ruamoko/include/plist.h index 4544e00ff..bfaa25516 100644 --- a/ruamoko/include/plist.h +++ b/ruamoko/include/plist.h @@ -10,6 +10,7 @@ typedef enum {QFDictionary, QFArray, QFBinary, QFString} pltype_t; // possible t @extern plitem_t PL_GetPropertyList (string str); @extern string PL_WritePropertyList (plitem_t pl); @extern pltype_t PL_Type (plitem_t str); +@extern int PL_Line (plitem_t str); @extern string PL_String (plitem_t str); @extern plitem_t PL_ObjectForKey (plitem_t item, string key); @extern plitem_t PL_RemoveObjectForKey (plitem_t item, string key); diff --git a/ruamoko/lib/PropertyList.r b/ruamoko/lib/PropertyList.r index b8469e473..c6df13070 100644 --- a/ruamoko/lib/PropertyList.r +++ b/ruamoko/lib/PropertyList.r @@ -94,6 +94,11 @@ return PL_Type (item); } +- (int) line +{ + return PL_Line (item); +} + - (int) count { if ([self class] == [PLDictionary class]) { diff --git a/ruamoko/lib/plist.r b/ruamoko/lib/plist.r index 40ab2e1fc..34f0ce6c1 100644 --- a/ruamoko/lib/plist.r +++ b/ruamoko/lib/plist.r @@ -4,6 +4,7 @@ plitem_t PL_GetFromFile (QFile file) = #0; plitem_t PL_GetPropertyList (string str) = #0; string PL_WritePropertyList (plitem_t pl) = #0; pltype_t PL_Type (plitem_t str) = #0; +int PL_Line (plitem_t str) = #0; string PL_String (plitem_t str) = #0; plitem_t PL_ObjectForKey (plitem_t item, string key) = #0; plitem_t PL_RemoveObjectForKey (plitem_t item, string key) = #0;