/* -*- Mode: C -*-
 * $Header: /home/gene/library/website/docsrc/lizard/src/RCS/test0011-out.c,v 395.1 2008/04/20 17:25:55 gene Exp $
 *
 * Copyright (c) 2003 Gene Michael Stover.  All rights reserved.
 *
 * To STDOUT, write 1023 XDR-encoded "opaque" bytes.
 */

/* Standard C */
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include <rpc/rpc.h>                    /* XDR & RPC */
#include <gc.h>                         /* Boehm collector */

#define COUNT 1023

int main ()
{
  int rc = 0;
  XDR xdrs;
  char arr[COUNT];
  int i;

  for (i = 0; i < COUNT; ++i) {
    arr[i] = i % 256;
  }

  xdrstdio_create (&xdrs, stdout, XDR_ENCODE);

  if (xdr_opaque (&xdrs, arr, COUNT)) {
      /* success */
  } else {
    printf ("\n%s:%d: xdr_opaque failed", __FILE__, __LINE__);
    rc = -42;
  }
  xdr_destroy (&xdrs);
  return rc == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}

/* --- end of file --- */
