The val_field function
takes two arguments: the object containing the field to extract and the field identifier. As fields names are
not stored as actual strings within an object table, but as hashed equivalents of those names, the field
identifier needs to be looked up using the val_id function.
As noted earlier when preparing haXe code for transit to C/C++, the C readable string value stored in a
haXe String object is contained in a field called __s . As a String object is like any other Neko object,
the __s field needs to be extracted in the same manner as any object field in order to obtain the actual
textual string value struct.
Once you have extracted the value struct stored in an object, you can pretty much do what you will
with it. Any fields extracted from an object do not alter its content, except where the data held in a field
is a pointer reference to data in memory.
Creating and Modifying Neko Objects in C/C++
As you would expect from the previous table showing Neko library allocation functions, you create a
Neko object in C/C++ using the alloc_object function.
Pages:
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052