krb5_error_code ret;
krb5_error_code ret = 0;
kt_purge(int argc, char **argv){    krb5_error_code ret;    krb5_kt_cursor cursor;    krb5_keytab_entry entry;    int help_flag = 0;    char *age_str = "1 week";    int age;    struct getargs args[] = {	{ "age",   0,  arg_string, NULL, "age to retire" },	{ "help", 'h', arg_flag, NULL }    };    int num_args = sizeof(args) / sizeof(args[0]);    int optind = 0;    int i = 0;    struct e *head = NULL;    time_t judgement_day;    args[i++].value = &age_str;    args[i++].value = &help_flag;    if(getarg(args, num_args, argc, argv, &optind)) {	arg_printusage(args, num_args, "ktutil remove", "");	return 0;    }    if(help_flag) {	arg_printusage(args, num_args, "ktutil remove", "");	return 0;    }    age = parse_time(age_str, "s");    if(age < 0) {	krb5_warnx(context, "unparasable time `%s'", age_str);	return 0;    }    ret = krb5_kt_start_seq_get(context, keytab, &cursor);    if(ret){	krb5_warn(context, ret, "krb5_kt_start_seq_get %s", keytab_string);	return 1;    }    while((ret = krb5_kt_next_entry(context, keytab, &entry, &cursor)) == 0) {	add_entry (entry.principal, entry.vno, &head);	krb5_kt_free_entry(context, &entry);    }    ret = krb5_kt_end_seq_get(context, keytab, &cursor);    judgement_day = time (NULL);    ret = krb5_kt_start_seq_get(context, keytab, &cursor);    if(ret){	krb5_warn(context, ret, "krb5_kt_start_seq_get, %s", keytab_string);	return 1;    }    while((ret = krb5_kt_next_entry(context, keytab, &entry, &cursor)) == 0) {	struct e *e = get_entry (entry.principal, head);	if (e == NULL) {	    krb5_warnx (context, "ignoring extra entry");	    continue;	}	if (entry.vno < e->max_vno	    && judgement_day - entry.timestamp > age) {	    if (verbose_flag) {		char *name_str;		krb5_unparse_name (context, entry.principal, &name_str);		printf ("removing %s vno %d\n", name_str, entry.vno);		free (name_str);	    }	    ret = krb5_kt_remove_entry (context, keytab, &entry);	    if (ret)		krb5_warn (context, ret, "remove");	}	krb5_kt_free_entry(context, &entry);    }    ret = krb5_kt_end_seq_get(context, keytab, &cursor);    delete_list (head);    return 0;}