Back to index

lightning-sunbird  0.9+nobinonly
Functions
idtest.c File Reference
#include <stdio.h>
#include <psap.h>
#include <quipu/attr.h>

Go to the source code of this file.

Functions

static usage (char *name)
 main (int argc, char **argv)

Function Documentation

main ( int  argc,
char **  argv 
)

Definition at line 61 of file idtest.c.

{
       PE     pe;
       PS     psin, psout, pserr;

       /* read the pe from standard in */
       if ( (psin = ps_alloc( std_open )) == NULLPS ) {
              perror( "ps_alloc" );
              exit( 1 );
       }
       if ( std_setup( psin, stdin ) == NOTOK ) {
              perror( "std_setup" );
              exit( 1 );
       }
       /* write the pe to standard out */
       if ( (psout = ps_alloc( std_open )) == NULLPS ) {
              perror( "ps_alloc" );
              exit( 1 );
       }
       if ( std_setup( psout, stdout ) == NOTOK ) {
              perror( "std_setup" );
              exit( 1 );
       }
       /* pretty print it to standard error */
       if ( (pserr = ps_alloc( std_open )) == NULLPS ) {
              perror( "ps_alloc" );
              exit( 1 );
       }
       if ( std_setup( pserr, stderr ) == NOTOK ) {
              perror( "std_setup" );
              exit( 1 );
       }

       while ( (pe = ps2pe( psin )) != NULLPE ) {
              pe2pl( pserr, pe );
              pe2ps( psout, pe );
       }

       exit( 0 );
}

Here is the call graph for this function:

static usage ( char *  name) [static]

Definition at line 56 of file idtest.c.

{
       fprintf( stderr, "usage: %s\n", name );
}

Here is the call graph for this function: