1 /* idtest.c - ber decoding test program using isode libraries */
4 * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
8 * Copyright (c) 1990 Regents of the University of Michigan.
11 * Redistribution and use in source and binary forms are permitted
12 * provided that this notice is preserved and that due credit is given
13 * to the University of Michigan at Ann Arbor. The name of the University
14 * may not be used to endorse or promote products derived from this
15 * software without specific prior written permission. This software
16 * is provided ``as is'' without express or implied warranty.
23 #include <ac/stdlib.h>
27 #include <quipu/attr.h>
31 main( int argc, char **argv )
35 PS psin, psout, pserr;
37 /* read the pe from standard in */
38 if ( (psin = ps_alloc( std_open )) == NULLPS ) {
42 if ( std_setup( psin, stdin ) == NOTOK ) {
43 perror( "std_setup" );
46 /* write the pe to standard out */
47 if ( (psout = ps_alloc( std_open )) == NULLPS ) {
51 if ( std_setup( psout, stdout ) == NOTOK ) {
52 perror( "std_setup" );
55 /* pretty print it to standard error */
56 if ( (pserr = ps_alloc( std_open )) == NULLPS ) {
60 if ( std_setup( pserr, stderr ) == NOTOK ) {
61 perror( "std_setup" );
65 while ( (pe = ps2pe( psin )) != NULLPE ) {
72 fprintf(stderr, "requires ISODE X.500 distribution.\n");
73 return( EXIT_FAILURE );