Use submodule for memory structure definitions (df-structures).

develop
Petr Mrázek 2012-01-01 03:34:29 +01:00
parent 52dfa842cc
commit f2a69188ea
36 changed files with 4 additions and 11392 deletions

3
.gitmodules vendored

@ -4,3 +4,6 @@
[submodule "plugins/df2mc"]
path = plugins/df2mc
url = git://github.com/peterix/DF2MC.git
[submodule "library/xml"]
path = library/xml
url = git://github.com/peterix/df-structures.git

@ -0,0 +1 @@
Subproject commit af32a27c89382a0cab330a74e5b6dec8a0006bff

@ -1,50 +0,0 @@
package Bitfield;
use utf8;
use strict;
use warnings;
BEGIN {
use Exporter ();
our $VERSION = 1.00;
our @ISA = qw(Exporter);
our @EXPORT = qw( &render_bitfield_core &render_bitfield_type );
our %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
our @EXPORT_OK = qw( );
}
END { }
use XML::LibXML;
use Common;
sub render_bitfield_core {
my ($name, $tag) = @_;
emit_block {
emit get_primitive_base($tag), ' whole;';
emit_block {
for my $item ($tag->findnodes('child::ld:field')) {
($item->getAttribute('ld:meta') eq 'number' &&
$item->getAttribute('ld:subtype') eq 'flag-bit')
or die "Invalid bitfield member: ".$item->toString."\n";
check_bad_attrs($item);
my $name = ensure_name $item->getAttribute('name');
my $size = $item->getAttribute('count') || 1;
emit "unsigned ", $name, " : ", $size, ";";
}
} "struct ", " bits;";
emit $name, '() : whole(0) {};';
} "union $name ", ";";
}
sub render_bitfield_type {
my ($tag) = @_;
render_bitfield_core($typename,$tag);
}
1;

@ -1,262 +0,0 @@
package Common;
use utf8;
use strict;
use warnings;
BEGIN {
use Exporter ();
our $VERSION = 1.00;
our @ISA = qw(Exporter);
our @EXPORT = qw(
$main_namespace $export_prefix
%types %type_files *typename *filename
&parse_address &check_bad_attrs &check_name
&is_attr_true &type_header_def &add_type_to_hash
*lines *indentation &with_emit &emit &indent &outdent &emit_block
&is_primitive_type &primitive_type_name &get_primitive_base
*weak_refs *strong_refs &register_ref &decode_type_name_ref
%static_lines %static_includes &with_emit_static
&ensure_name &with_anon
);
our %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
our @EXPORT_OK = qw( );
}
END { }
use XML::LibXML;
our $main_namespace = '';
our $export_prefix = '';
our %types;
our %type_files;
# Misc XML analysis
our $typename;
our $filename;
sub parse_address($;$) {
my ($str,$in_bits) = @_;
return undef unless defined $str;
# Parse the format used by offset attributes in xml
$str =~ /^0x([0-9a-f]+)(?:\.([0-7]))?$/
or die "Invalid address syntax: $str\n";
my ($full, $bv) = ($1, $2);
die "Bits not allowed: $str\n" unless $in_bits;
return $in_bits ? (hex($full)*8 + ($bv||0)) : hex($full);
}
sub check_bad_attrs($;$$) {
my ($tag, $allow_size, $allow_align) = @_;
die "Cannot use size, alignment or offset for ".$tag->nodeName."\n"
if ((!$allow_size && defined $tag->getAttribute('size')) ||
defined $tag->getAttribute('offset') ||
(!$allow_align && defined $tag->getAttribute('alignment')));
}
sub check_name($) {
my ($name) = @_;
$name =~ /^[_a-zA-Z][_a-zA-Z0-9]*$/
or die "Invalid identifier: $name\n";
return $name;
}
sub is_attr_true($$) {
my ($tag, $name) = @_;
return ($tag->getAttribute($name)||'') eq 'true';
}
sub type_header_def($) {
my ($name) = @_;
return uc($main_namespace).'_'.uc($name).'_H';
}
sub add_type_to_hash($) {
my ($type) = @_;
my $name = $type->getAttribute('type-name')
or die "Type without a name in $filename\n";
die "Duplicate definition of $name in $filename\n" if $types{$name};
local $typename = $name;
check_bad_attrs $type;
$types{$name} = $type;
$type_files{$name} = $filename;
}
# Text generation with indentation
our @lines;
our $indentation = 0;
sub with_emit(&;$) {
# Executes the code block, and returns emitted lines
my ($blk, $start_indent) = @_;
local @lines;
local $indentation = ($start_indent||0);
$blk->();
return @lines;
}
sub emit(@) {
# Emit an indented line to be returned from with_emit
my $line = join('',map { defined($_) ? $_ : '' } @_);
$line = (' 'x$indentation).$line unless length($line) == 0;
push @lines, $line;
}
sub indent(&) {
# Indent lines emitted from the block by one step
my ($blk) = @_;
local $indentation = $indentation+2;
$blk->();
}
sub outdent(&) {
# Unindent lines emitted from the block by one step
my ($blk) = @_;
local $indentation = ($indentation >= 2 ? $indentation-2 : 0);
$blk->();
}
sub emit_block(&;$$%) {
# Emit a full {...} block with indentation
my ($blk, $prefix, $suffix, %flags) = @_;
my @inner = &with_emit($blk,$indentation+2);
return if $flags{-auto} && !@inner;
$prefix ||= '';
$suffix ||= '';
emit $prefix,'{';
push @lines, @inner;
emit '}',$suffix;
}
# Primitive types
my @primitive_type_list =
qw(int8_t uint8_t int16_t uint16_t
int32_t uint32_t int64_t uint64_t
s-float
bool flag-bit
padding static-string);
my %primitive_aliases = (
's-float' => 'float',
'static-string' => 'char',
'flag-bit' => 'void',
'padding' => 'void',
);
my %primitive_types;
$primitive_types{$_}++ for @primitive_type_list;
sub is_primitive_type($) {
return $primitive_types{$_[0]};
}
sub primitive_type_name($) {
my ($tag_name) = @_;
$primitive_types{$tag_name}
or die "Not primitive: $tag_name\n";
return $primitive_aliases{$tag_name} || $tag_name;
}
sub get_primitive_base($;$) {
my ($tag, $default) = @_;
my $base = $tag->getAttribute('base-type') || $default || 'uint32_t';
$primitive_types{$base} or die "Must be primitive: $base\n";
return $base;
}
# Type references
our %weak_refs;
our %strong_refs;
sub register_ref($;$) {
# Register a reference to another type.
# Strong ones require the type to be included.
my ($ref, $is_strong) = @_;
if ($ref) {
my $type = $types{$ref}
or die "Unknown type $ref referenced.\n";
if ($is_strong) {
$strong_refs{$ref}++;
} else {
$weak_refs{$ref}++;
}
}
}
sub decode_type_name_ref($;%) {
# Interpret the type-name field of a tag
my ($tag,%flags) = @_;
my $force_type = $flags{-force_type};
my $attr = $flags{-attr_name} || 'type-name';
my $tname = $tag->getAttribute($attr) or return undef;
if ($primitive_types{$tname}) {
die "Cannot use type $tname as $attr here: $tag\n"
if ($force_type && $force_type ne 'primitive');
return primitive_type_name($tname);
} else {
register_ref $tname, !$flags{-weak};
die "Cannot use type $tname as $attr here: $tag\n"
if ($force_type && $force_type ne $types{$tname}->getAttribute('ld:meta'));
return $main_namespace.'::'.$tname;
}
}
# Static file output
our %static_lines;
our %static_includes;
sub with_emit_static(&;$) {
my ($blk, $tag) = @_;
my @inner = &with_emit($blk,2) or return;
$tag ||= '';
$static_includes{$tag}{$typename}++;
push @{$static_lines{$tag}}, @inner;
}
# Anonymous variable names
our $anon_id = 0;
our $anon_prefix;
sub ensure_name($) {
# If the name is empty, assign an auto-generated one
my ($name) = @_;
unless ($name) {
$name = $anon_prefix.(($anon_id == 0) ? '' : '_'.$anon_id);
$anon_id++;
}
return check_name($name);
}
sub with_anon(&;$) {
# Establish a new anonymous namespace
my ($blk,$stem) = @_;
local $anon_id = $stem ? 0 : 1;
local $anon_prefix = ($stem||'anon');
$blk->();
}
1;

@ -1,165 +0,0 @@
package Enum;
use utf8;
use strict;
use warnings;
BEGIN {
use Exporter ();
our $VERSION = 1.00;
our @ISA = qw(Exporter);
our @EXPORT = qw( &render_enum_core &render_enum_type );
our %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
our @EXPORT_OK = qw( );
}
END { }
use XML::LibXML;
use Common;
sub render_enum_core($$) {
my ($name,$tag) = @_;
my $base = 0;
emit_block {
my @items = $tag->findnodes('child::enum-item');
my $idx = 0;
for my $item (@items) {
my $name = ensure_name $item->getAttribute('name');
my $value = $item->getAttribute('value');
$base = ($idx == 0) ? $value : undef if defined $value;
$idx++;
emit $name, (defined($value) ? ' = '.$value : ''), ',';
}
emit "_last_item_of_$name";
} "enum $name ", ";";
return $base;
}
sub render_enum_tables($$$) {
my ($name,$tag,$base) = @_;
# Enumerate enum attributes
my %aidx = ('key' => 0);
my @anames = ('key');
my @avals = ('NULL');
my @atypes = ('const char*');
my @atnames = (undef);
my @aprefix = ('');
for my $attr ($tag->findnodes('child::enum-attr')) {
my $name = $attr->getAttribute('name') or die "Unnamed enum-attr.\n";
my $type = decode_type_name_ref $attr;
my $def = $attr->getAttribute('default-value');
my $base_tname = ($type && $type =~ /::(.*)$/ ? $1 : '');
$type = $base_tname if $base_tname eq $typename;
die "Duplicate attribute $name.\n" if exists $aidx{$name};
check_name $name;
$aidx{$name} = scalar @anames;
push @anames, $name;
push @atnames, $type;
if ($type) {
push @atypes, $type;
push @aprefix, ($base_tname ? $base_tname."::" : '');
push @avals, (defined $def ? $aprefix[-1].$def : "($type)0");
} else {
push @atypes, 'const char*';
push @avals, (defined $def ? "\"$def\"" : 'NULL');
push @aprefix, '';
}
}
# Emit accessor function prototypes
emit "const $name _first_item_of_$name = ($name)$base;";
emit_block {
emit "return (value >= _first_item_of_$name && value < _last_item_of_$name);";
} "inline bool is_valid($name value) ";
for (my $i = 0; $i < @anames; $i++) {
emit "${export_prefix}$atypes[$i] get_$anames[$i]($name value);";
}
# Emit implementation
with_emit_static {
emit_block {
emit_block {
# Emit the entry type
emit_block {
for (my $i = 0; $i < @anames; $i++) {
emit "$atypes[$i] $anames[$i];";
}
} "struct _info_entry ", ";";
# Emit the info table
emit_block {
for my $item ($tag->findnodes('child::enum-item')) {
my $tag = $item->nodeName;
# Assemble item-specific attr values
my @evals = @avals;
my $name = $item->getAttribute('name');
$evals[0] = "\"$name\"" if $name;
for my $attr ($item->findnodes('child::item-attr')) {
my $name = $attr->getAttribute('name') or die "Unnamed item-attr.\n";
my $value = $attr->getAttribute('value') or die "No-value item-attr.\n";
my $idx = $aidx{$name} or die "Unknown item-attr: $name\n";
if ($atnames[$idx]) {
$evals[$idx] = $aprefix[$idx].$value;
} else {
$evals[$idx] = "\"$value\"";
}
}
emit "{ ",join(', ',@evals)," },";
}
emit "{ ",join(', ',@avals)," }";
} "static const _info_entry _info[] = ", ";";
for (my $i = 0; $i < @anames; $i++) {
emit_block {
emit "return is_valid(value) ? _info[value - $base].$anames[$i] : $avals[$i];";
} "$atypes[$i] get_$anames[$i]($name value) ";
}
} "namespace $name ";
} "namespace enums ";
} 'enums';
}
sub render_enum_type {
my ($tag) = @_;
emit_block {
emit_block {
my $base = render_enum_core($typename,$tag);
if (defined $base) {
render_enum_tables($typename,$tag,$base);
} else {
print STDERR "Warning: complex enum: $typename\n";
}
} "namespace $typename ";
} "namespace enums ";
emit "using enums::",$typename,"::",$typename,";";
}
1;

@ -1,328 +0,0 @@
package StructFields;
use utf8;
use strict;
use warnings;
BEGIN {
use Exporter ();
our $VERSION = 1.00;
our @ISA = qw(Exporter);
our @EXPORT = qw(
*in_struct_body &with_struct_block
&get_struct_fields &get_struct_field_type
&emit_struct_fields
);
our %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
our @EXPORT_OK = qw( );
}
END { }
use XML::LibXML;
use Common;
use Enum;
use Bitfield;
# MISC
our $in_struct_body = 0;
sub with_struct_block(&$;$%) {
my ($blk, $tag, $name, %flags) = @_;
my $kwd = (is_attr_true($tag,'is-union') ? "union" : "struct");
my $exp = $flags{-export} ? $export_prefix : '';
my $prefix = $kwd.' '.$exp.($name ? $name.' ' : '');
emit_block {
local $_;
local $in_struct_body = 1;
if ($flags{-no_anon}) {
$blk->();
} else {
&with_anon($blk);
}
} $prefix, ";";
}
# FIELD TYPE
sub get_container_item_type($;%) {
my ($tag, %flags) = @_;
my @items = $tag->findnodes('ld:item');
if (@items) {
return get_struct_field_type($items[0], -local => 1, %flags);
} elsif ($flags{-void}) {
return $flags{-void};
} else {
die "Container without element: $tag\n";
}
}
my %atable = ( 1 => 'char', 2 => 'short', 4 => 'int' );
my %custom_primitive_handlers = (
'stl-string' => sub { return "std::string"; },
);
my %custom_container_handlers = (
'stl-vector' => sub {
my $item = get_container_item_type($_, -void => 'void*');
$item = 'char' if $item eq 'bool';
return "std::vector<$item>";
},
'stl-bit-vector' => sub {
return "std::vector<bool>";
},
'df-flagarray' => sub {
my $type = decode_type_name_ref($_, -attr_name => 'index-enum', -force_type => 'enum-type') || 'int';
return "BitArray<$type>";
},
);
sub emit_typedef($$) {
# Convert a prefix/postfix pair into a single name
my ($pre, $post) = @_;
my $name = ensure_name undef;
emit 'typedef ', $pre, ' ', $name, $post, ';';
return $name;
}
sub get_struct_fields($) {
return $_[0]->findnodes('ld:field');
}
sub get_struct_field_type($;%) {
# Dispatch on the tag name, and retrieve the type prefix & suffix
my ($tag, %flags) = @_;
my $meta = $tag->getAttribute('ld:meta');
my $subtype = $tag->getAttribute('ld:subtype');
my $prefix;
my $suffix = '';
if ($prefix = $tag->getAttribute('ld:typedef-name')) {
unless ($flags{-local}) {
my @names = ( $main_namespace );
for my $parent ($tag->findnodes('ancestor::*')) {
if ($parent->nodeName eq 'ld:global-type') {
push @names, $parent->getAttribute('type-name');
} elsif (my $n = $parent->getAttribute('ld:typedef-name')) {
push @names, $n;
}
}
$prefix = join('::',@names,$prefix);
}
} elsif ($meta eq 'number') {
$prefix = primitive_type_name($subtype);
} elsif ($meta eq 'bytes') {
if ($flags{-local} && !$flags{-weak}) {
if ($subtype eq 'static-string') {
my $count = $tag->getAttribute('size') || 0;
$prefix = "char";
$suffix = "[$count]";
} elsif ($subtype eq 'padding') {
my $count = $tag->getAttribute('size') || 0;
my $alignment = $tag->getAttribute('alignment') || 1;
$prefix = $atable{$alignment} or die "Invalid alignment: $alignment\n";
($count % $alignment) == 0 or die "Invalid size & alignment: $count $alignment\n";
$suffix = "[".($count/$alignment)."]";
} else {
die "Invalid bytes subtype: $subtype\n";
}
} else {
$prefix = primitive_type_name($subtype);
}
} elsif ($meta eq 'global') {
my $tname = $tag->getAttribute('type-name');
register_ref $tname, !$flags{-weak};
$prefix = $main_namespace.'::'.$tname;
} elsif ($meta eq 'compound') {
die "Unnamed compound in global mode: ".$tag->toString."\n" unless $flags{-local};
$prefix = ensure_name undef;
$tag->setAttribute('ld:typedef-name', $prefix) if $in_struct_body;
$subtype ||= 'compound';
if ($subtype eq 'enum') {
with_anon {
render_enum_core($prefix,$tag);
};
} elsif ($subtype eq 'bitfield') {
with_anon {
render_bitfield_core($prefix,$tag);
};
} else {
with_struct_block {
emit_struct_fields($tag, $prefix);
} $tag, $prefix;
}
} elsif ($meta eq 'pointer') {
$prefix = get_container_item_type($tag, -weak => 1, -void => 'void')."*";
} elsif ($meta eq 'static-array') {
($prefix, $suffix) = get_container_item_type($tag);
my $count = $tag->getAttribute('count') || 0;
$suffix = "[$count]".$suffix;
} elsif ($meta eq 'primitive') {
local $_ = $tag;
my $handler = $custom_primitive_handlers{$subtype} or die "Invalid primitive: $subtype\n";
$prefix = $handler->($tag, %flags);
} elsif ($meta eq 'container') {
local $_ = $tag;
my $handler = $custom_container_handlers{$subtype} or die "Invalid container: $subtype\n";
$prefix = $handler->($tag, %flags);
} elsif (!$flags{-local} && $tag->nodeName eq 'ld:global-type') {
my $tname = $tag->getAttribute('type-name');
$prefix = $main_namespace.'::'.$tname;
} else {
die "Invalid field meta type: $meta\n";
}
if ($subtype && $flags{-local} && $subtype eq 'enum') {
my $base = get_primitive_base($tag, 'int32_t');
$prefix = "enum_field<$prefix,$base>";
}
return ($prefix,$suffix) if wantarray;
if ($suffix) {
$prefix = emit_typedef($prefix, $suffix);
$tag->setAttribute('ld:typedef-name', $prefix) if $flags{-local} && $in_struct_body;
}
return $prefix;
}
sub render_struct_field($) {
my ($tag) = @_;
# Special case: anonymous compounds.
if (is_attr_true($tag, 'ld:anon-compound'))
{
check_bad_attrs($tag);
with_struct_block {
render_struct_field($_) for get_struct_fields($tag);
} $tag, undef, -no_anon => 1;
return;
}
# Otherwise, create the name if necessary, and render
my $field_name = $tag->getAttribute('name');
my $name = ensure_name $field_name;
$tag->setAttribute('ld:anon-name', $name) unless $field_name;
with_anon {
my ($prefix, $postfix) = get_struct_field_type($tag, -local => 1);
emit $prefix, ' ', $name, $postfix, ';';
} "T_$name";
}
our @simple_inits;
our $in_union = 0;
sub render_field_init($$) {
my ($field, $prefix) = @_;
local $_;
my $meta = $field->getAttribute('ld:meta');
my $subtype = $field->getAttribute('ld:subtype');
my $name = $field->getAttribute('name') || $field->getAttribute('ld:anon-name');
my $fname = ($prefix && $name ? $prefix.'.'.$name : ($name||$prefix));
my $is_struct = $meta eq 'compound' && !$subtype;
my $is_union = ($is_struct && is_attr_true($field, 'is-union'));
local $in_union = $in_union || $is_union;
if (is_attr_true($field, 'ld:anon-compound') || ($in_union && $is_struct))
{
my @fields = $is_union ? $field->findnodes('ld:field[1]') : get_struct_fields($field);
&render_field_init($_, $fname) for @fields;
return;
}
return unless ($name || $prefix =~ /\]$/);
my $val = $field->getAttribute('init-value');
my $assign = 0;
if ($meta eq 'number' || $meta eq 'pointer') {
$assign = 1;
my $signed_ref =
!is_attr_true($field,'ld:unsigned') &&
($field->getAttribute('ref-target') || $field->getAttribute('refers-to'));
$val ||= ($signed_ref ? '-1' : 0);
} elsif ($meta eq 'bytes') {
emit "memset($fname, 0, sizeof($fname));";
} elsif ($meta eq 'global' || $meta eq 'compound') {
return unless $subtype;
if ($subtype eq 'bitfield' && $val) {
emit $fname, '.whole = ', $val;
} elsif ($subtype eq 'enum') {
$assign = 1;
if ($meta eq 'global') {
my $tname = $field->getAttribute('type-name');
$val = ($val ? $main_namespace.'::enums::'.$tname.'::'.$val : "ENUM_FIRST_ITEM($tname)");
} else {
$val ||= $field->findvalue('enum-item[1]/@name');
}
}
} elsif ($meta eq 'static-array') {
my $idx = ensure_name undef;
my $count = $field->getAttribute('count')||0;
emit_block {
my $pfix = $fname."[$idx]";
render_field_init($_, $pfix) for $field->findnodes('ld:item');
} "for (int $idx = 0; $idx < $count; $idx++) ", "", -auto => 1;
}
if ($assign) {
if ($prefix || $in_union) {
emit "$fname = $val;";
} else {
push @simple_inits, "$name($val)";
}
}
}
sub emit_struct_fields($$;%) {
my ($tag, $name, %flags) = @_;
local $_;
my @fields = get_struct_fields($tag);
&render_struct_field($_) for @fields;
return if $tag->findnodes("ancestor-or-self::ld:field[\@is-union='true']");
local $in_struct_body = 0;
my $want_ctor = 0;
my $ctor_args = '';
my $ctor_arg_init = '';
with_emit_static {
local @simple_inits;
my @ctor_lines = with_emit {
if ($flags{-class}) {
$ctor_args = "virtual_identity *_id";
$ctor_arg_init = " = &".$name."::_identity";
push @simple_inits, "$flags{-inherits}(_id)" if $flags{-inherits};
emit "_identity.adjust_vtable(this, _id);";
}
render_field_init($_, '') for @fields;
};
if (@simple_inits || @ctor_lines) {
$want_ctor = 1;
my $full_name = get_struct_field_type($tag);
emit $full_name,'::',$name,"($ctor_args)";
emit " : ", join(', ', @simple_inits) if @simple_inits;
emit_block {
emit $_ for @ctor_lines;
};
}
} 'ctors';
if ($want_ctor) {
emit "$name($ctor_args$ctor_arg_init);";
}
}
1;

@ -1,192 +0,0 @@
package StructType;
use utf8;
use strict;
use warnings;
BEGIN {
use Exporter ();
our $VERSION = 1.00;
our @ISA = qw(Exporter);
our @EXPORT = qw(
&render_struct_type
);
our %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
our @EXPORT_OK = qw( );
}
END { }
use XML::LibXML;
use Common;
use StructFields;
# MISC
sub translate_lookup($) {
my ($str) = @_;
return undef unless $str && $str =~ /^\$global((\.[_a-zA-Z0-9]+)+)$/;
my @fields = split /\./, substr($1,1);
my $expr = "df::global::".shift(@fields);
for my $fn (@fields) {
$expr = "_toref($expr).$fn";
}
return $expr;
}
sub emit_find_instance {
my ($tag) = @_;
my $instance_vector = translate_lookup $tag->getAttribute('instance-vector');
if ($instance_vector) {
emit "static std::vector<$typename*> &get_vector();";
emit "static $typename *find(int id);";
with_emit_static {
emit_block {
emit "return ", $instance_vector, ";";
} "std::vector<$typename*>& ${typename}::get_vector() ";
emit_block {
emit "std::vector<$typename*> &vec_ = get_vector();";
if (my $id = $tag->getAttribute('key-field')) {
emit "return binsearch_in_vector(vec_, &${typename}::$id, id_);";
} else {
emit "return (id_ >= 0 && id_ < vec_.size()) ? vec_[id_] : NULL;";
}
} "$typename *${typename}::find(int id_) ";
};
}
}
sub render_virtual_methods {
my ($tag) = @_;
# Collect all parent classes
my @parents = ( $tag );
for (;;) {
my $inherits = $parents[0]->getAttribute('inherits-from') or last;
my $parent = $types{$inherits} || die "Unknown parent: $inherits\n";
unshift @parents, $parent;
}
# Build the vtable array
my %name_index;
my @vtable;
my @starts;
my $dtor_id = '~destructor';
for my $type (@parents) {
push @starts, scalar(@vtable);
for my $method ($type->findnodes('virtual-methods/vmethod')) {
my $is_destructor = is_attr_true($method, 'is-destructor');
my $name = $is_destructor ? $dtor_id : $method->getAttribute('name');
if ($name) {
die "Duplicate method: $name in ".$type->getAttribute('type-name')."\n"
if exists $name_index{$name};
$name_index{$name} = scalar(@vtable);
}
push @vtable, $method;
}
}
# Ensure there is a destructor to avoid warnings
my $dtor_idx = $name_index{$dtor_id};
unless (defined $dtor_idx) {
for (my $i = 0; $i <= $#vtable; $i++) {
next if $vtable[$i]->getAttribute('name');
$name_index{$dtor_id} = $dtor_idx = $i;
last;
}
}
unless (defined $dtor_idx) {
push @vtable, undef;
$dtor_idx = $#vtable;
}
# Generate the methods
my $min_id = $starts[-1];
my $cur_mode = '';
for (my $idx = $min_id; $idx <= $#vtable; $idx++) {
my $method = $vtable[$idx];
my $is_destructor = 1;
my $name = $typename;
my $is_anon = 1;
if ($method) {
$is_destructor = is_attr_true($method, 'is-destructor');
$name = $method->getAttribute('name') unless $is_destructor;
$is_anon = 0 if $name;
}
my $rq_mode = $is_anon ? 'protected' : 'public';
unless ($rq_mode eq $cur_mode) {
$cur_mode = $rq_mode;
outdent { emit "$cur_mode:"; }
}
with_anon {
$name = ensure_name $name;
$method->setAttribute('ld:anon-name', $name) if $method && $is_anon;
my @ret_type = $is_destructor ? () : $method->findnodes('ret-type');
my @arg_types = $is_destructor ? () : $method->findnodes('ld:field');
my $ret_type = $ret_type[0] ? get_struct_field_type($ret_type[0], -local => 1) : 'void';
my @arg_strs = map { scalar get_struct_field_type($_, -local => 1) } @arg_types;
my $ret_stmt = '';
unless ($ret_type eq 'void') {
$ret_stmt = ' return '.($ret_type =~ /\*$/ ? '0' : "$ret_type()").'; ';
}
emit 'virtual ', ($is_destructor?'~':$ret_type.' '), $name,
'(', join(', ', @arg_strs), ') {', $ret_stmt, '}; //', $idx;
} "anon_vmethod_$idx";
}
}
sub render_struct_type {
my ($tag) = @_;
my $tag_name = $tag->getAttribute('ld:meta');
my $is_class = ($tag_name eq 'class-type');
my $has_methods = $is_class || is_attr_true($tag, 'has-methods');
my $inherits = $tag->getAttribute('inherits-from');
my $original_name = $tag->getAttribute('original-name');
my $ispec = '';
if ($inherits) {
register_ref $inherits, 1;
$ispec = ' : '.$inherits;
} elsif ($is_class) {
$ispec = ' : virtual_class';
}
with_struct_block {
emit_struct_fields($tag, $typename, -class => $is_class, -inherits => $inherits);
emit_find_instance($tag);
if ($has_methods) {
if ($is_class) {
emit "static class_virtual_identity<$typename> _identity;";
with_emit_static {
emit "class_virtual_identity<$typename> ${typename}::_identity(",
"\"$typename\",",
($original_name ? "\"$original_name\"" : 'NULL'), ',',
($inherits ? "&${inherits}::_identity" : 'NULL'),
");";
};
}
if ($is_class) {
render_virtual_methods $tag;
} else {
emit "~",$typename,"() {}";
}
}
} $tag, "$typename$ispec", -export => 1;
}
1;

@ -1,166 +0,0 @@
#!/usr/bin/perl
use strict;
use warnings;
BEGIN {
our $script_root = '.';
if ($0 =~ /^(.*)[\\\/][^\\\/]*$/) {
$script_root = $1;
unshift @INC, $1;
}
};
use XML::LibXML;
use XML::LibXSLT;
use Common;
use Enum;
use Bitfield;
use StructType;
my $input_dir = $ARGV[0] || '.';
my $output_dir = $ARGV[1] || 'codegen';
$main_namespace = $ARGV[2] || 'df';
$export_prefix = 'DFHACK_EXPORT ';
# Collect all type definitions from XML files
our $script_root;
my $parser = XML::LibXML->new();
my $xslt = XML::LibXSLT->new();
my @transforms =
map { $xslt->parse_stylesheet_file("$script_root/$_"); }
('lower-1.xslt', 'lower-2.xslt');
my @documents;
for my $fn (sort { $a cmp $b } glob "$input_dir/*.xml") {
local $filename = $fn;
my $doc = $parser->parse_file($filename);
$doc = $_->transform($doc) for @transforms;
push @documents, $doc;
add_type_to_hash $_ foreach $doc->findnodes('/ld:data-definition/ld:global-type');
}
# Generate text representations
my %type_handlers = (
'enum-type' => \&render_enum_type,
'bitfield-type' => \&render_bitfield_type,
'class-type' => \&render_struct_type,
'struct-type' => \&render_struct_type,
);
my %type_data;
for my $name (sort { $a cmp $b } keys %types) {
local $typename = $name;
local $filename = $type_files{$typename};
local %weak_refs;
local %strong_refs;
eval {
my $type = $types{$typename};
my $meta = $type->getAttribute('ld:meta') or die "Null meta";
# Emit the actual type definition
my @code = with_emit {
with_anon {
my $handler = $type_handlers{$meta} or die "Unknown type meta: $meta\n";
$handler->($type);
};
} 2;
delete $weak_refs{$name};
delete $strong_refs{$name};
# Add wrapping
my @all = with_emit {
my $def = type_header_def($typename);
emit "#ifndef $def";
emit "#define $def";
for my $strong (sort { $a cmp $b } keys %strong_refs) {
my $sdef = type_header_def($strong);
emit "#ifndef $sdef";
emit "#include \"$strong.h\"";
emit "#endif";
}
emit_block {
for my $weak (sort { $a cmp $b } keys %weak_refs) {
next if $strong_refs{$weak};
my $ttype = $types{$weak};
my $tstr = 'struct';
$tstr = 'enum' if $ttype->nodeName eq 'enum-type';
$tstr = 'union' if $ttype->nodeName eq 'bitfield-type';
$tstr = 'union' if ($ttype->nodeName eq 'struct-type' && is_attr_true($ttype,'is-union'));
emit $tstr, ' ', $weak, ';';
}
push @lines, @code;
} "namespace $main_namespace ";
emit "#endif";
};
$type_data{$typename} = \@all;
};
if ($@) {
print 'Error: '.$@."Type $typename in $filename ignored\n";
}
}
# Write output files
mkdir $output_dir;
{
# Delete the old files
for my $name (glob "$output_dir/*.h") {
unlink $name;
}
for my $name (glob "$output_dir/*.inc") {
unlink $name;
}
unlink "$output_dir/codegen.out.xml";
# Write out the headers
local $, = "\n";
local $\ = "\n";
for my $name (keys %type_data) {
open FH, ">$output_dir/$name.h";
print FH "/* THIS FILE WAS GENERATED. DO NOT EDIT. */";
print FH @{$type_data{$name}};
close FH;
}
# Write out the static file
for my $tag (keys %static_lines) {
my $name = $output_dir.'/static'.($tag?'.'.$tag:'').'.inc';
open FH, ">$name";
print FH "/* THIS FILE WAS GENERATED. DO NOT EDIT. */";
for my $name (sort { $a cmp $b } keys %{$static_includes{$tag}}) {
print FH "#include \"$name.h\"";
}
print FH "namespace $main_namespace {";
print FH @{$static_lines{$tag}};
print FH '}';
close FH;
}
# Write an xml file with all types
open FH, ">$output_dir/codegen.out.xml";
print FH '<ld:data-definition xmlns:ld="http://github.com/peterix/dfhack/lowered-data-definition">';
for my $doc (@documents) {
for my $node ($doc->documentElement()->findnodes('*')) {
print FH ' '.$node->toString();
}
}
print FH '</ld:data-definition>';
close FH;
}

@ -1,58 +0,0 @@
<data-definition>
<class-type type-name='building_def' original-name='building_defst' key-field='code'>
<stl-string name="code"/>
<int32_t name="index"/>
<stl-string name="name"/>
<int32_t name='unk_40'/>
<int32_t name='unk_44'/>
<static-array name='name_color' count='3' type-name='int16_t'/>
<static-array name='tile' count='4'>
<static-array count='31'>
<static-array count='31' type-name='uint8_t'/>
</static-array>
</static-array>
<static-array name='tile_color' count='3'>
<static-array count='4'>
<static-array count='31'>
<static-array count='31' type-name='uint8_t'/>
</static-array>
</static-array>
</static-array>
<static-array name='tile_block' count='31'>
<static-array count='31' type-name='uint8_t'/>
</static-array>
<int32_t name='build_key'/>
<bool name='needs_magma'/>
<stl-vector name="build_items">
<pointer/>
</stl-vector>
<int32_t name="dim_x"/>
<int32_t name="dim_y"/>
<int32_t name="workloc_x"/>
<int32_t name="workloc_y"/>
<stl-vector name="build_labors">
<enum base-type='int32_t' type-name='unit_labor'/>
</stl-vector>
<stl-string name="labor_description"/>
<int32_t name="build_stages"/>
</class-type>
<class-type type-name='building_def_workshopst' inherits-from='building_def'/>
<class-type type-name='building_def_furnacest' inherits-from='building_def'/>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,403 +0,0 @@
<data-definition>
<bitfield-type type-name='building_flags'>
<flag-bit name='exists' comment='actually built, not just ordered'/>
<flag-bit/>
<flag-bit name='room_collision' comment='major intersection with another room?'/>
<flag-bit/>
<flag-bit name='justice'/>
</bitfield-type>
<class-type type-name='building' original-name='buildingst'
instance-vector='$global.world.buildings.all' key-field='id'>
<int32_t name='x1' comment='left'/>
<int32_t name='y1'/>
<int32_t name='x2' comment='work location'/>
<int32_t name='x3' comment='right'/>
<int32_t name='y3'/>
<int32_t name='y2'/>
<int32_t name='z'/>
<compound name='flags' type-name='building_flags'/>
<int16_t name='materialType' ref-target='material' aux-value='$$.materialIndex'/>
<int32_t name='materialIndex'/>
<compound name='room'>
<pointer name='extents' type-name='uint8_t'>
<comment>0 - not room; 1 in stockpile; 2 wall; 3 inner; 4 distance boundary.</comment>
</pointer>
<int32_t name='x'/>
<int32_t name='y'/>
<int32_t name='width'/>
<int32_t name='height'/>
</compound>
<int32_t name='age'/>
<int16_t name='race' ref-target='creature_raw'/>
<int32_t name='id'/>
<stl-vector name='jobs'>
<pointer type-name='job'/>
</stl-vector>
<stl-vector name='meetings'>
<pointer type-name='meeting_ref'/>
</stl-vector>
<stl-vector name='unk6' type-name='pointer'/>
<bool name='is_room'/>
<stl-vector name='children' comment='other buildings within this room'>
<pointer type-name='building'/>
</stl-vector>
<stl-vector name='parents' comment='rooms this building belongs to'>
<pointer type-name='building'/>
</stl-vector>
<pointer type-name='unit' name='owner'/>
<stl-vector name='unk7' type-name='pointer'/>
<stl-string name='name'/>
<stl-vector name='activities'>
<pointer>
<int32_t name='id' ref-target='activity_entry'/>
<int32_t name='is_group'/>
</pointer>
</stl-vector>
</class-type>
-- stockpile --
<class-type type-name='building_stockpilest' inherits-from='building'>
<compound type-name='stockpile_settings' name='settings'/>
<int16_t name='max_barrels'/>
<int16_t name='max_bins'/>
<stl-vector name='container_type'>
<enum base-type='int16_t' type-name='item_type'/>
</stl-vector>
<stl-vector name='container_item_id'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='container_x' type-name='int16_t'/>
<stl-vector name='container_y' type-name='int16_t'/>
<pointer name='give_to' type-name='building_stockpilest'/>
<stl-vector name='take_from'>
<pointer type-name='building_stockpilest'/>
</stl-vector>
<int32_t name='stockpile_number'/>
</class-type>
-- zone --
<class-type type-name='building_civzonest' inherits-from='building'>
</class-type>
-- actual --
<class-type type-name='building_actual' inherits-from='building'
original-name='building_actualst'>
<int16_t name='construction_stage'
comment='0 not started, then 1 or 3 max depending on type'/>
<stl-vector name='contained_items'>
<pointer>
<pointer name='item' type-name='item'/>
<int16_t name='use_mode'/>
</pointer>
</stl-vector>
<pointer name='design' type-name='building_design'/>
</class-type>
<struct-type type-name='building_design'>
<int32_t name='architect' ref-target='historical_figure'/>
<int32_t name='unk2' comment='-1'/>
<int16_t name='unk3'/>
<int32_t name='builder1' ref-target='historical_figure'/>
<int32_t name='unk5' comment='-1'/>
<int16_t name='unk6'/>
<int16_t name='build_timer1' comment='+1 per 10 frames while building'/>
<int32_t name='builder2' ref-target='historical_figure'/>
<int16_t name='build_timer2'/>
<int16_t name='unk8b'/>
<int16_t name='unk9'/>
<bitfield name='flags' base-type='uint32_t'>
<flag-bit name='rough' comment='rough gabbro road'/>
<flag-bit name='built'/>
<flag-bit name='designed'/>
</bitfield>
<int32_t name='unk11'/>
<int32_t name='unk12'/>
<int32_t name='unk13'/>
</struct-type>
-- workshops --
<enum-type type-name='furnace_type'>
<enum-item name="WoodFurnace"/>
<enum-item name="Smelter"/>
<enum-item name="GlassFurnace"/>
<enum-item name="Kiln"/>
<enum-item name="MagmaSmelter"/>
<enum-item name="MagmaGlassFurnace"/>
<enum-item name="MagmaKiln"/>
<enum-item name="Custom"/>
</enum-type>
<class-type type-name='building_furnacest' inherits-from='building_actual'>
<stl-vector name='melt_remainder' type-name='int32_t'
index-refers-to='(material-by-id 0 $)'/>
<int16_t name="unk_108"/>
<enum base-type='int16_t' name="type" type-name='furnace_type'/>
<stl-vector name="permitted_workers">
<int32_t ref-target='unit'/>
</stl-vector>
<int32_t name="min_level"/>
<int32_t name="max_level"/>
<int32_t name="custom_type" refers-to='$global.world.raws.buildings.furnaces[$]'/>
</class-type>
<enum-type type-name='workshop_type'>
<enum-item name="Carpenters"/>
<enum-item name="Farmers"/>
<enum-item name="Masons"/>
<enum-item name="Craftdwarfs"/>
<enum-item name="Jewelers"/>
<enum-item name="MetalsmithsForge"/>
<enum-item name="MagmaForge"/>
<enum-item name="Bowyers"/>
<enum-item name="Mechanics"/>
<enum-item name="Siege"/>
<enum-item name="Butchers"/>
<enum-item name="Leatherworks"/>
<enum-item name="Tanners"/>
<enum-item name="Clothiers"/>
<enum-item name="Fishery"/>
<enum-item name="Still"/>
<enum-item name="Loom"/>
<enum-item name="Quern"/>
<enum-item name="Kennels"/>
<enum-item name="Kitchen"/>
<enum-item name="Ashery"/>
<enum-item name="Dyers"/>
<enum-item name="Millstone"/>
<enum-item name="Custom"/>
</enum-type>
<class-type type-name='building_workshopst' inherits-from='building_actual'>
<enum base-type='int16_t' name="type" type-name='workshop_type'/>
<stl-vector name="permitted_workers">
<int32_t ref-target='unit'/>
</stl-vector>
<int32_t name="min_level"/>
<int32_t name="max_level"/>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_118"/>
<int32_t name="custom_type" refers-to='$global.world.raws.buildings.workshops[$]'/>
</class-type>
-- misc --
<class-type type-name='building_animaltrapst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_archerytargetst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_armorstandst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_bars_verticalst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_bars_floorst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_bedst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_boxst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_bridgest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_cabinetst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_cagest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_chainst' inherits-from='building_actual'>
<pointer name='assigned' type-name='unit'/>
<pointer name='chained' type-name='unit'/>
<int16_t name='unk'/>
</class-type>
<class-type type-name='building_chairst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_coffinst' inherits-from='building_actual'>
<bitfield name='burial_mode' base-type='uint16_t'>
<flag-bit name='allow_burial'/>
<flag-bit name='no_citizens'/>
<flag-bit name='no_pets'/>
</bitfield>
</class-type>
<class-type type-name='building_constructionst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_doorst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_farmplotst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_floodgatest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_grate_floorst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_grate_wallst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_hatchst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_hivest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_nestst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_nest_boxst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_roadst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_road_dirtst' inherits-from='building_roadst'>
</class-type>
<class-type type-name='building_road_pavedst' inherits-from='building_roadst'>
</class-type>
<class-type type-name='building_shopst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_siegeenginest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_slabst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_statuest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_supportst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_tablest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_traction_benchst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_tradedepotst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_trapst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_wagonst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_weaponst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_weaponrackst' inherits-from='building_actual'>
<int16_t name='unk_c0'/>
<stl-vector name='assignments'>
<pointer>
<int32_t name='squad_id' ref-target='squad'/>
<compound name='mode' type-name='squad_use_flags'/>
</pointer>
</stl-vector>
<int32_t name='unk_d0'/>
</class-type>
<class-type type-name='building_wellst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_windowst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_window_glassst' inherits-from='building_windowst'>
</class-type>
<class-type type-name='building_window_gemst' inherits-from='building_windowst'>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,592 +0,0 @@
<data-definition>
<enum-type type-name='creature_raw_flags'>
<enum-item/>
<enum-item name='EQUIPMENT_WAGON'/>
<enum-item name='MUNDANE'/>
<enum-item name='VERMIN_EATER'/>
<enum-item name='VERMIN_GROUNDER'/>
<enum-item name='VERMIN_ROTTER'/>
<enum-item name='VERMIN_SOIL'/>
<enum-item name='VERMIN_SOIL_COLONY'/>
<enum-item name='LARGE_ROAMING'/>
<enum-item name='VERMIN_FISH'/>
<enum-item name='LOOSE_CLUSTERS'/>
<enum-item name='FANCIFUL'/>
<enum-item name='BIOME_MOUNTAIN'/>
<enum-item name='BIOME_GLACIER'/>
<enum-item name='BIOME_TUNDRA'/>
<enum-item name='BIOME_SWAMP_TEMPERATE_FRESHWATER'/>
<enum-item name='BIOME_SWAMP_TEMPERATE_SALTWATER'/>
<enum-item name='BIOME_MARSH_TEMPERATE_FRESHWATER'/>
<enum-item name='BIOME_MARSH_TEMPERATE_SALTWATER'/>
<enum-item name='BIOME_SWAMP_TROPICAL_FRESHWATER'/>
<enum-item name='BIOME_SWAMP_TROPICAL_SALTWATER'/>
<enum-item name='BIOME_SWAMP_MANGROVE'/>
<enum-item name='BIOME_MARSH_TROPICAL_FRESHWATER'/>
<enum-item name='BIOME_MARSH_TROPICAL_SALTWATER'/>
<enum-item name='BIOME_FOREST_TAIGA'/>
<enum-item name='BIOME_FOREST_TEMPERATE_CONIFER'/>
<enum-item name='BIOME_FOREST_TEMPERATE_BROADLEAF'/>
<enum-item name='BIOME_FOREST_TROPICAL_CONIFER'/>
<enum-item name='BIOME_FOREST_TROPICAL_DRY_BROADLEAF'/>
<enum-item name='BIOME_FOREST_TROPICAL_MOIST_BROADLEAF'/>
<enum-item name='BIOME_GRASSLAND_TEMPERATE'/>
<enum-item name='BIOME_SAVANNA_TEMPERATE'/>
<enum-item name='BIOME_SHRUBLAND_TEMPERATE'/>
<enum-item name='BIOME_GRASSLAND_TROPICAL'/>
<enum-item name='BIOME_SAVANNA_TROPICAL'/>
<enum-item name='BIOME_SHRUBLAND_TROPICAL'/>
<enum-item name='BIOME_DESERT_BADLAND'/>
<enum-item name='BIOME_DESERT_ROCK'/>
<enum-item name='BIOME_DESERT_SAND'/>
<enum-item name='BIOME_OCEAN_TROPICAL'/>
<enum-item name='BIOME_OCEAN_TEMPERATE'/>
<enum-item name='BIOME_OCEAN_ARCTIC'/>
<enum-item name='BIOME_SUBTERRANEAN_WATER'/>
<enum-item name='BIOME_SUBTERRANEAN_CHASM'/>
<enum-item name='BIOME_SUBTERRANEAN_LAVA'/>
<enum-item name='BIOME_POOL_TEMPERATE_FRESHWATER'/>
<enum-item name='BIOME_POOL_TEMPERATE_BRACKISHWATER'/>
<enum-item name='BIOME_POOL_TEMPERATE_SALTWATER'/>
<enum-item name='BIOME_POOL_TROPICAL_FRESHWATER'/>
<enum-item name='BIOME_POOL_TROPICAL_BRACKISHWATER'/>
<enum-item name='BIOME_POOL_TROPICAL_SALTWATER'/>
<enum-item name='BIOME_LAKE_TEMPERATE_FRESHWATER'/>
<enum-item name='BIOME_LAKE_TEMPERATE_BRACKISHWATER'/>
<enum-item name='BIOME_LAKE_TEMPERATE_SALTWATER'/>
<enum-item name='BIOME_LAKE_TROPICAL_FRESHWATER'/>
<enum-item name='BIOME_LAKE_TROPICAL_BRACKISHWATER'/>
<enum-item name='BIOME_LAKE_TROPICAL_SALTWATER'/>
<enum-item name='BIOME_RIVER_TEMPERATE_FRESHWATER'/>
<enum-item name='BIOME_RIVER_TEMPERATE_BRACKISHWATER'/>
<enum-item name='BIOME_RIVER_TEMPERATE_SALTWATER'/>
<enum-item name='BIOME_RIVER_TROPICAL_FRESHWATER'/>
<enum-item name='BIOME_RIVER_TROPICAL_BRACKISHWATER'/>
<enum-item name='BIOME_RIVER_TROPICAL_SALTWATER'/>
<enum-item name='GOOD'/>
<enum-item name='EVIL'/>
<enum-item name='SAVAGE'/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item name='GENERATED'/>
<enum-item/>
<enum-item/>
<enum-item name='DOES_NOT_EXIST'/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item name='ARTIFICIAL_HIVEABLE'/>
<enum-item name='UBIQUITOUS'/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
</enum-type>
<struct-type type-name='body_part_layer_raw' key-field='layer_name'>
<stl-string name='layer_name'/>
<int32_t name='tissue_id'/>
<df-flagarray name='flags'/>
<int32_t name='unk2'/>
<int32_t name='healing_rate'/>
<int32_t name='vascular'/>
<int32_t name='pain_receptors'/>
<int32_t name='unk6'/>
<int16_t name='unk7'/>
<stl-vector name='unk8'/>
<int32_t name='layer_id' comment='across all body parts'/>
<int32_t name='unk10'/>
<int32_t name='unk11'/>
<int32_t name='layer_depth' comment='-1 for skin and internal organs'/>
<int32_t name='unk13'/>
<int32_t name='unk14'/>
<int32_t name='unk15'/>
<int32_t name='unk16'/>
</struct-type>
<struct-type type-name='body_part_raw' key-field='part_name'>
<stl-string name='part_code'/>
<stl-string name='part_name'/>
<int16_t name='con_part_id'/>
<df-flagarray name='flags'/>
<stl-vector name='layers'>
<pointer type-name='body_part_layer_raw'/>
</stl-vector>
<int32_t name='unk2'/>
<int32_t name='unk3'/>
<int32_t name='unk4'/>
<int32_t name='unk5'/>
<int32_t name='relsize'/>
<int32_t name='unk7'/>
<int16_t name='unk7b'/>
<stl-vector name='name_singular'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector name='name_plural'>
<pointer type-name='stl-string'/>
</stl-vector>
<pointer name='bp_relation_part_id'>
<stl-vector type-name='int16_t'/>
</pointer>
<pointer name='bp_relation_code'>
<stl-vector type-name='int16_t'/> // 0 around of, 1 around by
</pointer>
<pointer name='bp_relation_coverage'>
<stl-vector type-name='int16_t'/>
</pointer>
<uint16_t name='min_temp'/>
<uint16_t name='max_temp'/>
<uint16_t name='temp_factor'/>
<int32_t name='unused'/>
<int32_t name='unk11'/>
<int16_t name='unk12'/>
</struct-type>
<struct-type type-name='caste_raw' key-field='caste_id'>
<stl-string name='caste_id'/>
<code-helper name='find-instance'>$global.world.raws.creatures.all[$$].caste[$]</code-helper>
<static-array type-name='stl-string' name='caste_name' count='3'/>
<stl-string name='vermin_bite_txt'/>
<stl-string name='gnawer_txt'/>
<static-array type-name='stl-string' name='baby_name' count='2'/>
<static-array type-name='stl-string' name='child_name' count='2'/>
<static-array type-name='stl-string' name='itemcorpse_str' count='5'/> // temporary
<static-array type-name='stl-string' name='remains' count='2'/>
<stl-string name='description'/>
<static-array type-name='stl-string' name='mannerisms' count='17'>
<comment>fingers[2], nose, ear, head, eyes, mouth, hair, knuckles, lips, cheek, nails, f eet, arms, hands, tongue, leg</comment>
</static-array>
<uint8_t name='caste_tile'/>
<uint8_t name='caste_soldier_tile'/>
<uint8_t name='caste_alttile'/>
<uint8_t name='caste_soldier_alttile'/>
<uint8_t name='caste_glowtile'/>
<uint16_t name='homeotherm'/>
<int16_t name='unk1_1'/>
<int16_t name='unk1_2'/>
<uint16_t name='fixed_temp'/>
<static-array type-name='int16_t' name='caste_color' count='3'/>
<compound name='misc'>
<int16_t name='litter_size_min'/>
<int16_t name='litter_size_max'/>
<int16_t name='penetratepower'/>
<int16_t name='vermin_bite_chance'/>
<int16_t name='grasstrample'/>
<int16_t name='buildingdestroyer'/>
<enum base-type='int16_t' name='itemcorpse_itemtype' type-name='item_type'/>
<int16_t name='itemcorpse_itemsubtype'/>
<int16_t name='itemcorpse_materialtype'
ref-target='material' aux-value='$$.itemcorpse_materialindex'/>
<int16_t name='itemcorpse_materialindex'/> // NOT 32-bit!
<int16_t name='itemcorpse_quality'/>
<static-array type-name='int16_t' name='remains_color' count='3'/>
<int16_t name='difficulty'/>
<static-array type-name='int16_t' name='caste_glowcolor' count='3'/>
<int16_t name='beach_frequency'/>
<int16_t name='clutch_size_min'/>
<int16_t name='clutch_size_max'/>
<int32_t name='speed'/>
<int32_t name='modvalue'/>
<int32_t name='petvalue'/>
<int32_t name='milkable'/>
<int32_t name='viewrange'/>
<int32_t name='maxage_min'/>
<int32_t name='maxage_max'/>
<static-array type-name='int32_t' name='unk3' count='2'/>
<int32_t name='swim_speed'/>
<int32_t name='trade_capacity'/>
<int32_t name='unk4'/>
<int32_t name='pop_ratio'/>
<int32_t name='adult_size'/>
<static-array type-name='int32_t' name='unk5' count='4'/>
<static-array type-name='int32_t' name='attack_trigger' count='3'/>
<int32_t name='egg_size'/>
<int32_t name='grazer'/>
<int32_t name='petvalue_divisor'/>
<int32_t name='prone_to_rage'/>
<static-array type-name='int32_t' name='unk6' count='29'/>
</compound>
<static-array name='personality' count='30'>
<int16_t name='a'/>
<int16_t name='b'/>
<int16_t name='c'/>
</static-array>
<df-flagarray name='flags'/>
<int32_t name='unk7'/>
<stl-vector name='body_parts'>
<pointer type-name='body_part_raw'/>
</stl-vector>
<stl-vector name='attacks'>
<pointer/>
</stl-vector>
<compound name='unknown1'>
<int32_t name='unk8'/>
<stl-vector type-name='int16_t' name='unk9a'/>
<stl-vector type-name='int16_t' name='unk9b'/>
<stl-vector name='unk10'/>
<stl-vector name='unk11'/>
<stl-vector name='unk12'/>
<stl-vector type-name='int16_t' name='unk13'/>
<stl-vector type-name='int32_t' name='unk14'/>
</compound>
<static-array type-name='int32_t' name='unk15' count='4'/>
<stl-vector name='caste_speech_1'/>
<stl-vector name='caste_speech_2'/>
<static-array name='skill_rates' count='116'>
<static-array type-name='int32_t' count='4'/>
</static-array>
<compound name='attributes'>
<static-array name='phys_att_range' count='7'>
<static-array type-name='int32_t' count='6'/>
</static-array>
<static-array name='ment_att_range' count='7'>
<static-array type-name='int32_t' count='13'/>
</static-array>
<static-array name='phys_att_rates' count='4'>
<static-array type-name='int32_t' count='6'/>
</static-array>
<static-array name='ment_att_rates' count='4'>
<static-array type-name='int32_t' count='13'/>
</static-array>
<static-array type-name='int32_t' name='phys_att_cap_perc' count='6'/>
<static-array type-name='int32_t' name='ment_att_cap_perc' count='13'/>
</compound>
<int8_t name='gender'/>
<stl-vector type-name='int32_t' name='body_size_1'/>
<stl-vector type-name='int32_t' name='body_size_2'/>
<static-array name='unk16' count='19'>
<stl-vector/>
</static-array>
<static-array type-name='int32_t' name='unk17' count='2'/>
<stl-vector type-name='int16_t' name='natural_skill_id'/>
<stl-vector type-name='int32_t' name='natural_skill_exp'/>
<stl-vector type-name='int32_t' name='natural_skill_lvl'/>
<static-array name='caste_profession_name' count='106'>
<stl-string name='singular'/>
<stl-string name='plural'/>
</static-array>
<compound name='extracts'>
<stl-vector type-name='int16_t' name='extract_mat'/>
<stl-vector type-name='int32_t' name='extract_matidx'/>
<static-array name='extract_str' count='3'>
<stl-vector>
<pointer type-name='stl-string'/>
</stl-vector>
</static-array>
<int16_t name='milkable_mat'/>
<int32_t name='milkable_matidx'/>
<static-array name='milkable_str' count='3'>
<stl-string/>
</static-array>
<int16_t name='webber_mat'/>
<int32_t name='webber_matidx'/>
<static-array name='webber_str' count='3'>
<stl-string/>
</static-array>
<int16_t name='vermin_bite_mat'/>
<int32_t name='vermin_bite_matidx'/>
<int16_t name='vermin_bite_chance'/>
<static-array name='vermin_bite_str' count='3'>
<stl-string/>
</static-array>
<int16_t name='tendons_mat'/>
<int32_t name='tendons_matidx'/>
<static-array name='tendons_str' count='3'>
<stl-string/>
</static-array>
<int32_t name='tendons_heal'/>
<int16_t name='ligaments_mat'/>
<int32_t name='ligaments_matidx'/>
<static-array name='ligaments_str' count='3'>
<stl-string/>
</static-array>
<int32_t name='ligaments_heal'/>
<int16_t name='blood_state'/>
<int16_t name='blood_mat'/>
<int32_t name='blood_matidx'/>
<static-array name='blood_str' count='3'>
<stl-string/>
</static-array>
<int16_t name='pus_state'/>
<int16_t name='pus_mat'/>
<int32_t name='pus_matidx'/>
<static-array name='pus_str' count='3'>
<stl-string/>
</static-array>
<stl-vector type-name='int16_t' name='material_breath_attack_mattype'/>
<stl-vector type-name='int32_t' name='material_breath_attack_matindex'/>
<static-array name='material_breath_attack_str' count='3'>
<stl-vector>
<pointer type-name='stl-string'/>
</stl-vector>
</static-array>
<stl-vector type-name='int16_t' name='material_breath_attack_type'/>
<stl-vector type-name='int16_t' name='egg_material_mattype'/>
<stl-vector type-name='int32_t' name='egg_material_matindex'/>
<static-array name='egg_material_str' count='3'>
<stl-vector>
<pointer type-name='stl-string'/>
</stl-vector>
</static-array>
<stl-vector name='lays_unusual_eggs_itemtype'>
<enum base-type='int16_t' type-name='item_type'/>
</stl-vector>
<stl-vector name='lays_unusual_eggs_itemsubtype'/>
<stl-vector type-name='int16_t' name='lays_unusual_eggs_mattype'/>
<stl-vector type-name='int32_t' name='lays_unusual_eggs_matindex'/>
<static-array name='lays_unusual_eggs_str' count='5'>
<stl-vector>
<pointer type-name='stl-string'/>
</stl-vector>
</static-array>
</compound>
<stl-vector name='unk22'/>
<stl-vector name='creature_class'>
<pointer type-name='stl-string'/>
</stl-vector>
<compound name='unknown2'>
<stl-vector name='unk23a'/>
<stl-vector name='unk23b'/>
<stl-vector name='unk23c'/>
<df-flagarray name='unk24_flags'/>
<df-flagarray name='unk25_flags'/>
<static-array type-name='int32_t' name='unk26' count='33'/>
<static-array name='unk27' count='5'><stl-vector/></static-array>
<static-array type-name='int32_t' name='unk28' count='2'/>
</compound>
<static-array type-name='int32_t' name='habit_num' count='2'/>
<static-array name='habit' count='2'><stl-vector/></static-array>
<static-array name='lair' count='2'><stl-vector/></static-array>
<static-array name='lair_characteristic' count='2'><stl-vector/></static-array>
<static-array name='lair_hunter_speech' count='2'><stl-vector/></static-array>
<static-array name='unk29' count='2'><stl-vector/></static-array>
<static-array name='specific_food' count='2'><stl-vector/></static-array>
<static-array name='unk30' count='3'><stl-vector/></static-array>
</struct-type>
<struct-type type-name='creature_raw' key-field='creature_id'>
<stl-string name='creature_id'/>
<code-helper name='find-instance'>$global.world.raws.creatures.all[$]</code-helper>
<static-array type-name='stl-string' name='name' count='3'/>
<static-array type-name='stl-string' name='general_baby_name' count='2'/>
<static-array type-name='stl-string' name='general_child_name' count='2'/>
<uint8_t name='creature_tile'/>
<uint8_t name='creature_soldier_tile'/>
<uint8_t name='alttile'/>
<uint8_t name='soldier_alttile'/>
<uint8_t name='glowtile'/>
<int16_t name='unk1'/>
<int16_t name='unk2'/>
<int16_t name='frequency'/>
<static-array type-name='int16_t' name='population_number' count='2'/>
<static-array type-name='int16_t' name='cluster_number' count='2'/>
<static-array type-name='int16_t' name='triggerable_group' count='2'/>
<static-array type-name='int16_t' name='color' count='3'/>
<static-array type-name='int16_t' name='glowcolor' count='3'/>
<int32_t name='adultsize'/>
<stl-vector name='prefstring'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector type-name='int16_t' name='sphere'/>
<stl-vector name='caste'>
<pointer type-name='caste_raw'/>
</stl-vector>
<stl-vector type-name='int32_t' name='pop_ratio'/>
<df-flagarray name='flags' index-enum='creature_raw_flags'/>
<compound name='stuff'>
<static-array name='stuff1' count='2'>
<static-array type-name='int32_t' count='7'/>
</static-array>
<static-array name='stuff2a' count='7'>
<static-array type-name='int32_t' count='12'/>
</static-array>
<static-array name='stuff2b' count='7'>
<static-array type-name='int32_t' count='12'/>
</static-array>
<static-array type-name='int32_t' name='unk3' count='84'/>
<static-array name='stuff3a' count='7'>
<static-array type-name='int32_t' count='106'/>
</static-array>
<static-array name='stuff3b' count='7'>
<static-array type-name='int32_t' count='106'/>
</static-array>
<static-array type-name='int8_t' name='stuff4' count='7'/>
<static-array name='stuff2c' count='7'>
<static-array type-name='int8_t' count='12'/>
</static-array>
<static-array type-name='int8_t' name='unk4' count='42'/>
<static-array name='stuff3c' count='7'>
<static-array type-name='int8_t' count='106'/>
</static-array>
</compound>
<stl-vector name='unk5'/>
<stl-vector name='speech1'/>
<stl-vector name='speech2'/>
<stl-vector name='speech3'/>
<stl-vector name='material'>
<pointer type-name='material'/>
</stl-vector>
<stl-vector type-name='pointer' name='tissue'/>
<static-array name='profession_name' count='106'>
<stl-string name='singular'/>
<stl-string name='plural'/>
</static-array>
<pointer name='unk6pa'/>
<pointer name='unk6pb'/>
<stl-vector type-name='int32_t' name='unk6'/>
<stl-vector type-name='int32_t' name='unk7'/>
<stl-vector type-name='int32_t' name='hive_product_0'/>
<stl-vector type-name='int32_t' name='hive_product_1'/>
<stl-vector type-name='int16_t' name='hive_product_2'/>
<stl-vector type-name='int16_t' name='hive_product_3'/>
<stl-vector type-name='int16_t' name='hive_product_4'/>
<stl-vector type-name='int32_t' name='hive_product_5'/>
<static-array name='hive_product_tmpstr' count='5'>
<stl-vector>
<pointer type-name='stl-string'/>
</stl-vector>
</static-array>
<int32_t name='unk8'/>
<stl-vector name='raws'>
<pointer type-name='stl-string'/>
</stl-vector>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,129 +0,0 @@
<data-definition>
<enum-type type-name='d_init_nickname'>
<enum-item name='REPLACE_FIRST'/>
<enum-item name='CENTRALIZE'/>
<enum-item name='REPLACE_ALL'/>
</enum-type>
<enum-type type-name='d_init_z_view'>
<enum-item name='OFF'/>
<enum-item name='UNHIDDEN'/>
<enum-item name='CREATURE'/>
<enum-item name='ON'/>
</enum-type>
<enum-type type-name='d_init_idlers'>
<enum-item name='OFF' value='-1'/>
<enum-item name='TOP'/>
<enum-item name='BOTTOM'/>
</enum-type>
<enum-type type-name='d_init_tunnel'>
<enum-item name='NO'/>
<enum-item name='FINDER'/>
<enum-item name='ALWAYS'/>
</enum-type>
<enum-type type-name='d_init_flags1'>
<enum-item name='VARIED_GROUND_TILES'/>
<enum-item name='ENGRAVINGS_START_OBSCURED'/>
<enum-item name='SHOW_IMP_QUALITY'/>
<enum-item name='SHOW_FLOW_AMOUNTS'/>
</enum-type>
<enum-type type-name='d_init_flags2'>
<enum-item name='MORE'/>
<enum-item name='ADVENTURER_TRAPS'/>
<enum-item name='ADVENTURER_ALWAYS_CENTER'/>
</enum-type>
<enum-type type-name='d_init_flags3'>
<enum-item name='COFFIN_NO_PETS_DEFAULT'/>
</enum-type>
<enum-type type-name='d_init_flags4'>
<enum-item name='TEMPERATURE'/>
<enum-item name='WEATHER'/>
<enum-item name='ECONOMY'/>
<enum-item name='ZERO_RENT'/>
<enum-item name='AUTOSAVE_SEASONAL'/>
<enum-item name='AUTOSAVE_YEARLY'/>
<enum-item name='AUTOSAVE_PAUSE'/>
<enum-item name='AUTOBACKUP'/>
<enum-item name='INITIAL_SAVE'/>
<enum-item name='INVADERS'/>
<enum-item name='CAVEINS'/>
<enum-item name='ARTIFACTS'/>
<enum-item name='LOG_MAP_REJECTS'/>
<enum-item name='PAUSE_ON_LOAD'/>
<enum-item name='EMBARK_WARNING_ALWAYS'/>
<enum-item name='SHOW_ALL_HISTORY_IN_DWARF_MODE'/>
<enum-item name='TESTING_ARENA'/>
<enum-item name='WALKING_SPREADS_SPATTER_DWF'/>
<enum-item name='WALKING_SPREADS_SPATTER_ADV'/>
</enum-type>
<struct-type type-name='d_init'>
<df-flagarray name='flags1' index-enum='d_init_flags1'/>
<enum name="nickname_dwarf" type-name='d_init_nickname'/>
<enum name="nickname_adventure" type-name='d_init_nickname'/>
<enum name="nickname_legends" type-name='d_init_nickname'/>
<enum name="nickname_dwarf2" type-name='d_init_nickname'/>
<int32_t name="unk_18"/>
<int32_t name="unk_1c"/>
<uint8_t name='sky_tile'/>
<static-array name='sky_color' type-name='int16_t' count='3'/>
<uint8_t name='chasm_tile'/>
<uint8_t name='pillar_tile'/>
<static-array name='chasm_color' type-name='int16_t' count='3'/>
<compound name='wound_color'>
<static-array name='none' type-name='int16_t' count='3'/>
<static-array name='minor' type-name='int16_t' count='3'/>
<static-array name='inhibited' type-name='int16_t' count='3'/>
<static-array name='function_loss' type-name='int16_t' count='3'/>
<static-array name='broken' type-name='int16_t' count='3'/>
<static-array name='missing' type-name='int16_t' count='3'/>
</compound>
<enum name="idlers" base-type='int16_t' type-name='d_init_idlers'/>
<enum name="show_embark_tunnel" base-type='int16_t' type-name='d_init_tunnel'/>
<df-flagarray name='flags2' index-enum='d_init_flags2'/>
<int32_t name="display_length"/>
<enum name="adventurer_z_view" type-name='d_init_z_view'/>
<int32_t name="adventurer_z_view_size"/>
<df-flagarray name='flags3' index-enum='d_init_flags3'/>
<int32_t name="population_cap"/>
<int32_t name="baby_cap_absolute"/>
<int32_t name="baby_cap_percent"/>
<static-array name='path_cost' type-name='int32_t' count='4'/>
<static-array name='embark_rect' type-name='int16_t' count='2'/>
<compound name='store_dist'>
<int16_t name='item_decrease'/>
<int16_t name='seed_combine'/>
<int16_t name='bucket_combine'/>
<int16_t name='barrel_combine'/>
<int16_t name='bin_combine'/>
</compound>
<df-flagarray name='flags4' index-enum='d_init_flags4'/>
85266c0
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,246 +0,0 @@
<data-definition>
<struct-type type-name='historical_kills'>
-- Important
<stl-vector name="events">
<int32_t ref-target='history_event'/>
</stl-vector>
-- Misc
<stl-vector name="killed_race">
<int16_t ref-target='creature_raw'/>
</stl-vector>
<stl-vector name="killed_caste">
<int16_t ref-target='caste_raw' aux-value='$$._parent.killed_race[$._key]'/>
</stl-vector>
<stl-vector name="unk_30">
<int32_t comment='-1'/>
</stl-vector>
<stl-vector name="unk_40">
<int32_t comment='-1'/>
</stl-vector>
<stl-vector name="killed_site">
<int32_t ref-target='world_site'/>
</stl-vector>
<stl-vector name="killed_undead">
<bitfield base-type='uint16_t'>
<flag-bit name='skeletal'/>
<flag-bit name='zombie'/>
<flag-bit name='ghostly'/>
</bitfield>
</stl-vector>
<stl-vector name="killed_count" type-name='int32_t'/>
</struct-type>
<struct-type type-name='historical_figure_info'>
<pointer name="unk_0">
<stl-vector>
<int16_t/>
</stl-vector>
</pointer>
<pointer name="unk_4">
<stl-vector name="unk_0">
<int16_t/>
</stl-vector>
<stl-vector name="unk_10">
<int32_t/>
</stl-vector>
<stl-vector name="unk_20"/>
<stl-vector name="unk_30"/>
<stl-vector name="unk_40" type-name='int16_t'/>
<stl-vector name="unk_50" type-name='int16_t'/>
<int16_t name="unk_60"/>
</pointer>
<pointer name="unk_8">
<stl-vector>
<int16_t/>
</stl-vector>
</pointer>
<pointer name="unk_c">
<static-array name='unk_0' count='30' type-name='int16_t'/>
<stl-vector name="unk_3c">
<pointer>
<int16_t name='a'/>
<int16_t name='b'/>
</pointer>
</stl-vector>
<stl-vector name="unk_4c">
<int16_t/>
</stl-vector>
</pointer>
<pointer name="masterpieces">
<stl-vector name="events">
<int32_t ref-target='history_event'/>
</stl-vector>
<stl-vector name="events2" comment='ones that were stolen??..'>
<int32_t ref-target='history_event'/>
</stl-vector>
</pointer>
<pointer name="unk_14">
<int16_t name="unk_0"/>
<int32_t name="site" ref-target='world_site'/>
<int32_t name="unk_8"/>
<int32_t name="unk_c"/>
<int16_t name="unk_10"/>
<int16_t name="unk_12"/>
</pointer>
<pointer name="kills" type-name='historical_kills'/>
<pointer name="wounds">
<stl-vector name="events">
<int32_t ref-target='history_event'/>
</stl-vector>
<stl-bit-vector name="status">
<code-helper name='index-refers-to'>
(let* ((info $$._parent._parent._parent)
(figure $info._parent._parent)
(caste (find-instance $caste_raw $figure.caste $figure.race)))
$caste.body_parts[$])
</code-helper>
</stl-bit-vector>
</pointer>
</struct-type>
<struct-type type-name='historical_figure' instance-vector='$global.world.history.figures' key-field='id'>
<enum base-type='int16_t' name='profession' type-name='profession'/>
<int16_t name='race' ref-target='creature_raw'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int8_t name='sex'/>
<int32_t name='appeared_year'/>
<int32_t name='born_year'/>
<int32_t name='born_seconds'/>
<int32_t name='old_year'/>
<int32_t name='old_seconds'/>
<int32_t name='died_year'/>
<int32_t name='died_seconds'/>
<compound type-name='language_name' name='name'/>
<code-helper name='describe'>
(describe-obj $.name)
(awhen (find-creature $.race)
(fmt "~:(~A ~A~)" $it.caste[$.caste].caste_id $it.creature_id))
</code-helper>
<int32_t name='civ_id' ref-target='historical_entity'/>
<int32_t name='population_id' ref-target='entity_population'/>
<df-flagarray name='flags'/>
<int32_t name='unit_id' ref-target='unit'/>
<int32_t name='id'/>
<int32_t name='unk4'/>
<stl-vector name='entity_links'/>
<stl-vector name='site_links'/>
<stl-vector name='histfig_links'/>
<pointer name='info' type-name='historical_figure_info'/>
<compound name='worldgen'>
<pointer name="unk_0" type-name="world_site"/>
<pointer name="unk_4" type-name="language_name"/>
<pointer name="unk_8" type-name="world_underground_region"/>
<pointer name="unk_c">
<pointer name="unk_0" type-name='uint8_t' is-array='true'/>
<int16_t name="unk_4"/>
<pointer name="unk_8" type-name='int16_t' is-array='true'/>
<int16_t name="unk_c"/>
</pointer>
<int32_t name="unk_10"/>
</compound>
</struct-type>
<class-type type-name='history_event' original-name='history_eventst'
instance-vector='$global.world.history.events' key-field='id'>
<int32_t name='year'/>
<int32_t name='seconds'/>
<df-flagarray name='flags'/>
<int32_t name='id'/>
</class-type>
<class-type type-name='history_event_masterpiece_createdst' inherits-from='history_event'>
<int32_t name='maker' ref-target='historical_figure'/>
<int32_t name='maker_entity' ref-target='historical_entity'/>
<int32_t name='site' ref-target='world_site'/>
</class-type>
<class-type type-name='history_event_masterpiece_created_itemst'
inherits-from='history_event_masterpiece_createdst'>
<enum base-type='int32_t' name='skill_used' type-name='job_skill'/>
<enum base-type='int16_t' name='item_type' type-name='item_type'/>
<int16_t name='item_subtype' refers-to='(item-subtype-target $$._parent.item_type $)'/>
<int16_t name='mat_type' ref-target='material' aux-value='$$.mat_index'/>
<int16_t name='mat_index'/>
<int32_t name='item_id' ref-target='item'/>
</class-type>
<class-type type-name='history_event_masterpiece_created_foodst'
inherits-from='history_event_masterpiece_createdst'>
<int32_t name='unk1'/>
<int16_t name='item_subtype' refers-to='$global.world.raws.itemdefs.food[$]'/>
<int32_t name='item_id' ref-target='item'/>
</class-type>
<struct-type type-name='world_history'>
dtor 8532fa0
<stl-vector name='events'>
<pointer type-name='history_event'/>
</stl-vector>
<stl-vector name='events2'>
<pointer type-name='history_event'/>
</stl-vector>
<stl-vector name='figures'>
<pointer type-name='historical_figure'/>
</stl-vector>
<static-array name='other_events' count='9'>
<stl-vector>
<pointer type-name='history_event'/>
</stl-vector>
</static-array>
<stl-vector name='ages'>
<pointer/>
</stl-vector>
<stl-vector name='unk1' type-name='int32_t'/>
<stl-vector name='unk2' type-name='int16_t'/>
<int32_t/>
<int32_t/>
<int32_t/>
<int32_t/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<bool/>
<stl-vector/>
<int32_t/>
<int32_t/>
<int32_t/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,138 +0,0 @@
<data-definition>
-- init.h
<enum-type type-name='init_display_flags'>
<enum-item name='USE_GRAPHICS'/>
<enum-item name='BLACK_SPACE'/>
<enum-item name='PARTIAL_PRINT'/>
<enum-item name='FRAME_BUFFER'/>
<enum-item name='SINGLE_BUFFER'/>
<enum-item name='ACCUM_BUFFER'/>
<enum-item name='VBO'/>
<enum-item name='RENDER_2D'/>
<enum-item name='RENDER_2DHW'/>
<enum-item name='RENDER_2DASYNC'/>
<enum-item name='UNUSED_01_08'/>
<enum-item name='TEXT'/>
<enum-item name='SHADER'/>
<enum-item name='NOT_RESIZABLE'/>
<enum-item name='ARB_SYNC'/>
</enum-type>
<struct-type type-name='init_display'>
<df-flagarray name='flag' index-enum='init_display_flags'/>
<enum name='windowed'>
<enum-item name='True'/>
<enum-item name='False'/>
<enum-item name='Prompt'/>
</enum>
<int32_t name='grid_x'/>
<int32_t name='grid_y'/>
<int32_t name='desired_fullscreen_width'/>
<int32_t name='desired_fullscreen_height'/>
<int32_t name='desired_windowed_width'/>
<int32_t name='desired_windowed_height'/>
<int8_t name='partial_print_count'/>
</struct-type>
<enum-type type-name='init_media_flags'>
<enum-item name='SOUND_OFF'/>
<enum-item name='INTRO_OFF'/>
<enum-item name='COMPRESS_SAVES'/>
</enum-type>
<struct-type type-name='init_media'>
<df-flagarray name='flag' index-enum='init_media_flags'/>
<int32_t name='volume'/>
</struct-type>
<enum-type type-name='init_input_flags'>
<enum-item name='MOUSE_OFF'/>
<enum-item name='MOUSE_PICTURE'/>
</enum-type>
<struct-type type-name='init_input'>
<int32_t name='hold_time'/>
<int32_t name='repeat_time'/>
<int32_t name='macro_time'/>
<int32_t name='pause_zoom_no_interface_ms'/>
<df-flagarray name='flag' index-enum='init_input_flags'/>
<int32_t name='zoom_speed'/>
<int32_t name='repeat_accel_start'/>
<int32_t name='repeat_accel_limit'/>
</struct-type>
<struct-type type-name='init_font'>
<static-array name='small_font_texpos' type-name='int32_t' count='256'/>
<static-array name='large_font_texpos' type-name='int32_t' count='256'/>
<static-array name='small_font_datapos' type-name='int32_t' count='256'/>
<static-array name='large_font_datapos' type-name='int32_t' count='256'/>
<s-float name='small_font_adjx'/>
<s-float name='small_font_adjy'/>
<s-float name='large_font_adjx'/>
<s-float name='large_font_adjy'/>
<int32_t name='small_font_dispx'/>
<int32_t name='small_font_dispy'/>
<int32_t name='large_font_dispx'/>
<int32_t name='large_font_dispy'/>
<bool name='use_ttf'/>
</struct-type>
<enum-type type-name='init_window_flags'>
<enum-item name='TOPMOST'/>
<enum-item name='VSYNC_ON'/>
<enum-item name='VSYNC_OFF'/>
<enum-item name='TEXTURE_LINEAR'/>
</enum-type>
<struct-type type-name='init_window'>
<df-flagarray name='flag' index-enum='init_window_flags'/>
</struct-type>
<struct-type type-name='init'>
<compound name='display' type-name='init_display'/>
<compound name='media' type-name='init_media'/>
<compound name='input' type-name='init_input'/>
<compound name='font' type-name='init_font'/>
<compound name='window' type-name='init_window'/>
</struct-type>
-- texture_handler.h
<struct-type type-name='tile_page'>
<stl-string name='token'/>
<stl-string name='filename'/>
<int16_t name='tile_dim_x'/>
<int16_t name='tile_dim_y'/>
<int16_t name='page_dim_x'/>
<int16_t name='page_dim_y'/>
<stl-vector name='texpos' type-name='int32_t'/>
<stl-vector name='datapos' type-name='int32_t'/>
<stl-vector name='texpos_gs' type-name='int32_t'/>
<stl-vector name='datapos_gs' type-name='int32_t'/>
<bool name='loaded'/>
</struct-type>
<struct-type type-name='texture_handler'>
<stl-vector name='page'>
<pointer type-name='tile_page'/>
</stl-vector>
<stl-vector name='texpos' type-name='int32_t'/>
<stl-vector name='datapos' type-name='int32_t'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,374 +0,0 @@
<data-definition>
<enum-type type-name='item_type'>
<enum-item name='BAR' comment='Bars, such as metal, fuel, or soap.'/>
<enum-item name='SMALLGEM' comment='Cut gemstones usable in jewelers workshop'/>
<enum-item name='BLOCKS' comment='Blocks of any kind.'/>
<enum-item name='ROUGH' comment='Rough gemstones.'/>
<enum-item name='BOULDER' comment='Raw mined stone.'/>
<enum-item name='WOOD' comment='Wooden logs.'/>
<enum-item name='DOOR' comment='Doors.'/>
<enum-item name='FLOODGATE' comment='Floodgates.'/>
<enum-item name='BED' comment='Beds.'/>
<enum-item name='CHAIR' comment='Chairs and thrones.'/>
<enum-item name='CHAIN' comment='Restraints.'/>
<enum-item name='FLASK' comment='Flasks.'/>
<enum-item name='GOBLET' comment='Goblets.'/>
<enum-item name='INSTRUMENT' comment='Musical instruments.'/>
<enum-item name='TOY' comment='Toys.'/>
<enum-item name='WINDOW' comment='Glass windows.'/>
<enum-item name='CAGE' comment='Cages.'/>
<enum-item name='BARREL' comment='Barrels.'/>
<enum-item name='BUCKET' comment='Buckets.'/>
<enum-item name='ANIMALTRAP' comment='Animal traps.'/>
<enum-item name='TABLE' comment='Tables.'/>
<enum-item name='COFFIN' comment='Coffins.'/>
<enum-item name='STATUE' comment='Statues.'/>
<enum-item name='CORPSE' comment='Corpses. Does not have a material.'/>
<enum-item name='WEAPON' comment='Weapons.'/>
<enum-item name='ARMOR' comment='Armor and clothing worn on the upper body.'/>
<enum-item name='SHOES' comment='Armor and clothing worn on the feet.'/>
<enum-item name='SHIELD' comment='Shields and bucklers.'/>
<enum-item name='HELM' comment='Armor and clothing worn on the head.'/>
<enum-item name='GLOVES' comment='Armor and clothing worn on the hands.'/>
<enum-item name='BOX' comment='Chests (wood), coffers (stone), boxes (glass), and bags (cloth or leather).'/>
<enum-item name='BIN' comment='Bins.'/>
<enum-item name='ARMORSTAND' comment='Armor stands.'/>
<enum-item name='WEAPONRACK' comment='Weapon racks.'/>
<enum-item name='CABINET' comment='Cabinets.'/>
<enum-item name='FIGURINE' comment='Figurines.'/>
<enum-item name='AMULET' comment='Amulets.'/>
<enum-item name='SCEPTER' comment='Scepters.'/>
<enum-item name='AMMO' comment='Ammunition for hand-held weapons.'/>
<enum-item name='CROWN' comment='Crowns.'/>
<enum-item name='RING' comment='Rings.'/>
<enum-item name='EARRING' comment='Earrings.'/>
<enum-item name='BRACELET' comment='Bracelets.'/>
<enum-item name='GEM' comment='Large gems.'/>
<enum-item name='ANVIL' comment='Anvils.'/>
<enum-item name='CORPSEPIECE' comment='Body parts. Does not have a material.'/>
<enum-item name='REMAINS' comment='Dead vermin bodies. Material is CREATURE_ID:CASTE.'/>
<enum-item name='MEAT' comment='Butchered meat.'/>
<enum-item name='FISH' comment='Prepared fish. Material is CREATURE_ID:CASTE.'/>
<enum-item name='FISH_RAW' comment='Unprepared fish. Material is CREATURE_ID:CASTE.'/>
<enum-item name='VERMIN' comment='Live vermin. Material is CREATURE_ID:CASTE.'/>
<enum-item name='PET' comment='Tame vermin. Material is CREATURE_ID:CASTE.'/>
<enum-item name='SEEDS' comment='Seeds from plants.'/>
<enum-item name='PLANT' comment='Plants.'/>
<enum-item name='SKIN_TANNED' comment='Tanned skins.'/>
<enum-item name='LEAVES' comment='Leaves, usually from quarry bushes.'/>
<enum-item name='THREAD' comment='Thread gathered from webs or made at the farmers workshop.'/>
<enum-item name='CLOTH' comment='Cloth made at the loom.'/>
<enum-item name='TOTEM' comment='Skull totems.'/>
<enum-item name='PANTS' comment='Armor and clothing worn on the legs.'/>
<enum-item name='BACKPACK' comment='Backpacks.'/>
<enum-item name='QUIVER' comment='Quivers.'/>
<enum-item name='CATAPULTPARTS' comment='Catapult parts.'/>
<enum-item name='BALLISTAPARTS' comment='Ballista parts.'/>
<enum-item name='SIEGEAMMO' comment='Siege engine ammunition.'/>
<enum-item name='BALLISTAARROWHEAD' comment='Ballista arrow heads.'/>
<enum-item name='TRAPPARTS' comment='Mechanisms.'/>
<enum-item name='TRAPCOMP' comment='Trap components.'/>
<enum-item name='DRINK' comment='Alcoholic drinks.'/>
<enum-item name='POWDER_MISC' comment='Powders such as flour, gypsum plaster, dye, or sand.'/>
<enum-item name='CHEESE' comment='Pieces of cheese.'/>
<enum-item name='FOOD' comment='Prepared meals. Subtypes come from item_food.txt'/>
<enum-item name='LIQUID_MISC' comment='Liquids such as water, lye, and extracts.'/>
<enum-item name='COIN' comment='Coins.'/>
<enum-item name='GLOB' comment='Fat, tallow, pastes/pressed objects, and small bits of molten rock/metal.'/>
<enum-item name='ROCK' comment='Small rocks (usually sharpened and/or thrown in adventurer mode)'/>
<enum-item name='PIPE_SECTION' comment='Pipe sections.'/>
<enum-item name='HATCH_COVER' comment='Hatch covers.'/>
<enum-item name='GRATE' comment='Grates.'/>
<enum-item name='QUERN' comment='Querns.'/>
<enum-item name='MILLSTONE' comment='Millstones.'/>
<enum-item name='SPLINT' comment='Splints.'/>
<enum-item name='CRUTCH' comment='Crutches.'/>
<enum-item name='TRACTION_BENCH' comment='Traction benches.'/>
<enum-item name='ORTHOPEDIC_CAST' comment='Casts'/>
<enum-item name='TOOL' comment='Tools.'/>
<enum-item name='SLAB' comment='Slabs.'/>
<enum-item name='EGGS' comment='Eggs. Material is CREATURE_ID:CASTE.'/>
</enum-type>
<class-type type-name='itemdef' original-name='itemdefst' key-field='id'>
<stl-string name="id"/>
<int16_t name="subtype"/>
</class-type>
<enum-type type-name='ammo_flags'>
<enum-item name='HAS_EDGE_ATTACK'/>
</enum-type>
<class-type type-name='itemdef_ammost' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-string name="ammo_class"/>
<df-flagarray name='flags' index-enum='ammo_flags'/>
<int32_t name="size" comment='divided by 10'/>
<int32_t name="unk_84"/>
<stl-vector name="attacks">
<pointer/>
</stl-vector>
</class-type>
<enum-type type-name='armor_general_flags'>
<enum-item name='SOFT'/>
<enum-item name='HARD'/>
<enum-item name='METAL'/>
<enum-item name='BARRED'/>
<enum-item name='SCALED'/>
<enum-item name='LEATHER'/>
<enum-item name='SHAPED'/>
<enum-item name='CHAIN_METAL_TEXT'/>
<enum-item name='STRUCTURAL_ELASTICITY_WOVEN_THREAD'/>
<enum-item name='STRUCTURAL_ELASTICITY_CHAIN_METAL'/>
<enum-item name='STRUCTURAL_ELASTICITY_CHAIN_ALL'/>
</enum-type>
<struct-type type-name='armor_properties'>
<df-flagarray name='flags' index-enum='armor_general_flags'/>
<int32_t name="layer"/>
<int16_t name="layer_size"/>
<int16_t name="layer_permit"/>
<int16_t name="coverage"/>
</struct-type>
<enum-type type-name='armor_flags'>
<enum-item name='METAL_ARMOR_LEVELS'/>
</enum-type>
<class-type type-name='itemdef_armorst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-string name="name_preplural"/>
<stl-string name="material_placeholder"/>
<int32_t name="value"/>
<int8_t name="armorlevel"/>
<int16_t name="ubstep"/>
<int16_t name="lbstep"/>
<int32_t name="material_size"/>
<compound name='props' type-name='armor_properties'/>
<df-flagarray name='flags' index-enum='armor_flags'/>
</class-type>
<class-type type-name='itemdef_foodst' inherits-from='itemdef'>
<stl-string name="name"/>
<int16_t name="level"/>
</class-type>
<enum-type type-name='gloves_flags'>
<enum-item name='METAL_ARMOR_LEVELS'/>
</enum-type>
<class-type type-name='itemdef_glovesst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<int32_t name="value"/>
<int8_t name='armorlevel'/>
<int16_t name="ubstep"/>
<df-flagarray name='flags' index-enum='gloves_flags'/>
<int32_t name="material_size"/>
<compound name='props' type-name='armor_properties'/>
</class-type>
<enum-type type-name='helm_flags'>
<enum-item name='METAL_ARMOR_LEVELS'/>
</enum-type>
<class-type type-name='itemdef_helmst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<int32_t name="value"/>
<int8_t name='armorlevel'/>
<df-flagarray name='flags' index-enum='helm_flags'/>
<int32_t name="material_size"/>
<compound name='props' type-name='armor_properties'/>
</class-type>
<enum-type type-name='instrument_flags'>
<enum-item name='HARD_MAT'/>
</enum-type>
<class-type type-name='itemdef_instrumentst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<df-flagarray name='flags' index-enum='instrument_flags'/>
</class-type>
<enum-type type-name='pants_flags'>
<enum-item name='METAL_ARMOR_LEVELS'/>
</enum-type>
<class-type type-name='itemdef_pantsst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-string name="name_preplural"/>
<stl-string name="material_placeholder"/>
<int32_t name="value"/>
<int8_t name="armorlevel"/>
<df-flagarray name='flags' index-enum='pants_flags'/>
<int32_t name="material_size"/>
<int16_t name="lbstep"/>
<compound name='props' type-name='armor_properties'/>
</class-type>
<class-type type-name='itemdef_shieldst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<int32_t name="value"/>
<int32_t name="blockchance"/>
<int8_t name='armorlevel'/>
<int16_t name="ubstep"/>
<int32_t name="material_size"/>
</class-type>
<enum-type type-name='shoes_flags'>
<enum-item name='METAL_ARMOR_LEVELS'/>
</enum-type>
<class-type type-name='itemdef_shoesst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<int32_t name="value"/>
<int8_t name='armorlevel'/>
<int16_t name="ubstep"/>
<df-flagarray name='flags' index-enum='shoes_flags'/>
<int32_t name="material_size"/>
<compound name='props' type-name='armor_properties'/>
</class-type>
<class-type type-name='itemdef_siegeammost' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-string name="ammo_class"/>
</class-type>
<enum-type type-name='tool_flags'>
<enum-item name='HARD_MAT'/>
<enum-item name='METAL_MAT'/>
<enum-item name='HAS_EDGE_ATTACK'/>
<enum-item name='METAL_WEAPON_MAT'/>
<enum-item name='UNIMPROVABLE'/>
</enum-type>
<enum-type type-name='tool_uses'>
<enum-item name='LIQUID_COOKING'/>
<enum-item name='LIQUID_SCOOP'/>
<enum-item name='GRIND_POWDER_RECEPTACLE'/>
<enum-item name='GRIND_POWDER_GRINDER'/>
<enum-item name='MEAT_CARVING'/>
<enum-item name='MEAT_BONING'/>
<enum-item name='MEAT_SLICING'/>
<enum-item name='MEAT_CLEAVING'/>
<enum-item name='HOLD_MEAT_FOR_CARVING'/>
<enum-item name='MEAL_CONTAINER'/>
<enum-item name='LIQUID_CONTAINER'/>
<enum-item name='FOOD_STORAGE'/>
<enum-item name='HIVE'/>
<enum-item name='NEST_BOX'/>
</enum-type>
<class-type type-name='itemdef_toolst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<df-flagarray name='flags' index-enum='tool_flags'/>
<int32_t name="value"/>
<uint8_t name="tile"/>
<stl-vector name="tool_use">
<enum base-type='int16_t' type-name='tool_uses'/>
</stl-vector>
<stl-string name="adjective"/>
<int32_t name="size"/>
<int16_t name="skill_melee"/>
<int16_t name="skill_ranged"/>
<stl-string name="ranged_ammo"/>
<int32_t name="two_handed"/>
<int32_t name="minimum_size"/>
<int32_t name="material_size"/>
<stl-vector name="attacks"/>
<int32_t name="shoot_force"/>
<int32_t name="shoot_maxvel"/>
<int32_t name="container_capacity"/>
</class-type>
<enum-type type-name='toy_flags'>
<enum-item name='HARD_MAT'/>
</enum-type>
<class-type type-name='itemdef_toyst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<df-flagarray name='flags' index-enum='toy_flags'/>
</class-type>
<enum-type type-name='trapcomp_flags'>
<enum-item name='IS_SCREW'/>
<enum-item name='IS_SPIKE'/>
<enum-item name='WOOD'/>
<enum-item name='METAL'/>
<enum-item name='HAS_EDGE_ATTACK'/>
</enum-type>
<class-type type-name='itemdef_trapcompst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-string name="adjective"/>
<int32_t name="size"/>
<int32_t name="unk_7c"/>
<int32_t name="hits"/>
<int32_t name="material_size"/>
<df-flagarray name='flags' index-enum='trapcomp_flags'/>
<stl-vector name="attacks">
<pointer/>
</stl-vector>
</class-type>
<enum-type type-name='weapon_flags'>
<enum-item name='CAN_STONE'/>
<enum-item name='HAS_EDGE_ATTACK'/>
<enum-item name='TRAINING'/>
</enum-type>
<class-type type-name='itemdef_weaponst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-string name="adjective"/>
<int32_t name="size"/>
<int32_t name="unk_7c"/>
<int16_t name="skill_melee"/>
<int16_t name="skill_ranged"/>
<stl-string name="ranged_ammo"/>
<int32_t name="two_handed"/>
<int32_t name="minimum_size"/>
<int32_t name="material_size"/>
<df-flagarray name='flags' index-enum='weapon_flags'/>
<stl-vector name="attacks">
<pointer/>
</stl-vector>
<int32_t name="shoot_force"/>
<int32_t name="shoot_maxvel"/>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,894 +0,0 @@
<data-definition>
-- MISC TYPES
<bitfield-type type-name='item_flags'>
<flag-bit name='on_ground' comment='Item on ground'/>
<flag-bit name='in_job' comment='Item currently being used in a job'/>
<flag-bit name='hostile' comment='Item owned by hostile'/>
<flag-bit name='in_inventory' comment='Item in a creature or workshop inventory'/>
<flag-bit name='unk1' comment='unknown, lost (artifact)?, unusable, unseen'/>
<flag-bit name='in_building' comment='Part of a building (including mechanisms, bodies in coffins)'/>
<flag-bit name='unk2' comment='unknown, unseen'/>
<flag-bit name='dead_dwarf' comment='Dwarfs dead body or body part'/>
<flag-bit name='rotten' comment='Rotten food'/>
<flag-bit name='spider_web' comment='Thread in spider web'/>
<flag-bit name='construction' comment='Material used in construction'/>
<flag-bit name='unk3' comment='unknown, unseen, unusable'/>
<flag-bit name='unk4' comment='unknown, unseen'/>
<flag-bit name='murder' comment='Implies murder - used in fell moods'/>
<flag-bit name='foreign' comment='Item is imported'/>
<flag-bit name='trader' comment='Item ownwed by trader'/>
<flag-bit name='owned' comment='Item is owned by a dwarf'/>
<flag-bit name='garbage_colect' comment='Marked for deallocation by DF it seems'/>
<flag-bit name='artifact1' comment='Artifact ?'/>
<flag-bit name='forbid' comment='Forbidden item'/>
<flag-bit name='unk6' comment='unknown, unseen'/>
<flag-bit name='dump' comment='Designated for dumping'/>
<flag-bit name='on_fire' comment='Indicates if item is on fire, Will Set Item On Fire if Set!'/>
<flag-bit name='melt' comment='Designated for melting, if applicable'/>
<flag-bit name='hidden' comment='Hidden item'/>
<flag-bit name='in_chest' comment='Stored in chest/part of well?'/>
<flag-bit name='unk7' comment='unknown, unseen'/>
<flag-bit name='artifact2' comment='Artifact ?'/>
<flag-bit name='unk8' comment='unknown, unseen, common'/>
<flag-bit name='weight_computed'/>
<flag-bit name='unk10' comment='unknown, unseen'/>
<flag-bit name='unk11' comment='unknown, unseen'/>
</bitfield-type>
<struct-type type-name='contaminant'>
<int16_t name='mat_type' ref-target='material' aux-value='$$.mat_index'/>
<int32_t name='mat_index'/>
<int16_t name='mat_state' comment='enum or document in text'/>
<uint16_t name='temperature'/>
<uint16_t name='temperature_fraction'/>
<int32_t name='size' comment='1-24=spatter, 25-49=smear, 50-* = coating'/>
<int16_t name='unk' comment='-1'/>
<int16_t name='id'/>
</struct-type>
<enum-type type-name='item_quality'>
<enum-item name='Ordinary'/>
<enum-item name='WellCrafted'/>
<enum-item name='FinelyCrafted'/>
<enum-item name='Superior'/>
<enum-item name='Exceptional'/>
<enum-item name='Masterful'/>
<enum-item name='Artifact'/>
</enum-type>
-- CORE ITEM
<class-type type-name='item' original-name='itemst'
instance-vector='$global.world.items.all' key-field='id'>
<int16_t name='x'/>
<int16_t name='y'/>
<int16_t name='z'/>
<compound name='flags' type-name='item_flags'/>
<uint32_t name='age'/>
<uint32_t name='id'/>
<stl-vector name='jobs'>
<pointer>
<int32_t name='unk1'/>
<pointer name='job' type-name='job'/>
<int32_t name='unk2'/>
</pointer>
</stl-vector>
<stl-vector name='itemrefs'>
<pointer type-name='general_ref'/>
</stl-vector>
<compound name='temp'>
<int16_t name='unk1'/>
<int16_t name='unk2'/>
<int16_t name='unk3'/>
<int16_t name='unk4'/>
<int16_t name='unk5'/>
<int16_t name='spec_heat'/>
<int16_t name='ignite_point'/>
<int16_t name='heatdam_point'/>
<int16_t name='colddam_point'/>
<int16_t name='boiling_point'/>
<int16_t name='melting_point'/>
<int16_t name='fixed_temp'/>
</compound>
<int32_t name='weight' comment='if flags.weight_computed'/>
<int32_t name='weight_fraction' comment='1e-6'/>
<virtual-methods>
<vmethod ret-type='item_type' name='getType'/>
<vmethod ret-type='int16_t' name='getSubtype'/>
<vmethod ret-type='int16_t' name='getMaterial'/>
<vmethod ret-type='int32_t' name='getMaterialIndex'/>
<vmethod name='setSubtype'> <int16_t/> </vmethod>
<vmethod name='setMaterial'> <int16_t/> </vmethod>
<vmethod name='setMaterialIndex'> <int32_t/> </vmethod>
<vmethod ret-type='int16_t' name='getActualMaterial'
comment='returns an actual material type, never a race'/>
<vmethod ret-type='int32_t' name='getActualMaterialIndex'
comment='returns an actual material index, never a caste'/>
<vmethod ret-type='int16_t' name='getRace'
comment='only if the object is made of a "specific creature mat"'/>
-- 10
<vmethod ret-type='int16_t' name='getCaste'
comment='only if the object is made of a "specific creature mat"'/>
<vmethod ret-type='int16_t' name='getPlantID'
comment='only if the object is made of a plant material'/>
<vmethod ret-type='int32_t' name='getTotalDimension'/>
<vmethod name='setDimension'> <int32_t name='amount'/> </vmethod>
<vmethod ret-type='bool' name='subtractDimension'> <int32_t name='amount'/> </vmethod>
<vmethod ret-type='bool' name='isFoodStorage'/>
<vmethod name='getStockpile'>
<ret-type><pointer type-name='item_stockpile_ref'/></ret-type>
</vmethod>
<vmethod ret-type='bool' name='containsPlaster'/>
<vmethod ret-type='bool' name='isPlaster'/>
<vmethod ret-type='bool' name='getColorOverride'> <pointer/> </vmethod>
-- 20
<vmethod name='getHistoryInfo'>
<ret-type><pointer><pointer type-name='item_history_info'/></pointer></ret-type>
</vmethod>
<vmethod ret-type='bool' name='hasToolUse'> <int16_t/> </vmethod>
<vmethod name='becomePaste'/>
<vmethod name='becomePressed'/>
<vmethod name='calculateWeight'/>
<vmethod ret-type='bool' name='isSharpStone'/>
<vmethod ret-type='bool' name='isCrystalGlassable'/>
<vmethod ret-type='bool' name='isMetalOre'> <int16_t name='matIndex'/> </vmethod>
<vmethod/>
<vmethod/>
-- 30
<vmethod ret-type='uint16_t' name='getSpecHeat'/>
<vmethod ret-type='uint16_t' name='getIgnitePoint'/>
<vmethod ret-type='uint16_t' name='getHeatdamPoint'/>
<vmethod ret-type='uint16_t' name='getColddamPoint'/>
<vmethod ret-type='uint16_t' name='getBoilingPoint'/>
<vmethod ret-type='uint16_t' name='getMeltingPoint'/>
<vmethod ret-type='uint16_t' name='getFixedTemp'/>
<vmethod ret-type='int32_t' name='getSolidDensity'/>
<vmethod ret-type='bool' name='materialRots'/>
<vmethod ret-type='uint16_t' name='getTemperature'/>
-- 40
<vmethod ret-type='bool' name='adjustTemperature'>
<uint16_t name='target'/>
<int32_t name='unk'/>
</vmethod>
<vmethod/>
<vmethod name='extinguish'/>
<vmethod ret-type='int8_t' name='getGloveHandedness'/>
<vmethod name='setGloveHandedness'> <int8_t/> </vmethod>
<vmethod ret-type='bool' name='isSpike'/>
<vmethod ret-type='bool' name='isScrew'/>
<vmethod ret-type='bool' name='isBuildMat'/>
<vmethod ret-type='bool' name='isTemperatureSafe'> <int8_t comment='1 fire, 2 magma'/> </vmethod>
<vmethod name='setRandSubtype'> <pointer/> </vmethod>
-- 50
<vmethod/>
<vmethod ret-type='int16_t' name='getWear'/>
<vmethod name='setWear'> <int16_t/> </vmethod>
<vmethod ret-type='int32_t' name='getMaker'/>
<vmethod name='setMaker'> <int32_t name='unit_id'/> </vmethod>
<vmethod/>
<vmethod/>
<vmethod name='getGloveFlags'>
<ret-type><pointer><df-flagarray/></pointer></ret-type>
</vmethod>
<vmethod name='getItemShapeDesc' comment='a statue/figurine of "string goes here"'>
<ret-type><pointer type-name='stl-string'/></ret-type>
</vmethod>
<vmethod ret-type='bool' name='isMatchingAmmoItem'> <pointer type-name='item_filter_spec'/> </vmethod>
-- 60
<vmethod/>
<vmethod name='setSeedsUnk84'> <int32_t/> </vmethod>
<vmethod ret-type='int16_t' name='getCorpseUnk17c'/>
<vmethod name='ageItem'><int32_t name='amount'/></vmethod>
<vmethod ret-type='int32_t' name='getCritterUnk80'/>
<vmethod name='setCritterUnk80'> <int32_t/> </vmethod>
<vmethod name='incrementCritterUnk80'/>
<vmethod ret-type='int32_t' name='getRotTimer'/>
<vmethod name='setRotTimer'> <int32_t name='val'/> </vmethod>
<vmethod name='incrementRotTimer'/>
-- 70
<vmethod ret-type='bool' name='isBogeymanCorpse'/>
<vmethod/>
<vmethod name='getAmmoType'>
<ret-type><pointer type-name='stl-string'/></ret-type>
<pointer type-name='stl-string'/>
</vmethod>
<vmethod/>
<vmethod ret-type='bool' name='isLiquid'/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod ret-type='bool' name='isArmorNotClothing'/>
<vmethod ret-type='bool' name='isMillable'/>
-- 80
<vmethod ret-type='bool' name='isProcessableThread'/>
<vmethod ret-type='bool' name='isProcessableVial'/>
<vmethod ret-type='bool' name='isProcessableBag'/>
<vmethod ret-type='bool' name='isProcessableBarrel'/>
<vmethod ret-type='bool' name='isEdiblePlant'/>
<vmethod ret-type='bool' name='isEdibleRaw'> <int32_t name='hunger'/> </vmethod>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
-- 90
<vmethod/>
<vmethod ret-type='bool' name='isPressed'/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
-- 100
<vmethod/>
<vmethod/>
<vmethod ret-type='bool' name='needTwoHandedWield'> <int32_t/> </vmethod>
<vmethod name='splitStack'>
<ret-type><pointer type-name='item'/></ret-type>
<int32_t/>
<int32_t/>
</vmethod>
<vmethod ret-type='bool' name='isTameableVermin'/>
<vmethod ret-type='bool' name='isDistillable'>
<bool name='checkKitchenSettings'/>
</vmethod>
<vmethod ret-type='bool' name='isDye'/>
<vmethod/>
<vmethod ret-type='bool' name='isSandBearing'/>
<vmethod ret-type='bool' name='isLyeBearing'/>
-- 110
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
-- 120
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod name='write_file'> <pointer comment='file_compressorst'/> </vmethod>
<vmethod name='read_file'>
<pointer comment='file_compressorst'/>
<int32_t name='loadversion'/>
</vmethod>
<vmethod name='getWeaponAttacks'>
<ret-type><pointer><stl-vector type-name='pointer'/></pointer></ret-type>
</vmethod>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
-- 130
<vmethod/>
<vmethod ret-type='bool' name='isBag' comment='BOX made of cloth'/>
<vmethod ret-type='bool' name='isSand'/>
<vmethod ret-type='int32_t' name='getStackSize'/>
<vmethod name='addStackSize'> <int32_t name='amount'/> </vmethod>
<vmethod name='setStackSize'> <int32_t name='amount'/> </vmethod>
<vmethod ret-type='bool' name='isAmmoClass'> <pointer type-name='stl-string'/> </vmethod>
<vmethod/>
<vmethod/>
<vmethod/>
-- 140
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod ret-type='int16_t' name='getMeleeSkill'/>
<vmethod ret-type='int16_t' name='getRangedSkill'/>
-- 150
<vmethod name='setQuality'> <int16_t name='quality'/> </vmethod>
<vmethod ret-type='int16_t' name='getQuality'/>
<vmethod ret-type='int16_t' name='getOverallQuality'/>
<vmethod ret-type='int16_t' name='getImprovementQuality'/>
<vmethod ret-type='int32_t' name='getProjectileSize'/>
<vmethod/>
<vmethod name='setSharpness'>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
</vmethod>
<vmethod ret-type='int32_t' name='getSharpness'/>
<vmethod ret-type='bool' name='isTotemable'/>
<vmethod ret-type='bool' name='isDyeable'/>
-- 160
<vmethod ret-type='bool' name='isNotDyed'/>
<vmethod ret-type='bool' name='isDyed'/>
<vmethod ret-type='bool' name='canSewImage'/>
<vmethod/>
<vmethod ret-type='bool' name='isProcessableVialAtStill'/>
<vmethod/>
<vmethod ret-type='int32_t' name='getBlockChance'/>
<vmethod/>
<vmethod ret-type='int16_t' name='getMakerRace'/>
<vmethod name='setMakerRace'> <int16_t/> </vmethod>
-- 170
<vmethod ret-type='int8_t' name='getEffectiveArmorLevel'
comment="adds 1 if it has [METAL_ARMOR_LEVELS] and it's made of an inorganic mat"/>
<vmethod/>
<vmethod ret-type='bool' name='isOrganicCloth'/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod ret-type='bool' name='isImproved'/>
<vmethod ret-type='int32_t' name='getUnk60'/>
<vmethod name='getItemDescription'>
<pointer type-name='stl-string'/>
<int8_t name='mode'/>
</vmethod>
<vmethod/>
-- 180
<vmethod/>
<vmethod ret-type='bool' name='isExtractBearingFish'/>
<vmethod ret-type='bool' name='isExtractBearingVermin'/>
<vmethod ret-type='int32_t' name='getBaseWeight'/>
<vmethod ret-type='int32_t' name='getWeightShiftBits'/>
<vmethod ret-type='bool' name='isCollected'/>
<vmethod/>
<vmethod ret-type='bool' name='isEdibleVermin'/>
<vmethod name='drawSelf'/>
<vmethod ret-type='bool' name='isRangedWeapon'/>
-- 190
<vmethod ret-type='bool' name='isClothing'/>
<vmethod ret-type='bool' name='isWet'/>
<vmethod/>
<vmethod ret-type='bool' name='isAssignedToStockpile'/>
<vmethod ret-type='bool' name='isAssignedToThisStockpile'> <int32_t/> </vmethod>
<vmethod/>
<vmethod name='removeStockpileAssignment'/>
<vmethod name='getStockpile2'>
<ret-type><pointer type-name='item_stockpile_ref'/></ret-type>
</vmethod>
<vmethod/>
<vmethod/>
-- 200
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
-- 210
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod ret-type='int16_t' name='isEngraved' comment='slabs only'/>
<vmethod ret-type='int32_t' name='getAbsorption'/>
<vmethod/>
<vmethod is-destructor='true'/>
</virtual-methods>
</class-type>
-- ACTUAL ITEM
<struct-type type-name='item_kill_info'>
<compound name='targets' type-name='historical_kills'/>
-- Wielders
<stl-vector name="slayers">
<int32_t ref-target='historical_figure'/>
</stl-vector>
<stl-vector name="slayer_kill_counts" type-name='int32_t'/>
</struct-type>
<struct-type type-name='item_history_info'>
<pointer name='kills' type-name='item_kill_info'/>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
</struct-type>
<class-type type-name='item_actual' inherits-from='item' original-name='item_actualst'>
<int32_t name='stack_size'/>
<code-helper name='describe'>
(if (> $.stack_size 1) (fmt "stack: ~A" $.stack_size))
(if (> $.wear 0) (fmt "wear: ~A" $.wear))
</code-helper>
<pointer name='history_info'>
<pointer type-name='item_history_info'/>
</pointer>
<pointer name='unk5'>
<stl-vector/>
</pointer>
<pointer name='contaminants'>
<stl-vector>
<pointer type-name='contaminant'/>
</stl-vector>
</pointer>
<uint16_t name='temperature'/>
<uint16_t name='temperature_fraction'/>
<int16_t name='wear'/>
<int32_t name='wear_timer' comment='counts up to 806400'/>
<int32_t name='unk3' comment='-1'/>
</class-type>
-- CRAFTED ITEM
<class-type type-name='item_crafted' inherits-from='item_actual'
original-name='item_craftedst'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<code-helper name='describe'>
$.quality
(describe-obj (material-by-id $.matType $.matIndex))
</code-helper>
<int16_t name='maker_race' ref-target='creature_raw'/>
<enum base-type='int16_t' name='quality' type-name='item_quality'/>
<enum base-type='int32_t' name='skill_used' type-name='job_skill'/>
<int32_t name='maker' ref-target='historical_figure'/>
<int32_t name='masterpiece_event' ref-target='history_event'/>
</class-type>
-- CONSTRUCTED ITEM
<class-type type-name='item_constructed' inherits-from='item_crafted'
original-name='item_constructedst'>
<stl-vector name='improvements'>
<pointer/>
</stl-vector>
</class-type>
-- BODY COMPONENT
<class-type type-name='item_body_component' inherits-from='item_actual'
original-name='item_body_componentst'>
<int16_t name='race' ref-target='creature_raw'/>
<int32_t name='unk_7c'/>
<int32_t name='unk_80'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int8_t name='unk_86'/>
<int32_t name='unk_88'/>
<int8_t name='unk_8c'/>
<stl-vector name='unk_90'/>
<padding size='44'/>
<stl-vector name='unk_cc'/>
<stl-vector name='unk_dc'/>
<stl-vector name='unk_ec'/>
<stl-vector name='unk_fc'/>
<stl-vector name='unk_10c'/>
<stl-vector name='unk_11c'/>
<stl-vector name='unk_12c'/>
<stl-vector name='unk_13c'/>
<padding size='72'/>
<stl-vector name='unk_194'/>
<stl-vector name='unk_1a4'/>
<stl-vector name='unk_1b4'/>
<padding size='20'/>
<stl-vector name='unk_1d8'/>
<stl-vector name='unk_1e8'/>
<stl-vector name='unk_1f8'/>
<stl-vector name='unk_208'/>
<stl-vector name='unk_218'/>
<padding size='12'/>
<static-array name='unk_234' count='19' type-name='int32_t'/>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int16_t name='unk_288'/>
<int32_t name='unk_28c'/>
</class-type>
<class-type type-name='item_corpsest' inherits-from='item_body_component'/>
<class-type type-name='item_corpsepiecest' inherits-from='item_body_component'/>
-- CRITTER
<class-type type-name='item_critter' inherits-from='item_actual' original-name='item_critterst'>
<int16_t name='race' ref-target='creature_raw'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int32_t name='unk_7c'/>
<int32_t name='unk_80'/>
</class-type>
-- LIQUID/POWER
<bitfield-type type-name='item_matstate'>
<flag-bit/>
<flag-bit name='pressed'/>
<flag-bit name='paste'/>
</bitfield-type>
<class-type type-name='item_liquidpowder' inherits-from='item_actual'
original-name='item_liquidpowderst'>
<compound name='mat_state' type-name='item_matstate'/>
<int32_t name='dimension'/>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
<class-type type-name='item_liquid' inherits-from='item_liquidpowder' original-name='item_liquidst'/>
<class-type type-name='item_powder' inherits-from='item_liquidpowder' original-name='item_powderst'/>
-- MISC
<class-type type-name='item_barst' inherits-from='item_actual'>
<int16_t name='subtype'/>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='dimension'/>
</class-type>
<class-type type-name='item_smallgemst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
<class-type type-name='item_blocksst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
<class-type type-name='item_roughst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
<class-type type-name='item_boulderst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
<class-type type-name='item_woodst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
<class-type type-name='item_rockst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='sharpness'/>
<int32_t name='unk_84'/>
</class-type>
<class-type type-name='item_seedsst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='unk_80'/>
<int32_t name='unk_84'/>
</class-type>
<class-type type-name='item_skin_tannedst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='unk_80'/>
</class-type>
<class-type type-name='item_meatst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_plantst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_leavesst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_cheesest' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_globst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='rot_timer'/>
<compound name='mat_state' type-name='item_matstate'/>
</class-type>
<class-type type-name='item_remainsst' inherits-from='item_actual'>
<int16_t name='race' ref-target='creature_raw'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_fishst' inherits-from='item_actual'>
<int16_t name='race' ref-target='creature_raw'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_fish_rawst' inherits-from='item_actual'>
<int16_t name='race' ref-target='creature_raw'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_foodst' inherits-from='item_crafted'>
<pointer name='subtype' type-name='itemdef_foodst'/>
<int32_t name='unk_94'/>
<int16_t name='unk_98'/>
<stl-vector name='unk_9c'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_verminst' inherits-from='item_critter'/>
<class-type type-name='item_petst' inherits-from='item_critter'/>
<class-type type-name='item_drinkst' inherits-from='item_liquid'/>
<class-type type-name='item_powder_miscst' inherits-from='item_powder'/>
<class-type type-name='item_liquid_miscst' inherits-from='item_liquid'>
<int32_t name='unk_88'/>
</class-type>
<class-type type-name='item_threadst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int16_t name='dyeColor'/>
<int32_t name='unk_84'/>
<int32_t name='unk_88'/>
<int32_t name='unk_8c'/>
<int16_t name='unk_90'/>
<int16_t name='unk_92'/>
<int32_t name='unk_94'/>
<int8_t name='unk_98'/>
<int32_t name='dimension'/>
</class-type>
<class-type type-name='item_eggst' inherits-from='item_actual'>
<int16_t name='race' ref-target='creature_raw'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int32_t name='unk_7c'/>
<stl-vector name='eggMatType' type-name='int16_t'/>
<stl-vector name='eggMatIndex' type-name='int32_t'/>
<padding size='44'/>
<compound name='unk_cc'>
<int16_t/>
<int16_t/>
<int16_t/>
<int32_t/>
<int32_t/>
<int32_t/>
<int16_t/>
</compound>
<int32_t/>
<int32_t name='size'/>
</class-type>
-- CONSTRUCTED
<class-type type-name='item_doorst' inherits-from='item_constructed'/>
<class-type type-name='item_floodgatest' inherits-from='item_constructed'/>
<class-type type-name='item_bedst' inherits-from='item_constructed'/>
<class-type type-name='item_chairst' inherits-from='item_constructed'/>
<class-type type-name='item_chainst' inherits-from='item_constructed'/>
<class-type type-name='item_flaskst' inherits-from='item_constructed'/>
<class-type type-name='item_gobletst' inherits-from='item_constructed'/>
<class-type type-name='item_windowst' inherits-from='item_constructed'/>
<class-type type-name='item_cagest' inherits-from='item_constructed'/>
<class-type type-name='item_bucketst' inherits-from='item_constructed'/>
<class-type type-name='item_animaltrapst' inherits-from='item_constructed'/>
<class-type type-name='item_tablest' inherits-from='item_constructed'/>
<class-type type-name='item_coffinst' inherits-from='item_constructed'/>
<class-type type-name='item_boxst' inherits-from='item_constructed'/>
<class-type type-name='item_armorstandst' inherits-from='item_constructed'/>
<class-type type-name='item_weaponrackst' inherits-from='item_constructed'/>
<class-type type-name='item_cabinetst' inherits-from='item_constructed'/>
<class-type type-name='item_amuletst' inherits-from='item_constructed'/>
<class-type type-name='item_scepterst' inherits-from='item_constructed'/>
<class-type type-name='item_crownst' inherits-from='item_constructed'/>
<class-type type-name='item_ringst' inherits-from='item_constructed'/>
<class-type type-name='item_earringst' inherits-from='item_constructed'/>
<class-type type-name='item_braceletst' inherits-from='item_constructed'/>
<class-type type-name='item_gemst' inherits-from='item_constructed'/>
<class-type type-name='item_anvilst' inherits-from='item_constructed'/>
<class-type type-name='item_backpackst' inherits-from='item_constructed'/>
<class-type type-name='item_quiverst' inherits-from='item_constructed'/>
<class-type type-name='item_catapultpartsst' inherits-from='item_constructed'/>
<class-type type-name='item_ballistapartsst' inherits-from='item_constructed'/>
<class-type type-name='item_trappartsst' inherits-from='item_constructed'/>
<class-type type-name='item_pipe_sectionst' inherits-from='item_constructed'/>
<class-type type-name='item_hatch_coverst' inherits-from='item_constructed'/>
<class-type type-name='item_gratest' inherits-from='item_constructed'/>
<class-type type-name='item_quernst' inherits-from='item_constructed'/>
<class-type type-name='item_millstonest' inherits-from='item_constructed'/>
<class-type type-name='item_splintst' inherits-from='item_constructed'/>
<class-type type-name='item_crutchst' inherits-from='item_constructed'/>
<class-type type-name='item_traction_benchst' inherits-from='item_constructed'/>
<class-type type-name='item_instrumentst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_instrumentst'/>
</class-type>
<class-type type-name='item_toyst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_toyst'/>
</class-type>
<class-type type-name='item_armorst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_armorst'/>
</class-type>
<class-type type-name='item_shoesst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_shoesst'/>
</class-type>
<class-type type-name='item_shieldst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_shieldst'/>
</class-type>
<class-type type-name='item_helmst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_helmst'/>
</class-type>
<class-type type-name='item_glovesst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_glovesst'/>
<df-flagarray name='flags' comment='1 right, 2 left'/>
</class-type>
<class-type type-name='item_pantsst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_pantsst'/>
</class-type>
<class-type type-name='item_siegeammost' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_siegeammost'/>
</class-type>
<class-type type-name='item_weaponst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_weaponst'/>
<int32_t name='sharpness'/>
</class-type>
<class-type type-name='item_ammost' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_ammost'/>
<int32_t name='sharpness'/>
</class-type>
<class-type type-name='item_trapcompst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_trapcompst'/>
<int32_t name='sharpness'/>
</class-type>
<class-type type-name='item_toolst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_toolst'/>
<int32_t name='sharpness'/>
<compound name='stockpile' type-name='item_stockpile_ref'/>
</class-type>
<struct-type type-name='item_stockpile_ref'>
<int32_t name='id' ref-target='building'/>
<int16_t name='x'/>
<int16_t name='y'/>
</struct-type>
<class-type type-name='item_barrelst' inherits-from='item_constructed'>
<compound name='stockpile' type-name='item_stockpile_ref'/>
</class-type>
<class-type type-name='item_binst' inherits-from='item_constructed'>
<compound name='stockpile' type-name='item_stockpile_ref'/>
</class-type>
<class-type type-name='item_statuest' inherits-from='item_constructed'>
<int32_t name='unk_a0'/>
<int16_t name='unk_a4'/>
<stl-string name='description'/>
</class-type>
<class-type type-name='item_figurinest' inherits-from='item_constructed'>
<int32_t name='unk_a0'/>
<int16_t name='unk_a4'/>
<stl-string name='description'/>
</class-type>
<class-type type-name='item_slabst' inherits-from='item_constructed'>
<stl-string name='description'/>
<int32_t name='unk_bc'/>
<int16_t name='unk_c0'/>
</class-type>
<class-type type-name='item_orthopedic_castst' inherits-from='item_constructed'>
<stl-string name='unk_a0'/>
<stl-string name='unk_bc'/>
</class-type>
<class-type type-name='item_coinst' inherits-from='item_constructed'>
<int16_t name='unk_a0'/>
</class-type>
<class-type type-name='item_totemst' inherits-from='item_constructed'>
<int16_t name='unk_a0'/>
<int16_t name='unk_a2'/>
<int16_t name='unk_a4'/>
</class-type>
<class-type type-name='item_clothst' inherits-from='item_constructed'>
<int32_t name='dimension'/>
</class-type>
<class-type type-name='item_ballistaarrowheadst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

File diff suppressed because it is too large Load Diff

@ -1,264 +0,0 @@
<data-definition>
<struct-type type-name='meeting_diplomat'>
<int32_t name='unk1' comment='uninitialized'/>
<pointer name='person1' type-name='unit' comment='diplomat'/>
<pointer name='person2' type-name='unit' comment='count'/>
<pointer name='place' type-name='building'/>
<int16_t name='unk2' comment='1'/>
<int8_t name='unk3' comment='3'/>
<int16_t name='unk4' comment='0'/>
<int32_t name='unk5' comment='-1'/>
</struct-type>
<struct-type type-name='meeting_pet' key-field='name'>
<int32_t name='unk0' comment='uninitialized'/>
<int32_t name='unk1' comment='-1'/>
<int32_t name='pet_id' ref-target='unit'/>
<compound name='name' type-name='language_name'/>
<int32_t name='unk3'/>
<int32_t name='owner_id' ref-target='unit'/>
</struct-type>
<struct-type type-name='meeting_ref'>
<int32_t name='unk1'
comment='4 person, 7 pet (pet), 8 pet (owner)'/>
<pointer name='ptr' comment='type varies'/>
<int32_t name='unk2' comment='0'/>
</struct-type>
<bitfield-type type-name='job_material_category' base-type='uint32_t'>
<flag-bit name='plant'/>
<flag-bit name='wood'/>
<flag-bit name='cloth'/>
<flag-bit name='silk'/>
<flag-bit name='leather'/>
<flag-bit name='bone'/>
<flag-bit name='shell'/>
<flag-bit name='wood2'/>
<flag-bit name='soap'/>
<flag-bit name='tooth'/>
<flag-bit name='horn'/>
<flag-bit name='pearl'/>
<flag-bit name='yarn'/>
</bitfield-type>
<bitfield-type type-name='job_item_category' base-type='uint32_t'>
<flag-bit name='unk1'/>
<flag-bit name='unk2'/>
<flag-bit name='furniture'/>
<flag-bit name='unk8'/>
<flag-bit name='unk16'/>
<flag-bit name='unk32'/>
<flag-bit name='ammo'/>
<flag-bit name='unk128'/>
<flag-bit name='unk256'/>
<flag-bit name='unk512'/>
<flag-bit name='finished_goods'/>
</bitfield-type>
<struct-type type-name='job_list_link' key-field='job'>
<pointer name='job' type-name='job'/>
<pointer name='prev' type-name='job_list_link'/>
<pointer name='next' type-name='job_list_link'/>
</struct-type>
<struct-type type-name='job' key-field='id'>
<int32_t name='id'/>
<pointer name='list_link' type-name='job_list_link'/>
<enum name='job_id' base-type='int16_t' type-name='job_type'/>
<int32_t name='unk2'/>
<int16_t name='x'/>
<int16_t name='y'/>
<int16_t name='z'/>
<int32_t name='completion_timer' comment='-1 per 10 frames'/>
<uint16_t name='unk4a'/>
<uint16_t name='unk4b'/>
<bitfield name='flags' base-type='uint32_t'>
<flag-bit name='repeat'/>
<flag-bit name='suspend'/>
</bitfield>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int16_t name='unk5'/>
<int16_t name='unk6'/>
<int16_t name='item_subtype'/>
<int32_t name='unk7'/>
<int32_t name='unk8'/>
<compound name='job_material_category' type-name='job_material_category'/>
<stl-string name='reaction_name'/>
<int32_t name='unk9'/>
<int32_t name='unk10'/>
<stl-vector name='items'>
<pointer>
<pointer name='item' type-name='item'/>
<int32_t name='unk1' comment='1 for reagents, 2 for build materials'/>
<int32_t name='to_bring'
comment='0 immediately once taken to be brought'/>
<int32_t name='job_item_idx'/>
</pointer>
</stl-vector>
<stl-vector name='unk11' type-name='pointer'/>
<stl-vector name='references'>
<pointer type-name='general_ref'/>
</stl-vector>
<stl-vector name='job_items'>
<pointer type-name='job_item'/>
</stl-vector>
</struct-type>
<struct-type type-name='job_item'>
<enum base-type='int16_t' name='itemType' type-name='item_type'/>
<int16_t name='itemSubtype' refers-to='(item-subtype-target $$._parent.itemType $)'/>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<bitfield name='flags1' base-type='uint32_t'/>
<int32_t name='count'/>
<int16_t name='unk1'/>
<bitfield name='flags2' base-type='uint32_t'/>
<int32_t name='unk2'/>
<bitfield name='flags3' base-type='uint32_t'/>
<int32_t name='unk3'/>
<int32_t name='metal_ore'/>
<stl-string name='reaction_class'/>
<stl-string name='has_material_reaction_product'/>
<int32_t name='unk4'/>
<int32_t name='reagent_index'/>
<stl-vector type-name='int32_t' name='contains' comment='used with custom reactions'/>
<int32_t name='unk5'/>
<int16_t name='has_tool_use'/>
</struct-type>
<struct-type type-name='manager_order'>
<enum name='job_id' base-type='int16_t' type-name='job_type'/>
<int16_t name="unk_2"/>
<int16_t name="item_subtype"/>
<stl-string name="reaction_name"/>
<int16_t name="mat_type" ref-target='material' aux-value='$$.mat_index'/>
<int32_t name="mat_index"/>
<compound name="item_category" type-name='job_item_category'/>
<int32_t name="unk_18"/>
<compound name="material_category" type-name='job_material_category'/>
<int16_t name="amount_left"/>
<int16_t name="amount_total"/>
<int32_t name="is_validated"/>
</struct-type>
<struct-type type-name='mandate'>
<pointer name='unit' type-name='unit'/>
<int16_t name='mode' comment='0 export, 1 make, 2 guild jobs'/>
<enum base-type='int16_t' name='item_type' type-name='item_type'/>
<int16_t name='item_subtype' refers-to='(item-subtype-target $$._parent.item_type $)'/>
<int16_t name='mat_type' ref-target='material' aux-value='$$.mat_index'/>
<int32_t name='mat_index'/>
<int16_t name='amount_total'/>
<int16_t name='amount_remaining'/>
<int32_t name='timeout_counter' comment='counts once per 10 frames'/>
<int32_t name='timeout_limit' comment='once counter passes limit, mandate ends'/>
<int16_t name='unk2'/>
<int16_t name='unk3'/>
<int32_t name='unk4'/>
<uint8_t name='unk5'/>
</struct-type>
<struct-type type-name='activity_entry' instance-vector='$global.world.activities.all' key-field='id'>
<int32_t name='id'/>
<int16_t name='is_individual'/>
<stl-vector name='events'>
<pointer type-name='activity_event'/>
</stl-vector>
<int32_t name='unk2'/>
</struct-type>
<class-type type-name='activity_event' original-name='activity_eventst'>
<int32_t name='event_id'
comment='mostly, but not always, the index in activity.events'/>
<int32_t name='activity_id' ref-target='activity_entry'/>
-- Guess:
<int32_t name='subevent_id' comment='-1 unless subevent'/>
<int32_t name='num_subevents' comment='0 for ind.drill, 2 for all in training session'/>
<stl-vector name='hist_figure_ids'>
<int32_t ref-target='historical_figure'/>
</stl-vector>
<stl-vector name='participant_ids'>
<int32_t ref-target='unit'/>
</stl-vector>
-- Either empty, or same as above:
<stl-vector name='hist_figure_ids2'>
<int32_t ref-target='historical_figure'/>
</stl-vector>
<stl-vector name='participant_ids2'>
<int32_t ref-target='unit'/>
</stl-vector>
-- These are equal to the ones above:
<int32_t name='activity_id2' ref-target='activity_entry'/>
<int32_t name='event_id2'/>
</class-type>
<class-type type-name='activity_event_individual_skill_drillst' inherits-from='activity_event'>
<int32_t name='building_id' ref-target='building'/>
<int32_t name='unk5'/>
</class-type>
<class-type type-name='activity_event_training_sessionst' inherits-from='activity_event'>
</class-type>
<class-type type-name='activity_event_combat_trainingst' inherits-from='activity_event'>
<int32_t name='building_id' ref-target='building'/>
<int32_t name='hist_figure_id' ref-target='historical_figure'/>
<int32_t name='unit_id' ref-target='unit'/>
<int32_t name='unk5'/>
</class-type>
<class-type type-name='activity_event_skill_demonstrationst' inherits-from='activity_event'>
<int32_t name='building_id' ref-target='building'/>
<int32_t name='hist_figure_id' ref-target='historical_figure'/>
<int32_t name='unit_id' ref-target='unit'/>
<int16_t name='unk5'/>
<int32_t name='unk6'/>
<int32_t name='unk7'/>
<int32_t name='unk8'/>
<int32_t name='unk9'/>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,123 +0,0 @@
<data-definition>
<enum-type type-name='language_word_flags'>
<enum-item name='FRONT_COMPOUND_NOUN_SING'/>
<enum-item name='FRONT_COMPOUND_NOUN_PLUR'/>
<enum-item name='FRONT_COMPOUND_ADJ'/>
<enum-item name='FRONT_COMPOUND_PREFIX'/>
<enum-item name='REAR_COMPOUND_NOUN_SING'/>
<enum-item name='REAR_COMPOUND_NOUN_PLUR'/>
<enum-item name='REAR_COMPOUND_ADJ'/>
<enum-item name='THE_NOUN_SING'/>
<enum-item name='THE_NOUN_PLUR'/>
<enum-item name='THE_COMPOUND_NOUN_SING'/>
<enum-item name='THE_COMPOUND_NOUN_PLUR'/>
<enum-item name='THE_COMPOUND_ADJ'/>
<enum-item name='THE_COMPOUND_PREFIX'/>
<enum-item name='OF_NOUN_SING'/>
<enum-item name='OF_NOUN_PLUR'/>
<enum-item name='STANDARD_VERB'/>
</enum-type>
<enum-type type-name='part_of_speech'>
<enum-item name='Noun'/>
<enum-item name='NounPlural'/>
<enum-item name='Adjective'/>
<enum-item name='Prefix'/>
<enum-item name='Verb'/>
<enum-item name='Verb3rdPerson'/>
<enum-item name='VerbPast'/>
<enum-item name='VerbPassive'/>
<enum-item name='VerbGerund'/>
</enum-type>
<struct-type type-name='language_word' instance-vector='$global.world.raws.language_words'>
<stl-string name='word'/>
<code-helper name='describe'>$.word</code-helper>
<static-array type-name='stl-string' name='forms' count='9' index-enum='part_of_speech'/>
<uint8_t name='adj_dist'/>
<padding size='7' comment='looks like garbage'/>
<df-flagarray name='flags' index-enum='language_word_flags'/>
</struct-type>
<struct-type type-name='language_translation' instance-vector='$global.world.raws.translations'>
<stl-string name='name'/>
<code-helper name='describe'>$.name</code-helper>
<stl-vector name='unknown1' comment='empty'/>
<stl-vector name='unknown2' comment='empty'/>
<stl-vector name='words' index-refers-to='$global.world.raws.language_words[$]'>
<pointer type-name='stl-string'/>
</stl-vector>
</struct-type>
<struct-type type-name='language_symbol'>
<stl-string name='name'/>
<stl-vector name='unknown' comment='empty'/>
<stl-vector name='words'>
<int32_t ref-target='language_word'/>
</stl-vector>
</struct-type>
<struct-type type-name='language_name'>
<stl-string name='first_name'/>
<stl-string name='nickname'/>
<static-array name='words' count='7'>
<int32_t ref-target='language_word'/>
</static-array>
<static-array name='parts_of_speech' count='7'>
<enum base-type='int16_t' type-name='part_of_speech'/>
</static-array>
<int32_t name='language' ref-target='language_translation'/>
<int16_t name='unknown'/>
<bool name='has_name'/>
<code-helper name='describe'>
(when $.has_name
(let* ((nick $.nickname)
(language $global.world.raws.translations[$.language])
(english $global.world.raws.language_words)
(fname $.first_name)
(lwords $language.words))
(flet ((get-words (start end)
(loop for i from start to end
for word = $.words[i]
collect $lwords[word].value))
(get-english (start end)
(loop for i from start to end
for word = $.words[i] and ps = $.parts_of_speech[i]
collect $english[word].forms[ps])))
(list
(fmt "Name:~:(~@[ ~A~]~@[ '~A'~]~@[ ~{~A~}~]~@[ ~{~A~}~]~@[ ~{~A~}~]~)"
(if (> (length fname) 0) fname)
(if (> (length nick) 0) nick)
(flatten (get-words 0 1))
(flatten (get-words 2 5))
(flatten (get-words 6 6)))
(fmt "aka~:(~@[ ~A~]~@[ ~{~A~}~]~@[ the ~A~]~@[ of ~{~A~}~]~)"
(if (> (length fname) 0) fname)
(flatten (get-english 0 1))
(when (>= $.words[5] 0)
(apply #'format nil "~@[~A ~]~@[~A ~]~@[~A-~]~A" (get-english 2 5)))
(flatten (get-english 6 6)))))))
</code-helper>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,305 +0,0 @@
<data-definition>
<struct-type type-name='historical_entity' key-field='id' instance-vector='$global.world.entities.all'>
<int16_t name='unk1'/>
<int32_t name='id' comment='index in the array'/>
<pointer name='entity_raw'/>
<int32_t name='save_file_id' comment='changes once has 100 entries'/>
<int16_t name='next_member_idx'/>
<compound name='name' type-name='language_name'/>
<code-helper name='describe'>
(describe-obj $.name)
(describe-obj (find-creature $.race))
</code-helper>
<int16_t name='race' ref-target='creature_raw'/>
<int32_t name='unk5'/>
<static-array name='unk6' count='2'>
<stl-vector>
<pointer>
<int16_t name='unk1'/>
<int32_t name='unk2'/>
<int16_t name='unk3'/>
</pointer>
</stl-vector>
</static-array>
<stl-vector name='unit_ids'>
<int32_t ref-target='unit'/>
</stl-vector>
<stl-vector name='unk7' type-name='int32_t'/>
<stl-vector name='nemesis_ids'>
<int32_t ref-target='historical_figure'/>
</stl-vector>
<compound name='unknown1'>
<static-array name='unk8' count='15'>
<stl-vector type-name='int16_t'/>
</static-array>
<static-array name='unk9' count='12'>
<stl-vector name='unk1' type-name='int16_t'/>
<stl-vector name='unk2' type-name='int32_t'/>
</static-array>
<static-array name='unk10' count='3'>
<stl-vector type-name='int32_t'/>
</static-array>
<static-array name='unk11' count='21'>
<stl-vector name='unk1' type-name='int16_t'/>
<stl-vector name='unk2' type-name='int32_t'/>
</static-array>
<compound name='unk12'>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector name='unk6e8' type-name='int32_t' comment='empty'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t' comment='empty'/>
<stl-vector type-name='int16_t'/>
<stl-vector name='unk748' type-name='int16_t' comment='empty'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector name='unk798' type-name='int32_t' comment='empty'/>
<stl-vector name='unk7a8' type-name='int32_t' comment='empty'/>
</compound>
<static-array name='unk13' count='3'>
<int16_t name='unk1'/>
<int32_t name='unk2'/>
</static-array>
<stl-vector name='unk14' type-name='pointer' comment='empty'/>
<static-array name='unk15' count='24' type-name='int16_t'/>
<stl-vector name='unk16' type-name='int16_t'/>
<stl-vector name='unk17' type-name='int32_t'/>
<stl-vector name='unk18' type-name='int16_t'/>
<stl-vector name='unk19' type-name='int8_t'/>
<stl-vector name='unk20' type-name='int8_t'/>
<stl-vector name='unk21' type-name='int8_t'/>
<stl-vector name='unk22' type-name='int8_t'/>
<stl-vector name='unk23' type-name='int16_t'/>
<stl-vector name='unk24' type-name='int16_t'/>
</compound>
<stl-vector name='uniforms'>
<pointer type-name='entity_uniform'/>
</stl-vector>
<compound name='unknown1b'>
<int16_t name='unk26a'/>
<int16_t name='unk26b'/>
<int16_t name='unk27'/>
<int32_t name='unk28'/>
<int32_t name='unk29'/>
<int32_t name='unk30'/>
<int32_t name='unk31'/>
<df-flagarray name='flags'/>
<stl-vector name='unk32a' type-name='pointer' comment='empty'/>
<stl-vector name='unk32b' type-name='int32_t'/>
<stl-vector name='unk32c' type-name='int32_t'/>
<stl-vector name='unk32d' type-name='int32_t'/>
<stl-vector name='unk32e' type-name='pointer'/>
<stl-vector name='unk32f' type-name='pointer'/>
<int16_t name='unk33'/>
<stl-vector name='unk34a' type-name='int16_t'/>
<stl-vector name='unk34b' type-name='int16_t'/>
<stl-vector name='unk34c' type-name='int16_t'/>
<stl-vector name='unk34d' type-name='pointer' comment='empty'/>
<stl-vector name='unk34e' type-name='pointer' comment='empty'/>
<stl-vector name='unk34f' type-name='pointer'/>
<stl-vector name='unk34g' type-name='pointer'/>
<stl-vector name='unk34h' type-name='pointer'/>
<int32_t name='unk35'/>
<stl-vector name='unk36' type-name='pointer'/>
<int32_t name='unk37'/>
<stl-vector name='unk38' type-name='pointer'/>
<int32_t name='unk39'/>
<stl-vector name='unk40' type-name='pointer'/>
<stl-vector name='unk41' type-name='int32_t'/>
<int32_t name='unk42'/>
<stl-vector name='unk43' type-name='pointer' comment='empty'/>
<int32_t name='unk44'/>
<stl-vector name='unk45' type-name='pointer'/>
<pointer name='unk46'/>
<int16_t name='unk47'/>
<int32_t name='unk48'/>
<static-array name='unk49' count='15' type-name='int32_t'/>
<stl-vector name='unk50' type-name='pointer' comment='empty'/>
</compound>
<stl-vector name='hist_figures'>
<pointer type-name='historical_figure'/>
</stl-vector>
<stl-vector name='nemesis'>
<pointer type-name='nemesis_record'/>
</stl-vector>
<compound name='unknown2'>
<stl-vector name='unk1' type-name='int16_t'/>
<stl-vector name='unk2' type-name='int32_t'/>
<stl-vector name='unk3' type-name='int16_t'/>
<stl-vector name='unk4' type-name='int32_t'/>
<static-array name='unk5' count='30'>
<stl-vector type-name='int16_t'/>
</static-array>
<static-array name='unk6' count='25'>
<stl-vector type-name='pointer'/>
</static-array>
<static-array name='unk6b' count='6'>
<stl-vector type-name='int16_t'/>
</static-array>
<stl-vector name='unk8' type-name='int32_t'/>
<int32_t name='unk9'/>
<stl-vector name='unk10' type-name='int16_t'/>
<pointer name='unk11'/>
<int16_t name='unk12a' comment='-1'/>
<int16_t name='unk12b' comment='uninitialized'/>
<bool name='unk13' comment='0'/>
<int32_t name='unk14' comment='0'/>
<int32_t name='unk15' comment='uninitialized'/>
<int32_t name='unk16' comment='uninitialized'/>
<int16_t name='unk17' comment='0'/>
<stl-vector name='unk18' type-name='pointer' comment='empty'/>
<stl-vector name='unk19' type-name='pointer' comment='empty'/>
<int16_t name='unk20' comment='0'/>
<int32_t name='unk21' comment='0'/>
<int32_t name='unk22' comment='0'/>
<int32_t name='unk23' comment='0'/>
<stl-vector name='unk24' type-name='pointer' comment='empty'/>
<stl-vector name='unk25' type-name='pointer' comment='empty'/>
<static-array name='unk26' count='173' type-name='int32_t' comment='Uninitialized'/>
<static-array name='unk27' count='15' type-name='int32_t' comment='0'/>
<stl-vector name='unk28' type-name='pointer' comment='empty'/>
</compound>
</struct-type>
<struct-type type-name='entity_population_unk4'>
<static-array count='3'>
<stl-vector>
<pointer>
<int32_t name='idx'/>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
</pointer>
</stl-vector>
</static-array>
</struct-type>
<struct-type type-name='entity_population' key-field='id' instance-vector='$global.world.entity_populations'>
<compound name='name' type-name='language_name'/>
<code-helper name='describe'>
(describe-obj $.name)
</code-helper>
<stl-vector name='unk1'>
<int16_t ref-target='creature_raw'/>
</stl-vector>
<stl-vector name='unk2' type-name='int32_t'/>
<stl-vector name='unk3' type-name='int32_t'/>
<stl-vector name='unk4'>
<pointer type-name='entity_population_unk4'/>
</stl-vector>
<int32_t name='unk5'/>
<int32_t name='unk6'/>
<int32_t name='id'/>
<bool name='unk7' comment='unk6 == -1'/>
<int32_t name='civ_id' ref-target='historical_entity'/>
</struct-type>
<struct-type type-name='nemesis_record' key-field='id' instance-vector='$global.world.nemesis.all'>
<int32_t name='id' comment='sequential index in the array'/>
<int32_t name='unit_id' ref-target='unit'/>
<int32_t name='save_file_id' comment='unit-*.dat'/>
<int16_t name='member_idx' comment='index in the file'/>
<pointer name='figure' type-name='historical_figure'/>
<pointer name='unit' type-name='unit'/>
<code-helper name='describe'>
(describe-obj $.figure)
</code-helper>
<int32_t name='unk6' comment='-1'/>
<stl-vector name='unk7' type-name='pointer' comment='empty'/>
<int16_t name='unk10' comment='-1'/>
<int32_t name='unk11' comment='-1'/>
<int32_t name='unk12' comment='-1'/>
<df-flagarray name='flags'/>
<stl-vector name='unk13' type-name='pointer' comment='empty'/>
</struct-type>
<struct-type type-name='artifact_record' key-field='id'
instance-vector='$global.world.artifacts.all'>
<int32_t name='id'/>
<code-helper name='describe'>
(describe-obj $.name)
</code-helper>
<compound name='name' type-name='language_name'/>
<df-flagarray name='flags'/>
<pointer name='item' type-name='item'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,96 +0,0 @@
<data-definition>
-- MACHINE
<class-type type-name='machine' original-name='machinest'
instance-vector='$global.world.machines.all' key-field='id'>
<int32_t name="x"/>
<int32_t name="y"/>
<int32_t name="z"/>
<int32_t name="id"/>
<stl-vector name="components">
<pointer>
<int32_t name="building_id" ref-target='building'/>
<stl-vector name="connections" type-name='int32_t'
comment='indices into the same component vector'/>
</pointer>
</stl-vector>
<int32_t name="cur_power"/>
<int32_t name="min_power"/>
<int8_t name='visual_phase'/>
<int16_t name="phase_timer"/>
<int32_t name="is_active"/>
</class-type>
<class-type type-name='machine_standardst' inherits-from='machine'>
</class-type>
-- MACHINE COMPONENT BUILDINGS
<class-type type-name='building_axle_horizontalst' inherits-from='building_actual'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_fc"/>
<bool name='is_vertical'/>
</class-type>
<class-type type-name='building_axle_verticalst' inherits-from='building_actual'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_fc"/>
</class-type>
<class-type type-name='building_gear_assemblyst' inherits-from='building_actual'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_fc"/>
<bitfield name='gear_flags'>
<flag-bit name='disengaged'/>
</bitfield>
</class-type>
<class-type type-name='building_windmillst' inherits-from='building_actual'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_fc"/>
<int16_t name="orient_angle"/>
<int16_t name="orient_mode"/>
<int16_t name="is_working"/>
<bool name="visual_rotated"/>
<int16_t name="rotate_timer"/>
<int16_t name="orient_timer"/>
</class-type>
<class-type type-name='building_water_wheelst' inherits-from='building_actual'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_fc"/>
<bool name='is_vertical'/>
<bool name='gives_power'/>
</class-type>
<class-type type-name='building_screw_pumpst' inherits-from='building_actual'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_fc"/>
<uint8_t name="unk_100"/>
<enum name='direction' base-type='int8_t'>
<enum-item name='FromNorth'/>
<enum-item name='FromEast'/>
<enum-item name='FromSouth'/>
<enum-item name='FromWest'/>
</enum>
<bool name='pump_manually'/>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,247 +0,0 @@
<data-definition>
<enum-type type-name='tile_traffic'>
<enum-item name='Normal'/>
<enum-item name='Low'/>
<enum-item name='High'/>
<enum-item name='Restricted'/>
</enum-type>
<enum-type type-name='tile_dig_designation'>
<enum-item name='No' comment='no designation'/>
<enum-item name='Default' comment='dig walls, remove stairs and ramps, gather plants, fell trees'/>
<enum-item name='UpDownStair'/>
<enum-item name='Channel'/>
<enum-item name='Ramp'/>
<enum-item name='DownStair'/>
<enum-item name='UpStair'/>
</enum-type>
<enum-type type-name='tile_liquid'>
<enum-item name='Water'/>
<enum-item name='Magma'/>
</enum-type>
<bitfield-type type-name='tile_designation'>
<flag-bit name='flow_size' count='3' comment='liquid amount'/>
<flag-bit name='pile' comment='stockpile?'/>
<flag-bit name='dig' count='3'
refers-to='(enum-to-key $tile_dig_designation $)'/>
<flag-bit name='smooth' count='2'/>
<flag-bit name='hidden'/>
<flag-bit name='geolayer_index' count='4'/>
<flag-bit name='light'/>
<flag-bit name='subterranean'/>
<flag-bit name='outside'/>
<flag-bit name='biome' count='4'/>
<flag-bit name='liquid_type'
refers-to='(enum-to-key $tile_liquid $)'/>
<flag-bit name='water_table' comment='aquifer'/>
<flag-bit name='rained'/>
<flag-bit name='traffic' count='2'
refers-to='(enum-to-key $tile_traffic $)'/>
<flag-bit name='flow_forbid'/>
<flag-bit name='liquid_static'/>
<flag-bit name='feature_local'/>
<flag-bit name='feature_global'/>
<flag-bit name='water_stagnant'/>
<flag-bit name='water_salt'/>
</bitfield-type>
<bitfield-type type-name='tile_occupancy'>
<flag-bit name='building' count='3'/>
<flag-bit name='unit' comment='standing'/>
<flag-bit name='unit_grounded' comment='prone'/>
<flag-bit name='item'/>
<flag-bit name='edge_flow_in'
comment='if set on an edge tile, water or magma will flow in'/>
<flag-bit name='moss'/>
<flag-bit name='arrow_color' count='4'/>
<flag-bit name='arrow_variant'/>
<flag-bit name='unk13'/>
<flag-bit name='monster_lair'
comment='A monster lair. Items placed wont be moved.'/>
<flag-bit name='no_grow'
comment='seems to be set on terrain tiles where grass growth is impossible'/>
</bitfield-type>
<enum-type type-name='block_flags'>
<enum-item name='Designated' comment='for jobs etc'/>
<enum-item name='UpdateTemperature'/>
<enum-item name='UpdateLiquid'/>
<enum-item name='UpdateLiquidTwice'
comment='Protects UpdateLiquid from being cleared the first time.'/>
</enum-type>
<struct-type type-name='block_burrow'>
<int32_t name='id' ref-target='burrow'/>
<static-array name='tile_bitmask' count='16'>
<uint16_t/>
</static-array>
<pointer name="link" type-name='block_burrow_link'/>
</struct-type>
<struct-type type-name='block_burrow_link'>
<pointer name='item' type-name='block_burrow'/>
<pointer name='prev' type-name='block_burrow_link'/>
<pointer name='next' type-name='block_burrow_link'/>
</struct-type>
<struct-type type-name='map_block'>
<df-flagarray name='flags' index-enum='block_flags'/>
<stl-vector name='block_events'>
<pointer/>
</stl-vector>
<compound name='block_burrows' type-name='block_burrow_link'/>
<int32_t name='local_feature'/>
<int32_t name='global_feature'/>
<int32_t name='unk2'/>
<int32_t name='unk3' comment='undef'/>
<int32_t name='unk4'/>
<int32_t name='unk5'/>
<stl-vector name='items'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='effects'>
<pointer/>
</stl-vector>
<int32_t name='unk7'/>
<int32_t name='unk8' comment='undef'/>
<stl-vector name='plants'>
<pointer/>
</stl-vector>
<int16_t name='map_x'/>
<int16_t name='map_y'/>
<int16_t name='map_z'/>
<int16_t name='region_x'/>
<int16_t name='region_y'/>
<static-array name='tiletype' count='16'>
<static-array count='16'>
<int16_t/>
</static-array>
</static-array>
<static-array name='designation' count='16'>
<static-array count='16'>
<compound type-name='tile_designation'/>
</static-array>
</static-array>
<static-array name='occupancy' count='16'>
<static-array count='16'>
<compound type-name='tile_occupancy'/>
</static-array>
</static-array>
<static-array name='unk9' count='16'>
<static-array count='16'>
<int8_t/>
</static-array>
</static-array>
<static-array name='pathfinding' count='16'>
<static-array count='16'>
<int32_t/>
</static-array>
</static-array>
<static-array name='unk10' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='unk11' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='unk12' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='temperature_1' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='temperature_2' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='unk13' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='unk14' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='region_offset' count='9'>
<uint8_t/>
</static-array>
</struct-type>
<struct-type type-name='cave_column_link'>
<pointer name='item'/>
<pointer name='prev' type-name='cave_column_link'/>
<pointer name='next' type-name='cave_column_link'/>
</struct-type>
<struct-type type-name='map_block_column'>
<int16_t name="unk_0"/>
<int16_t name="unk_2"/>
<int16_t name="unk_4"/>
<stl-vector name="unk_8">
<pointer>
<static-array name='unk1' count='8' type-name='int16_t'/>
<static-array name='unk2' count='4' type-name='uint8_t'/>
</pointer>
</stl-vector>
<int16_t name="z_base"/>
<static-array name='cave_columns' count='16'>
<static-array count='16'>
<compound type-name='cave_column_link'/>
</static-array>
</static-array>
<stl-vector name='column_rectangles'>
<pointer/>
</stl-vector>
<int16_t name='unk_c2c'/>
<df-flagarray name='flags'/>
<int16_t name='tile_min_x'/>
<int16_t name='tile_min_y'/>
<int16_t name='unk_c3c' comment='uninitialized'/>
<int16_t name='unk_c3e'/>
<int16_t name='unk_c40'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,419 +0,0 @@
<data-definition>
<enum-type type-name='material_flags'>
<enum-item name='BONE'/>
<enum-item name='MEAT'/>
<enum-item name='EDIBLE_VERMIN'/>
<enum-item name='EDIBLE_RAW'/>
<enum-item name='EDIBLE_COOKED'/>
<enum-item/>
<enum-item name='ITEMS_METAL'/>
<enum-item name='ITEMS_BARRED'/>
<enum-item name='ITEMS_SCALED'/>
<enum-item name='ITEMS_LEATHER'/>
<enum-item name='ITEMS_SOFT'/>
<enum-item name='ITEMS_HARD'/>
<enum-item name='IMPLIES_ANIMAL_KILL'/>
<enum-item name='ALCOHOL_PLANT'/>
<enum-item name='ALCOHOL_CREATURE'/>
<enum-item name='CHEESE_PLANT'/>
<enum-item name='CHEESE_CREATURE'/>
<enum-item name='POWDER_MISC_PLANT'/>
<enum-item name='POWDER_MISC_CREATURE'/>
<enum-item name='STOCKPILE_GLOB'/>
<enum-item name='LIQUID_MISC_PLANT'/>
<enum-item name='LIQUID_MISC_CREATURE'/>
<enum-item name='LIQUID_MISC_OTHER'/>
<enum-item name='WOOD'/>
<enum-item name='THREAD_PLANT'/>
<enum-item name='TOOTH'/>
<enum-item name='HORN'/>
<enum-item name='PEARL'/>
<enum-item name='SHELL'/>
<enum-item name='LEATHER'/>
<enum-item name='SILK'/>
<enum-item name='SOAP'/>
<enum-item name='ROTS'/>
<enum-item comment='dye?'/>
<enum-item/>
<enum-item/>
<enum-item name='STRUCTURAL_PLANT_MAT'/>
<enum-item name='SEED_MAT'/>
<enum-item name='LEAF_MAT'/>
<enum-item/>
<enum-item name='ENTERS_BLOOD'/>
<enum-item name='BLOOD_MAP_DESCRIPTOR'/>
<enum-item name='ICHOR_MAP_DESCRIPTOR'/>
<enum-item name='GOO_MAP_DESCRIPTOR'/>
<enum-item name='SLIME_MAP_DESCRIPTOR'/>
<enum-item name='PUS_MAP_DESCRIPTOR'/>
<enum-item name='GENERATES_MIASMA'/>
<enum-item name='IS_METAL'/>
<enum-item name='IS_GEM'/>
<enum-item name='IS_GLASS'/>
<enum-item name='CRYSTAL_GLASSABLE'/>
<enum-item name='ITEMS_WEAPON'/>
<enum-item name='ITEMS_WEAPON_RANGED'/>
<enum-item name='ITEMS_ANVIL'/>
<enum-item name='ITEMS_AMMO'/>
<enum-item name='ITEMS_DIGGER'/>
<enum-item name='ITEMS_ARMOR'/>
<enum-item name='ITEMS_DELICATE'/>
<enum-item name='ITEMS_SIEGE_ENGINE'/>
<enum-item name='ITEMS_QUERN'/>
<enum-item name='IS_STONE'/>
<enum-item name='UNDIGGABLE'/>
<enum-item name='YARN'/>
<enum-item name='STOCKPILE_GLOB_PASTE'/>
<enum-item name='STOCKPILE_GLOB_PRESSED'/>
<enum-item name='DISPLAY_UNGLAZED'/>
<enum-item name='DO_NOT_CLEAN_GLOB'/>
<enum-item name='NO_STONE_STOCKPILE'/>
<enum-item name='STOCKPILE_THREAD_METAL'/>
</enum-type>
<struct-type type-name='material_common'>
<stl-string name='id'/>
<stl-string name='gem_name1'/>
<stl-string name='gem_name2'/>
<stl-string name='stone_name'/>
<code-helper name='describe'> (describe-material $) </code-helper>
<compound name='heat'>
<uint16_t name='spec_heat'/>
<uint16_t name='heatdam_point'/>
<uint16_t name='colddam_point'/>
<uint16_t name='ignite_point'/>
<uint16_t name='melting_point'/>
<uint16_t name='boiling_point'/>
<uint16_t name='mat_fixed_temp'/>
</compound>
<int32_t name='solid_density'/>
<int32_t name='liquid_density'/>
<int32_t name='molar_mass'/>
<static-array name='state_color' type-name='int32_t' count='6'/>
<static-array name='state_name' type-name='stl-string' count='6'/>
<static-array name='state_adj' type-name='stl-string' count='6'/>
<compound name='strength'>
<int32_t name='absorption'/>
<int32_t name='bending_yield'/>
<int32_t name='shear_yield'/>
<int32_t name='torsion_yield'/>
<int32_t name='impact_yield'/>
<int32_t name='tensile_yield'/>
<int32_t name='compressive_yield'/>
<int32_t name='bending_fracture'/>
<int32_t name='shear_fracture'/>
<int32_t name='torsion_fracture'/>
<int32_t name='impact_fracture'/>
<int32_t name='tensile_fracture'/>
<int32_t name='compressive_fracture'/>
<int32_t name='bending_strain_at_yield'/>
<int32_t name='shear_strain_at_yield'/>
<int32_t name='torsion_strain_at_yield'/>
<int32_t name='impact_strain_at_yield'/>
<int32_t name='tensile_strain_at_yield'/>
<int32_t name='compressive_strain_at_yield'/>
<int32_t name='max_edge'/>
</compound>
<int32_t name='material_value'/>
<df-flagarray name='mat_flags' index-enum='material_flags'/>
<int16_t name='extract_storage'/>
<int16_t name='butcher_special_type'/>
<int16_t name='butcher_special_subtype'/>
<static-array name='meat_name' type-name='stl-string' count='3'/>
<static-array name='block_name' type-name='stl-string' count='2'/>
<stl-vector name='material_reaction_product_id'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector name='material_reaction_product_matType' type-name='int16_t'/>
<stl-vector name='material_reaction_product_matIndex' type-name='int32_t'/>
<static-array name='material_reaction_product_str' count='3'>
<stl-vector>
<pointer type-name='stl-string'/>
</stl-vector>
</static-array>
<int16_t name='hardens_with_water_matType'/>
<int32_t name='hardens_with_water_matIndex'/>
<static-array name='hardens_with_water_str' type-name='stl-string' count='3'/>
<stl-vector name='reaction_class'>
<pointer type-name='stl-string'/>
</stl-vector>
<uint8_t name='tile'/>
<static-array name='basic_color' type-name='int16_t' count='2'/>
<static-array name='build_color' type-name='int16_t' count='3'/>
<static-array name='tile_color' type-name='int16_t' count='3'/>
<uint8_t name='item_symbol'/>
<int16_t name='powder_dye'/> // color token index
<int16_t name='temp_diet_info'/>
<stl-vector name='syndrome'>
<pointer/>
</stl-vector>
<int32_t name='soap_level'/>
</struct-type>
<struct-type type-name='material' inherits-from='material_common'>
<code-helper name='find-instance'>(material-by-id $ $$)</code-helper>
<code-helper name='describe'> (describe-material $) </code-helper>
<stl-string name='prefix'/>
<static-array name='food_mat_index' count='37' index-enum='organic_mat_category'>
<int32_t refers-to='(food-mat-by-idx $$._key $)'
comment='When valid, refers to itself.'/>
</static-array>
<stl-string name='powder_dye_str' comment='temporary'/>
<static-array name='state_color_str' type-name='stl-string' count='6'/>
</struct-type>
<struct-type type-name='material_template'>
<compound type-name='material_common'/>
<code-helper name='describe'> (describe-material $) </code-helper>
<stl-string name='powder_dye_str' comment='temporary'/>
<static-array name='state_color_str' type-name='stl-string' count='6'/>
</struct-type>
<struct-type type-name='material_plant' instance-vector='$global.world.raws.plants.all'>
<stl-string name='id'/>
<code-helper name='describe'>$.id</code-helper>
<df-flagarray name='flags'/>
<stl-string name='name'/>
<stl-string name='name_plural'/>
<stl-string name='adj'/>
<stl-string name='seed_singular'/>
<stl-string name='seed_plural'/>
<stl-string name='leaves_singular'/>
<stl-string name='leaves_plural'/>
<uint8_t name='unk1'/>
<uint8_t name='unk2'/>
<compound name='tiles'>
<uint8_t name='picked_tile'/>
<uint8_t name='dead_picked_tile'/>
<uint8_t name='shrub_tile'/>
<uint8_t name='dead_shrub_tile'/>
<uint8_t name='leaves_tile'/>
<uint8_t name='tree_tile'/>
<uint8_t name='dead_tree_tile'/>
<uint8_t name='sapling_tile'/>
<uint8_t name='dead_sapling_tile'/>
<static-array type-name='uint8_t' name='grass_tiles' count='16'/>
<static-array type-name='uint8_t' name='alt_grass_tiles' count='12'/>
</compound>
<int32_t name='growdur'/>
<int32_t name='value'/>
<compound name='colors'>
<static-array type-name='int8_t' name='picked_color' count='3'/>
<static-array type-name='int8_t' name='dead_picked_color' count='3'/>
<static-array type-name='int8_t' name='shrub_color' count='3'/>
<static-array type-name='int8_t' name='dead_shrub_color' count='3'/>
<static-array type-name='int8_t' name='seed_color' count='3'/>
<static-array type-name='int8_t' name='leaves_color' count='3'/>
<static-array type-name='int8_t' name='dead_leaves_color' count='3'/>
<static-array type-name='int8_t' name='tree_color' count='3'/>
<static-array type-name='int8_t' name='dead_tree_color' count='3'/>
<static-array type-name='int8_t' name='sapling_color' count='3'/>
<static-array type-name='int8_t' name='dead_sapling_color' count='3'/>
<static-array type-name='int8_t' name='grass_colors_0' count='20'/>
<static-array type-name='int8_t' name='grass_colors_1' count='20'/>
<static-array type-name='int8_t' name='grass_colors_2' count='20'/>
</compound>
<static-array type-name='int32_t' name='alt_period' count='2'/>
<int8_t name='shrub_drown_level'/>
<int8_t name='tree_drown_level'/>
<int8_t name='sapling_drown_level'/>
<int16_t name='frequency'/>
<int16_t name='clustersize'/>
<stl-vector name='prefstring'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector name='material'>
<pointer type-name='material'/>
</stl-vector>
<compound name='material_defs'>
<int16_t name='material_type_basic_mat'/>
<int16_t name='material_type_tree'/>
<int16_t name='material_type_drink'/>
<int16_t name='material_type_seed'/>
<int16_t name='material_type_thread'/>
<int16_t name='material_type_mill'/>
<int16_t name='material_type_extract_vial'/>
<int16_t name='material_type_extract_barrel'/>
<int16_t name='material_type_extract_still_vial'/>
<int16_t name='material_type_leaves'/>
<int32_t name='material_idx_basic_mat'/>
<int32_t name='material_idx_tree'/>
<int32_t name='material_idx_drink'/>
<int32_t name='material_idx_seed'/>
<int32_t name='material_idx_thread'/>
<int32_t name='material_idx_mill'/>
<int32_t name='material_idx_extract_vial'/>
<int32_t name='material_idx_extract_barrel'/>
<int32_t name='material_idx_extract_still_vial'/>
<int32_t name='material_idx_leaves'/>
<static-array type-name='stl-string' name='material_str_basic_mat' count='3'/>
<static-array type-name='stl-string' name='material_str_tree' count='3'/>
<static-array type-name='stl-string' name='material_str_drink' count='3'/>
<static-array type-name='stl-string' name='material_str_seed' count='3'/>
<static-array type-name='stl-string' name='material_str_thread' count='3'/>
<static-array type-name='stl-string' name='material_str_mill' count='3'/>
<static-array type-name='stl-string' name='material_str_extract_vial' count='3'/>
<static-array type-name='stl-string' name='material_str_extract_barrel' count='3'/>
<static-array type-name='stl-string' name='material_str_extract_still_vial' count='3'/>
<static-array type-name='stl-string' name='material_str_leaves' count='3'/>
</compound>
<int32_t name='underground_depth_min'/>
<int32_t name='underground_depth_max'/>
</struct-type>
<struct-type type-name='material_inorganic' instance-vector='$global.world.raws.inorganics'>
<stl-string name='id'/>
<code-helper name='describe'>$.id</code-helper>
<df-flagarray name='flags'/>
<stl-vector name='metal_ore_str' comment='only during parsing'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector type-name='int16_t' name='metal_ore_matIndex'/>
<stl-vector type-name='int16_t' name='metal_ore_probability'/>
<stl-vector name='thread_metal_str' comment='only during parsing'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector type-name='int16_t' name='thread_metal_matIndex'/>
<stl-vector type-name='int16_t' name='thread_metal_probability'/>
<stl-vector type-name='int32_t' name='unk1'/>
<stl-vector name='environment_spec_str' comment='only during parsing'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector type-name='int16_t' name='environment_spec_matIndex'/>
<stl-vector type-name='int16_t' name='environment_spec_inclusion_type'/>
<stl-vector type-name='int8_t' name='environment_spec_probability'/>
<stl-vector type-name='int16_t' name='environment_location'/>
<stl-vector type-name='int16_t' name='environment_type'/>
<stl-vector type-name='int8_t' name='environment_probability'/>
<int32_t name='unk2'/>
<compound name='material' type-name='material'/>
</struct-type>
<enum-type type-name='organic_mat_category'>
<enum-item name='Meat'/>
<enum-item name='Fish'/>
<enum-item name='UnpreparedFish'/>
<enum-item name='Eggs'/>
<enum-item name='Plants'/>
<enum-item name='PlantDrink'/>
<enum-item name='CreatureDrink'/>
<enum-item name='PlantCheese'/>
<enum-item name='CreatureCheese'/>
<enum-item name='Seed'/>
<enum-item name='Leaf'/>
<enum-item name='PlantPowder'/>
<enum-item name='CreaturePowder'/>
<enum-item name='Glob'/>
<enum-item name='PlantLiquid'/>
<enum-item name='CreatureLiquid'/>
<enum-item name='MiscLiquid'/>
<enum-item name='Leather'/>
<enum-item name='Silk'/>
<enum-item name='PlantFiber'/>
<enum-item name='Bone'/>
<enum-item name='Shell'/>
<enum-item name='Wood'/>
<enum-item name='Horn'/>
<enum-item name='Pearl'/>
<enum-item name='Tooth'/>
<enum-item name='EdibleCheese'/>
<enum-item name='AnyDrink'/>
<enum-item name='EdiblePlant'/>
<enum-item name='CookableLiquid'/>
<enum-item name='CookablePowder'/>
<enum-item name='CookableSeed'/>
<enum-item name='CookableLeaf'/>
<enum-item name='Paste'/>
<enum-item name='Pressed'/>
<enum-item name='Yarn'/>
<enum-item name='MetalThread'/>
</enum-type>
<struct-type type-name='special_mat_table'>
<static-array name='organic_types' count='37' index-enum='organic_mat_category'>
<stl-vector type-name='int16_t' index-refers-to='(food-mat-by-idx $$._key $)'/>
</static-array>
<static-array name='organic_indexes' count='37' index-enum='organic_mat_category'>
<stl-vector type-name='int32_t'/>
</static-array>
<static-array name='organic_unknown' count='37' comment='everything 0'
index-enum='organic_mat_category'>
<stl-vector type-name='int32_t'/>
</static-array>
<static-array name='builtin' count='659'>
<pointer type-name='material'/>
</static-array>
<stl-vector name='extract_types'>
<int16_t ref-target='material' aux-value='$$._parent.extract_indexes[$._key]'/>
</stl-vector>
<stl-vector name='extract_indexes' type-name='int32_t'/>
<stl-vector name='extract_unknown' type-name='int32_t'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,285 +0,0 @@
<data-definition>
<enum-type type-name='uniform_material_class'>
<enum-item name='None' value='-1'/>
<enum-item comment='BROKEN'/>
<enum-item name='Leather'/>
<enum-item name='Cloth'/>
<enum-item name='Wood'/>
<enum-item comment='BROKEN'/>
<enum-item name='Stone'/>
<enum-item comment='BROKEN'/>
<enum-item comment='BROKEN'/>
<enum-item comment='BROKEN'/>
<enum-item comment='BROKEN'/>
<enum-item comment='BROKEN'/>
<enum-item comment='BROKEN'/>
<enum-item comment='BROKEN'/>
<enum-item comment='BROKEN'/>
<enum-item name='Metal'/>
<enum-item comment='BROKEN'/>
<enum-item name='Metal2'/>
<enum-item name='Gem'/>
<enum-item name='Bone'/>
<enum-item name='Shell'/>
<enum-item name='Pearl'/>
<enum-item name='Tooth'/>
<enum-item name='Horn'/>
<enum-item comment='BROKEN'/>
<enum-item comment='BROKEN'/>
<enum-item comment='BROKEN'/>
<enum-item comment='BROKEN'/>
<enum-item name='PlantFiber'/>
<enum-item name='Silk'/>
<enum-item name='Yarn'/>
</enum-type>
<bitfield-type type-name='uniform_indiv_choice'>
<flag-bit name='any'/>
<flag-bit name='melee'/>
<flag-bit name='ranged'/>
</bitfield-type>
<struct-type type-name='item_filter_spec'>
<enum base-type='int16_t' name="item_type" type-name='item_type'/>
<int16_t name="item_subtype" refers-to='(item-subtype-target $$._parent.item_type $)'/>
<enum base-type='int16_t' name="material_class" type-name='uniform_material_class'/>
<int16_t name='mattype' ref-target='material' aux-value='$$.matindex'/>
<int32_t name='matindex'/>
</struct-type>
<struct-type type-name='squad_uniform_spec'>
<int32_t name="item" ref-target='item'/>
<compound name='item_filter' type-name='item_filter_spec'/>
<int32_t name="color"/>
<stl-vector name="assigned">
<int32_t ref-target='item'/>
</stl-vector>
<compound name="indiv_choice" type-name='uniform_indiv_choice'/>
</struct-type>
<struct-type type-name='squad_ammo_spec'>
<compound name='item_filter' type-name='item_filter_spec'/>
<int32_t name="amount"/>
<bitfield name='flags' base-type='uint32_t'>
<flag-bit name='use_combat'/>
<flag-bit name='use_training'/>
</bitfield>
<stl-vector name="assigned">
<int32_t ref-target='item'/>
</stl-vector>
</struct-type>
<bitfield-type type-name='squad_use_flags' base-type='uint32_t'>
<flag-bit name='sleep'/>
<flag-bit name='train'/>
<flag-bit name='indiv_eq'/>
<flag-bit name='squad_eq'/>
</bitfield-type>
<enum-type type-name='uniform_category'>
<enum-item name='body'/>
<enum-item name='head'/>
<enum-item name='pants'/>
<enum-item name='gloves'/>
<enum-item name='shoes'/>
<enum-item name='shield'/>
<enum-item name='weapon'/>
</enum-type>
<bitfield-type type-name='uniform_flags' base-type='uint32_t'>
<flag-bit name='replace_clothing'/>
<flag-bit name='exact_matches'/>
</bitfield-type>
<struct-type type-name='squad_position' key-field='occupant'>
<int32_t name='occupant' ref-target='historical_figure'/>
<stl-vector name="unk_4"/>
<compound name='preferences'>
<stl-vector name="bed">
<int32_t ref-target='building'/>
</stl-vector>
<stl-vector name="armor_stand">
<int32_t ref-target='building'/>
</stl-vector>
<stl-vector name="box">
<int32_t ref-target='building'/>
</stl-vector>
</compound>
<stl-vector name="unk_44"/>
<static-array name='uniform' count='7' index-enum='uniform_category'>
<stl-vector>
<pointer type-name='squad_uniform_spec'/>
</stl-vector>
</static-array>
<stl-string name="unk_c4"/>
<compound name='flags' type-name='uniform_flags'/>
<stl-vector name='assigned_items'>
<int32_t ref-target='item'/>
</stl-vector>
<int32_t name="quiver" ref-target='item'/>
<int32_t name="backpack" ref-target='item'/>
<int32_t name="flask" ref-target='item'/>
-- May be invalid:
<int32_t name="activity1" ref-target='activity_entry'/>
<int32_t name="activity2" ref-target='activity_entry'/>
<int32_t name="activity3" ref-target='activity_entry'/>
<int32_t name="unk_10c"/>
<int32_t name="unk_110"/>
<int32_t name="unk_114"/>
<int32_t name="unk_118"/>
<int32_t name="unk_11c"/>
</struct-type>
<struct-type type-name='squad' key-field='id' instance-vector='$global.world.squads.all'>
<int32_t name='id'/>
<compound name='name' type-name='language_name'/>
<stl-string name='alias' comment='if not empty, used instead of name'/>
<code-helper name='describe'>
(describe-obj $.name)
</code-helper>
<stl-vector name='positions'>
<pointer type-name='squad_position'/>
</stl-vector>
<stl-vector name="unk_9c"/>
<stl-vector name="schedule">
<pointer>
<static-array count='12'>
<stl-string name='name'/>
<int16_t name='sleep_mode' comment='0 room, 1 barrack will, 2 barrack need'/>
<int16_t name='uniform_mode' comment='0 uniformed, 1 civ clothes'/>
<stl-vector name='orders'>
<pointer>
<pointer name="order"/>
<int32_t name="min_count"/>
<stl-vector name="unk_8">
<int32_t/>
</stl-vector>
<int32_t name="unk_18"/>
</pointer>
</stl-vector>
<stl-vector name='order_assignments'>
<int32_t refers-to='$$._parent._parent.orders[$]'/>
</stl-vector>
</static-array>
</pointer>
</stl-vector>
<int32_t name="cur_alert_idx"/>
<stl-vector name="rooms">
<pointer>
<int32_t name='building_id' ref-target='building'/>
<compound name='mode' type-name='squad_use_flags'/>
</pointer>
</stl-vector>
<stl-vector name="unk_d0"/>
<stl-vector name="unk_e0"/>
<int32_t name="uniform_priority"/>
<int32_t name="activity" ref-target='activity_entry'/>
<stl-vector name="ammunition">
<pointer type-name='squad_ammo_spec'/>
</stl-vector>
<stl-vector name="weapons_free">
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name="weapons_inuse">
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name="ammo_items">
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name="ammo_units">
<int32_t ref-target='unit'/>
</stl-vector>
<int16_t name="carry_food"/>
<int16_t name="carry_water"/>
</struct-type>
<struct-type type-name='entity_uniform' key-field='id'>
<int32_t name="id"/>
<int16_t name="unk_4"/>
<code-helper name='describe'>
(describe-obj $.name)
</code-helper>
<static-array name='uniform_item_types' count='7' index-enum='uniform_category'>
<stl-vector>
<enum base-type='int16_t' type-name='item_type'/>
</stl-vector>
</static-array>
<static-array name='uniform_item_subtypes' count='7' index-enum='uniform_category'>
<stl-vector>
<int16_t refers-to='(item-subtype-target $$._parent._parent._parent.uniform_item_types[$$._parent._key][$$._key] $)'/>
</stl-vector>
</static-array>
<static-array name='uniform_item_info' count='7' index-enum='uniform_category'>
<stl-vector name="unk_e8">
<pointer>
<int16_t name="unk_0"/>
<int16_t name="color"/>
<int32_t name="unk_4"/>
<int32_t name="unk_8"/>
<int32_t name="unk_c"/>
<compound name="indiv_choice" type-name='uniform_indiv_choice'/>
<int16_t name="mattype" ref-target='material' aux-value='$$.matindex'/>
<int32_t name="matindex"/>
<enum base-type='int16_t' name="material_class" type-name='uniform_material_class'/>
</pointer>
</stl-vector>
</static-array>
<stl-string name="name"/>
<compound name='flags' type-name='uniform_flags'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,62 +0,0 @@
<data-definition>
<struct-type type-name='proj_list_link'>
<pointer name='item' type-name='projectile'/>
<pointer name='prev' type-name='proj_list_link'/>
<pointer name='next' type-name='proj_list_link'/>
</struct-type>
<class-type type-name='projectile' original-name='projst' key-field='id'>
<pointer name='link' type-name='proj_list_link'/>
<int32_t name='id'/>
<pointer name='firer' type-name='unit'/>
<int16_t name='origin_x'/>
<int16_t name='origin_y'/>
<int16_t name='origin_z'/>
<int16_t name='target_x'/>
<int16_t name='target_y'/>
<int16_t name='target_z'/>
<int16_t name='cur_x'/>
<int16_t name='cur_y'/>
<int16_t name='cur_z'/>
<int16_t name='prev_x'/>
<int16_t name='prev_y'/>
<int16_t name='prev_z'/>
<int32_t name='distance_flown'/>
<int32_t name='unk14'/>
<int32_t name='unk15'/>
<int32_t name='unk16'/>
<bool name='collided' comment='or falling?'/>
<int16_t name='fall_counter' comment='counts down from delay to 0, then it moves'/>
<int16_t name='fall_delay'/>
<int32_t name='unk20'/>
<int32_t name='unk21'/>
<int32_t name='unk22'/>
<int32_t name='unk23'/>
</class-type>
<class-type type-name='proj_itemst' inherits-from='projectile'>
<pointer name='item' type-name='item'/>
</class-type>
<class-type type-name='proj_unitst' inherits-from='projectile'>
<pointer name='unit' type-name='unit' comment='?'/>
</class-type>
<class-type type-name='proj_magicst' inherits-from='projectile'>
<pointer name='unk' comment='?'/>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,237 +0,0 @@
<data-definition>
<struct-type type-name='world_raws'>
-- Materials
<stl-vector name='material_templates'>
<pointer type-name='material_template'/>
</stl-vector>
-- Inorganic
<stl-vector name='inorganics'>
<pointer type-name='material_inorganic'/>
</stl-vector>
<stl-vector name='inorganics_subset'>
<pointer type-name='material_inorganic'/>
</stl-vector>
-- Plants
<compound name='plants'>
dtor 852cc20
<stl-vector name='all'>
<pointer type-name='material_plant'/>
</stl-vector>
<stl-vector name='bushes'>
<pointer type-name='material_plant'/>
</stl-vector>
<stl-vector name='bushes_idx' index-refers-to='$$._parent.bushes[$]'>
<int32_t ref-target='material_plant'/>
</stl-vector>
<stl-vector name='trees'>
<pointer type-name='material_plant'/>
</stl-vector>
<stl-vector name='trees_idx' index-refers-to='$$._parent.trees[$]'>
<int32_t ref-target='material_plant'/>
</stl-vector>
<stl-vector name='grasses'>
<pointer type-name='material_plant'/>
</stl-vector>
<stl-vector name='grasses_idx' index-refers-to='$$._parent.grasses[$]'>
<int32_t ref-target='material_plant'/>
</stl-vector>
</compound>
-- Creature RAWs
<stl-vector name='tissue_templates' type-name='pointer'/>
dtor 89bab50
<stl-vector name='misc_templates' type-name='pointer'/>
dtor 8527e40
<stl-vector name='body_templates' type-name='pointer'/>
<stl-vector name='part_name_pairs'>
<pointer key-field='id'>
<stl-string name='id'/>
<stl-string name='human_singular'/>
<stl-string name='animal_singular'/>
<stl-string name='human_plural'/>
<stl-string name='animal_plural'/>
</pointer>
</stl-vector>
dtor 89ba980
<stl-vector name='mutant_templates' type-name='pointer'/>
-- Creatures
<compound name='creatures'>
dtor 81448c0
<stl-vector name='alphabetic'>
<pointer type-name='creature_raw'/>
</stl-vector>
<stl-vector name='all'>
<pointer type-name='creature_raw'/>
</stl-vector>
<int32_t name='unk1'/>
<stl-vector name='list_creature' type-name='int32_t'
comment='Together with list_caste, a list of all caste indexes in order.'/>
<stl-vector name='list_caste' type-name='int32_t'/>
</compound>
-- Item RAWs
<compound name='itemdefs'>
dtor 852e080
<stl-vector name='all'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='weapons'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='trapcomps'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='toys'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='tools'>
<pointer type-name='itemdef'/>
</stl-vector>
<static-array name='tools_by_type' count='14'>
<stl-vector>
<pointer type-name='itemdef'/>
</stl-vector>
</static-array>
<stl-vector name='instruments'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='armor'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='ammo'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='siege_ammo'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='gloves'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='shoes'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='shields'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='helms'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='pants'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='food'>
<pointer type-name='itemdef'/>
</stl-vector>
</compound>
-- Sapient species
<stl-vector name='species'>
<pointer/>
</stl-vector>
-- Language RAWs
dtor 852bc90
<stl-vector name='language_words'>
<pointer type-name='language_word'/>
</stl-vector>
<stl-vector name='language_symbols'>
<pointer type-name='language_symbol'/>
</stl-vector>
<stl-vector name='translations'>
<pointer type-name='language_translation'/>
</stl-vector>
<static-array name='unknown_54c88' count='2'>
<static-array count='58'>
<static-array count='12'>
<stl-vector type-name='int32_t'/>
</static-array>
</static-array>
</static-array>
-- Words
<stl-vector name='color_words'>
<pointer key-field='id'>
<stl-string name="id"/>
<stl-vector name="unk_1c"/>
<stl-vector name="unk_2c"/>
<stl-string name="name"/>
<int16_t name="unk_58"/>
<s-float name="unk_5c"/>
<s-float name="unk_60"/>
<s-float name="unk_64"/>
</pointer>
</stl-vector>
<stl-vector name='shape_words'>
<pointer key-field='id'>
<stl-string name="id"/>
<stl-vector name="unk_1c"/>
<stl-vector name="unk_2c"/>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-vector name="unk_74"/>
<int8_t name="unk_84"/>
</pointer>
</stl-vector>
<stl-vector name='all_color_words' type-name='pointer'/>
-- Reaction RAWs
<stl-vector name='reactions'>
<pointer/>
</stl-vector>
-- Workshops
<compound name='buildings'>
<stl-vector name='all'>
<pointer type-name='building_def'/>
</stl-vector>
<stl-vector name='workshops'>
<pointer type-name='building_def'/>
</stl-vector>
<stl-vector name='furnaces'>
<pointer type-name='building_def'/>
</stl-vector>
<int32_t name='unk3'/>
</compound>
-- Material index
<compound name='mat_table' type-name='special_mat_table'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,109 +0,0 @@
<data-definition>
<class-type type-name='general_ref' original-name='general_refst'/>
<class-type type-name='general_ref_artifact' inherits-from='general_ref'
original-name='general_ref_artifactst'>
<int32_t name='artifact_id' ref-target='artifact_record'/>
</class-type>
<class-type type-name='general_ref_nemesis' inherits-from='general_ref'
original-name='general_ref_nemesisst'>
<int32_t name='nemesis_id' ref-target='nemesis_record'/>
</class-type>
<class-type type-name='general_ref_item' inherits-from='general_ref'
original-name='general_ref_itemst'>
<int32_t name='item_id' ref-target='item'/>
</class-type>
<class-type type-name='general_ref_item_type' inherits-from='general_ref'
original-name='general_ref_item_typest'>
<enum base-type='int32_t' name='type' type-name='item_type'/>
<int32_t name='subtype' refers-to='(item-subtype-target $$._parent.type $)'/>
<int16_t name='unk1'/>
<int16_t name='unk2'/>
</class-type>
<class-type type-name='general_ref_coinbatch' inherits-from='general_ref'
original-name='general_ref_coinbatchst'>
<int32_t name='batch'/>
</class-type>
<class-type type-name='general_ref_mapsquare' inherits-from='general_ref'
original-name='general_ref_mapsquarest'>
<int16_t name='unk1'/>
<int16_t name='unk2'/>
<int32_t name='unk3'/>
</class-type>
<class-type type-name='general_ref_projectile' inherits-from='general_ref'
original-name='general_ref_projectilest'>
<int32_t name='projectile_id'/>
</class-type>
<class-type type-name='general_ref_unit' inherits-from='general_ref'
original-name='general_ref_unitst'>
<int32_t name='unit_id' ref-target='unit'/>
</class-type>
<class-type type-name='general_ref_building' inherits-from='general_ref'
original-name='general_ref_buildingst'>
<int32_t name='building_id' ref-target='building'/>
</class-type>
<class-type type-name='general_ref_building_well_tag' inherits-from='general_ref_building'
original-name='general_ref_building_well_tagst'>
<bool name='unk'/>
</class-type>
<class-type type-name='general_ref_entity' inherits-from='general_ref'
original-name='general_ref_entityst'>
<int32_t name='entity_id' ref-target='historical_entity'/>
</class-type>
<class-type type-name='general_ref_entity_art_image' inherits-from='general_ref'
original-name='general_ref_entity_art_imagest'>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
</class-type>
<class-type type-name='general_ref_is_artifactst' inherits-from='general_ref_artifact'/>
<class-type type-name='general_ref_is_nemesisst' inherits-from='general_ref_nemesis'/>
<class-type type-name='general_ref_contains_unitst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_contains_itemst' inherits-from='general_ref_item'/>
<class-type type-name='general_ref_contained_in_itemst' inherits-from='general_ref_item'/>
<class-type type-name='general_ref_unit_milkeest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_traineest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_itemownerst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_tradebringerst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_holderst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_workerst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_cageest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_beateest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_foodreceiverst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_kidnapeest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_patientst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_infantst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_slaughtereest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_sheareest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_building_civzone_assignedst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_triggerst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_triggertargetst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_chainst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_cagedst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_holderst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_use_target_1st' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_use_target_2st' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_destinationst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_nest_boxst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_entity_stolenst' inherits-from='general_ref_entity'/>
<class-type type-name='general_ref_entity_offeredst' inherits-from='general_ref_entity'/>
<class-type type-name='general_ref_entity_itemownerst' inherits-from='general_ref_entity'/>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,254 +0,0 @@
<data-definition>
<struct-type type-name='stockpile_settings_food'>
<stl-vector type-name='bool' name='meat'
index-refers-to='(food-mat-by-idx $Meat $)'/>
<stl-vector type-name='bool' name='fish'
index-refers-to='(food-mat-by-idx $Fish $)'/>
<stl-vector type-name='bool' name='unprepared_fish'
index-refers-to='(food-mat-by-idx $UnpreparedFish $)'/>
<stl-vector type-name='bool' name='egg'
index-refers-to='(food-mat-by-idx $Eggs $)'/>
<stl-vector type-name='bool' name='plants'
index-refers-to='(food-mat-by-idx $Plants $)'/>
<stl-vector type-name='bool' name='drink_plant'
index-refers-to='(food-mat-by-idx $PlantDrink $)'/>
<stl-vector type-name='bool' name='drink_animal'
index-refers-to='(food-mat-by-idx $CreatureDrink $)'/>
<stl-vector type-name='bool' name='cheese_plant'
index-refers-to='(food-mat-by-idx $PlantCheese $)'/>
<stl-vector type-name='bool' name='cheese_animal'
index-refers-to='(food-mat-by-idx $CreatureCheese $)'/> also 26
<stl-vector type-name='bool' name='seeds'
index-refers-to='(food-mat-by-idx $Seed $)'/> also 31
<stl-vector type-name='bool' name='leaves'
index-refers-to='(food-mat-by-idx $Leaf $)'/> also 32
<stl-vector type-name='bool' name='powder_plant'
index-refers-to='(food-mat-by-idx $PlantPowder $)'/>
<stl-vector type-name='bool' name='powder_creature'
index-refers-to='(food-mat-by-idx $CreaturePowder $)'/>
<stl-vector type-name='bool' name='glob'
index-refers-to='(food-mat-by-idx $Glob $)'/>
<stl-vector type-name='bool' name='glob_paste'
index-refers-to='(food-mat-by-idx $Paste $)'/>
<stl-vector type-name='bool' name='glob_pressed'
index-refers-to='(food-mat-by-idx $Pressed $)'/>
<stl-vector type-name='bool' name='liquid_plant'
index-refers-to='(food-mat-by-idx $PlantLiquid $)'/>
<stl-vector type-name='bool' name='liquid_animal'
index-refers-to='(food-mat-by-idx $CreatureLiquid $)'/>
<stl-vector type-name='bool' name='liquid_misc'
index-refers-to='(food-mat-by-idx $MiscLiquid $)'/>
</struct-type>
<struct-type type-name='stockpile_settings_refuse'>
<stl-vector type-name='bool' name='type' index-enum='item_type'/>
<stl-vector type-name='bool' name='corpses'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='body_parts'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='skulls'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='bones'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='hair'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='shells'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='teeth'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='horns'
index-refers-to='(find-creature $)'/>
</struct-type>
<enum-type type-name='stockpile_category'>
<enum-item name='Animals'/>
<enum-item name='Food'/>
<enum-item name='Furniture'/>
<enum-item name='Corpses'/>
<enum-item name='Refuse'/>
<enum-item name='Stone'/>
<enum-item name='Unused6'/>
<enum-item name='Ammo'/>
<enum-item name='Coins'/>
<enum-item name='Bars'/>
<enum-item name='Gems'/>
<enum-item name='Goods'/>
<enum-item name='Leather'/>
<enum-item name='Cloth'/>
<enum-item name='Wood'/>
<enum-item name='Weapons'/>
<enum-item name='Armor'/>
<enum-item name='Custom'/>
</enum-type>
<struct-type type-name='stockpile_settings'>
<bitfield name='flags' base-type='uint32_t'>
<flag-bit name='animals'/>
<flag-bit name='food'/>
<flag-bit name='furniture'/>
<flag-bit name='corpses'/>
<flag-bit name='refuse'/>
<flag-bit name='stone'/>
<flag-bit name='ammo'/>
<flag-bit name='coins'/>
<flag-bit name='bars'/>
<flag-bit name='gems'/>
<flag-bit name='goods'/>
<flag-bit name='leather'/>
<flag-bit name='cloth'/>
<flag-bit name='wood'/>
<flag-bit name='weapons'/>
<flag-bit name='armor'/>
</bitfield>
<compound name='animals'>
<bool name='animals_empty_cages'/>
<bool name='animals_empty_traps'/>
<stl-vector type-name='bool' name='enabled'
index-refers-to='(find-creature $)'/>
</compound>
<compound name='food'>
<compound type-name='stockpile_settings_food' name='type'/>
<bool name='prepared_meals'/>
</compound>
<compound name='furniture'>
<stl-vector type-name='bool' name='type' index-enum='item_type'/>
<stl-vector type-name='bool' name='other_mats'/> 16
<stl-vector type-name='bool' name='mats'
index-refers-to='(material-by-id 0 $)'/>
<static-array type-name='bool' name='quality_core' count='7' index-enum='item_quality'/>
<static-array type-name='bool' name='quality_total' count='7' index-enum='item_quality'/>
<bool name='sand_bags'/>
</compound>
<int32_t name='unk1'/>
<compound name='refuse'>
<compound type-name='stockpile_settings_refuse' name='type'/>
<bool name='fresh_raw_hide'/>
<bool name='rotten_raw_hide'/>
</compound>
<stl-vector type-name='bool' name='stone'
index-refers-to='(material-by-id 0 $)'/>
<stl-vector type-name='bool' name='unk2'/>
<compound name='ammo'>
<stl-vector type-name='bool' name='type'
index-refers-to='$global.world.raws.itemdefs.ammo[$]'/>
<stl-vector type-name='bool' name='other_mats'/> 2
<stl-vector type-name='bool' name='mats'
index-refers-to='(material-by-id 0 $)'/>
<static-array type-name='bool' name='quality_core' count='7' index-enum='item_quality'/>
<static-array type-name='bool' name='quality_total' count='7' index-enum='item_quality'/>
</compound>
<stl-vector type-name='bool' name='coins'
index-refers-to='(material-by-id 0 $)'/>
<stl-vector type-name='bool' name='bars_other_mats'/> 5
<stl-vector type-name='bool' name='blocks_other_mats'/> 5
<stl-vector type-name='bool' name='bars_mats'
index-refers-to='(material-by-id 0 $)'/>
<stl-vector type-name='bool' name='blocks_mats'
index-refers-to='(material-by-id 0 $)'/>
<compound name='gems'>
<stl-vector type-name='bool' name='rough_other_mats'
index-refers-to='(material-by-id $ -1)'/> 659
<stl-vector type-name='bool' name='cut_other_mats'
index-refers-to='(material-by-id $ -1)'/>
<stl-vector type-name='bool' name='rough_mats'
index-refers-to='(material-by-id 0 $)'/>
<stl-vector type-name='bool' name='cut_mats'
index-refers-to='(material-by-id 0 $)'/>
</compound>
<compound name='finished_goods'>
<stl-vector type-name='bool' name='type' index-enum='item_type'/>
<stl-vector type-name='bool' name='other_mats'/> 17
<stl-vector type-name='bool' name='mats'
index-refers-to='(material-by-id 0 $)'/>
<static-array type-name='bool' name='quality_core' count='7' index-enum='item_quality'/>
<static-array type-name='bool' name='quality_total' count='7' index-enum='item_quality'/>
</compound>
<stl-vector type-name='bool' name='leather'
index-refers-to='(food-mat-by-idx $Leather $)'/>
<compound name='cloth'>
<stl-vector type-name='bool' name='thread_silk'
index-refers-to='(food-mat-by-idx $Silk $)'/>
<stl-vector type-name='bool' name='thread_plant'
index-refers-to='(food-mat-by-idx $PlantFiber $)'/>
<stl-vector type-name='bool' name='thread_yarn'
index-refers-to='(food-mat-by-idx $Yarn $)'/>
<stl-vector type-name='bool' name='thread_metal'
index-refers-to='(food-mat-by-idx $MetalThread $)'/>
<stl-vector type-name='bool' name='cloth_silk'
index-refers-to='(food-mat-by-idx $Silk $)'/>
<stl-vector type-name='bool' name='cloth_plant'
index-refers-to='(food-mat-by-idx $PlantFiber $)'/>
<stl-vector type-name='bool' name='cloth_yarn'
index-refers-to='(food-mat-by-idx $Yarn $)'/>
<stl-vector type-name='bool' name='cloth_metal'
index-refers-to='(food-mat-by-idx $MetalThread $)'/>
</compound>
<stl-vector type-name='bool' name='wood'
index-refers-to='(find-plant-raw $)'/>
<compound name='weapons'>
<stl-vector type-name='bool' name='weapon_type'
index-refers-to='$global.world.raws.itemdefs.weapons[$]'/>
<stl-vector type-name='bool' name='trapcomp_type'
index-refers-to='$global.world.raws.itemdefs.trapcomps[$]'/>
<stl-vector type-name='bool' name='other_mats'/> 11
<stl-vector type-name='bool' name='mats'
index-refers-to='(material-by-id 0 $)'/>
<static-array type-name='bool' name='quality_core' count='7' index-enum='item_quality'/>
<static-array type-name='bool' name='quality_total' count='7' index-enum='item_quality'/>
<bool name='usable'/>
<bool name='unusable'/>
</compound>
<compound name='armor'>
<stl-vector type-name='bool' name='body'
index-refers-to='$global.world.raws.itemdefs.armor[$]'/>
<stl-vector type-name='bool' name='head'
index-refers-to='$global.world.raws.itemdefs.helms[$]'/>
<stl-vector type-name='bool' name='feet'
index-refers-to='$global.world.raws.itemdefs.shoes[$]'/>
<stl-vector type-name='bool' name='hands'
index-refers-to='$global.world.raws.itemdefs.gloves[$]'/>
<stl-vector type-name='bool' name='legs'
index-refers-to='$global.world.raws.itemdefs.pants[$]'/>
<stl-vector type-name='bool' name='shield'
index-refers-to='$global.world.raws.itemdefs.shields[$]'/>
<stl-vector type-name='bool' name='other_mats'/> 11
<stl-vector type-name='bool' name='mats'
index-refers-to='(material-by-id 0 $)'/>
<static-array type-name='bool' name='quality_core' count='7' index-enum='item_quality'/>
<static-array type-name='bool' name='quality_total' count='7' index-enum='item_quality'/>
<bool name='usable'/>
<bool name='unusable'/>
</compound>
<bool name='allow_organic'/>
<bool name='allow_inorganic'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,607 +0,0 @@
<data-definition>
<struct-type type-name='dipscript_info' key-field='code'>
<int32_t name='unk1' comment='uninit'/>
<stl-string name='script_file' comment='data/dipscript/dwarf_liaison'/>
<stl-vector name='script_steps' type-name='pointer'/>
<stl-vector name='unknown' comment='null'/>
<stl-string name='code' comment='DWARF_LIAISON etc'/>
</struct-type>
<struct-type type-name='burrow' key-field='id' instance-vector='$global.ui.burrows.list'>
<int32_t name='id'/>
<stl-string name='name'/>
<code-helper name='describe'>
(describe-obj $.name)
</code-helper>
<uint8_t name='tile'/>
<int16_t name='fg_color'/>
<int16_t name='bg_color'/>
<stl-vector name='unk1' type-name='int32_t'/>
<stl-vector name='unk2' type-name='int32_t'/>
<stl-vector name='unk3' type-name='int32_t'/>
<stl-vector name='units'>
<int32_t ref-target='unit'/>
</stl-vector>
</struct-type>
<enum-type type-name='ui_sidebar_mode'>
<enum-item name='Default'/>
<enum-item name='Squads'/>
-- 2
<enum-item name='DesignateMine'/>
<enum-item name='DesignateRemoveRamps'/>
<enum-item name='DesignateUpStair'/>
<enum-item name='DesignateDownStair'/>
<enum-item name='DesignateUpDownStair'/>
<enum-item name='DesignateUpRamp'/>
<enum-item name='DesignateChannel'/>
<enum-item name='DesignateGatherPlants'/>
<enum-item name='DesignateRemoveDesignation'/>
<enum-item name='DesignateSmooth'/>
<enum-item name='DesignateEngrave'/>
<enum-item name='DesignateCarveFortification'/>
-- 14
<enum-item name='Stockpiles'/>
<enum-item name='Build'/>
<enum-item name='QueryBuilding'/>
-- 17
<enum-item name='Orders'/>
<enum-item name='OrdersForbid'/>
<enum-item name='OrdersRefuse'/>
<enum-item name='OrdersWorkshop'/>
<enum-item name='OrdersZone'/>
-- 22
<enum-item name='BuildingItems'/>
<enum-item name='ViewUnits'/>
<enum-item name='LookAround'/>
-- 25
<enum-item name='DesignateItemsClaim'/>
<enum-item name='DesignateItemsForbid'/>
<enum-item name='DesignateItemsMelt'/>
<enum-item name='DesignateItemsUnmelt'/>
<enum-item name='DesignateItemsDump'/>
<enum-item name='DesignateItemsUndump'/>
<enum-item name='DesignateItemsHide'/>
<enum-item name='DesignateItemsUnhide'/>
-- 33
<enum-item name='DesignateChopTrees'/>
<enum-item name='DesignateToggleEngravings'/>
-- 35
<enum-item name='Hotkeys'/>
-- 36
<enum-item name='DesignateTrafficHigh'/>
<enum-item name='DesignateTrafficNormal'/>
<enum-item name='DesignateTrafficLow'/>
<enum-item name='DesignateTrafficRestricted'/>
-- 40
<enum-item name='Zones'/>
<enum-item name='ZonesPenInfo'/>
<enum-item name='ZonesPitInfo'/>
<enum-item name='ZonesHospitalInfo'/>
-- 44
<enum-item name='DesignateRemoveConstruction'/>
<enum-item name='DepotAccess'/>
<enum-item name='NotesPoints'/>
<enum-item name='NotesRoutes'/>
<enum-item name='Burrows'/>
</enum-type>
<struct-type type-name='cursor'>
<int32_t name='x'/>
<int32_t name='y'/>
<int32_t name='z'/>
</struct-type>
<struct-type type-name='selection_rect'>
<int32_t name='start_x'/>
<int32_t name='start_y'/>
<int32_t name='start_z'/>
<int32_t name='end_x'
comment='only valid for an instant while its being completed'/>
<int32_t name='end_y'/>
<int32_t name='end_z'/>
</struct-type>
<struct-type type-name='ui'>
ctor 86e33c0 x
dtor 8534190
<padding size='16'/>
<stl-vector name='unk10'/>
<padding size='76'/>
<stl-vector name='unk68' type-name='pointer'/>
<padding size='388'/>
<stl-vector name='currency_value' type-name='int32_t'
index-refers-to='(material-by-id 0 $)'/>
<padding size='812'/>
<stl-vector name='unk530' type-name='int32_t'/>
<padding size='7516'/>
<stl-vector name='unk2298' type-name='bool'
index-refers-to='(find-creature $)'/>
<stl-vector name='unk22a4' type-name='bool'
index-refers-to='(find-creature $)'/>
<stl-vector name='unk22b0' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<stl-vector name='unk22bc' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<padding size='16'/>
<stl-vector name='unk22d8' type-name='int32_t'/>
<padding size='4'/>
<stl-vector name='unk22e8'/>
<stl-vector name='dip_meeting_vec'>
<pointer type-name='meeting_diplomat'/>
</stl-vector>
<stl-vector name='dip_meeting_info'>
<pointer>
<int32_t name='civ_id' ref-target='historical_entity'/>
<int16_t name='unk1'/>
<int32_t name='diplomat_id' ref-target='historical_figure'/>
<int32_t name='unk2' comment='-1'/>
<padding size='32' comment='0'/>
<pointer name='dipscript' type-name='dipscript_info'/>
<padding size='16' comment='0'/>
<stl-string name='unk3'/>
<stl-string name='unk4'/>
<padding size='112' comment='0'/>
</pointer>
</stl-vector>
<stl-vector name='unk230c' comment='really a wild guess'>
<int32_t ref-target='unit'/>
</stl-vector>
<padding size='4'/>
<stl-vector name='invasions' comment='goblins...'>
<pointer>
<int32_t name='id'/>
<int32_t name='civ_id' ref-target='historical_entity'/>
<int32_t name='is_active1' comment='0 unless active'/>
<int32_t name='is_active2'/>
<int32_t name='size' comment='just a guess'/>
<int32_t name='duration_counter'/>
<int16_t name='unk4a'/>
<int16_t name='unk4b'/>
</pointer>
</stl-vector>
<int32_t name='next_invasion_id'/>
<stl-vector name='crimes'>
<pointer>
<enum name='mode' base-type='int16_t'>
<enum-item name='ProductionOrderViolation'/>
<enum-item name='ExportViolation'/>
<enum-item name='JobOrderViolation'/>
<enum-item name='ConspiracyToSlowLabor'/>
<enum-item name='Murder'/>
<enum-item name='DisorderlyBehavior'/>
<enum-item name='BuildingDestruction'/>
<enum-item name='Vandalism'/>
</enum>
<int16_t name='unk2' comment='uninit'/>
<int16_t name='unk3'/>
<int16_t name='unk4'/>
<int32_t name='unk5'/>
<pointer name='criminal' type-name='unit'/>
<pointer name='victim' type-name='unit'/>
<int32_t name='punishment_assigned'/>
</pointer>
</stl-vector>
<stl-vector name='punishments'>
<pointer>
<pointer name="criminal" type-name='unit'/>
<pointer name="officer" type-name='unit'/>
<int16_t name="beating"/>
<int16_t name="hammer_strikes"/>
<int32_t name="prison_counter"/>
<int16_t name="unk_10" comment='10080'/>
<pointer name="chain" type-name='building'/>
<stl-vector name="victims">
<pointer type-name="unit"/>
</stl-vector>
</pointer>
</stl-vector>
<stl-vector name='pet_meeting_vec'>
<pointer type-name='meeting_pet'/>
</stl-vector>
<stl-vector name='unk2350' type-name='pointer'/>
<stl-vector name='unk235c' type-name='pointer'/>
<stl-vector name='dipscripts'>
<pointer type-name='dipscript_info'/>
</stl-vector>
<stl-vector name='unk2374' type-name='pointer'/>
<compound name='kitchen'>
<stl-vector name='item_types' type-name='int16_t'/>
<stl-vector name='item_subtypes' type-name='int16_t'/>
<stl-vector name='mat_types'>
<int16_t ref-target='material' aux-value='$$._parent.mat_indices[$._key]'/>
</stl-vector>
<stl-vector name='mat_indices' type-name='int32_t'/>
<stl-vector name='exc_types' type-name='int8_t'/>
</compound>
<stl-vector name='economic_stone' type-name='bool'
index-refers-to='(material-by-id 0 $)'/>
<padding size='4'/>
<int16_t name='unk23cc'/>
<int16_t name='unk23ce'/>
<int32_t name='unk23d0'/>
<int32_t name='unk23d4'/>
<int32_t name='group_id' ref-target='historical_entity'/>
<int32_t name='race_id' ref-target='creature_raw'/>
<stl-vector name='unk23e0' type-name='int16_t'/>
<stl-vector name='unk23ec' type-name='int8_t'/>
<static-array name='unk23f8' count='2'>
<static-array count='30'>
<stl-vector type-name='int32_t'/>
</static-array>
</static-array>
<compound name='stockpile'>
<int32_t name='reserved_bins'/>
<int32_t name='reserved_barrels'/>
<compound name='custom_settings' type-name='stockpile_settings'/>
</compound>
<static-array name='unk2a8c' count='4'>
<static-array count='768'>
<int16_t name='unk1'/>
<int16_t name='unk2'/>
</static-array>
</static-array>
<stl-vector name='unk5a8c' type-name='int16_t'/>
<stl-vector name='unk5a98' type-name='int16_t'/>
<stl-vector name='unk5aa4' type-name='int16_t'/>
<static-array name='unk5ab0' count='5'>
<stl-vector type-name='int16_t'/>
</static-array>
<stl-vector name='unk5aec' type-name='int16_t'/>
<static-array name='unk5af8' count='5'>
<stl-vector type-name='int16_t'/>
</static-array>
<stl-vector name='unk5b34' type-name='int16_t'/>
<static-array name='unk5b40' count='5'>
<stl-vector type-name='int16_t'/>
</static-array>
<stl-vector name='unk5b7c' type-name='int16_t'/>
<static-array name='unk5b88' count='7'>
<stl-vector/>
</static-array>
<compound name='waypoints'>
<stl-vector name='points'>
<pointer key-field='name'>
<int32_t name='id'/>
<uint8_t name='tile'/>
<int16_t name='fg_color'/>
<int16_t name='bg_color'/>
<stl-string name='name'/>
<stl-string name='comment'/>
<int16_t name='x'/>
<int16_t name='y'/>
<int16_t name='z'/>
</pointer>
</stl-vector>
<stl-vector name='routes'>
<pointer key-field='name'>
<int32_t name='id'/>
<stl-string name='name'/>
<stl-vector name='points'>
<int32_t/>
</stl-vector>
</pointer>
</stl-vector>
<int16_t name='sym_selector'/>
<int16_t/>
<int32_t name='cur_point_index'/>
<bool name='in_edit_name_mode'/>
<int8_t/>
<uint8_t name='sym_tile'/>
<int16_t name='sym_fg_color'/>
<int16_t name='sym_bg_color'/>
<stl-vector name='unk5c04'>
<pointer type-name='stl-string'/>
</stl-vector>
<int32_t name='next_point_id'/>
<int32_t name='next_route_id'/>
<int32_t name='sel_route_idx'/>
<int32_t name='sel_route_waypt_idx'/>
<bool name='in_edit_waypts_mode'/>
</compound>
<compound name='burrows'>
<stl-vector name='list'>
<pointer type-name='burrow'/>
</stl-vector>
<int32_t name='next_id'/>
<int32_t name='sel_index1'/>
<int32_t name='sel_index2'/>
<bool name='in_add_units_mode'/>
<stl-vector name='list_units'>
<pointer type-name='unit'/>
</stl-vector>
<stl-bit-vector name='sel_units' index-refers-to='$$._parent.list_units[$]'/>
<int32_t name='unit_cursor_pos'/>
<bool name='in_define_mode'/>
<int16_t name='rect_start_x'/>
<int16_t name='rect_start_y'/>
<int16_t name='rect_start_z'/>
<int32_t name='brush_mode'/>
<int16_t name='sym_selector'/>
<int16_t name='sym_tile'/>
<int16_t name='sym_fg_color'/>
<int16_t name='sym_bg_color'/>
</compound>
<compound name='alerts'>
<stl-vector name='list'>
<pointer key-field='name'>
<int32_t name='id'/>
<stl-string name='name'/>
<stl-vector/>
</pointer>
</stl-vector>
<int32_t name='next_id'/>
<int32_t name='civ_alert_idx' refers-to='$$._parent.list[$]'/>
</compound>
<compound name='equipment'>
<static-array name='items_by_type1' count='112' index-enum='item_type'>
<stl-vector>
<pointer type-name='item'/>
</stl-vector>
</static-array>
<static-array name='items_unassigned' count='112' index-enum='item_type'>
<stl-vector>
<pointer type-name='item'/>
</stl-vector>
</static-array>
<static-array name='items_assigned' count='112' index-enum='item_type'>
<stl-vector>
<pointer type-name='item'/>
</stl-vector>
</static-array>
<int32_t name='unk6c4c'/>
<stl-vector name='work_weapons' comment='i.e. woodcutter axes, and miner picks'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='work_units'>
<int32_t ref-target='unit'/>
</stl-vector>
<stl-vector name='hunter_ammunition'>
<pointer type-name='squad_ammo_spec'/>
</stl-vector>
<stl-vector name='ammo_items'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='ammo_units'>
<int32_t ref-target='unit'/>
</stl-vector>
</compound>
<compound name='main'>
<static-array name='hotkeys' count='16'>
<stl-string name='name'/>
<int16_t name='cmd'/>
<int32_t name='x'/>
<int32_t name='y'/>
<int32_t name='z'/>
</static-array>
<int32_t name='traffic_cost_high'/>
<int32_t name='traffic_cost_normal'/>
<int32_t name='traffic_cost_low'/>
<int32_t name='traffic_cost_restricted'/>
<stl-vector name='unk6ddc'>
<pointer>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
<int32_t name='unk3'/>
<int32_t name='unk4'/>
<int32_t name='unk5'/>
<int16_t name='unk6'/>
<int32_t name='unk7'/>
</pointer>
</stl-vector>
<pointer name='unk6de8' type-name='historical_entity'/>
<enum base-type='int32_t' name='mode' type-name='ui_sidebar_mode'/>
<int32_t name='selected_traffic_cost'
comment='For changing the above costs.'/>
<int32_t name='unk6df4'/>
<int16_t name='selected_hotkey'/>
<bool name='in_rename_hotkey'/>
</compound>
<compound name='squads'>
<stl-vector name='list' has-bad-pointers='true'
comment='valid only when ui is displayed'>
<pointer type-name='squad'/>
</stl-vector>
<stl-vector name='unk6e08'/>
<stl-bit-vector name='sel_squads' index-refers-to='$$._parent.list[$]'/>
<stl-vector name='indiv_selected'>
<int32_t ref-target='historical_figure'/>
</stl-vector>
<bool name='in_select_indiv'/>
<int32_t name='sel_indiv_squad' refers-to='$$._parent.list[$]'/>
<padding size='8'/>
<int32_t name='unk48'/>
<pointer name='unk4c' type-name='squad'/>
<bool name='in_move_order'/>
<int32_t name='point_list_scroll'/>
<bool name='in_kill_order'/>
<stl-vector name='kill_rect_targets'>
<pointer type-name='unit'/>
</stl-vector>
<padding size='4'/>
<bool name='in_kill_list'/>
<stl-vector name='kill_targets'>
<pointer type-name='unit'/>
</stl-vector>
<stl-bit-vector name='sel_kill_targets' index-refers-to='$$._parent.kill_target[$]'/>
<padding size='4'/>
<bool name='in_kill_rect'/>
<int16_t name='rect_start_x'/>
<int16_t name='rect_start_y'/>
<int16_t name='rect_start_z'/>
</compound>
<padding size='4'/>
</struct-type>
<struct-type type-name='build_item_selector'>
<stl-vector name='requirement'>
<pointer>
<enum base-type='int16_t' name="item_type" type-name='item_type'/>
<int16_t name="unk_2"/>
<int16_t name="unk_4"/>
<int32_t name="unk_8"/>
<int32_t name="unk_c"/>
<pointer name="item_vector">
<stl-vector>
<pointer type-name='item'/>
</stl-vector>
</pointer>
<int8_t name="unk_14"/>
<int32_t name="unk_18"/>
<int8_t name="unk_1c"/>
<int32_t name="unk_20"/>
<int8_t name="unk_24"/>
<int32_t name="unk_28"/>
<int8_t name="unk_2c"/>
<int32_t name="unk_30"/>
<int8_t name="unk_34"/>
<stl-string name='unk38'/>
<stl-string name='unk3c'/>
<int32_t name="unk_40"/>
<int16_t name="unk_44"/>
<int8_t name="unk_46"/>
<int32_t name="unk_48"/>
<int32_t name="unk_4c"/>
<stl-vector name='unk50'/>
<int8_t name="unk_5c"/>
<int16_t name="unk_5e"/>
<int16_t name="unk_60"/>
<int16_t name="unk_62"/>
<int16_t name="unk_64"/>
<int32_t name="unk_68"/>
<int32_t name="unk_6c"/>
<int32_t name="unk_70"/>
<int32_t name="unk_74"/>
<stl-vector name='unk78'/>
<int8_t name="unk_84"/>
<stl-vector name='candidates'>
<pointer type-name='item'/>
</stl-vector>
<stl-vector name='unk_94' type-name='int8_t'/>
<stl-vector name='unk_a0' type-name='int16_t'/>
<stl-vector name='unk_ac' type-name='int8_t'/>
<int32_t name="unk_b8"/>
<int16_t name="unk_bc"/>
</pointer>
</stl-vector>
<stl-vector name='choices' type-name='pointer'/>
<int32_t name="unk_18"/>
<int16_t name="unk_1c"/>
<int16_t name="unk_1e"/>
<int32_t name="unk_20"/>
<int32_t name="unk_24"/>
<int16_t name="unk_28"/>
<int16_t name="sel_index"/>
<int32_t name="unk_2c"/>
<stl-vector name='unk3'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector name='unk4'>
<pointer type-name='stl-string'/>
</stl-vector>
<padding size='3848'/>
<int32_t name='unk5_1'/>
<int32_t name='unk5_2'/>
<int8_t name='unk5_3a'/>
<int8_t name='unk5_3b'/>
<int8_t name='unk5_3c'/>
<int8_t name='unk5_3d'/>
<int32_t name='unk5_4'/>
<stl-vector name='unk6'/>
<stl-vector name='unk7'/>
dtor: 0x85272c0
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,696 +0,0 @@
<data-definition>
<bitfield-type type-name='unit_flags1' base-type='uint32_t'>
<flag-bit name='move_state'
comment='Can the dwarf move or are they waiting for their movement timer'/>
<flag-bit name='dead'
comment='Dead (might also be set for incoming/leaving critters that are alive)'/>
<flag-bit name='has_mood' comment='Currently in mood'/>
<flag-bit name='had_mood' comment='Had a mood already'/>
<flag-bit name='marauder' comment='wide class of invader/inside creature attackers'/>
<flag-bit name='drowning' comment='Is currently drowning'/>
<flag-bit name='merchant' comment='An active merchant'/>
<flag-bit name='forest'
comment='used for units no longer linked to merchant/diplomacy, they just try to leave mostly'/>
<flag-bit name='left' comment='left the map'/>
<flag-bit name='rider' comment='Is riding an another creature'/>
<flag-bit name='incoming'/>
<flag-bit name='diplomat'/>
<flag-bit name='zombie'/>
<flag-bit name='skeleton'/>
<flag-bit name='can_swap' comment='Can swap tiles during movement (prevents multiple swaps)'/>
<flag-bit name='on_ground' comment='The creature is laying on the floor, can be conscious'/>
<flag-bit name='projectile' comment='Launched into the air? Funny.'/>
<flag-bit name='active_invader' comment='Active invader (for organized ones)'/>
<flag-bit name='hidden_in_ambush'/>
<flag-bit name='invader_origin' comment='Invader origin (could be inactive and fleeing)'/>
<flag-bit name='coward' comment='Will flee if invasion turns around'/>
<flag-bit name='hidden_ambusher' comment='Active marauder/invader moving inward?'/>
<flag-bit name='invades' comment='Marauder resident/invader moving in all the way'/>
<flag-bit name='check_flows' comment='Check against flows next time you get a chance'/>
<flag-bit name='ridden'/>
<flag-bit name='caged'/>
<flag-bit name='tame'/>
<flag-bit name='chained'/>
<flag-bit name='royal_guard'/>
<flag-bit name='fortress_guard'/>
<flag-bit name='suppress_wield'/>
<flag-bit name='important_historical_figure' comment='Is an important historical figure'/>
</bitfield-type>
<bitfield-type type-name='unit_flags2' base-type='uint32_t'>
<flag-bit name='swimming'/>
<flag-bit name='sparring'/>
<flag-bit name='no_notify' comment='Do not notify about level gains (for embark etc)'/>
<flag-bit name='unused'/>
<flag-bit name='calculated_nerves'/>
<flag-bit name='calculated_bodyparts'/>
<flag-bit name='important_historical_figure'
comment='Is important historical figure (slight variation)'/>
<flag-bit name='killed'
comment='Has been killed by kill function (slightly different from dead, not necessarily violent death)'/>
<flag-bit name='cleanup_1' comment='Must be forgotten by forget function (just cleanup)'/>
<flag-bit name='cleanup_2' comment='Must be deleted (cleanup)'/>
<flag-bit name='cleanup_3' comment='Recently forgotten (cleanup)'/>
<flag-bit name='for_trade' comment='Offered for trade'/>
<flag-bit name='trade_resolved'/>
<flag-bit name='has_breaks'/>
<flag-bit name='gutted'/>
<flag-bit name='circulatory_spray'/>
<flag-bit name='locked_in_for_trading'
comment="Locked in for trading (it's a projectile on the other set of flags, might be what the flying was)"/>
<flag-bit name='slaughter' comment='marked for slaughter'/>
<flag-bit name='underworld' comment='Underworld creature'/>
<flag-bit name='resident' comment='Current resident'/>
<flag-bit name='cleanup_4'
comment='Marked for special cleanup as unused load from unit block on disk'/>
<flag-bit name='calculated_insulation' comment='Insulation from clothing calculated'/>
<flag-bit name='visitor_uninvited' comment='Uninvited guest'/>
<flag-bit name='visitor'/>
<flag-bit name='calculated_inventory' comment='Inventory order calculated'/>
<flag-bit name='vision_good' comment='Vision -- have good part'/>
<flag-bit name='vision_damaged' comment='Vision -- have damaged part'/>
<flag-bit name='vision_missing' comment='Vision -- have missing part'/>
<flag-bit name='breathing_good' comment='Breathing -- have good part'/>
<flag-bit name='breathing_problem' comment='Breathing -- having a problem'/>
<flag-bit name='roaming_wilderness_population_source'/>
<flag-bit name='roaming_wilderness_population_source_not_a_map_feature'/>
</bitfield-type>
<bitfield-type type-name='unit_flags3' base-type='uint32_t'>
<flag-bit name='unk0' comment='Is 1 for new and dead creatures, periodicaly set to 0 for non-dead creatures.'/>
<flag-bit name='unk1' comment='Is 1 for new creatures, periodically set to 0 for non-dead creatures.'/>
<flag-bit name='unk2' comment='Is set to 1 every tick for non-dead creatures.'/>
<flag-bit name='unk3' comment='Is periodically set to 0 for non-dead creatures.'/>
<flag-bit name='announce_titan' comment='Announces creature like an FB or titan.'/>
<flag-bit name='unk5'/>
<flag-bit name='unk6'/>
<flag-bit name='unk7'/>
<flag-bit name='unk8' comment='Is set to 1 every tick for non-dead creatures.'/>
<flag-bit name='unk9' comment='Is set to 0 every tick for non-dead creatures.'/>
<flag-bit name='scuttle'>
<comment>
Scuttle creature: causes creature to be killed, leaving a behind
corpse and generating negative thoughts like a real kill.
</comment>
</flag-bit>
<flag-bit name='unk11'/>
<flag-bit name='ghostly'/>
</bitfield-type>
<struct-type type-name='unit' key-field='id' instance-vector='$global.world.units.all'>
<compound type-name='language_name' name='name'/>
<code-helper name='describe'>
(describe-obj $.name)
(awhen (find-creature $.race)
(fmt "~:(~A ~A~)" $it.caste[$.caste].caste_id $it.creature_id))
</code-helper>
<stl-string name='custom_profession'/>
<enum base-type='int16_t' name='profession' type-name='profession'/>
<enum base-type='int16_t' name='profession2' type-name='profession'/>
<uint32_t name='race' ref-target='creature_raw'/>
<int16_t name='x'/>
<int16_t name='y'/>
<int16_t name='z'/>
<int16_t name='old_x'>
<comment>
E.g. for a dead miner, holds the place where he
was likely hanging around when he got the command
to mine in an aquifer.
</comment>
</int16_t>
<int16_t name='old_y'/>
<int16_t name='old_z'/>
<compound name='unknown1'>
<uint32_t name='unk_9c'/>
<int16_t name='unk_a0'/>
<padding size='2'/>
<int16_t name='unk_a4a'/>
<int16_t name='unk_a4b'/>
</compound>
<compound name='path'>
<int16_t name='dest_x'/>
<int16_t name='dest_y'/>
<int16_t name='dest_z'/>
<int16_t name='unk_ae' comment='-1 unless dest valid'/>
<stl-vector name='path_x' type-name='int16_t'/>
<stl-vector name='path_y' type-name='int16_t'/>
<stl-vector name='path_z' type-name='int16_t'/>
</compound>
<compound name='flags1' type-name='unit_flags1'/>
<compound name='flags2' type-name='unit_flags2'/>
<compound name='flags3' type-name='unit_flags3'/>
<compound name='unknown2'>
<int8_t name='unk_ec'/>
<int32_t name='unk_f0'/>
<int16_t name='unk_f4'/>
<padding size='2'/>
</compound>
<uint16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<uint8_t name='sex'/>
<int32_t name='id'/>
<int16_t name='unk_100'/>
<int32_t name='unk_104'/>
<int32_t name='civ_id' ref-target='historical_entity'/>
<int32_t name='population_id' ref-target='entity_population'/>
<compound name='unknown3'>
<int32_t name='unk_110'/>
<stl-vector name='unk_114'/>
<stl-vector name='unk_124'/>
<stl-vector name='unk_134'/>
<uint32_t name='unk_144'/>
</compound>
<stl-vector name='meetings'>
<pointer type-name='meeting_ref'/>
</stl-vector>
<stl-vector name='refs'>
<pointer type-name='general_ref'/>
</stl-vector>
<compound name='military'>
<int32_t name='squad_index' ref-target='squad'/>
<int32_t name='squad_position'/>
<int32_t name='unk_170'/>
<int32_t name='draft_timer'/>
<int16_t name='cur_uniform'/>
<static-array name='uniforms' count='4'>
<stl-vector>
<int32_t ref-target='item'/>
</stl-vector>
</static-array>
<bitfield name='pickup_flags'>
<flag-bit name='update'/>
</bitfield>
<stl-vector name='uniform_pickup'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='uniform_drop'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='individual_drills'>
<int32_t ref-target='activity_entry'/>
</stl-vector>
</compound>
<compound name='unknown4'>
<int16_t name='unk_1f0_a'/>
<int16_t name='unk_1f0_b'/>
<int16_t name='unk_1f4'/>
<int32_t name='unk_1f8'/>
<int32_t name='unk_1fc'/>
<int32_t name='unk_200'/>
<int16_t name='unk_204'/>
<uint32_t name='animal_leave_countdown'
comment='once 0, it heads for the edge and leaves'/>
<uint32_t name='unk_20c'/>
</compound>
<int16_t name='mood'/>
<int16_t name='unk_18e'/>
<compound name='relations'>
<uint32_t name='pregnancy_timer'/>
<pointer name='pregnancy_ptr'/>
<int16_t name='unk_21c_a'/>
<int16_t name='unk_21c_b'/>
<uint32_t name='unk_220'/>
<int32_t name='birth_year'/>
<int32_t name='birth_time'/>
<int32_t name='old_year' comment='could there be a death of old age time??'/>
<int32_t name='old_time'/>
<pointer type-name='unit' name='following'/>
<uint16_t name='unk_238'/>
<int32_t name='pet_owner_id' ref-target='unit'/>
<int32_t name='married_id' ref-target='unit'
comment='not used in relationship screen..'/>
<int32_t name='mother_id' ref-target='unit'/>
<int32_t name='father_id' ref-target='unit'/>
<int32_t name='last_attacker_id' ref-target='unit'/>
<int32_t name='enemy_group_leader_id' ref-target='unit'/>
<int32_t name='unk_254'/>
<int32_t name='unk_258'/>
<int32_t name='unk_25c_mother'/>
<int32_t name='lover_id' ref-target='unit'/>
<int16_t name='unk_264'/>
</compound>
<compound name='last_hit'>
<int32_t name='item' ref-target='item'/>
<enum base-type='int16_t' name='item_type' type-name='item_type'/>
<int16_t name='item_subtype' refers-to='(item-subtype-target $$._parent.item_type $)'/>
<int16_t name='mattype' ref-target='material' aux-value='$$.matindex'/>
<int32_t name='matindex'/>
-- If shot by a ranged weapon:
<int32_t name='bow_item' ref-target='item'/>
<enum base-type='int16_t' name='bow_item_type' type-name='item_type'/>
<int16_t name='bow_item_subtype' refers-to='(item-subtype-target $$._parent.bow_item_type $)'/>
<int16_t name='bow_mattype' ref-target='material' aux-value='$$.bow_matindex'/>
<int32_t name='bow_matindex'/>
</compound>
<stl-vector name='inventory'>
<pointer key-field='item'>
<pointer name='item' type-name='item'/>
<int16_t name='mode' comment='0 carried, 1 weapon, 2 worn, 9 sewn'/>
<int16_t name='body_part_id'/>
</pointer>
</stl-vector>
<stl-vector name='owned_items'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='traded_items' comment='items brought to trade depot'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='owned_buildings'>
<pointer type-name='building'/>
</stl-vector>
<stl-vector name='corpse_parts' comment='entries remain even when items are destroyed'>
<int32_t ref-target='item'/>
</stl-vector>
<compound name='job'>
<uint32_t name='unk_2d8'/>
<uint32_t name='unk_2dc'/>
<pointer type-name='unit' name='hunt_target'/>
<pointer type-name='building' name='destroy_target'/>
<int16_t name='unk_2e8'/> // fight related
<int16_t name='unk_2ea'/> // fight related
<uint16_t name='unk_2ec'/>
<uint16_t name='unk_2ee'/>
<uint16_t name='unk_2f0_cntr'/> // increments every tick
<pointer comment='df_job' name='current_job' type-name='job'/>
<uint16_t name='unk_2f8'/>
<uint32_t name='unk_2fc'/>
<uint32_t name='unk_300'/>
<uint32_t name='unk_304'/>
</compound>
<compound name='body'>
<stl-vector name='body_part_308' type-name='uint32_t'/> // 87*0 ?
<stl-vector name='unk_318'/>
<stl-vector name='body_layer_328' type-name='uint32_t'/>
<stl-vector name='body_layer_338' type-name='uint32_t'/> // 238*0
<stl-vector name='body_layer_348' type-name='uint32_t'/> // 238*0
<stl-vector name='body_layer_358' type-name='uint32_t'/> // 238*0
<stl-vector name='body_layer_368' type-name='uint32_t'/> // 238*0
<stl-vector name='body_layer_378' type-name='uint32_t'/> // 238*0
<stl-vector name='body_layer_388' type-name='pointer'/>
<uint32_t name='unk_398'/>
<int32_t name='unk_39c'/>
<int32_t name='unk_3a0'/>
<int32_t name='unk_3a4'/>
<int32_t name='unk_3a8'/>
<int32_t name='unk_3ac'/>
<int32_t name='unk_3b0'/>
<int32_t name='unk_3b4'/>
<int32_t name='unk_3b8'/>
<int32_t name='unk_3bc'/>
<int32_t name='unk_3c0'/>
<pointer name='body_plan' comment='points to the body_parts field of caste_raw'>
<stl-vector name='body_parts'>
<pointer type-name='body_part_raw'/>
</stl-vector>
</pointer>
<uint16_t name='unk_3c8'/>
<static-array type-name='unit_attribute' name='physical_attrs' count='6'/>
<uint32_t name='unk_474'/>
<uint32_t name='unk_478'/>
<uint32_t name='unk_47c'/>
<uint32_t name='unk_480'/>
<uint32_t name='unk_484'/>
<uint32_t name='unk_488'/>
<uint32_t name='blood_max'/>
<uint32_t name='blood_count'/> // 490
<uint32_t name='unk_494'/>
<stl-vector name='spatters'/>
</compound>
<compound name='unknown6'>
<stl-vector type-name='uint16_t' name='unk_4a8'/>
<stl-vector type-name='uint16_t' name='unk_4b8'/>
<uint32_t name='unk_4c8'/>
<stl-vector type-name='int16_t' name='unk_4cc'/>
<stl-vector type-name='int32_t' name='unk_4dc'/>
<stl-vector type-name='int32_t' name='unk_4ec'/>
<stl-vector type-name='int32_t' name='unk_4fc'/>
<stl-vector type-name='int16_t' name='unk_50c'/>
<pointer name='unk_51c'/>
<uint16_t name='unk_520'/>
<pointer name='unk_524'/>
<uint16_t name='unk_528'/>
</compound>
<stl-vector type-name='uint32_t' name='appearance'/>
<compound name='counters'>
<int32_t name='think_counter'/> // 53c decrements every job_counter reroll, set when changing jobs
<int32_t name='job_counter'/> // 540 current_job unit/walk done when reach -1, decremented every tick
<int32_t name='unk_544'/> // if set, decrements every job_counter reroll
<int16_t name='unk_548'/>
<int16_t name='winded'/>
<int16_t name='stunned'/> // 54c decrements every tick, unstun at 0
<int16_t name='unconscious'/>
<int16_t name='unk_550'/>
<int16_t name='webbed'/>
<int16_t name='unk_x554'/> // coords ? (-30.000x3)
<int16_t name='unk_y556'/>
<int16_t name='unk_z558'/>
<int16_t name='unk_x55a'/> // coords again
<int16_t name='unk_y55c'/>
<int16_t name='unk_z55e'/>
<int16_t name='soldier_mood_countdown'/>
<enum name='soldier_mood' base-type='int16_t'>
<enum-item name='None' value='-1'/>
<enum-item name='MartialTrance'/>
<enum-item name='Enranged'/>
<enum-item name='Tantrum'/>
</enum>
<uint32_t name='unk_564'/>
<uint32_t name='unk_568'/>
<uint32_t name='unk_56c'/>
<uint32_t name='unk_570'/>
<uint32_t name='unk_574'/>
<uint32_t name='unk_578'/>
<uint32_t name='unk_57c'/>
<uint32_t name='hunger_timer'/>
<uint32_t name='thirst_timer'/>
<uint32_t name='sleepiness_timer'/>
<uint32_t name='unk_58c'/> // counter, decrement to 0
<uint32_t name='unk_590'/> // same as 58c
<uint32_t name='unk_594'/>
<uint32_t name='unk_cntdn_598'/> // fluctuate
<uint32_t name='unk_59c'/>
</compound>
<compound name='status'>
<stl-vector name='misc_traits'>
<pointer type-name='unit_misc_trait'/>
</stl-vector>
<pointer name='unk_5b0'>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
</pointer>
<uint32_t name='unk_5b4'/> // 0x3e8 (1000)
<uint32_t name='unk_5b8'/> // 0x3e8 (1000)
<stl-vector name='unk_5bc'/>
<stl-vector name='unk_5cc'/>
<int8_t name='unk_5dc'/>
<compound type-name='language_name' name='artifact_name'/>
<stl-vector name='souls'>
<pointer type-name='unit_soul'/>
</stl-vector>
<pointer name='current_soul' type-name='unit_soul'/>
<stl-vector name='unk_660'/>
<static-array type-name='bool' name='labors' index-enum='unit_labor' count='94'/>
<stl-vector name='unk_6d0'/>
<stl-vector name='unk_6e0'/> // item ids?
<stl-vector name='recent_events'/> // 6f0: dined in a legendary dinning room, etc
<stl-vector name='unk_700'/>
<uint32_t name='happiness'/> // 710
<uint16_t name='unk_714'/>
<stl-vector name='unk_718'/>
<stl-vector name='unk_728'/>
<stl-vector name='relationships'/> // 738
<stl-vector name='unk_748'/>
<uint16_t name='unk_758'/>
<int16_t name='unk_x75a'/> // coords (-30000*3)
<int16_t name='unk_y75c'/>
<int16_t name='unk_z75e'/>
<stl-vector type-name='uint16_t' name='unk_760'/>
<stl-vector type-name='uint16_t' name='unk_770'/>
<stl-vector type-name='uint16_t' name='unk_780'/>
</compound>
<int32_t name='hist_figure_id' ref-target='historical_figure'/>
<compound name='status2'>
<uint16_t name='able_stand'/> // 794
<uint16_t name='able_stand_impair'/> // 796
<uint16_t name='able_grasp'/> // 798
<uint16_t name='able_grasp_impair'/> // 79a
<uint32_t name='unk_79c'/>
<uint32_t name='unk_7a0'/>
<stl-vector name='body_part_temperature'>
<pointer>
<uint16_t name='whole'/>
<uint16_t name='fraction' comment='the unit is 1/temp_factor in body part'/>
</pointer>
</stl-vector>
<uint32_t name='unk_7b4'/>
<uint32_t name='unk_7b8'/>
<uint8_t name='unk_7bc'/>
<int32_t name='unk_7c0'/>
</compound>
<compound name='unknown8'>
<stl-vector name='unk_7c4'/>
<stl-vector name='unk_7d4' type-name='int32_t'/>
<stl-vector name='unk_7e4' type-name='int16_t'/>
<stl-vector name='unk_7f4' type-name='int32_t'/> // combat log?
<stl-vector name='unk_804' type-name='int32_t'/>
<stl-vector name='unk_814' type-name='int32_t'/>
<uint32_t name='unk_824'/>
<uint32_t name='unk_828'/>
<uint32_t name='unk_82c'/>
<uint32_t name='unk_830'/>
<uint32_t name='unk_834'/>
<uint32_t name='unk_838'/>
<pointer name='unk_83c'/>
<stl-vector name='unk_840' type-name='pointer'/> // item related
<stl-vector name='unk_850'/>
<stl-vector name='unk_860' type-name='int32_t'/>
<int32_t name='unk_870'/>
<int32_t name='unk_874_cntr'/> // age ? incremented every tick
<stl-vector name='body_part_878' type-name='uint8_t'/>
<stl-vector name='body_part_888' type-name='uint8_t'/>
<stl-vector name='body_part_898' type-name='uint32_t'/>
<stl-vector name='body_part_8a8' type-name='uint8_t'/>
<stl-vector name='body_part_8b8' type-name='uint16_t'/>
<stl-vector name='body_part_8c8' type-name='uint16_t'/>
<stl-vector name='body_part_8d8' type-name='uint16_t'/>
<stl-vector name='unk_8e8'/> // items ids?
<stl-vector type-name='uint16_t' name='unk_8f8'/> // same size as 8e8, soldier related?
<stl-vector name='body_layer_908' type-name='uint32_t'/>
<int32_t name='unk_918'/>
<int32_t name='unk_91c'/>
<int32_t name='unk_920'/>
<uint32_t name='unk_924'/>
<uint32_t name='unk_928'/>
</compound>
<stl-vector name='burrows'>
<int32_t ref-target='burrow'/>
</stl-vector>
<uint32_t name='unk_93c'/>
</struct-type>
<struct-type type-name='unit_attribute'>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
<int32_t name='unk3'/>
<int32_t name='unk4'/>
<int32_t name='unk5'/>
<int32_t name='unk6'/>
<int32_t name='unk7'/>
</struct-type>
<struct-type type-name='unit_misc_trait' key-field='id'>
<enum base-type='int16_t' name='id'>
<enum-item name='ClaimCooldown' value='12'/>
<enum-item name='WantsDrink'/>
<enum-item name='LikesOutdoors'/>
<enum-item name='Hardened'/>
</enum>
<code-helper name='describe'>(fmt "value=~A" $.value)</code-helper>
<int32_t name='value'/>
</struct-type>
<struct-type type-name='unit_soul'>
<int32_t name='unit_id' ref-target='unit'/>
<compound name='name' type-name='language_name'/>
<uint32_t name='race' ref-target='creature_raw'/>
<uint8_t name='sex'/>
<uint16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<code-helper name='describe'>
(describe-obj $.name)
(awhen (find-creature $.race)
(fmt "~:(~A ~A~)" $it.caste[$.caste].caste_id $it.creature_id))
</code-helper>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
<int32_t name='unk3'/>
<int32_t name='unk4'/>
<static-array type-name='unit_attribute' name='mental_attrs' count='13'/>
<stl-vector name='skills'>
<pointer type-name='unit_skill'/>
</stl-vector>
<stl-vector name='preferences'>
<pointer type-name='unit_preference'/>
</stl-vector>
<static-array type-name='uint16_t' name='traits' count='30'/>
<stl-vector name='unk5'>
<pointer>
<int16_t name='unk1'/>
<int16_t name='unk2'/>
</pointer>
</stl-vector>
<stl-vector name='unk6'/>
</struct-type>
<struct-type type-name='unit_skill' key-field='id'>
<enum base-type='int16_t' name="id" type-name='job_skill'/>
<int32_t name="rating"/>
<uint32_t name="experience"/>
<int32_t name="unk_c"/>
<int32_t name="rusty"/>
<int32_t name="unk_14"/>
<int32_t name="unk_18"/>
<int32_t name="unk_1c"/>
</struct-type>
<struct-type type-name='unit_preference' key-field='type'>
<enum base-type='int16_t' name="type">
<enum-item name='LikeMaterial'/>
<enum-item name='LikeCreature'/>
<enum-item name='LikeFood'/>
<enum-item name='HateCreature'/>
<enum-item name='LikeItem'/>
<enum-item name='LikePlant'/>
<enum-item name='LikePlant2' comment='likely 2nd prefstring'/>
<enum-item name='LikeColor'/>
<enum-item name='LikeShape'/>
</enum>
<compound is-union='true'>
<int16_t name="item_type" refers-to='(enum-to-key $item_type $)'/>
<int16_t name='creature_id' ref-target='creature_raw'/>
<int16_t name='color_id' refers-to='$global.world.raws.color_words[$]'/>
<int16_t name='shape_id' refers-to='$global.world.raws.shape_words[$]'/>
<int16_t name='plant_id' ref-target='material_plant'/>
</compound>
<int16_t name="item_subtype" refers-to='(item-subtype-target $$._parent.item_type $)'/>
<int16_t name='mattype' ref-target='material' aux-value='$$.matindex'/>
<int32_t name='matindex'/>
<bool name='active'/>
<uint32_t name='unk'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,106 +0,0 @@
<data-definition>
<enum-type type-name='interface_breakdown_types'>
<enum-item name='NONE'/>
<enum-item name='QUIT'/>
<enum-item name='STOPSCREEN'/>
<enum-item name='TOFIRST'/>
</enum-type>
<class-type type-name='viewscreen' original-name='viewscreenst'>
<pointer name='child' type-name='viewscreen'/>
<pointer name='parent' type-name='viewscreen'/>
<enum base-type='int8_t' name='breakdown_level' type-name='interface_breakdown_types'/>
<int8_t name='option_key_pressed'/>
<virtual-methods>
<vmethod name='feed'> <pointer name='events'/> </vmethod>
<vmethod name='logic'/>
<vmethod name='render'/>
<vmethod name='resize'> <int32_t name='w'/> <int32_t name='h'/> </vmethod>
<vmethod name='help'/>
<vmethod ret-type='bool' name='movies_okay'/>
<vmethod ret-type='bool' name='is_option_screen'/>
<vmethod ret-type='bool' name='is_save_screen'/>
<vmethod is-destructor='true'/>
<vmethod ret-type='bool' name='key_conflict'> <int32_t/> </vmethod>
</virtual-methods>
</class-type>
<struct-type type-name='interface'>
<int32_t name='original_fps'/>
<compound name='view' type-name='viewscreen'/>
<uint32_t name='flag'/>
<int32_t name='shutdown_interface_tickcount'/>
<int32_t name='shutdown_interface_for_ms'/>
<int8_t name='supermovie_on'/>
<int32_t name='supermovie_pos'/>
<int32_t name='supermovie_delayrate'/>
<int32_t name='supermovie_delaystep'/>
<stl-vector name='supermovie_sound'>
<pointer type-name='stl-string'/>
</stl-vector>
<static-array name='supermovie_sound_time' count='16' comment='SOUND_CHANNELNUM'>
<static-array count='200' type-name='int32_t'/>
</static-array>
<padding name='supermoviebuffer' size='800000'/>
<padding name='supermoviebuffer_comp' size='1000000'/>
<int32_t name='currentblocksize'/>
<int32_t name='nextfilepos'/>
<int8_t name='first_movie_write'/>
<stl-string name='movie_file'/>
</struct-type>
<class-type type-name='viewscreen_titlest' inherits-from='viewscreen'>
<static-string name='str_histories' size='256'/>
<static-string name='menu_items' size='256'/>
<enum base-type='int16_t' name="sel_subpage">
<enum-item name='None'/>
<enum-item name='StartGame'/>
<enum-item name='Unk2'/>
<enum-item name='Arena'/>
<enum-item name='About'/>
</enum>
<int32_t name="sel_menu_line"/>
<int32_t name="sel_submenu_line"/>
<int8_t name="unk_218"/>
<stl-vector name="unk_21c">
<int32_t/>
</stl-vector>
<stl-vector name="unk_228"/>
<stl-vector name="unk_234"/>
<stl-vector name="start_savegames">
<pointer/>
</stl-vector>
<stl-vector name="continue_savegames">
<pointer/>
</stl-vector>
<stl-string name="str_slaves"/>
<stl-string name="str_chapter"/>
<stl-string name="str_copyright"/>
<stl-string name="str_version"/>
<stl-string name="str_unk"/>
<stl-string name="str_programmed"/>
<stl-string name="str_designed"/>
<stl-string name="str_visit"/>
<stl-string name="str_site"/>
</class-type>
<class-type type-name='viewscreen_dwarfmodest' inherits-from='viewscreen'>
todo
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,476 +0,0 @@
<data-definition>
<struct-type type-name='world_site_unk130'>
<int32_t name="index"/>
<stl-vector name="unk_4">
<pointer>
<int32_t name="unk_0"/>
<int32_t name="index"/>
<int32_t name="unk_8"/>
<stl-vector name="unk_c">
<int32_t/>
</stl-vector>
</pointer>
</stl-vector>
</struct-type>
<struct-type type-name='world_site' key-field='id'
instance-vector='$global.world.world_data.sites'>
<compound name='name' type-name='language_name'/>
<code-helper name='describe'>(describe-obj $.name)</code-helper>
<int32_t name="civ_id" ref-target='historical_entity'/>
<int32_t name="owner1" ref-target='historical_entity'/>
<int32_t name="owner2" ref-target='historical_entity'/>
<int16_t name="unk_78"/>
<int16_t name="unk_7a"/>
<int16_t name="unk_7c"/>
<int32_t name="id"/>
<stl-vector name="unk_84">
<int32_t/>
</stl-vector>
<stl-vector name="unk_94"/>
<stl-vector name="animals">
<pointer>
<int16_t name="unk_0"/>
<int16_t name="race" ref-target='creature_raw'/>
<int32_t name="count"/>
<int32_t name="unk_8"/>
<int32_t name="owner" ref-target='historical_entity'/>
<int32_t name="unk_10"/>
<int32_t name="unk_14"/>
</pointer>
</stl-vector>
<stl-vector name="inhabitants">
<pointer>
<int32_t name="count"/>
<int32_t name="race" ref-target='creature_raw'/>
<int32_t name="unk_8"/>
</pointer>
</stl-vector>
<stl-vector name="unk_c4"/>
<stl-vector name="unk_d4"/>
<int32_t name="index"/>
<int16_t name="unk_e8"/>
<int16_t name="unk_ea"/>
<int16_t name="unk_ec"/>
<int16_t name="unk_ee"/>
<int32_t name="unk_f0"/>
<int32_t name="unk_f4"/>
<int32_t name="unk_f8"/>
<int32_t name="unk_fc"/>
<int32_t name="unk_100"/>
<uint32_t name="unk_104"/>
<uint32_t name="unk_108"/>
<int32_t name="unk_10c"/>
<int32_t name="unk_110"/>
<int32_t name="unk_114"/>
<int32_t name="unk_118"/>
<int32_t name="unk_11c"/>
<int32_t name="unk_120"/>
<int32_t name="unk_124"/>
<int32_t name="unk_128"/>
<int32_t name="unk_12c"/>
<int32_t name="unk_130"/>
<int32_t name="unk_134"/>
<int32_t name="unk_138"/>
<stl-vector name="unk_13c">
<pointer>
<int32_t name="unk_0"/>
<int32_t name="unk_4"/>
<int32_t name="unk_8"/>
<int32_t name="unk_c"/>
</pointer>
</stl-vector>
<df-flagarray name='flags'/>
<stl-vector name="unk_154"/>
<int32_t name="unk_164"/>
<int32_t name="unk_168"/>
<int32_t name="unk_16c"/>
<int32_t name="unk_170"/>
<int32_t name="unk_174"/>
<int16_t name="unk_178"/>
<int16_t name="unk_17a"/>
<int16_t name="unk_17c"/>
<int32_t name="unk_180"/>
<pointer name="unk_184">
<int16_t name="unk_0"/>
<stl-vector name="unk_4"/>
<int32_t name="unk_14"/>
<int32_t name="unk_18"/>
<int32_t name="unk_1c"/>
</pointer>
<pointer name="unk_188" type-name='world_site_unk130'/>
<stl-vector name="unk_18c"/>
<stl-vector name="unk_19c"/>
</struct-type>
<struct-type type-name='world_underground_region'>
<int16_t name='unk1'/>
<compound name='name' type-name='language_name'/>
<int32_t name="unk_70"/>
<int16_t name="unk_74"/>
<int16_t name="unk_76"/>
<int16_t name="unk_78"/>
<int16_t name="unk_7a"/>
<int32_t name="unk_7c"/>
<int16_t name="unk_80"/>
<int16_t name="unk_82"/>
<int16_t name="unk_84"/>
<padding name="unk_86" size="2"/>
<stl-vector name="unk_88">
<int16_t/>
</stl-vector>
<stl-vector name="unk_98">
<int16_t/>
</stl-vector>
<stl-vector name="unk_a8">
<int16_t/>
</stl-vector>
<stl-vector name="unk_b8">
<int16_t/>
</stl-vector>
<stl-vector name="unk_c8"/>
<pointer name="feature_init"/>
</struct-type>
<struct-type type-name='world_data'>
<compound name='name' type-name='language_name' comment='name of the world'/>
<static-array name='unk1' count='15' type-name='int8_t'/>
<int32_t name='num_sites'/>
<int32_t name='cur_site_id'/>
<int32_t/>
<int32_t/>
<int16_t name='world_width'/>
<int16_t name='world_height'/>
<stl-vector name='unk2'>
<pointer>
<int16_t name="unk_0"/>
<int16_t name="unk_2"/>
<int16_t name="unk_4"/>
<int16_t name="unk_6"/>
<int16_t name="unk_8"/>
<int32_t name="unk_c"/>
<int32_t name="unk_10"/>
<stl-vector name="unk_14">
<pointer/>
</stl-vector>
<int32_t name="unk_24"/>
<df-flagarray name='flags'/>
<stl-vector name="unk_30"/>
<stl-vector name="unk_40"/>
<stl-vector name="unk_50"/>
<stl-vector name="unk_60"/>
<int16_t name="unk_70"/>
<int16_t name="unk_72"/>
<int16_t name="unk_74"/>
<int16_t name="unk_76"/>
<int16_t name="unk_78"/>
<int32_t name="unk_7c"/>
<int32_t name="unk_80"/>
<int32_t name="unk_84"/>
</pointer>
</stl-vector>
<int32_t/>
<int32_t/>
<int16_t/>
<int16_t/>
<int16_t/>
<int16_t/>
<int16_t/>
<int16_t/>
<int32_t name='world_width2'/>
<int32_t name='world_height2'/>
<pointer type-name='uint32_t' is-array='true' comment='align(width,4)*height'/>
<pointer type-name='uint32_t' is-array='true' comment='align(width,4)*height'/>
<pointer type-name='uint32_t' is-array='true' comment='width*height'/>
<pointer type-name='uint8_t' is-array='true' comment='align(width,4)*height'/>
<stl-vector name='unk4' type-name='pointer'/>
<int32_t name="unk_dc"/>
<int32_t name="unk_e0"/>
<int32_t name="unk_e4"/>
<int32_t name="unk_e8"/>
<int32_t name="unk_ec"/>
<int32_t name="unk_f0"/>
<compound name='construction_squares'>
<int16_t name="width"/>
<int16_t name="height"/>
<pointer name="table" is-array='true'>
<pointer is-array='true'>
<stl-vector>
<pointer/>
</stl-vector>
</pointer>
</pointer>
</compound>
<stl-vector name="constructions">
<pointer/>
</stl-vector>
<int32_t name="next_construction_id"/>
<static-array name="unk_110" count='2'>
<pointer name="table" is-array='true'>
<pointer is-array='true'>
<stl-vector name='unk1'>
<int32_t/>
</stl-vector>
<stl-vector name='unk2'>
<pointer type-name='int8_t' is-array='true'/>
</stl-vector>
</pointer>
</pointer>
<int16_t name="width"/>
<int16_t name="height"/>
</static-array>
<stl-vector name="sites">
<pointer type-name='world_site'/>
</stl-vector>
<stl-vector name="site_unk130">
<pointer type-name='world_site_unk130'/>
</stl-vector>
<stl-vector name="unk_140">
<pointer>
<int32_t name='index'/>
<static-array name='resource_allotments' count='100'>
<stl-vector>
<pointer/>
</stl-vector>
</static-array>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
<int32_t name='unk3'/>
</pointer>
</stl-vector>
<stl-vector name="unk_150">
<pointer>
<int32_t name="index"/>
<int32_t name="unk_4"/>
<stl-vector name="unk_8">
<pointer>
<int32_t name="index"/>
<int32_t name="unk_4"/>
<int32_t name="unk_8"/>
</pointer>
</stl-vector>
<stl-vector name="unk_18">
<pointer>
<int32_t name="index"/>
<int32_t name="unk_4"/>
<int32_t name="unk_8"/>
</pointer>
</stl-vector>
<stl-vector name="unk_28">
<pointer>
<int32_t name="unk_0"/>
<int32_t name="unk_4"/>
</pointer>
</stl-vector>
</pointer>
</stl-vector>
<stl-vector name="islands">
<pointer>
<compound name='name' type-name='language_name'/>
</pointer>
</stl-vector>
<stl-vector name="regions">
<pointer>
<compound name='name' type-name='language_name'/>
</pointer>
</stl-vector>
<stl-vector name="underground_regions">
<pointer type-name='world_underground_region'/>
</stl-vector>
<stl-vector name="unk_190">
<pointer>
<int16_t name='unk1'/>
<int16_t name='index'/>
<stl-vector name="unk_4">
<pointer>
<int16_t name="unk_0"/>
<int32_t name="unk_4"/>
<stl-vector name="unk_8">
<int32_t/>
</stl-vector>
<stl-vector name="unk_18">
<int16_t/>
</stl-vector>
<stl-vector name="unk_28">
<int8_t/>
</stl-vector>
<stl-vector name="unk_38">
<int8_t/>
</stl-vector>
<int32_t name="index"/>
</pointer>
</stl-vector>
</pointer>
</stl-vector>
<stl-vector name="unk_1a0">
<pointer>
<compound name='name' type-name='language_name'/>
<int16_t name="unk_6c"/>
<int16_t name="unk_6e"/>
<df-flagarray name='flags'/>
<int16_t name="unk_78"/>
</pointer>
</stl-vector>
<stl-vector name="unk_1b0">
<pointer>
<compound name='name' type-name='language_name'/>
<stl-vector name="unk_6c">
<int16_t/>
</stl-vector>
<stl-vector name="unk_7c">
<int16_t/>
</stl-vector>
<stl-vector name="unk_8c">
<int32_t/>
</stl-vector>
<stl-vector name="unk_9c">
<int16_t/>
</stl-vector>
<stl-vector name="unk_ac">
<int16_t/>
</stl-vector>
<int16_t name="unk_bc"/>
<int16_t name="unk_be"/>
<df-flagarray name='flags'/>
</pointer>
</stl-vector>
<pointer name="unk_1c0"/>
<pointer name="unk_1c4"/>
<padding name="unk_1c8" size="4"/>
<stl-vector name="unk_1cc"/>
<pointer name="unk_1dc" is-array='true'>
<pointer is-array='true'>
<stl-vector/>
</pointer>
</pointer>
<pointer name="unk_1e0" is-array='true'>
<pointer is-array='true'>
<stl-vector/>
</pointer>
</pointer>
<pointer name="unk_1e4" is-array='true'>
<pointer is-array='true'>
<stl-vector/>
</pointer>
</pointer>
<pointer name="unk_1e8" is-array='true'>
<pointer is-array='true'>
<stl-vector/>
</pointer>
</pointer>
<pointer name="unk_1ec" is-array='true'>
<pointer is-array='true'>
<stl-vector/>
</pointer>
</pointer>
<pointer name="unk_1f0" is-array='true'>
<pointer is-array='true'>
<stl-vector/>
</pointer>
</pointer>
<stl-vector name="active_site">
<pointer type-name='world_site'/>
</stl-vector>
<pointer name="unk_204" is-array='true'>
<pointer is-array='true'>
<int16_t name='x'/>
<int16_t name='y'/>
<int32_t name='unk_4'/>
<pointer name='unk_8' type-name='int16_t' is-array='true'/>
<pointer name='unk_c' type-name='int32_t' is-array='true'/>
</pointer>
</pointer>
<df-flagarray name='flags'/>
<stl-vector name="unk_210"/>
<stl-vector name="unk_220"/>
<stl-vector name="unk_230"/>
<stl-vector name="unk_240">
<int16_t/>
</stl-vector>
<stl-vector name="unk_250">
<int16_t/>
</stl-vector>
<padding name="unk_260" size="4"/>
<int8_t name="unk_264"/>
<padding name="unk_265" size="3"/>
<padding name="unk_268" size="4"/>
<int8_t name="unk_26c"/>
<padding name="unk_26d" size="3"/>
<int32_t name="unk_270"/>
<stl-vector name="unk_274">
<pointer>
<stl-vector name="unk_0">
<pointer type-name="historical_figure"/>
</stl-vector>
<stl-vector name="unk_10">
<pointer>
<int32_t name="unk_0"/>
<int32_t name="unk_4"/>
<int32_t name="unk_8"/>
</pointer>
</stl-vector>
<pointer name="unk_20" type-name="historical_entity"/>
<int32_t name="unk_24"/>
<pointer name="unk_28" type-name="language_name"/>
<int32_t name="unk_2c"/>
<int32_t name="unk_30"/>
</pointer>
</stl-vector>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,518 +0,0 @@
<data-definition>
<struct-type type-name='world'>
dtor 89fff80
<static-array name='unk0' count='21'>
dtor 8532540
<stl-vector>
<pointer/>
</stl-vector>
</static-array>
<stl-vector name='unk_fc'>
<pointer/>
</stl-vector>
<stl-vector name='unk_108'>
<pointer/>
</stl-vector>
<stl-vector name='unk_114'>
<pointer>
<int8_t name='unk_0'/>
<int16_t name="unk_2"/>
<int32_t name="unk_4"/>
<int8_t name="unk_8"/>
<padding name="unk_9" size="3"/>
<int16_t name="unk_c"/>
<int16_t name="unk_e"/>
<int16_t name="unk_10"/>
<int32_t name="unk_14"/>
<int32_t name="unk_18"/>
<int32_t name="unk_1c"/>
<int16_t name="unk_20"/>
</pointer>
</stl-vector>
--
<stl-vector name='manager_orders'>
<pointer type-name='manager_order'/>
</stl-vector>
<stl-vector name='mandates'>
<pointer type-name='mandate'/>
</stl-vector>
-- Entities
<compound name='entities'>
<stl-vector name='all'>
<pointer type-name='historical_entity'/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='historical_entity'/>
</stl-vector>
</compound>
-- Unknown
<padding size='80004' comment='0 bytes; same size on Windows'/>
-- Units
<compound name='units'>
<stl-vector name='all'>
<pointer type-name='unit'/>
</stl-vector>
<static-array name='other' count='4'>
<stl-vector>
<pointer type-name='unit'/>
</stl-vector>
</static-array>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='unit'/>
</stl-vector>
</compound>
-- Unknown
<stl-vector name='unk_13a1c'>
<pointer/>
</stl-vector>
<stl-vector name='unk_13a28'>
<pointer/>
</stl-vector>
-- Nemesis
<compound name='nemesis'>
<stl-vector name='all'>
<pointer type-name='nemesis_record'/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='nemesis_record'/>
</stl-vector>
</compound>
<bool name='unk4'/>
-- Items
<compound name='items'>
dtor 852f4b0
<stl-vector name='all'>
<pointer type-name='item'/>
</stl-vector>
<static-array name='other' count='127'>
<stl-vector>
<pointer type-name='item'/>
</stl-vector>
</static-array>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='item'/>
</stl-vector>
<stl-vector name='bad_tag' type-name='int32_t'/>
</compound>
-- Artifacts
<compound name='artifacts'>
<stl-vector name='all'>
<pointer type-name='artifact_record'/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='artifact_record'/>
</stl-vector>
</compound>
-- Jobs and projectiles
<compound name='job_list' type-name='job_list_link'/>
<compound name='proj_list' type-name='proj_list_link'/>
-- Buildings
<compound name='buildings'>
dtor 85316f0
<stl-vector name='all'>
<pointer type-name='building'/>
</stl-vector>
<static-array name='other' count='86'>
<stl-vector>
<pointer type-name='building'/>
</stl-vector>
</static-array>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='building'/>
</stl-vector>
</compound>
<bool name='unk5a'/>
<bool name='unk5b'/>
-- Machines (connected groups of gears and so on)
<compound name='machines'>
<stl-vector name='all'>
<pointer type-name='machine'/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='machine'/>
</stl-vector>
</compound>
-- Unknown
<compound name='unk_144d4'>
<stl-vector name='all' type-name='pointer'/>
<stl-vector name='bad' has-bad-pointers='true' type-name='pointer'/>
</compound>
<padding size='84'/>
<compound name='unk_material_info_14540'>
<stl-vector name='unk_plant_1' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<stl-vector name='unk_plant_2' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<stl-vector name='unk_creature_1' type-name='bool'
index-refers-to='(find-creature $)'/>
<stl-vector name='unk_creature_2' type-name='bool'
index-refers-to='(find-creature $)'/>
<stl-vector name='unk_creature_3' type-name='bool'
index-refers-to='(find-creature $)'/>
<stl-vector name='unk_plant_3' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<stl-vector name='unk_plant_4' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<padding size='8' comment='0'/>
<stl-vector name='unk_plant_5' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<stl-vector name='unk_creature_4' type-name='bool'
index-refers-to='(find-creature $)'/>
<stl-vector name='unk_builtin' type-name='bool'
index-refers-to='(material-by-id $ -1)'/>
<padding size='16' comment='0'/>
</compound>
-- Plants
<compound name='plants'>
<stl-vector name='all' type-name='pointer'/>
<static-array name='other' count='5'>
<stl-vector type-name='pointer'/>
</static-array>
</compound>
-- Unknown
<padding name='unk_14618' size='12' comment='linked list'/>
-- Unknown
<padding size='500' comment='bool array?'/>
<static-array name='unk_14818' type-name='int8_t' count='250000'/>
<int32_t name='unk_518a8'/>
<compound name='unk_518ac'>
<stl-vector name='all'>
<pointer/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer/>
</stl-vector>
</compound>
<compound name='squads'>
<stl-vector name='all'>
<pointer type-name='squad'/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='squad'/>
</stl-vector>
</compound>
<compound name='unk_518dc'>
<stl-vector name='all'>
<pointer/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer/>
</stl-vector>
</compound>
-- Drills
<compound name='activities'>
<stl-vector name='all'>
<pointer type-name='activity_entry'/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='activity_entry'/>
</stl-vector>
</compound>
-- Reports and announcements
<compound name='status'>
dtor 85356e0
<stl-vector name='reports' type-name='pointer'/>
<stl-vector name='announcements' type-name='pointer'/>
<stl-vector name='unk_vec' type-name='pointer'/>
<int32_t name='next_report_id'/>
<int32_t/>
<int32_t/>
<static-array name='slots' count='100'>
<comment>Written to by code at 0x80fd7b0</comment>
<int16_t name='id'/>
<padding name='info' size='24' alignment='4'
comment='Weird garbage. Possibly types change for different entries.'/>
<stl-string name='unk3a'/>
<stl-string name='unk3b'/>
<stl-string name='unk3c'/>
<stl-string name='unk3d'/>
<int32_t name='unk4'/>
</static-array>
<static-array name='slot_id_used' type-name='int16_t' count='34'/>
<static-array name='slot_id_idx1' type-name='int16_t' count='34'/>
<static-array name='slot_id_idx2' type-name='int16_t' count='34'/>
<int16_t name='slots_used'/>
</compound>
<pointer name='selected_building' type-name='building'/>
<enum base-type='int16_t' name='selected_stockpile_type' type-name='stockpile_category'/>
<bool/>
<padding size='8' alignment='4' comment='0'/>
<compound name='map'> 52cdc
<stl-vector name='map_blocks'>
<pointer type-name='map_block'/>
</stl-vector>
<pointer name='block_index'/>
<stl-vector name='map_block_columns'>
<pointer type-name='map_block_column'/>
</stl-vector>
<pointer name='column_index'/>
<int32_t name='x_count_block'/>
<int32_t name='y_count_block'/>
<int32_t name='z_count_block'/>
<int32_t name='x_count'/>
<int32_t name='y_count'/>
<int32_t name='z_count'/>
<int32_t name='region_x'/>
<int32_t name='region_y'/>
<int32_t name='region_z'/>
</compound>
<static-array name='unknown_52d20'
count='2810' type-name='int16_t'/>
<pointer name='world_data' type-name='world_data'/>
<compound name='unk_54318'>
<padding size='1180'/>
<stl-vector comment='547b4'/>
<stl-vector/>
<padding size='8'/>
<stl-vector/>
<stl-vector/>
<padding size='8'/>
<bool/>
<stl-string/> 547f8
<padding size='24'/>
<stl-vector comment='54814'/>
<stl-vector/>
<padding size='8'/>
<stl-vector/>
<stl-vector/>
<padding size='8'/>
<static-array count='10' comment='true array 54854'>
<stl-vector/>
</static-array>
<static-array count='10' comment='true array 548cc'>
<stl-vector/>
</static-array>
<static-array count='10' comment='true array'>
<stl-vector/>
</static-array>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
</compound>
<padding size='8' comment='0'/>
<int32_t name='unk_54a0c'/>
<int32_t name='unk_54a10'/>
-- RAWs
<compound name='raws' type-name='world_raws'/>
<compound name='unk_59dc4'>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='pointer'/>
<static-array type-name='int16_t' count='32'/>
<int32_t/>
<int32_t/>
<int32_t/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<pointer name='unk_59e70'/>
<int32_t name='unk_59e74'/>
</compound>
<int32_t name='unk_59e78'/>
<compound name='unk_59e7c'>
<stl-string name='unk_59e7c'/>
<int32_t name="unk_5e200"/>
<int32_t name="unk_5e204"/>
<int32_t name="unk_5e208"/>
<int32_t name="unk_5e20c"/>
ctor 87ae880
<stl-string name='unk_59e90'/>
<padding size='16'/>
<int32_t name="unk_5e23c"/>
<int32_t name="unk_5e240"/>
<stl-string name='unk_59eac'/>
<bool/>
<bool/>
<bool/>
<bool/>
<padding size='900'/>
<pointer name='unk_5a238'/> dtor 83bed90
<int32_t name="unk_5e5ec"/>
<int32_t name="unk_5e5f0"/>
<int32_t name="unk_5e5f4"/>
<int32_t name="unk_5e5f8"/>
<int32_t name="unk_5e5fc"/>
<int32_t name="unk_5e600"/>
<int32_t name="unk_5e604"/>
<int32_t name="unk_5e608"/>
<bool/>
</compound>
-- hist figures
<compound name='history' type-name='world_history'/>
<stl-vector name='entity_populations'>
<pointer type-name='entity_population'/>
</stl-vector>
<int32_t name="unk_5e7a0"/>
<int32_t name='frame_counter' comment='increases by 1 every time . is pressed'/>
<compound name='unk_5a39c'>
<stl-vector name='unk_5a39c'/>
<static-array name='unk' count='80000'>
<comment>Looks like a temporary buffer for pathfinding or something.</comment>
<uint16_t name='unk1a'/>
<uint16_t name='tag'/>
<int32_t name='unk2'/>
<int16_t name='x'/>
<int16_t name='y'/>
<int32_t name='z'/>
</static-array>
<int32_t/>
<int16_t name='x1'/>
<int16_t name='y1'/>
<int16_t name='z1'/>
<int16_t name='x2'/>
<int16_t name='y2'/>
<int16_t name='z2'/>
<int32_t/>
<int32_t/>
<int32_t/>
<uint16_t/>
<uint16_t name='tag'/>
<bool/>
<uint16_t/>
<bool/>
<int16_t/>
<int16_t/>
<bool/>
<int32_t/>
</compound>
<compound name='unk_192bd8'>
<stl-string name='save_dir'/>
<padding size='4'/>
<static-array count='19'> 192be0
<stl-vector/>
</static-array>
</compound>
<int32_t name="unk_192cc4"/>
<compound name='unk_192cc8'>
<stl-vector/>
<stl-vector/>
<padding size='4'/>
<static-array count='105' comment='true array'>
<stl-vector type-name='pointer'/>
</static-array>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<static-array count='7'>
<stl-vector/>
</static-array>
<padding size='8'/>
<stl-vector/>
</compound>
<compound name='unk_19325c'>
<static-array count='3'>
<stl-vector type-name='pointer'/>
</static-array>
<padding size='12'/>
</compound>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,33 +0,0 @@
#!/usr/bin/perl
use strict;
use warnings;
use XML::LibXML;
my $input_dir = $ARGV[0] || '.';
my $output_dir = $ARGV[1] || 'codegen';
my $separator = $ARGV[2] || "\n";
print "$output_dir/static.inc";
for my $filename (glob "$input_dir/*.xml") {
my $parser = XML::LibXML->new();
my $doc = $parser->parse_file($filename);
my @nodes = (
$doc->findnodes('/data-definition/enum-type'),
$doc->findnodes('/data-definition/bitfield-type'),
$doc->findnodes('/data-definition/struct-type'),
$doc->findnodes('/data-definition/class-type')
);
for my $node (@nodes) {
my $name = $node->getAttribute('type-name')
or die "Unnamed type in $filename\n";
print "$separator$output_dir/$name.h";
}
}
print $separator if $separator eq "\n";

@ -1,289 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
The original XML format is good for human use, but
difficult to interpret during code generation. This
lowers it to more repetitive & verbose, but easier
for the programs to interpret.
This is the first pass that folds all field tags into ld:field.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ld="http://github.com/peterix/dfhack/lowered-data-definition">
<!--
Global templates:
- Copy attributes and simple tags
- Bail out on unexpected tags
-->
<xsl:template match="@*">
<xsl:copy-of select='.'/>
</xsl:template>
<xsl:template match="*">
<xsl:message terminate="yes">
Error: Unexpected tag: <xsl:value-of select='name(.)'/>
</xsl:message>
</xsl:template>
<xsl:template match="/data-definition">
<ld:data-definition>
<xsl:apply-templates select='@*|node()'/>
</ld:data-definition>
</xsl:template>
<xsl:template match="comment|code-helper|enum-attr|enum-item|item-attr">
<xsl:copy>
<xsl:apply-templates select='@*|node()'/>
</xsl:copy>
</xsl:template>
<xsl:template match="virtual-methods|cond-if|cond-else">
<xsl:param name='level' select='-1'/>
<xsl:copy>
<xsl:apply-templates select='@*|node()'>
<xsl:with-param name='level' select="$level"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<!-- Type defs: convert to one common 'global-type' tag name. -->
<xsl:template match='enum-type|bitfield-type|class-type|struct-type'>
<ld:global-type>
<xsl:attribute name='ld:meta'><xsl:value-of select='name(.)'/></xsl:attribute>
<xsl:attribute name='ld:level'>0</xsl:attribute>
<xsl:apply-templates select='@*|node()'>
<xsl:with-param name='level' select="1"/>
</xsl:apply-templates>
</ld:global-type>
</xsl:template>
<!-- Code to properly annotate references to types by name -->
<xsl:key name="primitive-type-lookup" match="prim-type" use="@ld:subtype"/>
<xsl:variable name="primitive-types-top" select="document('')/*/ld:primitive-types"/>
<xsl:template match="ld:primitive-types">
<xsl:param name="name"/>
<xsl:param name="level"/>
<xsl:param name="rq_global"/>
<xsl:variable name='item' select="key('primitive-type-lookup', $name)"/>
<xsl:choose>
<xsl:when test="$item">
<xsl:if test='$rq_global'>
<xsl:message terminate="yes">
Error: Cannot refer to primitive types from <xsl:value-of select='$rq_global'/>
</xsl:message>
</xsl:if>
<xsl:apply-templates select="$item/@*"/>
<xsl:apply-templates select="$item/*">
<xsl:with-param name='level' select="$level+1"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name='ld:meta'>global</xsl:attribute>
<xsl:attribute name='type-name'><xsl:value-of select='$name'/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="lookup-type-ref">
<xsl:param name='name'/>
<xsl:param name='level' select='-1'/>
<xsl:param name='rq_global'/>
<xsl:attribute name='ld:level'><xsl:value-of select='$level'/></xsl:attribute>
<xsl:apply-templates select="$primitive-types-top">
<xsl:with-param name="name" select="$name"/>
<xsl:with-param name="level" select="$level"/>
<xsl:with-param name="rq_global" select="$rq_global"/>
</xsl:apply-templates>
</xsl:template>
<!--
Fields:
- Fold into one generic 'field' tag.
- Add a 'level' attribute to assist in searching by name.
-->
<!-- Primitive types: -->
<ld:primitive-types>
<prim-type ld:meta='number' ld:subtype='int8_t' ld:bits='8'/>
<prim-type ld:meta='number' ld:subtype='uint8_t' ld:unsigned='true' ld:bits='8'/>
<prim-type ld:meta='number' ld:subtype='int16_t' ld:bits='16'/>
<prim-type ld:meta='number' ld:subtype='uint16_t' ld:unsigned='true' ld:bits='16'/>
<prim-type ld:meta='number' ld:subtype='int32_t' ld:bits='32'/>
<prim-type ld:meta='number' ld:subtype='uint32_t' ld:unsigned='true' ld:bits='32'/>
<prim-type ld:meta='number' ld:subtype='int64_t' ld:bits='64'/>
<prim-type ld:meta='number' ld:subtype='uint64_t' ld:unsigned='true' ld:bits='64'/>
<prim-type ld:meta='number' ld:subtype='bool' ld:bits='8'/>
<prim-type ld:meta='number' ld:subtype='s-float' ld:bits='32'/>
<prim-type ld:meta='number' ld:subtype='flag-bit' ld:bits='1'/>
<prim-type ld:meta='bytes' ld:subtype='padding'/>
<prim-type ld:meta='bytes' ld:subtype='static-string'/>
<prim-type ld:meta='pointer' ld:subtype='pointer'/>
<prim-type ld:meta='pointer' ld:subtype='ptr-string' ld:is-container='true'>
<static-string/>
</prim-type>
<prim-type ld:meta='primitive' ld:subtype='stl-string'/>
</ld:primitive-types>
<xsl:template match='int8_t|uint8_t|int16_t|uint16_t|int32_t|uint32_t|int64_t|uint64_t|bool|flag-bit|s-float|padding|static-string|ptr-string|stl-string'>
<xsl:param name='level' select='-1'/>
<ld:field>
<xsl:apply-templates select='@*'/>
<xsl:call-template name='lookup-type-ref'>
<xsl:with-param name="name" select="name(.)"/>
<xsl:with-param name="level" select="$level"/>
</xsl:call-template>
<xsl:apply-templates select='node()'/>
</ld:field>
</xsl:template>
<!--
Compound, enum or bitfield:
- When a proxy: meta='global' subtype='$tag' type-name='blah'
- When an ad-hoc compound: meta='compound' subtype='$tag'
- Level not incremented unless it has a name.
-->
<xsl:template name='compound'>
<xsl:param name='level' select='-1'/>
<xsl:param name='level_shift' select='1'/>
<xsl:param name='rq_global'/>
<xsl:apply-templates select='@*'/>
<xsl:choose>
<xsl:when test='@type-name'>
<xsl:call-template name='lookup-type-ref'>
<xsl:with-param name='name' select="@type-name"/>
<xsl:with-param name="level" select="$level"/>
<xsl:with-param name='rq_global' select="$rq_global"/>
</xsl:call-template>
<xsl:apply-templates select='node()'/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name='ld:level'><xsl:value-of select='$level'/></xsl:attribute>
<xsl:attribute name='ld:meta'>compound</xsl:attribute>
<xsl:apply-templates select='node()'>
<xsl:with-param name='level' select="$level+$level_shift"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match='compound'>
<xsl:param name='level' select='-1'/>
<ld:field>
<xsl:if test="not(@name|@type-name)">
<xsl:attribute name='ld:anon-compound'>true</xsl:attribute>
</xsl:if>
<xsl:call-template name='compound'>
<xsl:with-param name='level' select="$level"/>
<xsl:with-param name='level_shift' select="count(@name)"/>
</xsl:call-template>
</ld:field>
</xsl:template>
<xsl:template match='bitfield|enum'>
<xsl:param name='level' select='-1'/>
<ld:field>
<xsl:attribute name='ld:subtype'><xsl:value-of select='name(.)'/></xsl:attribute>
<xsl:call-template name='compound'>
<xsl:with-param name='level' select="$level"/>
<xsl:with-param name='rq_global' select="name(.)"/>
</xsl:call-template>
</ld:field>
</xsl:template>
<!-- Generic container helper: resolve type-name to a field, then process subtags. -->
<xsl:template name='container'>
<xsl:param name='level' select='-1'/>
<xsl:attribute name='ld:is-container'>true</xsl:attribute>
<xsl:choose>
<xsl:when test='@type-name'>
<ld:field>
<xsl:call-template name='lookup-type-ref'>
<xsl:with-param name='name' select="@type-name"/>
<xsl:with-param name="level" select="$level"/>
</xsl:call-template>
</ld:field>
<xsl:apply-templates select='node()'/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select='node()'>
<xsl:with-param name='level' select="$level"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Special containers: meta='$tag' -->
<xsl:template match='static-array|pointer'>
<xsl:param name='level' select='-1'/>
<ld:field>
<xsl:attribute name='ld:level'><xsl:value-of select='$level'/></xsl:attribute>
<xsl:attribute name='ld:meta'><xsl:value-of select='name(.)'/></xsl:attribute>
<xsl:apply-templates select='@*'/>
<xsl:call-template name='container'>
<xsl:with-param name='level' select="$level+1"/>
</xsl:call-template>
</ld:field>
</xsl:template>
<!-- Misc containers: meta='container' subtype='$tag' -->
<xsl:template match='stl-vector|df-flagarray|stl-bit-vector'>
<xsl:param name='level' select='-1'/>
<ld:field ld:meta='container'>
<xsl:attribute name='ld:level'><xsl:value-of select='$level'/></xsl:attribute>
<xsl:attribute name='ld:subtype'><xsl:value-of select='name(.)'/></xsl:attribute>
<xsl:apply-templates select='@*'/>
<xsl:call-template name='container'>
<xsl:with-param name='level' select="$level+1"/>
</xsl:call-template>
</ld:field>
</xsl:template>
<!-- Virtual methods -->
<xsl:template match='vmethod'>
<xsl:param name='level' select='-1'/>
<xsl:copy>
<xsl:attribute name='ld:level'><xsl:value-of select='$level'/></xsl:attribute>
<xsl:apply-templates select='@*'/>
<xsl:if test='@ret-type'>
<xsl:copy-of select='text()[1]'/>
<ret-type>
<xsl:call-template name='lookup-type-ref'>
<xsl:with-param name='name' select="@ret-type"/>
<xsl:with-param name="level" select="$level+1"/>
</xsl:call-template>
</ret-type>
</xsl:if>
<xsl:apply-templates select='node()'>
<xsl:with-param name='level' select="$level+1"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match='ret-type'>
<xsl:param name='level' select='-1'/>
<xsl:copy>
<xsl:call-template name='compound'>
<xsl:with-param name='level' select="$level"/>
</xsl:call-template>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Second pass of lowering:
- Detect incorrectly placed fields
- Fold container item fields into a single ld:item subelement.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ld="http://github.com/peterix/dfhack/lowered-data-definition">
<!-- Generic walk -->
<xsl:template match="@*">
<xsl:copy-of select='.'/>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select='@*|node()'/>
</xsl:copy>
</xsl:template>
<!-- Detect invalid fields & methods -->
<xsl:template match="ld:field[not(@ld:level) or (@ld:level &lt; 0)]" priority='10'>
<xsl:message terminate='yes'>
Unexpected field: <xsl:copy-of select='.'/>
</xsl:message>
</xsl:template>
<xsl:template match="ld:vmethod[not(@ld:level) or not(@ld:level = 1)]" priority='10'>
<xsl:message terminate='yes'>
Unexpected method: <xsl:copy-of select='.'/>
</xsl:message>
</xsl:template>
<!-- Unify containers -->
<xsl:template match="ld:field" priority='8'>
<xsl:param name="tag" select="name(.)"/>
<xsl:element name='{$tag}'>
<xsl:apply-templates select='@*|node()'/>
</xsl:element>
</xsl:template>
<xsl:template match="*[@ld:is-container]" priority='9'>
<xsl:param name="tag" select="name(.)"/>
<xsl:element name='{$tag}'>
<xsl:apply-templates select='@*'/>
<xsl:choose>
<xsl:when test='count(ld:field) &lt;= 1'>
<xsl:apply-templates select='node()'>
<xsl:with-param name='tag' select="'ld:item'"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<!-- This destroys formatting, but it seems inevitable. -->
<xsl:copy-of select='text()[1]'/>
<ld:item ld:meta='compound'>
<xsl:attribute name='ld:level'><xsl:value-of select='@ld:level'/></xsl:attribute>
<xsl:apply-templates select='ld:field|text()'/>
</ld:item>
<xsl:apply-templates select='node()[not(self::ld:field)]'/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:template>
<xsl:template match='ret-type[count(ld:field)=1]'>
<xsl:apply-templates select='ld:field'>
<xsl:with-param name='tag' select="'ret-type'"/>
</xsl:apply-templates>
</xsl:template>
</xsl:stylesheet>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->