home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / VP2_409E.SZH / WRITE.C < prev   
Text File  |  1991-06-27  |  19KB  |  746 lines

  1. /*
  2.   $Header: write.c 3.3 87/12/12 00:45:50 Bob Exp $
  3.  
  4.                           The Conference Mail System
  5.  
  6.               This module was originally written by Bob Hartman
  7.                        Sysop of FidoNet node 1:132/101
  8.  
  9.    Spark Software, 427-3 Amherst St, CS 2032, Suite 232, Nashua, NH 03061
  10.  
  11.  The Conference Mail System  is a  complete Echomail processing package.  It
  12.  is a superset of the original  Echomail utilities created by Jeff Rush, and
  13.  also contains ideas gleaned from the  ARCmail,  Renum,  oMMM, MGM, and Opus
  14.  programs that were created by various software authors.
  15.  
  16.  This program source code is being released with the following provisions:
  17.  
  18.  1.  You are  free to make  changes to this source  code for use on your own
  19.  machine,  however,  altered source files may not be distributed without the
  20.  consent of Spark Software.
  21.  
  22.  2.  You may distribute "patches"  or  "diff" files for any changes that you
  23.  have made, provided that the "patch" or "diff" files are also sent to Spark
  24.  Software for inclusion in future releases of the entire package.   A "diff"
  25.  file for the source archives may also contain a compiled version,  provided
  26.  it is  clearly marked as not  being created  from the original source code.
  27.  No other  executable  versions may be  distributed without  the  consent of
  28.  Spark Software.
  29.  
  30.  3.  You are free to include portions of this source code in any program you
  31.  develop, providing:  a) Credit is given to Spark Software for any code that
  32.  may is used, and  b) The resulting program is free to anyone wanting to use
  33.  it, including commercial and government users.
  34.  
  35.  4.  There is  NO  technical support  available for dealing with this source
  36.  code, or the accompanying executable files.  This source  code  is provided
  37.  as is, with no warranty expressed or implied (I hate legalease).   In other
  38.  words, if you don't know what to do with it,  don't use it,  and if you are
  39.  brave enough to use it, you're on your own.
  40.  
  41.  Spark Software may be contacted by modem at (603) 888-8179 (node 1:132/101)
  42.  on the public FidoNet network, or at the address given above.
  43.  
  44.  To use this code you will need Microsoft C version 4.0, and also Microsoft
  45.  Macro Assembler version 4.0.
  46.  
  47. */
  48.  
  49. /*
  50.    $Log:    write.c $
  51.  * Revision 3.3  87/12/12  00:45:50  Bob
  52.  * Source code release
  53.  *
  54. */
  55.  
  56. #include <stdio.h>
  57. #include <ctype.h>
  58. #include <fcntl.h>
  59. #include <io.h>
  60. #include <time.h>
  61. #include <sys\types.h>
  62. #include <sys\stat.h>
  63. #include <malloc.h>
  64. #include <string.h>
  65. #include <stdlib.h>
  66. #include "fastecho.h"
  67.  
  68. #define DEBUG 0
  69.  
  70. WBUFFER wbuffs[60] = {
  71.    { NULL, NULL, -1 },
  72.    { NULL, NULL, -1 },
  73.    { NULL, NULL, -1 },
  74.    { NULL, NULL, -1 },
  75.    { NULL, NULL, -1 },
  76.    { NULL, NULL, -1 },
  77.    { NULL, NULL, -1 },
  78.    { NULL, NULL, -1 },
  79.    { NULL, NULL, -1 },
  80.    { NULL, NULL, -1 },
  81.    { NULL, NULL, -1 },
  82.    { NULL, NULL, -1 },
  83.    { NULL, NULL, -1 },
  84.    { NULL, NULL, -1 },
  85.    { NULL, NULL, -1 },
  86.    { NULL, NULL, -1 },
  87.    { NULL, NULL, -1 },
  88.    { NULL, NULL, -1 },
  89.    { NULL, NULL, -1 },
  90.    { NULL, NULL, -1 },
  91.    { NULL, NULL, -1 },
  92.    { NULL, NULL, -1 },
  93.    { NULL, NULL, -1 },
  94.    { NULL, NULL, -1 },
  95.    { NULL, NULL, -1 },
  96.    { NULL, NULL, -1 },
  97.    { NULL, NULL, -1 },
  98.    { NULL, NULL, -1 },
  99.    { NULL, NULL, -1 },
  100.    { NULL, NULL, -1 },
  101.    { NULL, NULL, -1 },
  102.    { NULL, NULL, -1 },
  103.    { NULL, NULL, -1 },
  104.    { NULL, NULL, -1 },
  105.    { NULL, NULL, -1 },
  106.    { NULL, NULL, -1 },
  107.    { NULL, NULL, -1 },
  108.    { NULL, NULL, -1 },
  109.    { NULL, NULL, -1 },
  110.    { NULL, NULL, -1 },
  111.    { NULL, NULL, -1 },
  112.    { NULL, NULL, -1 },
  113.    { NULL, NULL, -1 },
  114.    { NULL, NULL, -1 },
  115.    { NULL, NULL, -1 },
  116.    { NULL, NULL, -1 },
  117.    { NULL, NULL, -1 },
  118.    { NULL, NULL, -1 },
  119.    { NULL, NULL, -1 },
  120.    { NULL, NULL, -1 },
  121.    { NULL, NULL, -1 },
  122.    { NULL, NULL, -1 },
  123.    { NULL, NULL, -1 },
  124.    { NULL, NULL, -1 },
  125.    { NULL, NULL, -1 },
  126.    { NULL, NULL, -1 },
  127.    { NULL, NULL, -1 },
  128.    { NULL, NULL, -1 },
  129.    { NULL, NULL, -1 },
  130.    { NULL, NULL, -1 }
  131. };
  132.  
  133. extern char *open_err;
  134. extern char *pkt_err;
  135. extern SEACONFIG config;
  136. extern AREAS_PTR areas[];
  137. extern char board_name[], sysop_name[];
  138. extern int tot_areas;
  139. extern char bbsfile[];
  140. extern char *arc_cmd[];
  141. extern int nread;
  142. extern int arc_args;
  143. extern int last_msg;
  144. extern int high_one;
  145. extern int convert;
  146. extern char seen_byline[];
  147. extern char originline[];
  148. extern char tearline[];
  149. extern int max_msgs;
  150. extern int ctrla;
  151. extern int *msg_nums;
  152. extern char *holder1;
  153. extern int mail_low;
  154. extern int mail_high;
  155. extern char *seen_by;
  156. extern char *origin;
  157. extern char *tear;
  158. extern char *holder;
  159. extern int tearl;
  160. extern int originl;
  161. extern int seen_byl;
  162. extern int msgl;
  163. extern int seen_nets[];
  164. extern int seen_nodes[];
  165. extern int not_seen[];
  166. extern int tot_seen;
  167. extern char arealine[];
  168. extern int areal;
  169. extern MSG_PTR h;
  170. extern int msgs_done;
  171. extern struct tm *t2;
  172. extern char pkt_dir[];
  173. extern int num_pw;
  174. extern PW_PTR pw[];
  175. int to_netmail = 1;
  176. int opus_1 = 0;
  177. int cminternal = 1;
  178. int last_opened;
  179. unsigned int def_attr = 0;
  180. PKTHDR pkt_hdr;
  181. PACKED p_msg;
  182.  
  183. int write_it (
  184.    AREAS_PTR which,
  185.    int j)
  186. {
  187.     if (to_netmail)
  188.         return (write_netmail (which, j));
  189.     else
  190.         return (write_packet (which, j));
  191. }
  192.  
  193. void write_msg (int f)
  194. {
  195.     extern long fast_lseek();
  196.  
  197. #if DEBUG
  198. printf ("Seeking to proper location for tear line\n");
  199. #endif
  200.  
  201.     (void) fast_lseek (f, (long) (msgl+sizeof(MSG)), SEEK_SET);
  202.  
  203.     /* Finish off the messgage */
  204.     finish_msg (f);
  205. }
  206.  
  207. finish_msg (int f)
  208. {
  209.    int n;
  210.  
  211. #if DEBUG
  212. printf ("Writing origin line\n");
  213. #endif
  214.  
  215.     if (originl)
  216.       {
  217.         if ((n = fast_write (f, origin, originl)) != originl)
  218.          {
  219. #if DEBUG
  220. printf ("bad news, only wrote %d chars of %d\n", n, originl);
  221. #endif
  222.          disk_full (f, "");
  223.          return (1);
  224.          }
  225.       }
  226. #if DEBUG
  227. printf ("Writing Seen-by's\n");
  228. #endif
  229.  
  230.    if (seen_byl)
  231.       {
  232.     if (fast_write (f, seen_by, seen_byl) != seen_byl)
  233.          {
  234.          disk_full (f, "");
  235.          return (1);
  236.          }
  237.       }
  238.  
  239.    return (0);
  240. }
  241.  
  242. int write_netmail (
  243.    AREAS_PTR which,
  244.    int j)
  245. {
  246.     int f;
  247. /*  int err; */
  248.     char fname1[80];
  249.  
  250.    if (j >= 0)
  251.       {
  252.     h->dest = which->node[j];
  253.        h->dest_net = which->net[j];
  254.       }
  255.  
  256.     h->cost = 0;
  257.    h->attr |= def_attr;
  258.  
  259. #if DEBUG
  260. printf ("New message for %d/%d\n", which->node[j], which->net[j]);
  261. #endif
  262.  
  263.     /* Create the message file name */
  264.     sprintf (fname1, "%s\\%d.MSG", config.mailpath, ++mail_high);
  265.     printf (" (MAIL:%04d.MSG)", mail_high);
  266.  
  267. #if DEBUG
  268. printf ("placing it in '%s'\n", fname1);
  269. #endif
  270.  
  271.     /* Open up new message file */
  272.     if((f = open (fname1, O_WRONLY|O_CREAT|O_BINARY, S_IREAD|S_IWRITE)) == -1)
  273.         {
  274.         printf (open_err, fname1);
  275.       return (1);
  276.         }
  277.  
  278.     /* Write out the header information */
  279.     if (fast_write (f, (char *) h, sizeof (MSG)) != sizeof (MSG))
  280.       {
  281.       disk_full (f, fname1);
  282.       return (1);
  283.       }
  284.  
  285.     /* Write out the AREA: stuff */
  286.    if (!((which->flags & PASS_THRU) || (which->flags & ROUTETHRU)))
  287.       {
  288.     if (fast_write (f, arealine, areal) != areal)
  289.          {
  290.          disk_full (f, fname1);
  291.          return (1);
  292.          }
  293.       }
  294.  
  295.     /* Write out the message text */
  296.     if (fast_write (f, (char *) holder, msgl) != msgl)
  297.       {
  298.       disk_full (f, fname1);
  299.       return (1);
  300.       }
  301.  
  302.     /* Finish off the message */
  303.     if (finish_msg (f))
  304.       {
  305.       disk_full (f, fname1);
  306.       return (1);
  307.       }
  308.  
  309.     /* Now close the file */
  310.     (void) fast_close (f);
  311.  
  312.     ++msgs_done;
  313.     return (0);
  314. }
  315.  
  316. int write_reply (AREAS_PTR which)
  317. {
  318.     int f;
  319.     char fname1[80];
  320.     char s[256];
  321.  
  322.  
  323. #if DEBUG
  324. printf ("New message for %d/%d\n", h->dest_net, h->dest);
  325. #endif
  326.  
  327.     /* Create the message file name */
  328.     sprintf (fname1, "%s\\%d.MSG", config.mailpath, ++mail_high);
  329.     printf (" MAIL:%04d.MSG", mail_high);
  330.  
  331. #if DEBUG
  332. printf ("placing it in '%s'\n", fname1);
  333. #endif
  334.  
  335.     /* Open up new message file */
  336.     if((f = open (fname1, O_WRONLY|O_CREAT|O_BINARY, S_IREAD|S_IWRITE)) == -1)
  337.         {
  338.         printf (open_err, fname1);
  339.         exit (2);
  340.         }
  341.  
  342.     /* Write out the header information */
  343.     if (fast_write (f, (char *) h, sizeof (MSG)) != sizeof (MSG))
  344.       {
  345.       disk_full (f, fname1);
  346.       return (1);
  347.       }
  348.  
  349.    sprintf (s, "Forwarded privately in response to a message in AREA:%s\r\r", which->area_name);
  350.  
  351.    /* Write out the AREA: stuff */
  352.     (void) fast_write (f, s, strlen (s));
  353.  
  354.     /* Write out the message text */
  355.     if (fast_write (f, holder, msgl) != msgl)
  356.       {
  357.       disk_full (f, fname1);
  358.       return (1);
  359.       }
  360.  
  361.     /* Finish off the message */
  362.     if (originl)
  363.       {
  364.         if (fast_write (f, origin, originl) != originl)
  365.          {
  366.          disk_full (f, fname1);
  367.          return (1);
  368.          }
  369.       }
  370.  
  371.    /* Now add a reasonable end to the file */
  372.    if (fast_write (f, "\r\n\r\n", 5) != 5)
  373.       {
  374.       disk_full (f, fname1);
  375.       return (1);
  376.       }
  377.  
  378.     /* Now close the file */
  379.     (void) fast_close (f);
  380.  
  381.     ++msgs_done;
  382.     return (0);
  383. }
  384.  
  385. int write_packet (
  386.    AREAS_PTR which,
  387.    int j)
  388. {
  389.     int f;
  390.  
  391.    if (j < 0)
  392.       {
  393.       return (write1_packet ());
  394.       }
  395.  
  396.     /* Open the output file */
  397.     f = open_outfile (which, j);
  398.  
  399.     if(f == -1)
  400.         {
  401.         printf (pkt_err, which->net[j], which->node[j]);
  402.         return (1);
  403.         }
  404.  
  405.     /* Create the header information to go out */
  406.     p_msg.dest_node = which->node[j];
  407.     p_msg.dest_net = which->net[j];
  408.     p_msg.attr = h->attr;
  409.  
  410.     /* write out the packet header stuff */
  411.     (void) fast_write (f, (char *) &p_msg, sizeof (PACKED));
  412.  
  413.     /* write out the date */
  414.     (void) fast_write (f, h->date, strlen (h->date)+1);
  415.  
  416.     /* write out the to */
  417.     (void) fast_write (f, h->to, strlen (h->to)+1);
  418.  
  419.     /* write out the from */
  420.     (void) fast_write (f, h->from, strlen (h->from)+1);
  421.  
  422.     /* write out the subject */
  423.     (void) fast_write (f, h->subj, strlen (h->subj)+1);
  424.  
  425.     /* write out the AREA: line */
  426.    if (!(which->flags & PASS_THRU))
  427.       {
  428.     (void) fast_write (f, arealine, areal);
  429.       }
  430.  
  431.     /* Write out the message text */
  432.     if (fast_write (f, holder, msgl) != msgl)
  433.       {
  434.       disk_full (f, "");
  435.       return (1);
  436.       }
  437.  
  438.     /* Finish off the message */
  439.    if (finish_msg (f))
  440.       {
  441.       disk_full (f, "");
  442.       return (1);
  443.       }
  444.  
  445.     /* write out the final null */
  446.     (void) fast_write (f, "\0", 1);
  447.  
  448.     ++msgs_done;
  449.     return (0);
  450. }
  451.  
  452. int write1_packet ()
  453. {
  454.     int f;
  455.  
  456.     /* Open the output file */
  457.     f = open1_outfile ();
  458.  
  459.     if(f == -1)
  460.         {
  461.         printf (pkt_err, h->dest_net, h->dest);
  462.         return (1);
  463.         }
  464.  
  465.     /* Create the header information to go out */
  466.     p_msg.dest_node = h->dest;
  467.     p_msg.dest_net = h->dest_net;
  468.     p_msg.attr = h->attr;
  469.  
  470.     /* write out the packet header stuff */
  471.     (void) fast_write (f, (char *) &p_msg, sizeof (PACKED));
  472.  
  473.     /* write out the date */
  474.     (void) fast_write (f, h->date, strlen (h->date)+1);
  475.  
  476.     /* write out the to */
  477.     (void) fast_write (f, h->to, strlen (h->to)+1);
  478.  
  479.     /* write out the from */
  480.     (void) fast_write (f, h->from, strlen (h->from)+1);
  481.  
  482.     /* write out the subject */
  483.     (void) fast_write (f, h->subj, strlen (h->subj)+1);
  484.  
  485.     /* Write out the message text */
  486.     if (fast_write (f, holder, msgl) != msgl)
  487.       {
  488.       disk_full (f, "");
  489.       return (1);
  490.       }
  491.  
  492.     /* write out the final null */
  493.     (void) fast_write (f, "\r\n\r\n\0\0\0", 7);
  494.  
  495.    (void) fast_close (f);
  496.  
  497.     ++msgs_done;
  498.     return (0);
  499. }
  500.  
  501. char munger[100];
  502.  
  503. char *mung_path (int n)
  504. {
  505.    char *p;
  506.  
  507.    if ((n == config.zone[1]) || cminternal || !opus_1)
  508.       return (pkt_dir);
  509.  
  510.    strcpy (munger, pkt_dir);
  511.  
  512.    p = munger + strlen (munger) - 1;
  513.    sprintf (p, ".%03x\\", n);
  514.    return (munger);
  515. }
  516.  
  517. int open_outfile (
  518.    AREAS_PTR which,
  519.    int j)
  520. {
  521.     int outfile, i, done;
  522.     char template[80];
  523.  
  524.    if (which->handle[j] > 0)
  525.       {
  526.       return (which->handle[j]);
  527.       }
  528.  
  529.     /* First create the name of the file */
  530.     sprintf (template, "%s%04x%04x.%s", mung_path (which->zone[j]), which->net[j], which->node[j],
  531.       ((opus_1 && !cminternal)?"OUT":"FS$"));
  532.  
  533.     outfile = open(template, O_RDONLY|O_BINARY);
  534.  
  535.     /* If outfile does not exist, then create it */
  536.     if (outfile == -1)
  537.         {
  538.  
  539.         /* Attempt to create the file */
  540.         outfile = open(template, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, S_IREAD|S_IWRITE);
  541.  
  542.         /* If unsuccessful we have to get rid of a handle and try again */
  543.         if (outfile == -1)
  544.          {
  545.  
  546.          if ((last_opened >= 0) && (which->handle[last_opened] > 0))
  547.             {
  548.             i = last_opened;
  549.             }
  550.          else
  551.             {
  552.             done = 0;
  553.             while (!done)
  554.                {
  555.                for (i = j - 1; i >= 0; i--)
  556.                   {
  557.                   if (which->handle[i] > 0)
  558.                      {
  559.                      done = 1;
  560.                      break;
  561.                      }
  562.                   }
  563.                if (done)
  564.                   break;
  565.  
  566.                for (i = which->num_nodes - 1; i > j; i--)
  567.                   {
  568.                   if (which->handle[i] > 0)
  569.                      {
  570.                      done = 1;
  571.                      break;
  572.                      }
  573.                   }
  574.                if (done)
  575.                   break;
  576.             return (-1);
  577.                }
  578.             }
  579.  
  580.          (void) fast_write (which->handle[i], "\0\0", 2);
  581.          (void) fast_close (which->handle[i]);
  582.          which->handle[i] = -1;
  583.          outfile = open(template, O_RDONLY|O_BINARY);
  584.          if (outfile == -1)
  585.             {
  586.             outfile = open (template, O_WRONLY|O_CREAT|O_BINARY, S_IREAD|S_IWRITE);
  587.             if (outfile == -1)
  588.                {
  589.                return (-1);
  590.                }
  591.             else
  592.                {
  593.                last_opened = j;
  594.                }
  595.             }
  596.          else
  597.             {
  598.             (void) fast_close (outfile);
  599.             if ((outfile = open (template, O_RDWR|O_BINARY)) == -1)
  600.                {
  601.                return (-1);
  602.                }
  603.             if (fast_lseek (outfile, -2L, SEEK_END) == -1L)
  604.                {
  605.                return (-1);
  606.                }
  607.             which->handle[j] = outfile;
  608.  
  609.             if (wbuffs[outfile].wbuff == NULL)
  610.                {
  611.                wbuffs[outfile].wbuff = wbuffs[outfile].wptr = _fmalloc (BIGSIZE);
  612.                if (wbuffs[outfile].wbuff != NULL)
  613.                   wbuffs[outfile].wsize = 0;
  614.                }
  615.  
  616.             last_opened = j;
  617.             return (outfile);
  618.             }
  619.          }
  620.  
  621.         /* Otherwise fill in the structure */
  622.         pkt_hdr.dest_net  = which->net[j];
  623.         pkt_hdr.dest_node = which->node[j];
  624.       for (i = 0; i < num_pw; i++)
  625.          {
  626.          /* Find out if we have a password for this guy */
  627.          if ((pw[i]->net == which->net[j]) && (pw[i]->node == which->node[j]))
  628.             {
  629.             strncpy (pkt_hdr.password, pw[i]->password, 8);
  630.             break;
  631.             }
  632.          }
  633.  
  634.         fast_write(outfile,(char *)&pkt_hdr,sizeof(PKTHDR));
  635.         }
  636.     else
  637.         {
  638.       (void) fast_close (outfile);
  639.       if ((outfile = open (template, O_RDWR|O_BINARY)) == -1)
  640.          {
  641.          return (-1);
  642.          }
  643.         /* If we can't seek then we are in trouble */
  644.         if (fast_lseek (outfile,-2L,SEEK_END) == -1L)
  645.             {
  646.             return (-1);
  647.             }
  648.         }
  649.  
  650.    which->handle[j] = outfile;
  651.    memset ((char *) pkt_hdr.password, 0, 8);
  652.    if (wbuffs[outfile].wbuff == NULL)
  653.       {
  654.       wbuffs[outfile].wbuff = wbuffs[outfile].wptr = _fmalloc (BIGSIZE);
  655.       if (wbuffs[outfile].wbuff != NULL)
  656.          wbuffs[outfile].wsize = 0;
  657.       }
  658.  
  659.     return (outfile);
  660. }
  661.  
  662. int open1_outfile ()
  663. {
  664. /*  int outfile, i, done; */
  665.     int outfile, i;
  666.     char template[80];
  667.  
  668.     /* First create the name of the file */
  669.     sprintf (template, "%s%04x%04x.%s", pkt_dir, h->dest_net, h->dest,
  670.       ((opus_1 && !cminternal)?"OUT":"FS$"));
  671.  
  672.     outfile = open(template, O_RDONLY|O_BINARY);
  673.  
  674.     /* If outfile does not exist, then create it */
  675.     if (outfile == -1)
  676.         {
  677.         /* Attempt to create the file */
  678.         outfile = open(template, O_WRONLY|O_CREAT|O_BINARY, S_IREAD|S_IWRITE);
  679.  
  680.         /* If unsuccessful return the bad news */
  681.         if (outfile == -1)
  682.          {
  683.             return (-1);
  684.          }
  685.  
  686.       if (wbuffs[outfile].wbuff == NULL)
  687.          {
  688.          wbuffs[outfile].wbuff = wbuffs[outfile].wptr = _fmalloc (BIGSIZE);
  689.          if (wbuffs[outfile].wbuff != NULL)
  690.             wbuffs[outfile].wsize = 0;
  691.          }
  692.  
  693.         /* Fill in the structure */
  694.         pkt_hdr.dest_net  = h->dest_net;
  695.         pkt_hdr.dest_node = h->dest;
  696.       for (i = 0; i < num_pw; i++)
  697.          {
  698.          /* Find out if we have a password for this guy */
  699.          if ((pw[i]->net == h->dest_net) && (pw[i]->node == h->dest))
  700.             {
  701.             strncpy (pkt_hdr.password, pw[i]->password, 8);
  702.             break;
  703.             }
  704.          }
  705.  
  706.         fast_write(outfile,(char *)&pkt_hdr,sizeof(PKTHDR));
  707.         }
  708.     else
  709.         {
  710.       (void) fast_close (outfile);
  711.       if ((outfile = open (template, O_RDWR|O_BINARY)) == -1)
  712.          {
  713.          return (-1);
  714.          }
  715.         /* If we can't seek then we are in trouble */
  716.         if (fast_lseek (outfile,-2L,SEEK_END) == -1L)
  717.             {
  718.             return (-1);
  719.             }
  720.         }
  721.  
  722.    memset ((char *) pkt_hdr.password, 0, 8);
  723.  
  724.    if (wbuffs[outfile].wbuff == NULL)
  725.       {
  726.       wbuffs[outfile].wbuff = wbuffs[outfile].wptr = _fmalloc (BIGSIZE);
  727.       if (wbuffs[outfile].wbuff != NULL)
  728.          wbuffs[outfile].wsize = 0;
  729.       }
  730.  
  731.     return (outfile);
  732. }
  733.  
  734. void disk_full (
  735.    int f,
  736.    char *fname1)
  737. {
  738.    fast_close (f);
  739.    if (fname1[0] != '\0')
  740.       {
  741.       unlink (fname1);
  742.       }
  743.    printf ("\n%s Could not write - Disk Full???\n", fname1);
  744. }
  745.  
  746.