home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / word2x0a.zip / source / interface.h < prev    next >
C/C++ Source or Header  |  1997-04-09  |  1KB  |  61 lines

  1. /* $Id: interface.h,v 1.10 1997/04/09 12:14:24 dps Exp $ */
  2. /* Interface for output code */
  3.  
  4. #ifndef __w6cvt_iface_h__
  5. #define __w6cvt_iface_h__
  6. #include <stdio.h>
  7. #include <time.h>
  8.  
  9. typedef enum
  10. {
  11.     T_DOC=0,                /* Document */
  12.     T_PARAGRAPH,            /* Paragraph */
  13.     T_TABLE, T_FIELD, T_ROW,        /* Tables */
  14.     T_SPEC,                       /* Embed messages */
  15.     T_LIST, T_ITEM,            /* Lists */
  16.     T_CODE,                /* One off codes, e.g. page breaks */
  17.     T_OTHER,                /* Unknown stuff */
  18.     NFUNCS
  19. } token;
  20.  
  21. typedef struct
  22. {    
  23.     unsigned char win;
  24.     const char *ascii;
  25. } cmap;
  26.  
  27. #include "reader.h"                /* Need token for this file.... */
  28.  
  29. #ifndef __EXCLUDE_READER_CLASSES
  30. typedef struct
  31. {
  32.     void (*start)(const tok_seq::tok *, const struct docfmt *, FILE *, void *);
  33.     void (*end)(const tok_seq::tok *, const struct docfmt *, FILE *, void *);
  34. } funcs;
  35.  
  36. typedef struct docfmt
  37. {
  38.     struct
  39.     {
  40.     unsigned new_pages :1;
  41.     } flags;            /* Flags */
  42.     int maxline;        /* Maximum line length */
  43.     const char *foldchar;    /* Newline for folding line */
  44.     void *(*new_state)(void);    /* Make new state */
  45.     void (*free_state)(void *);    /* Free state */
  46.     funcs f[NFUNCS];        /* Document output fucntions */
  47.     char *(*date)(time_t);    /* Set by front end */
  48. } docfmt;
  49.  
  50. #endif /* __EXLCUDE_READER_CLASSES */
  51.  
  52. #ifndef N
  53. #define N(a) (sizeof(a)/sizeof(a[0]))
  54. #endif
  55.  
  56. #endif /* __w6cvt_iface_h__ */
  57.  
  58.  
  59.  
  60.  
  61.