home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / cdity / EasyTM_src.lha / EasyTM-src / write.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-27  |  1013 b   |  56 lines

  1. //************************************
  2. //
  3. // Name : Write.c
  4. //
  5. //************************************
  6.  
  7.  
  8. //**** Header files
  9.  
  10. //** OS Include files
  11. #include <dos/dos.h>
  12.  
  13. //** OS function prototypes
  14. #include <clib/dos_protos.h>
  15.  
  16. //** OS function inline calls
  17. #include <pragmas/dos_pragmas.h>
  18.  
  19. //** ANSI C includes
  20. #include <stdio.h>
  21.  
  22. //** application include
  23. #include "Write.h"
  24. #include "Node.h"
  25.  
  26.  
  27. //**** non-local vars
  28.  
  29. extern struct Library *DOSBase;
  30.  
  31.  
  32. //**** Write Tools file
  33.  
  34. int WriteFile(STRPTR FileName) {
  35.   BPTR fh;
  36.   struct ProgNode *pn;
  37.  
  38.   if (NULL==(fh=Open(FileName,MODE_NEWFILE))) {
  39.     return 0;
  40.   } // if open
  41.  
  42.   for ( pn=(struct ProgNode *)List->lh_Head; pn->pn_Node.ln_Succ ; pn=(struct ProgNode *)pn->pn_Node.ln_Succ) {
  43.     FPrintf(fh,"\"%s\" \"%s\" \"%s\" %ld %ld %ld\n",
  44.       pn->pn_Node.ln_Name, pn->pn_Filename,
  45.       pn->pn_Directory,    pn->pn_LaunchCode,
  46.       pn->pn_Stack,        pn->pn_Priority
  47.     ); // FPrintf
  48.   } // for
  49.  
  50.   Close(fh);
  51.  
  52.   return 1;
  53. } // WriteFile
  54.  
  55. //**** End of file
  56.