/* -*- Mode: C -*-
 * $Header: /home/gene/library/website/docsrc/lizard/RCS/make-data0010.c,v 395.1 2008/04/20 17:25:55 gene Exp $
 *
 * Copyright (c) 2005 Gene Michael Stover.  All rights reserved.
 *
 * To STDOUT, write the data file for Lisp test "test0010".
 * To STDOUT, write seven XDR-encoded opaque octets.  That should
 * be eight octets total because XDR writes blocks of 4 octets.
 */

#include "this.h"

int
main ()
{
  int rc = 0;
  XDR xdrs;
  static char arr[] = { 1, 2, 3, 4 };

  xdrstdio_create (&xdrs, stdout, XDR_ENCODE);

  if (xdr_opaque (&xdrs, arr, 4)) {     /* write four octets */
    if (xdr_opaque (&xdrs, arr, 3)) {   /* write three octets */
      /* success */
    } else {
      fprintf (stderr, "\n%s:%d: xdr_opaque failed", __FILE__, __LINE__);
      rc = 3;
    }
  } else {
    fprintf (stderr, "\n%s:%d: xdr_opaque failed", __FILE__, __LINE__);
    rc = -42;
  }

  xdr_destroy (&xdrs);
  return rc == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}

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