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 / FtpDebug.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-24  |  1.0 KB  |  53 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 ftplib_debug=FTP_nodebug;
  18.  
  19. #define __EXIT if (ftplib_debug!=FTP_noexit) exit(-1)
  20.  
  21. void FtpDebug(FTP *ftp)
  22. {
  23.   STATUS FtpDebugDebug(),
  24.          FtpDebugError(),
  25.          FtpDebugIO();
  26.  
  27.   FtpSetDebugHandler(ftp,FtpDebugDebug);
  28.   FtpSetErrorHandler(ftp,FtpDebugError);
  29.   FtpSetIOHandler(ftp,FtpDebugIO);
  30. }
  31.  
  32. STATUS FtpDebugDebug(FTP *ftp,int n, char * Message)
  33. {
  34.   fprintf(stderr,"DEBUG:: %s\n",Message);
  35.   return 1;
  36. }
  37.  
  38. STATUS FtpDebugError(FTP *ftp,int n, char * Message)
  39. {
  40.   fprintf(stderr,"Abort:: %s\n",Message);
  41.   __EXIT;
  42. }
  43.  
  44. STATUS FtpDebugIO(FTP *ftp,int n, char * Message)
  45. {
  46.   fprintf(stderr,"IO");
  47.   perror("");
  48.   __EXIT;
  49. }
  50.  
  51.  
  52.  
  53.