Add proper per-file copyright notices/licenses and top-level license.
[bluesky.git] / TBBT / trace_play / sfs_m_xdr.c
1 #ifndef lint
2 static char sfs_m_xdrSid[] = "@(#)sfs_m_xdr.c   2.1     97/10/23";
3 #endif
4
5 /*
6  *   Copyright (c) 1992-1997,2001 by Standard Performance Evaluation Corporation
7  *      All rights reserved.
8  *              Standard Performance Evaluation Corporation (SPEC)
9  *              6585 Merchant Place, Suite 100
10  *              Warrenton, VA 20187
11  *
12  *      This product contains benchmarks acquired from several sources who
13  *      understand and agree with SPEC's goal of creating fair and objective
14  *      benchmarks to measure computer performance.
15  *
16  *      This copyright notice is placed here only to protect SPEC in the
17  *      event the source is misused in any manner that is contrary to the
18  *      spirit, the goals and the intent of SPEC.
19  *
20  *      The source code is provided to the user or company under the license
21  *      agreement for the SPEC Benchmark Suite for this product.
22  */
23
24 /*****************************************************************
25  *                                                               *
26  *      Copyright 1991,1992  Legato Systems, Inc.                *
27  *      Copyright 1991,1992  Auspex Systems, Inc.                *
28  *      Copyright 1991,1992  Data General Corporation            *
29  *      Copyright 1991,1992  Digital Equipment Corporation       *
30  *      Copyright 1991,1992  Interphase Corporation              *
31  *      Copyright 1991,1992  Sun Microsystems, Inc.              *
32  *                                                               *
33  *****************************************************************/
34
35 /*
36  *.Exported_routines
37  *      bool_t xdr_sync_string(XDR *, sync_string *)
38  *
39  *.Revision_history
40  *      28-Nov-91       0.0.13  Teelucksingh
41  *                              added 'transaction id' field to xdr data
42  *                              structure and ANSI C features.
43  *      17-Jun-91       0.0.7   Teelucksingh - Creation
44  *                              Multi-client synchronization rpc xdr
45  *                              functions.
46  */
47
48
49 /*
50  * -------------------------  Include Files  -------------------------
51  */
52
53 /*
54  * ANSI C headers
55  */
56 #include <stdio.h>
57 #include <stdlib.h>
58 #include <string.h>
59 #include <errno.h>
60
61 #include <sys/types.h>
62 #include <sys/stat.h> 
63
64 #include "sfs_c_def.h"
65 #include "sfs_m_def.h"
66
67 /*
68  * ---------------  Multi-client Message XDR Routines  ---------------
69  */
70
71 bool_t
72 xdr_sync_string(
73     XDR *               xdrs,
74     sync_string *       objp)
75 {
76     if (!xdr_int(xdrs, (int *) &objp->clnt_id)) {
77         (void) fprintf(stderr, "%s: can't encode client id %d",
78                         sfs_Myname, objp->clnt_id);
79         return (FALSE);
80     }
81     if (!xdr_string(xdrs, (char **) &objp->clnt_type,
82                                         (unsigned int) MAX_STR1_LEN)) {
83         (void) fprintf(stderr, "%s: can't encode client type %s",
84                         sfs_Myname, objp->clnt_type);
85         return (FALSE);
86     }
87     if (!xdr_string(xdrs, (char **) &objp->clnt_transaction,
88                                         (unsigned int) MAX_STR1_LEN)) {
89         (void) fprintf(stderr, "%s: can't encode client transaction %s",
90                         sfs_Myname, objp->clnt_transaction);
91         return (FALSE);
92     }
93     if (!xdr_string(xdrs, (char **) &objp->clnt_data,
94                                         (unsigned int) MAX_STR2_LEN)) {
95         (void) fprintf(stderr, "%s: can't encode client data %s",
96                         sfs_Myname, objp->clnt_data);
97         return (FALSE);
98     }
99     return (TRUE);
100 }
101
102
103 /* sfs_m_xdr.c */