mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 21:02:50 +00:00
017d2c1f44
The addition of data an then string support made keeping track of things in struct's writeTable a nightmare.
36 lines
757 B
R
36 lines
757 B
R
#include <PropertyList.h>
|
|
|
|
#include "vkfieldstring.h"
|
|
#include "vkgen.h"
|
|
|
|
@implementation StringField
|
|
|
|
-init:(PLItem *) item struct:(Struct *)strct field:(string)fname
|
|
{
|
|
self = [super init:item struct:strct field:fname];
|
|
if (!self) {
|
|
return self;
|
|
}
|
|
|
|
value_field = [[item getObjectForKey:"string"] string];
|
|
return self;
|
|
}
|
|
|
|
-writeParseData
|
|
{
|
|
fprintf (output_file, "static parse_string_t parse_%s_%s_data = {\n",
|
|
struct_name, field_name);
|
|
fprintf (output_file, "\tfield_offset (%s, %s),\n",
|
|
struct_name, value_field);
|
|
fprintf (output_file, "};\n");
|
|
return self;
|
|
}
|
|
|
|
-writeField
|
|
{
|
|
fprintf (output_file, "\t{\"%s\", 0, %s, parse_%s, &parse_%s_%s_data},\n",
|
|
field_name, "QFString", "string", struct_name, field_name);
|
|
return self;
|
|
}
|
|
|
|
@end
|