/*
 * Copyright (c) 2006 Claus Assmann
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * $Id: smtpch.h,v 1.5 2007/05/27 15:13:00 ca Exp $
 */

#ifndef SMTPCH_H
#define SMTPCH_H 1

#if SMTPC_DEFINE
#define EXTERN	
#define INIT(x)	= (x)
#else
#define EXTERN	extern
#define INIT(x)
#endif

EXTERN int	 sc_index INIT(-1);	/* Current process index */
EXTERN pid_t	 sc_pid INIT(-1);	/* Current process pid   */

/* context for SMTPC/QMGR communication subsystem */
EXTERN c2q_ctx_T	c2q_ctx;

sm_ret_T	 sc_init0(sc_ctx_P _sc_ctx);
sm_ret_T	 sc_init_chk(sc_ctx_P _sc_ctx);
sm_ret_T	 sc_init1(sc_ctx_P _sc_ctx);
void		 sc_start_threads(sc_ctx_P _sc_ctx);
void		 sc_set_thread_throttling(sc_ctx_P _sc_ctx);
sm_ret_T	 sc_hdl_session(sc_t_ctx_P _sc_t_ctx);
sm_ret_T	 sc_timeout_session(sc_t_ctx_P _sc_t_ctx);
sm_ret_T	 sc_shutdown_session(sc_t_ctx_P _sc_t_ctx, bool _fast);
#if 0
void		 sc_load_configs(sc_ctx_P _sc_ctx);
#endif
void		 sc_dump_info(sc_ctx_P _sc_ctx);
sm_ret_T	 sc_showversion(sc_ctx_P _sc_ctx, const char *_progname, const char *_cnf, uint _level);

#if MTA_USE_TLS
sm_ret_T	 sc_extra_conf(sc_ctx_P _sc_ctx, sm_str_P _conf_str, tlsreq_cnf_P _tlsreq_cnf, sm_conf_T **_pcnf);
#endif

#undef EXTERN
#undef INIT

#endif /* SMTPCH_H */


syntax highlighted by Code2HTML, v. 0.9.1