#include "bbs.h"

int MenuSend24(char *s,int startcount)
{
FILE *fp;
int stat;
BOOL checked=FALSE;
char c[1000]; /**** old char c[256]; ****/
stat=Restricted(s);
LineCount=startcount;
fp=fopen(s,"r");
if(fp==NULL || stat)
	{
	sprintf(c,"File %s Unavailable\r\n",s);
	AEPutStr(c);
	return(FAILURE);
	}
ConPutStr("[0 p"); /* turn console cursor off */

while(fgets(c,995,fp)!=NULL)
	{
		{
		c[996]='\0'; /**** old c[251]='\0'; ****/
          if(c[0]=='~' && !checked) { fclose(fp); return(mcisend(s)); }
          checked=TRUE;
		if(c[strlen(c)-1]=='\n')
			{
			strcat(c,"\r");
			AEPutStr(c);
			if(stat=CheckForPause())
				{
				AEPutStr("\r\n");
				fclose(fp);
                    ConPutStr("[ p");  /* turn console cursor back on */

				return(stat);
				}
			}
		else
			{
			AEPutStr(c);
			}
		/* CHECK FOR INPUT && CARRIER */
		if(SCheckInput())
			{
			stat=ReadChar(1L);
			if(stat<0) { fclose(fp);
               ConPutStr("[ p");  /* turn console cursor back on */
               return(stat); }
			switch(stat)
				{
				case '\023': /* Pause */
					stat=ReadChar(KEYBOARD_TIMEOUT);
					if(stat<0)
						{
						fclose(fp);
                              ConPutStr("[ p");  /* turn console cursor back on */

						return(NO_CARRIER);
						}
					break;
				case '\003': /* ^C */
					AEPutStr("**Break\r\n\r\n");
                         fclose(fp); if(AnsiColor)  AEPutStr("[0m");return(SUCCESS);
					break;
				}
			}
		}
	}
MenuMark1:
fclose(fp);
ConPutStr("[ p");  /* turn console cursor back on */

AEPutStr("\r\n");
return(SUCCESS);
}