/*  Headers for nfsd

    ©1998, 1999, 2000 Joseph Walton

    This software is distributed under the terms of the GNU General Public
    License; either version 2 of the License, or (at your option) any
    later version.
*/

/*
    14-Oct-2000: Added `flushint' to global cfg
*/

#ifndef NFSD_H
#define NFSD_H

#include <exec/types.h>
#include <exec/lists.h>
#include <dos/dos.h>

#include "config.h"

struct nfsd_Global {
    /* Settings */
    STRPTR cfgFileName;
    LONG amigaGMTOffset; // Minutes we must add to GMT to get the current wall clock time
    BOOL verbose;
    BOOL allow_root;
    BOOL allow_nonpriv_port;
    BOOL keep_open;

    /*
     As per patches from David Trollope, `flushint' is the flush
     interval in seconds. A value of zero implies that flushing
     should not take place.
    */
    ULONG flushint;

    /* Resources */
    LONG cfgSerial; // A unique serial number for the current config
    __aligned struct List config;
    APTR recv_buffer, send_buffer;
    /* Buffers for file data */
    __aligned struct InfoData infodata;
    __aligned struct FileInfoBlock fib;
};

extern struct nfsd_Global global;

/* Define _DEBUG for a whole bunch of extra output */
#ifdef _DEBUG
#define DEBUG(x) (x)
#else
#define DEBUG(x)
#endif

#define VERBOSE(x) if(global.verbose){x;}

#endif
