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

  1. /**
  2. *
  3. * Name        MNVALMN0 -- Validate BMENU structure.
  4. *
  5. * Synopsis    presult = mnvalmn0(pmenu,signature);
  6. *
  7. *        BMENU *presult      Pointer to valid BMENU
  8. *                  structure, or NIL if failure.
  9. *        BMENU *pmenu      Pointer to BMENU structure to
  10. *                  examine.
  11. *        unsigned signature
  12. *                  Signature word expected by calling
  13. *                  function.
  14. *
  15. * Description    This function superficially examines a menu structure
  16. *        for validity and returns the result.
  17. *
  18. *        This function is invoked by the mnvalmnu() macro, which
  19. *        provides the signature value.  The same signature value
  20. *        is provided to MNCREAT0 by the mncreate() macro.  By
  21. *        using these macros, all menu functions provide signature
  22. *        values for comparison.    In this way incompatible
  23. *        versions of BMENU.H can be detected at run time.
  24. *
  25. * Returns    presult       Pointer to valid BMENU
  26. *                  structure, or NIL if failure.
  27. *
  28. * Version    6.00 (C)Copyright Blaise Computing Inc.  1987-1989
  29. *
  30. **/
  31.  
  32. #include <bmenu.h>
  33.  
  34. BMENU *mnvalmn0(pmenu,signature)
  35. BMENU    *pmenu;
  36. unsigned signature;
  37. {
  38.     if (pmenu == NIL || signature != pmenu->signature)
  39.     return (NIL);
  40.  
  41.     return pmenu;
  42. }
  43.