Diff for /libraries/liblber/dtest.c between versions 1.3 and 1.8

version 1.3, 1998/11/08 01:31:31 version 1.8, 1998/12/28 19:46:13
Line 1 Line 1
 /* dtest.c - lber decoding test program */  /* dtest.c - lber decoding test program */
 /*  /*
    * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
    * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
    */
   /* Portions
  * Copyright (c) 1990 Regents of the University of Michigan.   * Copyright (c) 1990 Regents of the University of Michigan.
  * All rights reserved.   * All rights reserved.
  *   *
Line 18 Line 22
   
 #include <ac/string.h>  #include <ac/string.h>
 #include <ac/socket.h>  #include <ac/socket.h>
   #include <ac/unistd.h>
   
 #ifdef HAVE_CONSOLE_H  #ifdef HAVE_CONSOLE_H
 #include <console.h>  #include <console.h>
 #endif /* MACOS */  #endif /* MACOS */
   
 #include "lber-int.h"  #include <lber.h>
   
 static void usage( char *name )  static void usage( char *name )
 {  {
Line 36  main( int argc, char **argv ) Line 41  main( int argc, char **argv )
         long            i;          long            i;
         unsigned long   len;          unsigned long   len;
         int             tag;          int             tag;
         BerElement      ber;          BerElement      *ber;
         Sockbuf         sb;          Sockbuf         *sb;
         extern char     *optarg;  
   
 #ifdef HAVE_CONSOLE_H  #ifdef HAVE_CONSOLE_H
         ccommand( &argv );          ccommand( &argv );
         cshow( stdout );          cshow( stdout );
 #endif /* MACOS */  #endif /* MACOS */
   
         memset( &sb, 0, sizeof(sb) );          sb = lber_sockbuf_alloc_fd( fileno(stdin) );
         sb.sb_sd = 0;  
         sb.sb_ber.ber_buf = NULL;          if( (ber = ber_alloc_t(LBER_USE_DER)) == NULL ) {
                   perror( "ber_alloc_t" );
                   exit( 1 );
           }
   
         if ( (tag = ber_get_next( &sb, &len, &ber )) == -1 ) {          if ( (tag = ber_get_next( sb, &len, ber )) == -1 ) {
                 perror( "ber_get_next" );                  perror( "ber_get_next" );
                 exit( 1 );                  exit( 1 );
         }          }
         printf( "message has tag 0x%x and length %ld\n", tag, len );          printf( "message has tag 0x%x and length %ld\n", tag, len );
   
         if ( ber_scanf( &ber, "i", &i ) == -1 ) {          if ( ber_scanf( ber, "i", &i ) == -1 ) {
                 fprintf( stderr, "ber_scanf returns -1\n" );                  fprintf( stderr, "ber_scanf returns -1\n" );
                 exit( 1 );                  exit( 1 );
         }          }
         printf( "got int %d\n", i );          printf( "got int %ld\n", i );
   
           lber_sockbuf_free( sb );
         return( 0 );          return( 0 );
 }  }

Removed from v.1.3  
changed lines
  Added in v.1.8


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org