home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / macify13.shr / macify.hqx / Source / U / Utils_Macify.c < prev    next >
Text File  |  1991-03-15  |  2KB  |  96 lines

  1. /*  Utils_Macify;                                                            Utilities */
  2.  
  3. /* Unit name:  Utils_Macify.c   */
  4. /* Function:  Utilities for the Program specific code. */
  5. /* History: 3/15/91 Original by Prototyper 3.0   */
  6.  
  7.  
  8.  
  9. #include "PCommonMacify.h"    /* Common */
  10. #include "Common_Macify.h"    /* Common */
  11. #include "PUtils_Macify.h"    /* General Utilities */
  12.  
  13. #include "Utils_Macify.h"    /* This file */
  14.  
  15.  
  16. /* ======================================================= */
  17.  
  18.  
  19.  
  20. /* ======================================================= */
  21.  
  22.  
  23. /* Close the input file */ 
  24. void Close_The_Input_File()
  25. {
  26.  
  27. ErrorCode = FSClose(inputRefNum );                                     /* Close the file */
  28. inputRefNum = 0;                                                            /* Invalidate the refnum */
  29. }
  30.  
  31.  
  32. /* ======================================================= */
  33.  
  34.  
  35. /* Close the output file */ 
  36. void Close_The_Output_File()
  37. {
  38.  
  39. ErrorCode = FSClose(outputRefNum );                                    /* Close the file */
  40. outputRefNum = 0;                                                          /* Invalidata the refnum */
  41. }
  42.  
  43.  
  44. /* ======================================================= */
  45.  
  46.  
  47. /* Open the input file */ 
  48. void Open_The_File()
  49. {
  50. short    NumberOfTypes;
  51.  
  52. typeList[0] = 'TEXT';                                                       /* Open TEXT files */
  53. typeList[1] = 'text';                                                         /* Open other files */
  54. NumberOfTypes = 1;                                                        /* Only use first filetype in the list */
  55. if (Do_The_Open_File(NumberOfTypes))                                 /* Try to open the file */
  56.     {
  57.  
  58.  
  59.  
  60.     /* ADD in your code here to read the file */
  61.  
  62.  
  63.  
  64.     Close_The_Input_File();                                                 /* Now close this file */
  65.     }
  66. }
  67.  
  68.  
  69. /* ======================================================= */
  70.  
  71.  
  72. /* Save the file */ 
  73. void Save_The_File()
  74. {
  75.  
  76. if (Do_The_Save_File('????', 'TEXT'))                                  /* Try to save the file */
  77.     {
  78.  
  79.  
  80.  
  81.     /* ADD in your code here to save the file */
  82.  
  83.  
  84.  
  85.     Close_The_Output_File();                                               /* Now close this file */
  86.     }
  87. }
  88.  
  89.  
  90. /* ======================================================= */
  91.  
  92.  
  93.  
  94. /* ======================================================= */
  95.  
  96.