2N/A/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2N/A/*
2N/A * lib/krb5/os/realm_init.c
2N/A *
2N/A * Copyright 1998 by the Massachusetts Institute of Technology.
2N/A * All Rights Reserved.
2N/A *
2N/A * Export of this software from the United States of America may
2N/A * require a specific license from the United States Government.
2N/A * It is the responsibility of any person or organization contemplating
2N/A * export to obtain such a license before exporting.
2N/A *
2N/A * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
2N/A * distribute this software and its documentation for any purpose and
2N/A * without fee is hereby granted, provided that the above copyright
2N/A * notice appear in all copies and that both that copyright notice and
2N/A * this permission notice appear in supporting documentation, and that
2N/A * the name of M.I.T. not be used in advertising or publicity pertaining
2N/A * to distribution of the software without specific, written prior
2N/A * permission. Furthermore if you modify this software you must label
2N/A * your software as modified software and not distribute it in such a
2N/A * fashion that it might be confused with the original M.I.T. software.
2N/A * M.I.T. makes no representations about the suitability of
2N/A * this software for any purpose. It is provided "as is" without express
2N/A * or implied warranty.
2N/A *
2N/A * krb5_realm_iterate()
2N/A */
2N/A
2N/A#include "k5-int.h"
2N/A#include <ctype.h>
2N/A#include <stdio.h>
2N/A
2N/Akrb5_error_code KRB5_CALLCONV
2N/Akrb5_realm_iterator_create(krb5_context context, void **iter_p)
2N/A{
2N/A static const char *const names[] = { "realms", 0 };
2N/A
2N/A return profile_iterator_create(context->profile, names,
2N/A PROFILE_ITER_LIST_SECTION |
2N/A PROFILE_ITER_SECTIONS_ONLY,
2N/A iter_p);
2N/A}
2N/A
2N/Akrb5_error_code KRB5_CALLCONV
2N/Akrb5_realm_iterator(krb5_context context, void **iter_p, char **ret_realm)
2N/A{
2N/A return profile_iterator(iter_p, ret_realm, 0);
2N/A}
2N/A
2N/Avoid KRB5_CALLCONV
2N/Akrb5_realm_iterator_free(krb5_context context, void **iter_p)
2N/A{
2N/A profile_iterator_free(iter_p);
2N/A}
2N/A
2N/Avoid KRB5_CALLCONV
2N/Akrb5_free_realm_string(krb5_context context, char *str)
2N/A{
2N/A profile_release_string(str);
2N/A}