CPU Performance Counters Library Functions cpcversion(3CPC)
NAME
cpcversion - coordinate CPC library and application ver-
sions
SYNOPSIS
cc [ flag... ] file... -lcpc [ library... ]
#include
uintt cpcversion(uintt version);
DESCRIPTION
The cpcversion() function takes an interface version as an
argument and returns an interface version as a result. Usu-
ally, the argument will be the value of CPCVERCURENT
bound to the application when it was compiled.
RETURN VALUES
If the version requested is still supported by the implemen-
tation, cpcversion() returns the requested version number
and the application can use the facilities of the library on
that platform. If the implementation cannot support the
version needed by the application, cpcversion() returns
CPCVERNONE, indicating that the application will at least
need to be recompiled to operate correctly on the new plat-
form, and may require further changes.
If version is CPCVERNONE, cpcversion() returns the most
current version of the library.
EXAMPLES
Example 1 Protect an application from using an incompatible
library.
The following lines of code protect an application from
using an incompatible library:
if (cpcversion(CPCVERCURENT) == CPCVERNONE) {
/* version mismatch - library cannot translate */
exit(1);
}
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 28 Mar 2005 1
CPU Performance Counters Library Functions cpcversion(3CPC)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Evolving
MT-Level Unsafe
SEE ALSO
cpc(3CPC), cpcopen(3CPC), libcpc(3LIB), attributes(5)
NOTES
The cpcversion() function exists for binary compatibility
only. Source containing this function will not compile. This
function is obsolete and might be removed in a future
release. Applications should use cpcopen(3CPC) instead.
The version number is used only to express incompatible
semantic changes in the performance counter interfaces on
the given platform within a single instruction set architec-
ture, for example, when a new set of performance counter
registers are added to an existing processor family that
cannot be specified in the existing cpceventt data struc-
ture.
SunOS 5.11 Last change: 28 Mar 2005 2
|