| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 1.91

 

srcdoc W (sflmail.c 336): function uuencode not known

#include "(unknown)"
static int uuencode (
   char *strIn,
   char *strOut)

Synopsis

Uuendcode a file, with the output going to a new file. This function is used by smtp_send_mail.

Source Code - (sflmail.c)

{
   char strLine[46];
   int iCnt, iLineLen;
   FILE *fpin, *fpout;

   if (!(fpin = fopen (strIn, "rb")))
     {
       return 1;
     }

   if (!(fpout = fopen (strOut, "wb")))
     {
       return 1;
     }

   fprintf (fpout, "begin 666 %s\n", getfilename (strIn));

   while (1)
     {
       iLineLen = fread (strLine, sizeof (char), 45, fpin);
       if (iLineLen <= 0)
           break;

       fputc (ENC (iLineLen), fpout);

       for (iCnt = 0; iCnt < iLineLen; iCnt += 3)
         {
           putgroup (&strLine[iCnt], fpout);
         }

       fputc ('\n', fpout);
     }

   fprintf (fpout, "end\n");

   fclose (fpin);
   fclose (fpout);
   return 0;
}

| << | < | > | >> iMatix Copyright © 1996-98 iMatix