view sfxace/uac_comm.c @ 0:879c2819a48d

Initial commit.
author Brian Smith <brian@dbsoft.org>
date Fri, 18 Feb 2011 08:45:38 -0600
parents
children
line wrap: on
line source

/* ------------------------------------------------------------------------ */
/*                                                                          */
/*      Decompresses and outputs comment if present.                        */
/*                                                                          */
/* ------------------------------------------------------------------------ */

#include <stdio.h>    // printf()

#include "globals.h"
#include "uac_dcpr.h"
#include "uac_comm.h"

INT  comm_cpr_size=0;
CHAR *comm;

void comment_out(CHAR *top)      // outputs comment if present
{
	INT  i;

	if (head.HEAD_FLAGS & ACE_COMM)
	{                             // comment present?
		if (head.HEAD_TYPE == MAIN_BLK)
		{                          // get begin and size of comment data
			comm = (CHAR*)MCOMM;
			comm_cpr_size = MCOMM_SIZE;
		}
		else
		{
		 comm = (CHAR*)FCOMM;
		 comm_cpr_size = FCOMM_SIZE;
		}                          // limit comment size if too big
		i = sizeof(head) - (INT)(comm - (CHAR*) &head);
		if (comm_cpr_size > i)
			comm_cpr_size = i;
		dcpr_comm(i);              // decompress comment

#ifdef AMIGA
		{
			char *p=comm;
			while (*p)
			{
				if (*p==0x0D)
					*p=0x0A;          // Replace ms-dos line termination
				p++;
			}
		}
#endif

		pipeit("%s\n\n%s\n\n", top, comm); // output comment
	}
}