|
NAME
SYNOPSIS#include <agar/core.h> DESCRIPTIONThe typedef struct ag_version {
Uint32 major; /* Major version number */
Uint32 minor; /* Minor version number */
Uint32 cid; /* Class ID */
Uint32 unicode; /* Icon (Unicode value) */
} AG_Version;
The major version number is incremented whenever a change introduces any type of binary incompatibility with previous versions of the data file. The minor number is incremented when a new feature is introduced which does not break binary compatibility with previous versions. A typical deserialization routine may test the minor number to determine the presence of new features (which do not break binary compatibility). The cid field is a 32-bit numerical class ID (or 0). The unicode field is an optional Unicode character value (or 0). VERSIONINGint
The
The
EXAMPLESThe following code writes version information to a data stream: AG_DataSource *ds; AG_Version ver; ver.major = 1; ver.minor = 1; AG_WriteVersion(ds, "My-Magic", &ver); The following code reads version information from a data stream: AG_DataSource *ds;
AG_Version verRequired, ver;
verRequired.major = 1;
verRequired.minor = 0;
if (AG_ReadVersion(ds, "My-Magic", &verRequired,
&ver) == 0) {
AG_Verbose("Version OK! (%u.%u)\n",
ver.major, ver.minor);
} else {
AG_Verbose("Version not OK!\n");
}
SEE ALSOHISTORYThe
|