#ifndef _DW_UTIL_H
#define _DW_UTIL_H

/*--------------------------------------------------------------------------
 *  Copyright (c) 2001-2004 Igor Daniloff. 
 *	All rights reserved.
 *
 * By using this file, you agree to the terms and conditions set
 * forth in the LICENSE file which can be found at this directory.
 *------------------------------------------------------------------------*/
 
/* $Id: dw_util.h,v 1.8 2005/03/19 13:03:25 asv Exp $ */

#include "dwc_type.h"
#include "dwc_macro.h"
#if !defined(DW_AGENT)
#include "dw_options.h"
#endif /* not AGENT */

typedef struct {
    char*       key;
    int         val;
} dwc_sls_t;
#define END_SLS_LINE    { NULL, 0 }

#if defined(__UNIX_DW)
extern dwc_sls_t SyslogFacilities[];
extern dwc_sls_t SyslogPriorities[];
#endif /* UNIX */
extern dwc_sls_t LogLevels[];

#if !defined(__WIN32_DW)
#if !defined(EMX_DW) 
extern pid_t        dw_daemonize( dwc_string_t ch_dir, dwc_bool_t close_fd );
#endif /* EMX */
#if !defined(DW_SAMBA)
#if defined(__UNIX_DW)
#if !defined(DW_AGENT)
#if defined(DW_SENDMAIL) || defined(DW_CGP) || defined(DW_ZMAILER) || defined(DW_COURIER) || defined(DW_MIO)
extern dwc_bool_t   dw_init_agent( dwcf_agent_opt_t* popt );
extern dwc_void_t   dw_fini_agent( dwcf_agent_opt_t* popt );
#endif /* SENDMAIL or CGP or ZMAILER or COURIER or MIO */
extern dwc_bool_t   dw_drop_stat( dwcf_agent_opt_t* popt, dwc_scan_result_t res );
#endif /* not AGENT */
#endif /* UNIX */
extern dwc_bool_t   dw_set_user( const dwc_string_t user );
#endif /* not SAMBA */
#if !defined(DW_AGENT)
extern dwc_bool_t   dw_init_lib( dwcf_comm_opt_t* comm );
extern dwc_bool_t   dw_check_version( void );
#endif /* not AGENT */
extern dwc_void_t   dw_sleep( const int msec );    
#endif /* WIN32 */
extern dwc_bool_t   dw_set_slproperty( char* key, int *pvalue, dwc_sls_t val_arr[] );
extern char*        dw_skip_space( char *buf );

#endif /* _DW_UTIL_H */
