4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
25 * Copyright 2015 Gary Mills
26 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
31 %#include "ldap_xdr.h"
39 %/* 'vers' is the version identifier. */
42 %#include "nisdb_rw.h"
44 #if RPC_HDR || RPC_XDR
51 __nisdb_rwlock_t vers_rwlock;
59 % unsigned int vers_high; /* major version number, tracks checkpoints */
60 % unsigned int vers_low; /* minor version number, tracks updates. */
61 % unsigned int time_sec; /* time stamp */
62 % unsigned int time_usec;
65 %/* No argument constructor. All entries initialized to zero. */
67 % vers_high = vers_low = time_sec = time_usec = 0;
71 %/* Constructor that makes copy of 'other'. */
72 % vers( vers *other );
74 %/* Constructor: create version with specified version numbers */
75 % vers( unsigned int high, unsigned int low) {
76 % vers_high = high; vers_low = low; time_sec = time_usec = 0;
80 %/* Creates new 'vers' with next higher minor version.
81 % If minor version exceeds MAXLOW, bump up major version instead.
82 % Set timestamp to that of the current time. */
85 %/* Creates new 'vers' with next higher major version.
86 % Set timestamp to that of the current time. */
89 %/* Set this 'vers' to hold values found in 'others'. */
90 % void assign( vers *other );
92 %/* Predicate indicating whether this vers is earlier than 'other' in
93 % terms of version numbers. */
94 % bool_t earlier_than( vers *other );
96 %/* Print the value of this 'vers' to specified file. */
97 % void print( FILE *file );
99 %/* Zero out this vers. */
102 %/* Predicate indicating whether this vers is equal to 'other'. */
103 % bool_t equal( vers *other);
105 %/* Locking methods */
107 % int acqexcl(void) {
108 % return (WLOCK(vers));
111 % int relexcl(void) {
112 % return (WULOCK(vers));
115 % int acqnonexcl(void) {
116 % return (RLOCK(vers));
119 % int relnonexcl(void) {
120 % return (RULOCK(vers));