home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / ANUMR5.ZIP / SYSIO.H < prev    next >
C/C++ Source or Header  |  1991-11-10  |  4KB  |  172 lines

  1.  
  2. /*     Définitions diverses pour les Entrées-Sorties */
  3.  
  4.  
  5. /* Constant defines */
  6.  
  7.  
  8. #define EFOPENR        -200
  9. #define EFOPENW        -201
  10.  
  11.  
  12. /* Useful macro */
  13.  
  14. #define SYSMSG(x, fp ) werrmsg(__FILE__, __DATE__, __TIME__, (x), (fp))
  15.  
  16.  
  17. /*    Now the provided routines     */
  18. /*    C-C++ compatibility hack      */
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24.  
  25. /*    void werrmsg(char *orgid, char *date, char *time,
  26.         int code,
  27.         FILE *fp);
  28.  
  29.     This  function   ouputs  an   error  or  warning  message
  30.     associated to a predefined code:
  31.  
  32.     Input parameters:
  33.     ----------------
  34.     orgid : Message indicating  the posistion  of the  call  to
  35.         werrmsg.(usually __FILE__ or __LINE__ or a combination of
  36.         the two).
  37.     date  : Date of  the  last  release  of  the  file  (usually
  38.         __DATE__).
  39.     time  : time of  the  last  release  of  the  file  (usually
  40.         __TIME__).
  41.     code  : Error code returned by the last Anum called function.
  42.     fp    : Stream, the output should be performed to which.
  43.  
  44.     Note:
  45.     -----
  46.     If code  is zero,  no message  is output. You can
  47.         then insert a call to werrmsg after any function call
  48.         to anum returning an error code at debugging stage.
  49.     The SYSMSG macro defined  above helps programmers to automate
  50.         calls  to standard ANUM error and warning messages.
  51. */
  52.   void werrmsg(char *orgid, char *date, char *time,
  53.         int code, FILE *fp);
  54.  
  55.  
  56. /*    void ena_wrn(void)
  57.  
  58.     This function enables the generation of warning messages.
  59. */
  60.    void ena_wrn(void);
  61.  
  62. /*    void disa_wrn(void)
  63.  
  64.     This  function   disables  the   generation  of   warning
  65.     messages.
  66. */
  67.   void disa_wrn(void);
  68.  
  69.  
  70.  
  71. /*    void ena_err(void)
  72.  
  73.     This function enables the generation of error messages.
  74. */
  75.   void ena_err(void);
  76.  
  77.  
  78.  
  79.  
  80. /*    void disa_err(void)
  81.  
  82.     This function disables the generation of error messages.
  83. */
  84.   void disa_err(void);
  85.  
  86.  
  87.  
  88. /*    void ena_m_beep(void)
  89.  
  90.     This function  enables the  generation of an audible tone
  91.     while printing error or warning messages.
  92. */
  93.   void ena_m_beep(void);
  94.  
  95.  
  96.  
  97. /*    void disa_m_beep(void)
  98.  
  99.     This function  disables the generation of an audible tone
  100.     while printing error or warning messages.
  101. */
  102.   void disa_m_beep(void);
  103.  
  104.  
  105. /*
  106.     void beep (void)
  107.  
  108.     This function outputs an audible tone to the speaker provided
  109.     it is allowed by ena_m_beep
  110. */
  111.   void beep(void);
  112.  
  113.  
  114. /*    void errmsg(char *orgid, char *date, char *time,
  115.         int code,
  116.         char *msg
  117.         FILE *fp)
  118.  
  119.     This function outputs user defined error messages.
  120.  
  121.     Input parameters:
  122.     ----------------
  123.     orgid    : origin  identifier  (usually  the  caller  __FILE__
  124.           pseudo variable)
  125.     date     : date (usually the caller __DATE__ pseudo variable)
  126.     time    : time (usually the caller __TIME__ pseudo variable)
  127.     code    : error code
  128.     msg    : explanatory message to be printed
  129.     fp    : file stream descriptor on which output must be
  130.           performed
  131.  
  132.     Note:
  133.     ----
  134.     If the code is zero (ENOERROR) no message. You can then insert a
  135.         call to werrmsg after any function which returns
  136.         an error code.
  137.     The SYSMSG macro - defined in this file - helps programmers to
  138.         automate standard error and warning messages generation.
  139. */
  140.   void errmsg(char *, char *, char *,
  141.     int ,
  142.     char *,
  143.     FILE *);
  144.  
  145.  
  146. /*  void wrnmsg(char *orgid, char *date, char *time,
  147.         int code,
  148.         char *msg,
  149.         FILE *fp)
  150.  
  151.     This function outputs user defined warning messages.
  152.  
  153.     Input parameters:
  154.     ----------------
  155.     orgid : origin identifier (usually the caller __FILE__
  156.         pseudo variable)
  157.     date  : date (usually the caller __DATE__ pseudo variable)
  158.     time  : time (usually the caller __TIME__ pseudo variable)
  159.     code  : error code
  160.     msg   : explanatory message to be printed
  161.     fp    : file stream descriptor on which output must be
  162.         performed
  163. */
  164.  void wrnmsg(char *, char *, char *,
  165.     int,
  166.     char *,
  167.     FILE *);
  168.  
  169.  
  170. #ifdef __cplusplus
  171. }
  172. #endif