Diff for /libraries/liblber/dtest.c between versions 1.1.3.1.20.2 and 1.12

version 1.1.3.1.20.2, 1998/09/28 17:27:54 version 1.12, 1999/03/03 14:45:06
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 11 Line 15
  * is provided ``as is'' without express or implied warranty.   * is provided ``as is'' without express or implied warranty.
  */   */
   
 #define DISABLE_BRIDGE  
 #include "portable.h"  #include "portable.h"
   
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
   
 #include <ac/string.h>  #include <ac/string.h>
   #include <ac/socket.h>
   #include <ac/unistd.h>
   
 #ifdef MACOS  #ifdef HAVE_CONSOLE_H
 #include <console.h>  #include <console.h>
 #else /* MACOS */  
 #include <sys/types.h>  
 #include <sys/socket.h>  
 #endif /* MACOS */  #endif /* MACOS */
   
 #include "lber.h"  #include <lber.h>
   
 static usage( char *name )  static void usage( char *name )
 {  {
         fprintf( stderr, "usage: %s fmt\n", name );          fprintf( stderr, "usage: %s fmt\n", name );
 }  }
   
   int
 main( int argc, char **argv )  main( int argc, char **argv )
 {  {
         long            i, i2, num;          long            i;
         unsigned long   len;          unsigned long   len;
         int             tag;          int             tag;
         char            *str, *s1, *s2;          BerElement      *ber;
         BerElement      ber;          Sockbuf         *sb;
         Sockbuf         sb;  
         extern char     *optarg;  
   
 #ifdef MACOS  #ifdef HAVE_CONSOLE_H
         ccommand( &argv );          ccommand( &argv );
         cshow( stdout );          cshow( stdout );
 #endif /* MACOS */  #endif /* MACOS */
   
         bzero( &sb, sizeof(sb) );          sb = lber_pvt_sb_alloc_fd( fileno(stdin) );
         sb.sb_sd = 0;  
         sb.sb_ber.ber_buf = NULL;          if( (ber = ber_alloc_t(LBER_USE_DER)) == NULL ) {
         if ( (tag = ber_get_next( &sb, &len, &ber )) == -1 ) {                  perror( "ber_alloc_t" );
                   exit( 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 ) == LBER_ERROR ) {
                 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_pvt_sb_free( sb );
         return( 0 );          return( 0 );
 }  }

Removed from v.1.1.3.1.20.2  
changed lines
  Added in v.1.12


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