home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Tools / nShell™ 1.0.3 / MoreSource / mem.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-23  |  918 b   |  45 lines  |  [TEXT/KAHL]

  1. /* ========== the commmand file: ==========
  2.  
  3.     mem.c
  4.     
  5.     Copyright (c) 1993,1994 Newport Software Development
  6.     
  7.     You may distribute unmodified copies of this file for
  8.     noncommercial purposes.  You may use this file as a
  9.     reference when writing your own nShell(tm) commands.
  10.     
  11.     All other rights are reserved.
  12.     
  13.    ========== the commmand file: ========== */
  14.  
  15. #ifdef __MWERKS__            // CodeWarrior requires an A4 setup
  16. #include <A4Stuff.h>
  17. #endif
  18.     
  19. #include "nshc.h"
  20.                     
  21. #include "nshc_utl.proto.h"
  22.                     
  23. void main(t_nshc_parms *nshc_parms, t_nshc_calls *nshc_calls)
  24. {
  25.     long    lFreeBytes;
  26.     
  27. #ifdef __MWERKS__
  28.     long oldA4  = SetCurrentA4();
  29. #endif
  30.  
  31.     if ( !nshc_bad_version( nshc_parms, nshc_calls, NSHC_VERSION ) ) {
  32.  
  33.         lFreeBytes = FreeMem();    
  34.         nshc_calls->NSH_printf("Free memory = %ld\r",lFreeBytes);
  35.     
  36.         nshc_parms->result = NSHC_NO_ERR;
  37.         nshc_parms->action = nsh_idle;
  38.         
  39.         }
  40.  
  41. #ifdef __MWERKS__
  42.     SetA4(oldA4);
  43. #endif
  44. }
  45.