RCS Version Functions

Version numbers

The RCS versions numbers are 2 decimal numbers separated by a decimal point. For example iin "2.7", the major version number is 2 and the minor version number is 7. If two programs communicate there should be no problem if the versions of RCS used differ only by a minor version number, but if they differ by a major version number then it is likely that one or both programs may need to be updated.

C++ Functions

There are several ways that programmers can test the RCS version.

RCS_VERSION

RCS_VERSION is a macro defined in rcs.hh, of the form "m.n", where m is the major version number and n is minor version number.

print_rcs_version

This function prints a line describing the RCS library, it's version, date compiled etc.

rcs_version_compare

int rcs_version_compare(const char * compversion);

This function allows users to determine if the RCS library linked in is newer or older than a particular version. It returns 0 if the version matches, -1 if the RCS library linked in is older than compversion, and +1 if the RCS library linked in is newer than compversion. If no minor number is included in compversion any version with the given major number will return 0.

Example 1:

main()
{
	if(rcs_version_compare("2.5") < 0)
	{
		printf("RCS library older than 2.5\n");
	}
}

Example 2:

// This example shows how to test if the rcs.hh included matches the
// library that is linked in.
main()
{
	if(rcs_version_compare(RCS_VERSION) != 0)
	{
		printf("RCS library and header file don't match.\n");
	}
}

Example 2:

// Only compare major number.
main()
{
	if(rcs_version_compare("2") != 0)
	{
		printf("RCS library is not version 2.\n");
	}
	else
	{
		printf("RCS library is version 2. (It could be 2.0 or 2.99, we don't care.)\n");
	}

}

Using What to determine the Version

The SCCS what command can be used to determine the version of the library linked into an executable.
	what executable_file | grep RCS_LIBRARY_VERSION

output:
        RCS_LIBRARY_VERSION: 2.9 Compiled on  May  6 1997 at 15:55:35 for the  sunos5 platform.


Java Functions

Not Implemented yet.

See Also

The list of modifications.