dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / ldap / common / idtest.c
blobb018a3d810b1e76116c411aac6a1aee4cb71587d
1 /*
3 * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
4 * Use is subject to license terms.
6 */
7 #pragma ident "%Z%%M% %I% %E% SMI"
8 /* idtest.c - ber decoding test program using isode libraries */
9 /*
10 * Copyright (c) 1990 Regents of the University of Michigan.
11 * All rights reserved.
13 * Redistribution and use in source and binary forms are permitted
14 * provided that this notice is preserved and that due credit is given
15 * to the University of Michigan at Ann Arbor. The name of the University
16 * may not be used to endorse or promote products derived from this
17 * software without specific prior written permission. This software
18 * is provided ``as is'' without express or implied warranty.
21 #include <stdio.h>
22 #include <psap.h>
23 #include <quipu/attr.h>
25 static usage( char *name )
27 fprintf( stderr, "usage: %s\n", name );
30 main( int argc, char **argv )
32 PE pe;
33 PS psin, psout, pserr;
35 /* read the pe from standard in */
36 if ( (psin = ps_alloc( std_open )) == NULLPS ) {
37 perror( "ps_alloc" );
38 exit( 1 );
40 if ( std_setup( psin, stdin ) == NOTOK ) {
41 perror( "std_setup" );
42 exit( 1 );
44 /* write the pe to standard out */
45 if ( (psout = ps_alloc( std_open )) == NULLPS ) {
46 perror( "ps_alloc" );
47 exit( 1 );
49 if ( std_setup( psout, stdout ) == NOTOK ) {
50 perror( "std_setup" );
51 exit( 1 );
53 /* pretty print it to standard error */
54 if ( (pserr = ps_alloc( std_open )) == NULLPS ) {
55 perror( "ps_alloc" );
56 exit( 1 );
58 if ( std_setup( pserr, stderr ) == NOTOK ) {
59 perror( "std_setup" );
60 exit( 1 );
63 while ( (pe = ps2pe( psin )) != NULLPE ) {
64 pe2pl( pserr, pe );
65 pe2ps( psout, pe );
68 exit( 0 );