typeval = ldaptool_local2UTF8( argv[optind] );
typeval = ldaptool_local2UTF8( argv[optind], "type and value" );
main( int argc, char **argv ){    char		buf[ 4096 ], *typeval = NULL, *type = NULL;    struct berval	bv;    int			rc, optind;    LDAPControl		*ldctrl;#ifdef notdef#ifdef HPUX11#ifndef __LP64__	_main( argc, argv);#endif /* __LP64_ */#endif /* HPUX11 */#endif    optind = ldaptool_process_args( argc, argv, "cq", 0, options_callback );    if ( ldaptool_fp == NULL && optind >= argc ) {	ldaptool_fp = stdin;    }    ld = ldaptool_ldap_init( 0 );    ldaptool_bind( ld );    if (( ldctrl = ldaptool_create_manage_dsait_control()) != NULL ) {	ldaptool_add_control_to_array( ldctrl, ldaptool_request_ctrls);    }     if ((ldctrl = ldaptool_create_proxyauth_control(ld)) !=NULL) {	ldaptool_add_control_to_array( ldctrl, ldaptool_request_ctrls);    }    if ( optind >= argc ) {	usage( LDAP_PARAM_ERROR );    }    typeval = ldaptool_local2UTF8( argv[optind] );    if (( rc = typeval2berval( typeval, &type, &bv )) != LDAP_SUCCESS ) {	fprintf( stderr, "%s: unable to parse \"%s\"\n",		    ldaptool_progname, argv[optind] );	usage( rc );	free( typeval );    }    ++optind;    rc = 0;    if ( ldaptool_fp == NULL ) {	for ( ; optind < argc &&		( contoper || !LDAPTOOL_RESULT_IS_AN_ERROR( rc ) );		++optind ) {            char *conv;            conv = ldaptool_local2UTF8( argv[ optind ] );	    rc = docompare( ld, conv, type, &bv, ldaptool_request_ctrls );            if ( conv != NULL ) {                free( conv );	    }	}    } else {	while (( contoper || !LDAPTOOL_RESULT_IS_AN_ERROR( rc )) &&		fgets(buf, sizeof(buf), ldaptool_fp) != NULL) {	    buf[ strlen( buf ) - 1 ] = '\0';	/* remove trailing newline */	    if ( *buf != '\0' ) {		rc = docompare( ld, buf, type, &bv, ldaptool_request_ctrls );	    }	}    }    ldaptool_reset_control_array( ldaptool_request_ctrls );    ldaptool_cleanup( ld );    if ( typeval != NULL ) free( typeval );    if ( bv.bv_val != NULL ) free( bv.bv_val );    return( rc );}