home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / trn_12.zip / src / threads.h < prev    next >
C/C++ Source or Header  |  1993-12-04  |  2KB  |  106 lines

  1. /* $Id: threads.h,v 2.3 1992/12/14 00:14:09 davison Trn $
  2. */
  3.  
  4. #define DB_VERSION    2
  5.  
  6. /*** OS2: BYTE and LONG are already defined in OS2.H*/
  7. #ifndef _OS2_H
  8. typedef char        BYTE;
  9. typedef long        LONG;
  10. #endif
  11. typedef short       WORD;
  12.  
  13. #define ROOT_ARTICLE    0x0001        /* article flag definitions */
  14. #define HAS_XREFS    0x0004        /* article has an xref line */
  15.  
  16. typedef struct Article {
  17.     ART_NUM num;
  18.     char *id;
  19.     struct Domain *domain;
  20.     struct Subject *subject;
  21.     struct Author *author;
  22.     struct Article *parent, *children, *siblings;
  23.     struct Root *root;
  24.     struct Article *id_link;
  25.     time_t date;
  26.     WORD child_cnt;
  27.     WORD flags;
  28.     WORD seq;
  29. } ARTICLE;
  30.  
  31. typedef struct Domain {
  32.     char *name;
  33.     ARTICLE *ids;
  34.     struct Domain *link;
  35. } DOMAIN;
  36.  
  37. typedef struct Author {
  38.     struct Author *link;        /* this link MUST be first */
  39.     char *name;
  40.     WORD seq;
  41.     WORD count;
  42. } AUTHOR;
  43.  
  44. typedef struct Subject {
  45.     struct Subject *link;        /* this link MUST be first */
  46.     char *str;
  47.     WORD seq;
  48.     WORD count;
  49. } SUBJECT;
  50.  
  51. typedef struct Root {
  52.     struct Root *link;            /* this link MUST be first */
  53.     ARTICLE *articles;
  54.     SUBJECT *subjects;
  55.     ART_NUM root_num;
  56.     WORD thread_cnt;
  57.     WORD subject_cnt;
  58.     WORD seq;
  59. } ROOT;
  60.  
  61. typedef struct {
  62.     LONG root_num;
  63.     WORD articles;
  64.     WORD thread_cnt;
  65.     WORD subject_cnt;
  66.     WORD pad_hack;
  67. } PACKED_ROOT;
  68.  
  69. typedef struct {
  70.     LONG num;
  71.     LONG date;
  72.     WORD subject, author;
  73.     WORD flags;
  74.     WORD child_cnt;
  75.     WORD parent;
  76.     WORD padding;
  77.     WORD siblings;
  78.     WORD root;
  79. } PACKED_ARTICLE;
  80.  
  81. typedef struct Total {
  82.     LONG first, last;
  83.     LONG string1;
  84.     LONG string2;
  85.     WORD root;
  86.     WORD article;
  87.     WORD subject;
  88.     WORD author;
  89.     WORD domain;
  90.     WORD pad_hack;
  91. } TOTAL;
  92.  
  93. typedef struct {
  94.     BYTE l[sizeof (LONG)];
  95.     BYTE w[sizeof (WORD)];
  96.     BYTE version;
  97.     BYTE pad_hack;
  98. } BMAP;
  99.  
  100. EXT bool word_same, long_same;
  101. EXT BMAP my_bmap, mt_bmap;
  102.  
  103. char *thread_name ANSI((char *));
  104. void mybytemap ANSI((BMAP *));
  105. void wp_bmap(), lp_bmap(), swap_bmaps();
  106.