home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / shr93.zip / SOMLIST.CSC < prev    next >
Text File  |  1993-04-12  |  4KB  |  140 lines

  1.  
  2. #***********************************************************************
  3. #
  4. #  OS/2 Work Place Shell Sample Program - ShrList
  5. #
  6. #  Copyright (C) 1993 IBM Corporation
  7. #
  8. #    DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
  9. #    sample code created by IBM Corporation.  This sample code is
  10. #    not part of any standard or IBM product and is provided to you
  11. #    solely for the purpose of assisting you in the development of
  12. #    your applications.  The code is provided "AS IS".  ALL
  13. #    WARRANTIES ARE EXPRESSLY DISCLAIMED, INCLUDING THE IMPLIED
  14. #    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  15. #    PURPOSE.  IBM shall not be liable for any damages arising out
  16. #    of your use of the sample code, even if IBM has been advised of
  17. #    the possibility of such damages.
  18. #
  19. #
  20. #***********************************************************************
  21.  
  22. #***********************************************************************
  23. #   Include the class definition file for the parent class
  24. #***********************************************************************
  25.  
  26. include <somobj.sc>
  27.  
  28. #***********************************************************************
  29. #   Define the new class
  30. #***********************************************************************
  31.  
  32. class: ShrList,
  33.        external stem   = ls,
  34.        local,
  35.        external prefix = ls_,
  36.        classprefix     = lsM_,
  37.        major version   = 1,
  38.        minor version   = 2;
  39.  
  40. --
  41. -- CLASS: ShrList
  42. --
  43. -- CLASS HIERARCHY:
  44. --
  45. --     SOMObject
  46. --       └── ShrList
  47. --
  48. -- DESCRIPTION:
  49. --
  50. --   See SOMLIST.C and LIST.C for more details.
  51. --
  52.  
  53. #***********************************************************************
  54. #   Specify the parent class
  55. #***********************************************************************
  56.  
  57. parent: SOMObject;
  58.  
  59. #***********************************************************************
  60. #   Passthru PUBLIC definitions to the .h file
  61. #***********************************************************************
  62.  
  63. passthru: C.h, before;
  64.  
  65. #include "list.h"
  66.  
  67. endpassthru;   /* C.h */
  68.  
  69. #***********************************************************************
  70. #   Define instance data
  71. #***********************************************************************
  72.  
  73. data:
  74.  
  75.    PVOID   pList;
  76.  
  77. #***********************************************************************
  78. #   Define methods
  79. #***********************************************************************
  80.  
  81. methods:
  82.  
  83. #***********************************************************************
  84. #   Define instance methods
  85. #***********************************************************************
  86.  
  87. PVOID shrQueryList();
  88. BOOL shrSetList(PVOID pNewList);
  89.  
  90. /*
  91.  * Add an item to a list.
  92.  */
  93.  
  94. BOOL shrAddLast(PVOID pValue);
  95. BOOL shrAddFirst(PVOID pValue);
  96. BOOL shrAddBefore(PVOID pValue, PVOID pBeforeValue);
  97. BOOL shrAddAfter(PVOID pValue, PVOID pAfterValue);
  98.  
  99. /*
  100.  * Remove an item from list.
  101.  */
  102.  
  103. BOOL shrRemove(PVOID pValue);
  104. BOOL shrRemoveAll();
  105.  
  106. /* 
  107.  * Enumerate items in a list.
  108.  */
  109.  
  110. PVOID shrBeginEnum();
  111. BOOL shrEndEnum(PVOID pListEnum);
  112. BOOL shrNext(PVOID pListEnum, PVOID *ppValue);
  113.  
  114. /* 
  115.  * List statistics.
  116.  */
  117.  
  118. ULONG shrCount();
  119.  
  120. /*
  121.  * Membership.
  122.  */
  123.  
  124. BOOL shrIncludes(PVOID pValue);
  125.  
  126. #***********************************************************************
  127. #   Specify instance methods being overridden
  128. #***********************************************************************
  129.  
  130. override somUninit;
  131.  
  132. #***********************************************************************
  133. #   Define class methods
  134. #***********************************************************************
  135.  
  136. SOMObject *shrclsExactStringListNew(), class;
  137. SOMObject *shrclsStringListNew(), class;
  138. SOMObject *shrclsValueListNew(), class;
  139. SOMObject *shrclsNew(PFNLISTCOMPARE pfnCompare), class;
  140.