mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[ruamoko] Add a wrapper for PL_Line
Makes error reporting in rua code easier.
This commit is contained in:
parent
7fb335a215
commit
e1e2a0e712
5 changed files with 18 additions and 0 deletions
|
@ -229,6 +229,15 @@ bi_PL_Type (progs_t *pr)
|
||||||
R_INT (pr) = PL_Type (plist->plitem);
|
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
|
static void
|
||||||
bi_PL_String (progs_t *pr)
|
bi_PL_String (progs_t *pr)
|
||||||
{
|
{
|
||||||
|
@ -432,6 +441,7 @@ static builtin_t builtins[] = {
|
||||||
{"PL_GetPropertyList", bi_PL_GetPropertyList, -1},
|
{"PL_GetPropertyList", bi_PL_GetPropertyList, -1},
|
||||||
{"PL_WritePropertyList", bi_PL_WritePropertyList, -1},
|
{"PL_WritePropertyList", bi_PL_WritePropertyList, -1},
|
||||||
{"PL_Type", bi_PL_Type, -1},
|
{"PL_Type", bi_PL_Type, -1},
|
||||||
|
{"PL_Line", bi_PL_Line, -1},
|
||||||
{"PL_String", bi_PL_String, -1},
|
{"PL_String", bi_PL_String, -1},
|
||||||
{"PL_ObjectForKey", bi_PL_ObjectForKey, -1},
|
{"PL_ObjectForKey", bi_PL_ObjectForKey, -1},
|
||||||
{"PL_RemoveObjectForKey", bi_PL_RemoveObjectForKey, -1},
|
{"PL_RemoveObjectForKey", bi_PL_RemoveObjectForKey, -1},
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
- initWithOwnItem:(plitem_t) item;
|
- initWithOwnItem:(plitem_t) item;
|
||||||
- (string) write;
|
- (string) write;
|
||||||
- (pltype_t) type;
|
- (pltype_t) type;
|
||||||
|
- (int) line;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface PLDictionary: PLItem <PLDictionary>
|
@interface PLDictionary: PLItem <PLDictionary>
|
||||||
|
|
|
@ -10,6 +10,7 @@ typedef enum {QFDictionary, QFArray, QFBinary, QFString} pltype_t; // possible t
|
||||||
@extern plitem_t PL_GetPropertyList (string str);
|
@extern plitem_t PL_GetPropertyList (string str);
|
||||||
@extern string PL_WritePropertyList (plitem_t pl);
|
@extern string PL_WritePropertyList (plitem_t pl);
|
||||||
@extern pltype_t PL_Type (plitem_t str);
|
@extern pltype_t PL_Type (plitem_t str);
|
||||||
|
@extern int PL_Line (plitem_t str);
|
||||||
@extern string PL_String (plitem_t str);
|
@extern string PL_String (plitem_t str);
|
||||||
@extern plitem_t PL_ObjectForKey (plitem_t item, string key);
|
@extern plitem_t PL_ObjectForKey (plitem_t item, string key);
|
||||||
@extern plitem_t PL_RemoveObjectForKey (plitem_t item, string key);
|
@extern plitem_t PL_RemoveObjectForKey (plitem_t item, string key);
|
||||||
|
|
|
@ -94,6 +94,11 @@
|
||||||
return PL_Type (item);
|
return PL_Type (item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (int) line
|
||||||
|
{
|
||||||
|
return PL_Line (item);
|
||||||
|
}
|
||||||
|
|
||||||
- (int) count
|
- (int) count
|
||||||
{
|
{
|
||||||
if ([self class] == [PLDictionary class]) {
|
if ([self class] == [PLDictionary class]) {
|
||||||
|
|
|
@ -4,6 +4,7 @@ plitem_t PL_GetFromFile (QFile file) = #0;
|
||||||
plitem_t PL_GetPropertyList (string str) = #0;
|
plitem_t PL_GetPropertyList (string str) = #0;
|
||||||
string PL_WritePropertyList (plitem_t pl) = #0;
|
string PL_WritePropertyList (plitem_t pl) = #0;
|
||||||
pltype_t PL_Type (plitem_t str) = #0;
|
pltype_t PL_Type (plitem_t str) = #0;
|
||||||
|
int PL_Line (plitem_t str) = #0;
|
||||||
string PL_String (plitem_t str) = #0;
|
string PL_String (plitem_t str) = #0;
|
||||||
plitem_t PL_ObjectForKey (plitem_t item, string key) = #0;
|
plitem_t PL_ObjectForKey (plitem_t item, string key) = #0;
|
||||||
plitem_t PL_RemoveObjectForKey (plitem_t item, string key) = #0;
|
plitem_t PL_RemoveObjectForKey (plitem_t item, string key) = #0;
|
||||||
|
|
Loading…
Reference in a new issue