home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 25 / AACD 25.iso / AACD / Magazine / Backups / FBackNG / support.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-08-30  |  2.1 KB  |  72 lines

  1. // $VER: support.c 1.0.0 (10.7.98)
  2.  
  3. /*                                                                    
  4.    Name     : support.c                                               
  5.    Purpose  : support functions                                       
  6.    Author   : Chris De Maeyer                                         
  7.    Compile  : sc nolink opt support.c                                 
  8.    Copyright: sources (C)1997 Visionary Software, bin is              
  9.               released as FREEWARE.
  10.                                                                       
  11.    History:                                                           
  12.    -------------------------------------------------------------------
  13.    Date     Description                                        By     
  14.    -------------------------------------------------------------------
  15.    Version 1.0                                                        
  16.    -----------                                                        
  17.    30-08-97 Creation                                           CDM    
  18.    31-08-97 Added functions for FMirror                        CDM    
  19.    10-07-98 Changed SrcPath, DstPath tags                      CDM    
  20.    24-04-99 Added logging                                      CDM    
  21.    -------------------------------------------------------------------
  22.                                                                       
  23. */   
  24. #include <stdio.h>
  25. #include "dirdiver.h"
  26.  
  27. /*
  28. ** Functions
  29. */
  30. int put_LogOneMsg(char *logfile,char *mesg)
  31. {
  32.     FILE *out;
  33.     int i;
  34.     
  35.     if((out=fopen(logfile,"a"))==NULL)
  36.         return(DD_OPENLOG);
  37.         
  38.     fputs(mesg,out);
  39.                 
  40.     i=(ferror(out))?DD_WRITELOG:DD_OK;
  41.     
  42.     fclose(out);
  43.     return(i);
  44. }
  45.  
  46. int put_LogMsg(FILE *log,char *mesg)
  47. {
  48.     int i;
  49.         
  50.     fputs(mesg,log);
  51.                 
  52.     i=(ferror(log))?DD_WRITELOG:DD_OK;
  53.     
  54.     return(i);
  55. }
  56.     
  57. FILE *open_Log(char *logfile)
  58. {
  59.     FILE *out;
  60.     
  61.     return((out=fopen(logfile,"a")));
  62. }
  63.  
  64. void close_Log(FILE *log)
  65. {
  66.     if(log!=NULL)
  67.         fclose(log);
  68. }
  69.  
  70.         
  71. /* The End */
  72.