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

  1. /*
  2.  * OS/2 Work Place Shell Sample Program - Simple ordered list functions
  3.  *
  4.  * Copyright (C) 1993 IBM Corporation
  5.  *
  6.  *   DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
  7.  *   sample code created by IBM Corporation.  This sample code is
  8.  *   not part of any standard or IBM product and is provided to you
  9.  *   solely for the purpose of assisting you in the development of
  10.  *   your applications.  The code is provided "AS IS".  ALL
  11.  *   WARRANTIES ARE EXPRESSLY DISCLAIMED, INCLUDING THE IMPLIED
  12.  *   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  13.  *   PURPOSE.  IBM shall not be liable for any damages arising out
  14.  *   of your use of the sample code, even if IBM has been advised of
  15.  *   the possibility of such damages.
  16.  *
  17.  * Simple list.  Note that PVOID is used for list to allow
  18.  * easy conversion to a SOM object.
  19.  */
  20.  
  21. #ifndef LIST_H
  22. #define LIST_H
  23.  
  24. /*
  25.  * Comparision functions for searching list.
  26.  */
  27.  
  28. typedef LONG (FNLISTCOMPARE)(PVOID, PVOID);
  29. typedef FNLISTCOMPARE *PFNLISTCOMPARE;
  30.  
  31. /*
  32.  * Create or destroy a list.
  33.  */
  34.  
  35. extern PVOID ShrGenericListNew(PFNLISTCOMPARE pfnCompare);
  36. extern PVOID ShrExactStringListNew(void);
  37. extern PVOID ShrStringListNew(void);
  38. extern PVOID ShrValueListNew(void);
  39.  
  40. extern BOOL ShrListFree(PVOID pListParm);
  41.  
  42. /*
  43.  * Add an item to a list.
  44.  */
  45.  
  46. extern BOOL ShrListAddLast(PVOID pListParm, PVOID pValue);
  47. extern BOOL ShrListAddFirst(PVOID pListParm, PVOID pValue);
  48. extern BOOL ShrListAddBefore
  49.     (PVOID pListParm, PVOID pValue, PVOID pBeforeValue);
  50. extern BOOL ShrListAddAfter
  51.     (PVOID pListParm, PVOID pValue, PVOID pAfterValue);
  52.  
  53. /*
  54.  * Remove an item from list.
  55.  */
  56.  
  57. extern BOOL ShrListRemove(PVOID pListParm, PVOID pValue);
  58. extern PVOID ShrListRemoveFirst(PVOID pListParm);
  59. extern BOOL ShrListRemoveAll(PVOID pListParm);
  60.  
  61. /* 
  62.  * Enumerate items in a list.
  63.  */
  64.  
  65. extern PVOID ShrListBeginEnum(PVOID pListParm);
  66. extern BOOL ShrListEndEnum(PVOID pListParm, PVOID pListEnum);
  67. extern BOOL ShrListNext
  68.     (PVOID pListParm, PVOID pListEnum, PVOID *ppValue);
  69.  
  70. /* 
  71.  * List statistics.
  72.  */
  73.  
  74. extern ULONG ShrListCount(PVOID pListParm);
  75.  
  76. /*
  77.  * Membership.
  78.  */
  79.  
  80. extern BOOL ShrListIncludes(PVOID pListParm, PVOID pValue);
  81.  
  82. #endif
  83.