Example #1
0
/* *********************************************************************** */
void creat_ini()
{
	disptitle("BATCH INFORMATION *CREATION*");
	setmidwin();
	clrscr();
	curoff();
	resetwin();
	dispfuncv(NFKEYS,Createkeys);
}
Example #2
0
File: zmax.c Project: cpeterso/zmax
main(int argc, char *argv[])
{
/*

   This is the main section of this driver. It's makeup is entirely
   up to you. With of course, several REQUIRED sets.

   */
int i,x,count;
int y=0,block_size=1024;
int send=0,do_acks=0;
char s[81],s1[81];
qvideo();
clrscrn();
Screen_ptr = malloc(1 * 4000);
if(Screen_ptr == NULL) exit(1);
uncomprs(&Screen_ptr[0*4000], tmod); /* uncompress screen 1 */
memtoscr(2000, 0, Screen_ptr);
curoff();
for(i=1;i<argc;i++)
 {
  if(argv[i][0] == '/' || argv[i][0] == '-')
  {
    switch(toupper(argv[i][1]))
    {
    case 'S' : block_size = atoi(argv[i+1]);
               if(block_size > 1024)
                             block_size = 1024;
               break;
    case 'A' : do_acks = 1;break;
    case 'K' : delete_aborted_transfers = 0;
               break;
    case 'P' : port_ptr = atoi(argv[i+1]);
               port_ptr--;
               break;
    case 'B' : connect_rate = atoi(argv[i+1]);
               cur_baud = connect_rate;
               block_size = (connect_rate > 2400) ? 2048 : 1024;
               break;
    case 'L' : locked_port = atol(argv[i+1]);
               break;
    case 'R' : set_com();

               /*
                 You should continue to cycle receiving files until
                 Zrecfile returns a ZERO, indicating that it did not
                 receive any files or the session was aborted.
                 */

               while ( Zrecfile(do_acks,block_size) && (async_carrier(port))) clear_screen() ;

               /* Following the last file, the sender will require an ACK
                  to signal the receivers acknowledges end of session.

                  The Sender doesn't respond back after receiving the ACK so
                  continue with you processing after sending a couple of
                  ACKS. Two is suggested, an extra incase line noise blew the
                  first one.
                  */

               com_putc(ACK);
               com_putc(ACK);
               end_prg();
               break;

    case 'F' : set_com();
               i++;
               for(;i<argc;i++)
                {
                 memset(s,'\0',sizeof(s));
                 parser(argv[i],&s[0]);

                 /* Cycle until all files are sent or Zsendfile returns
                    a zero indicating Session was aborted. */

                 if(!Zsendfile(argv[i],s))
                       end_prg();
                 if(!async_carrier(port)) end_prg();
                 clear_screen();
                }
                i = count = 0;

                /* Cycle sending EOT until receiver sees it and ACKs
                    the ending EOT. I suggest cycling only two periods
                    , period being defined as trying ACKEOT function twice. */

                while(!count && i <= 1)
                  {
                   com_putc(EOT);
                   i++;
                   if(ackeot()) count = 1;
                   if(!async_carrier(port)) count = 1;
                  }
                end_prg();
                break;
   }
 }
 }

}