6811333 Remove prom_printf() message in emlxs driver
[opensolaris.git] / usr / src / lib / libnisdb / db_dictxdr.c
blob2fb09e26cc53e9f50f07712d8b13b2c0a305f4d1
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * db_dictxdr.c
25 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include "db_dictionary_c.h"
32 #include "db_vers_c.h"
34 extern vers db_update_version;
36 extern void make_zero(vers*);
38 /* Special xdr_db_dict_desc that understands optional version number at end. */
39 bool_t
40 xdr_db_dict_desc(XDR *xdrs, db_dict_desc *objp)
43 if (!xdr_db_dict_version(xdrs, &objp->impl_vers))
44 return (FALSE);
45 if (!xdr_array(xdrs, (char **)&objp->tables.tables_val,
46 (uint_t *)&objp->tables.tables_len, ~0,
47 sizeof (db_table_desc_p), (xdrproc_t)xdr_db_table_desc_p))
48 return (FALSE);
49 if (!xdr_int(xdrs, &objp->count))
50 return (FALSE);
52 if (xdrs->x_op == XDR_DECODE) {
53 /* If no version was found, set version to 0. */
54 if (!xdr_vers(xdrs, (void**) &db_update_version))
55 make_zero(&db_update_version);
56 return (TRUE);
57 } else if (xdrs->x_op == XDR_ENCODE) {
58 /* Always write out version */
59 if (!xdr_vers(xdrs, (void**) &db_update_version))
60 return (FALSE);
61 } /* else XDR_FREE: do nothing */
63 return (TRUE);