home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 417_01 / libftp / FtpWrite.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-24  |  819 b   |  40 lines

  1. /*
  2.               Library for ftpd clients.(libftp)
  3.             Copyright by Oleg Orel
  4.              All rights reserved.
  5.             
  6. This  library is desined  for  free,  non-commercial  software  creation. 
  7. It is changeable and can be improved. The author would greatly appreciate 
  8. any  advises, new  components  and  patches  of  the  existing  programs.
  9. Commercial  usage is  also  possible  with  participation of it's author.
  10.  
  11.  
  12.  
  13. */
  14.  
  15. #include "FtpLibrary.h"
  16.  
  17. int FtpWrite(FTP *con,char c)
  18. {
  19.   int i;
  20.   
  21.   if ( con -> mode == 'I' )
  22.     {
  23.       if (putc(c,con->data)==EOF)
  24.     return EXIT(con,QUIT);
  25.       else
  26.     return 0;
  27.     }
  28.   
  29.   if ( c == '\n' )
  30.     {
  31.       if (putc(Ctrl('M'),con->data)==EOF)
  32.     return EXIT(con,QUIT);
  33.       i=putc(Ctrl('J'),con->data);
  34.     }
  35.   else
  36.     i = putc ( c , con->data );
  37.   if (i==EOF) return EXIT(con,QUIT);
  38.   return i;
  39. }
  40.