home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / slfinsta.zip / uac_comm.c < prev    next >
C/C++ Source or Header  |  2000-03-26  |  2KB  |  54 lines

  1. /* $Id: uac_comm.c,v 1.1 2000/03/27 04:52:58 ktk Exp $ */
  2.  
  3. /* ------------------------------------------------------------------------ */
  4. /*                                                                          */
  5. /*      Decompresses and outputs comment if present.                        */
  6. /*                                                                          */
  7. /* ------------------------------------------------------------------------ */
  8.  
  9. #include <stdio.h>    // printf()
  10.  
  11. #include "globals.h"
  12. #include "uac_dcpr.h"
  13. #include "uac_comm.h"
  14.  
  15. INT  comm_cpr_size=0;
  16. CHAR *comm;
  17.  
  18. void comment_out(CHAR *top)      // outputs comment if present
  19. {
  20.    INT  i;
  21.  
  22.    if (head.HEAD_FLAGS & ACE_COMM)
  23.    {                             // comment present?
  24.       if (head.HEAD_TYPE == MAIN_BLK)
  25.       {                          // get begin and size of comment data
  26.          comm = (CHAR*)MCOMM;
  27.          comm_cpr_size = MCOMM_SIZE;
  28.       }
  29.       else
  30.       {
  31.          comm = (CHAR*)FCOMM;
  32.          comm_cpr_size = FCOMM_SIZE;
  33.       }                          // limit comment size if too big
  34.       i = sizeof(head) - (INT)(comm - (CHAR*) &head);
  35.       if (comm_cpr_size > i)
  36.          comm_cpr_size = i;
  37.       dcpr_comm(i);              // decompress comment
  38.  
  39. #ifdef AMIGA
  40.       {
  41.          char *p=comm;
  42.          while (*p)
  43.          {
  44.             if (*p==0x0D)
  45.                *p=0x0A;          // Replace ms-dos line termination
  46.             p++;
  47.          }
  48.       }
  49. #endif
  50.  
  51.       pipeit("%s\n\n%s\n\n", top, comm); // output comment
  52.    }
  53. }
  54.