home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / MNDLKEYS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  851 b   |  43 lines

  1. /**
  2. *
  3. * Name        MNDLKEYS -- Free memory used by all keys in
  4. *                key list.
  5. *
  6. * Synopsis    mndlkeys (pmenu);
  7. *
  8. *        BMENU *pmenu    Pointer to BMENU structure to
  9. *                discard key list from.
  10. *
  11. * Description    This function completely discards a Blaise C TOOLS
  12. *        menu key list structure.
  13. *
  14. * Returns    *pmenu->pkeys    NIL.
  15. *
  16. * Version    6.00 (C)Copyright Blaise Computing Inc.  1987,1989
  17. *
  18. **/
  19.  
  20. #include <stdlib.h>
  21.  
  22. #include <bmenu.h>
  23.  
  24. int mndlkeys (pmenu)
  25. BMENU *pmenu;
  26. {
  27.     BKEYMAP *pkey, *qkey;
  28.  
  29.         /* Free memory used by key list.            */
  30.     for (pkey = pmenu->pkeys;  pkey != NIL;  pkey = qkey)
  31.     {
  32.         /* Check item signature, then delete it.        */
  33.     if (pkey->signature != MN_KEY_SIGN)
  34.         wnretern (MN_BAD_KEY);
  35.     pkey->signature = MN_DEAD_KEY;
  36.  
  37.     qkey = pkey->next;
  38.     free (pkey);
  39.     }
  40.  
  41.     return (WN_NO_ERROR);
  42. }
  43.