/*
 * dnsutl - utilities to make DNS easier to configure
 * Copyright (C) 1991-1993, 1995, 1996, 1999, 2000, 2006, 2007 Peter Miller
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef SRRF_H
#define SRRF_H

#include <ac/stdio.h>

#include <strlist.h>

struct srrf_t; /* forward */

typedef struct srrf_type_ty srrf_type_ty;
struct srrf_type_ty
{
    const char      *name;
    size_t          number_of_arguments;
    void            (*check_arguments)(struct srrf_t *);
    int             (*local_test)(struct srrf_t *);
    int             (*print)(struct srrf_t *, FILE *);
    void            (*abs_to_rel)(struct srrf_t *);
    void            (*aux1)(struct srrf_t *, void *);
    void            (*aux2)(struct srrf_t *, void *);
};

typedef struct srrf_class_ty srrf_class_ty;
struct srrf_class_ty
{
    const char      *name;
    srrf_type_ty    *type;
    size_t          ntypes;
};

typedef struct srrf_t srrf_t;
struct srrf_t
{
    string_ty       *name;
    long            ttl;
    srrf_class_ty   *class;
    srrf_type_ty    *type;
    strlist_ty      arg;
    string_ty       *file_name;
    int             line_number;
};

void srrf_open(const char *);
srrf_t *srrf_read(void);
srrf_t *srrf_read_dfn(void);
void srrf_close(void);
srrf_t *srrf_alloc(void);
void srrf_free(srrf_t *);
int srrf_print(FILE *, srrf_t *);
int srrf_print_config(FILE *);
void srrf_check_for_duplicates(srrf_t **, size_t, const char *);
void srrf_automatic_time_stamp(void);

srrf_class_ty *srrf_class_by_name(const char *name);
srrf_type_ty *srrf_type_by_name(srrf_class_ty *, const char *name);

void srrf_include_path(const char *);
int srrf_include_path_specified(void);
void srrf_invoke_aux1(srrf_t *, void *);
void srrf_invoke_aux2(srrf_t *, void *);

string_ty *srrf_find(string_ty *);

#endif /* SRRF_H */


syntax highlighted by Code2HTML, v. 0.9.1