GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
AG_VERSION(3) FreeBSD Library Functions Manual AG_VERSION(3)

AG_Version
agar data file versioning

#include <agar/core.h>

The agar AG_Version interface encodes or decodes versioning information. This includes a magic string and two 32-bit version numbers:
typedef struct ag_version {
	Uint32 major, minor;
} AG_Version;

The major is incremented whenever a change introduces binary incompatibility with previous versions of the data files.

The minor member is incremented whenever a change is made in the data file, but binary compatibility is preserved.

Major changes that would otherwise break binary compatibility can be dealt with by increasing only the minor version number and adding compatibility code in the loader routine.

int
AG_ReadVersion(AG_DataSource *ds, const char *magic, const AG_Version *ver, AG_Version *rver);


void
AG_WriteVersion(AG_DataSource *ds, const char *magic, const AG_Version *ver);


int
AG_ReadObjectVersion(AG_DataSource *ds, AG_Object *obj);


void
AG_WriteObjectVersion(AG_DataSource *ds, const AG_Object *obj);

The AG_ReadVersion() function reads version information from fd and returns 0 if the following data is binary compatible against the version represented by ver, or -1 if the data is not compatible. If rver is not NULL, it is initialized with the version information read from fd.

The AG_WriteVersion() function writes version information from the structure ver to ds.

The AG_ReadObjectVersion() and AG_WriteObjectVersion() variants use the version information contained in the AG_ObjectClass structure of AG_Object(3), using the name of the object class as a signature.

AG_DataSource(3), AG_Intro(3)

The AG_Version interface first appeared in Agar 1.0
August 23, 2002 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.