home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / NEF2242.RAR / feature / nefeat.h < prev   
C/C++ Source or Header  |  1997-04-20  |  6KB  |  153 lines

  1. /*****************************************************************************/
  2. /*                                                                           */
  3. /*                 (C) Copyright 1991-1997  Alberto Pasquale                 */
  4. /*                                                                           */
  5. /*                   A L L   R I G H T S   R E S E R V E D                   */
  6. /*                                                                           */
  7. /*****************************************************************************/
  8. /*                                                                           */
  9. /*   How to contact the author:  Alberto Pasquale of 2:332/504@fidonet       */
  10. /*                               alberto.pasquale@interbusiness.it           */
  11. /*                               Viale Verdi 106                             */
  12. /*                               41100 Modena                                */
  13. /*                               Italy                                       */
  14. /*                                                                           */
  15. /*****************************************************************************/
  16.  
  17. // NeFeat.H
  18.  
  19. // This include file is for use by the developers who want to write a
  20. // Feature DLL for NEF.
  21.  
  22. // In the case you _really_ need some "wider" interface to NEF,
  23. // please feel free to ask the author.
  24.  
  25.  
  26. #ifndef _NEFEAT_H_
  27. #define _NEFEAT_H_
  28.  
  29. #include <os2def.h>
  30.  
  31. #pragma pack (1)
  32.  
  33.                 // for dest of FeatOut, bitwise
  34.  
  35. #define FO_LOG  0x01 // send output to the log
  36. #define FO_CRT  0x02 // send output to the screen
  37. #define FO_BOTH 0x03 // send output to both log and screen
  38.  
  39. typedef VOID (* APIENTRY FeatOut) (UCHAR dest, CHAR prty, PCSZ format, ...);
  40.  
  41. // Function to write output to screen and/or log.
  42. // prty is the log priority char, usually one of "!*#: ".
  43. // prty is ignored for output to screen.
  44. // format and ... are the formatting string and parameters as in printf.
  45. // Heading and trailing \n are ignored for log entry.
  46.  
  47.  
  48. APIRET APIENTRY Init (FeatOut prnf);
  49.  
  50. #define NFI_OK  0x00000000      // Normal termination
  51. #define NFI_ERR 0x00000001      // Initialization error
  52.  
  53. // Mandatory.
  54. // This function is called during cfg file parsing, when the
  55. // FeatureLoad statement is encountered and the DLL loaded.
  56. // The prnf function pointer can be used to output messages to
  57. // screen and log file.
  58. // Must return NFI_OK on successful initialization.
  59.  
  60.  
  61. APIRET APIENTRY ParseCfg (PCSZ clnline);
  62.  
  63. #define NFP_OK  0x00000000      // Normal termination
  64. #define NFP_ERR 0x00000001      // Fatal Cfg Error
  65.  
  66. // This function is called by NEF when it finds a "Feature" configuration
  67. // statement.  The entire line, after the "Feature" statement, is passed
  68. // via the clnline pointer.
  69. // This string is guaranteed without tabs, comments,
  70. // trailing space and newline.
  71. // This function must normally return NFP_OK.
  72. // If NEF must exit with a "Cfg Error" errorlevel, this function
  73. // must return NFP_ERR.
  74. // In any case this function might use the prnf function to write
  75. // something to the screen and log file.
  76.  
  77.  
  78. APIRET APIENTRY BeforeNefToss (PCSZ fullname, PCSZ Tag, PCSZ Desc);
  79.  
  80. #define BNT_OK  0x00000000      // Normal termination
  81. #define BNT_BAD 0x00000001      // TIC must be renamed BAD
  82.  
  83. // This function is called after NEF has parsed the TIC file, before
  84. // it starts tossing the associated file.
  85.  
  86. // PCSZ fullname    Complete name (with path) of the file.
  87. // PCSZ Tag         Area Tag.
  88. // PCSZ Desc        Description for the file, as for announcements.
  89. //                  Multiple lines are separated by '\r'.
  90. // This function should normally return BNT_OK;
  91. // if the file must be processed as BAD, return BNT_BAD.
  92.  
  93.  
  94. typedef struct {
  95.     USHORT zone;
  96.     USHORT net;
  97.     USHORT node;
  98.     USHORT point;
  99. } _ADR;
  100.  
  101.  
  102. // structure with TIC data to be used (not modified) by AfterNefToss.
  103.  
  104. // Please note that all the strings containing lines from TICs (desc,
  105. // ldesc etc.) are a simple concatenation of the TIC lines, including
  106. // the heading keyword and terminating '\n'.
  107.  
  108. // The string pointers are never NULL: if there is no entry, they point
  109. // to an empty string.
  110.  
  111.             // definitions for the bits of the flags field.
  112.  
  113. #define TDF_CRCused     0x0001      // crc field is valid
  114. #define TDF_PassThru    0x0002      // The area is Pass Through
  115. #define TDF_NewArea     0x0004      // The area has just been created
  116.  
  117.  
  118. typedef struct {
  119.     USHORT  struct_size;        // Size of this structure.
  120.     USHORT  flags;              // Misc flags.
  121.     PCSZ    areatag;            // Area TAG.
  122.     PCSZ    areapath;           // Area path, terminated by '\'.
  123.     PCSZ    file;               // File name (no path).
  124.     PCSZ    replaces;           // File(s) to be replaced, separated by ' '.
  125.     LONG    size;               // Size of file.
  126.     ULONG   crc;                // CRC32 of file.
  127.     _ADR    from;               // System we received the file from.
  128.     _ADR    origin;             // System that hatched the file.
  129.     PCSZ    pwd;                // Password.
  130.     PCSZ    adesc;              // Description for announcement,
  131.                                 // lines separated by '\r'.
  132.     PCSZ    desc;               // "Desc" lines.
  133.     PCSZ    ldesc;              // "LDesc" lines.
  134.     PCSZ    path;               // "Path" lines.
  135.     PCSZ    seenby;             // "Seenby" lines.
  136.     PCSZ    unknown;            // Unrecognized lines.
  137. } _TICDATA;
  138.  
  139.  
  140. APIRET APIENTRY AfterNefToss (_TICDATA *td);
  141.  
  142. #define ANT_OK          0x00000000  // normal termination.
  143. #define ANT_NoFilesBbs  0x00000001  // do not update files.bbs.
  144. #define ANT_NoAnnounce  0x00000002  // do not announce this file.
  145.  
  146. // This function is called after NEF has tossed the file, before
  147. // it updates the files.bbs entry.
  148.  
  149. // The value returned by this function is to be processed as a group of
  150. // bitwise flags.
  151.  
  152. #endif
  153.