/** A C-string naming the type, for use by the built-in `type` function. */
char*tname;
/** Called with [this, rhs] to perform binary addition ("+"). */
sol_cfunc_tadd;
/** Called with [this, rhs] to perform binary subtraction ("-"). */
sol_cfunc_tsub;
/** Called with [this, rhs] to perform binary multiplication ("*"). */
sol_cfunc_tmul;
/** Called with [this, rhs] to perform binary division ("/"). */
sol_cfunc_tdiv;
/** Called with [this, rhs] to perform binary modulus ("%"). */
sol_cfunc_tmod;
/** Called with [this, rhs] to perform binary exponentiation ("**"). */
sol_cfunc_tpow;
/** Called with [this, rhs] to perform binary bitwise AND ("&") */
sol_cfunc_tband;
/** Called with [this, rhs] to perform binary bitwise OR ("|") */
sol_cfunc_tbor;
/** Called with [this, rhs] to perform binary bitwise XOR ("^") */
sol_cfunc_tbxor;
/** Called with [this, rhs] to perform binary bitwise left shift ("<<") */
sol_cfunc_tblsh;
/** Called with [this, rhs] to perform binary bitwise right shift (">>") */
sol_cfunc_tbrsh;
/** Called with [this] to perform bitwise not ("~") */
sol_cfunc_tbnot;
/** Called with [this, rhs] to perform comparison; the result should be an integer object of value -1 (this < rhs), 0 (this == rhs), or 1 (this > rhs) */
sol_cfunc_tcmp;
/** Called with [this, arg1, arg2, ...] to perform a call (as "this(arg1, arg2, ...)") */
sol_cfunc_tcall;
/** Called with [this, index] to perform an index like "this[index]" or "this.index" (in the latter, index will be a string object) */
sol_cfunc_tindex;
/** Called with [this, index, value] to perform a setindex (like "this[index] = value" or "this.index = value" for index being a string object) */
sol_cfunc_tsetindex;
/** Called with [this] to perform a length predicate (like "#this") */
sol_cfunc_tlen;
/** Called with [this] to return a function object (or cfunction object) that will iterate over "this" (see the iterator protocol for more details) */
sol_cfunc_titer;
/** Called with [this] to cast "this" to an integer object. This may raise an error, which should be checked. */
sol_cfunc_ttoint;
/** Called with [this] to cast "this" to a float object. This may raise an error, which should be checked. */
sol_cfunc_ttofloat;
/** Called with [this] to cast "this" to a string object. This generally shouldn't raise an error, and usually falls back to a simple representation. */
sol_cfunc_ttostring;
/** Called with [this] to provide a representation of "this", in the sense that it is human-readable and informative. This usually falls back to tostring. */
sol_cfunc_trepr;
/** Called with this (*not a list*) as a result of calling `sol_init_object`. Since this is usually called from a constructor anyway, it's usually fairly useless. It should return this. */
sol_cfunc_tinit;
/** Called with this (*not a list*) and *with a NULL state* before an object is freed; it should free any resources this object exclusively holds, and return this. */
/** The number of living references to this object, increased by `sol_incref` and decreased by `sol_obj_free`. */
intrefcnt;
/** The ops structure defining the behavior of this object under certain operations (more or less, its behavioral "type"). */
sol_ops_t*ops;
union{
/** For `SOL_INTEGER`, the value of the integer. */
longival;
/** For `SOL_FLOAT`, the value of the floating point number. */
doublefval;
/** For `SOL_STRING`, the C string pointer. For `SOL_SINGLET`, the name of this singlet. */
char*str;
/** For `SOL_LIST` and `SOL_MAP`, the DSL sequence that contains the items or pairs. */
dsl_seq*seq;
struct{
/** For `SOL_MCELL`, the key of the pair. */
structsol_tag_object_t*key;
/** For `SOL_MCELL`, the value of the pair. */
structsol_tag_object_t*val;
};
struct{
/** For `SOL_FUNCTION`, the `stmt_node` pointer representing the function's body. */
void*func;//Actuallyastmt_node*
/** For `SOL_FUNCTION`, the `identlist_node` pointer representing the list of the functions argument names. */
void*args;//Actuallyanidentlist_node*
/** For `SOL_FUNCTION`, a map representing the closure (initial scope, updated on exit) of the function. */
structsol_tag_object_t*closure;
/** For `SOL_FUNCTION`, a map of data defined by the user on this function object. */
structsol_tag_object_t*udata;
/** For `SOL_FUNCTION`, the name of the function if it was not declared anonymously (otherwise NULL). */
char*fname;
};
/** For `SOL_CFUNCTION`, the C function pointer. */
sol_cfunc_tcfunc;
/** For `SOL_STMT` and `SOL_EXPR`, the `stmt_node` or `expr_node` pointer, respectively. */
void*node;
struct{
/** For `SOL_BUFFER`, the memory region referred to by this buffer. */
void*buffer;
/** For `SOL_BUFFER`, the size of this memory region. Negative values indicate no or unknown size. */
ssize_tsz;
/** For `SOL_BUFFER`, the ownership type of this buffer's region. */
sol_owntype_town;
/** For `SOL_BUFFER`, the freeing function if own == `OWN_CALLF` */
sol_freefunc_tfreef;
/** For `SOL_BUFFER`, the moving function if own == `OWN_CALLF` */
sol_movefunc_tmovef;
};
/** For `SOL_DYLIB`, the handle as returned by `dlopen`. */
void*dlhandle;
struct{
/** For `SOL_DYSYM`, the symbol as resolved by `dlsym`. */
void*dlsym;
/** For `SOL_DYSYM`, a sequence of the types of the arguments (a set of `sol_buftype_t` cast to void *, the native type of DSL), if the symbol is a function. */
dsl_seq*argtp;
/** For `SOL_DYSYM`, the return type of the symbol if it is a function; otherwise, the type of the symbol if it is a variable. */
sol_buftype_trettp;
};
struct{
/** For `SOL_STREAM`, the actual file object. */
FILE*stream;
/** For `SOL_STREAM`, the modes for which this stream is open. */
sol_modes_tmodes;
};
/** For `SOL_CDATA`, an arbitrary, user-defined pointer. */