/* $Id: state_imp.h,v 1.3 2006/04/09 07:37:05 hurtta Exp $ */

/******************************************************************************
 *  The Elm (ME+) Mail System  -  $Revision: 1.3 $
 *
 *  Author: Kari Hurtta <hurtta+elm@posti.FMI.FI>
 *****************************************************************************/

#define   STATE_out_extern   0xEBFF   /* _magic */

#define STATE_out_magic		0xEB00

typedef void ex_init_so_func P_((out_state_t *s)); 
typedef int  ex_seekable_so_func P_((out_state_t *s));
typedef FILE * ex_FILE_so_func P_((out_state_t *s));
typedef int  ex_seek_so_func P_((out_state_t *s, long pos));
typedef long ex_ftell_so_func P_((out_state_t *s));
typedef void ex_dest_so_func P_((out_state_t *s));
typedef void ex_flush_filter_so_func P_((out_state_t *s, int munge_eoln));

enum state_policy { state_policy_putc_use_filter = 1,
		    state_policy_flush_via_put };

typedef int ex_policy_so_func P_((out_state_t *s, 
				  enum state_policy question));

typedef int  ex_putc_so_func P_((out_state_t *s, int ch));
typedef int  ex_put_so_func P_((out_state_t *s, const char *string, int len));

struct out_state_type {
  unsigned short magic;     /* STATE_out_magic */

  unsigned short register_code;

  ex_init_so_func     * ex_init_so_it;
  ex_dest_so_func     * ex_dest_so_it;
  ex_seekable_so_func * ex_seekable_so_it;
  ex_FILE_so_func     * ex_FILE_so_it;
  ex_seek_so_func     * ex_seek_so_it;
  ex_ftell_so_func    * ex_ftell_so_it;
  ex_flush_filter_so_func * ex_flush_filter_so_it;
  ex_policy_so_func   * ex_policy_so_it;
  ex_putc_so_func     * ex_putc_so_it;
  ex_put_so_func      * ex_put_so_it;
};

/* This only registers pointer, struct is not copied */
void register_state_out_type P_((struct out_state_type *T));




syntax highlighted by Code2HTML, v. 0.9.1