longlist.h

Go to the documentation of this file.
00001 /**
00002  * \file longlist.h <mi32/longlist.h>
00003  * \brief Definitions for LONGLIST
00004  *
00005  * \if NODOC
00006  * $Id: longlist.h_v 1.6 2003/09/15 13:49:56 fileserver!dwilliss Exp $
00007  *
00008  * $Log: longlist.h_v $
00009  * Revision 1.6  2003/09/15 13:49:56  fileserver!dwilliss
00010  * Doxygen
00011  *
00012  * Revision 1.5  2000/06/15 18:26:55  sparsons
00013  * Genitor revision.
00014  *
00015  * Revision 1.4  2000/06/13 17:25:40  sparsons
00016  * Genitor documentation.
00017  *
00018  * Revision 1.3  2000/06/12 20:19:43  mju
00019  * Include stddefns.h if not already.
00020  *
00021  * Revision 1.2  1999/05/07 21:17:55  mju
00022  * Header restruct.
00023  *
00024  * Revision 1.1  1999/04/08  14:44:29  mju
00025  * Initial revision
00026  *
00027  * \endif
00028 **/
00029 
00030 #ifndef  INC_MI32_LONGLIST_H
00031 #define  INC_MI32_LONGLIST_H
00032 
00033 #ifndef  INC_MI32_STDDEFNS_H
00034 #include <mi32/stddefns.h>
00035 #endif
00036 
00037 //----------------------------------------------------------------------------
00038 //!      Structure used by LongListXxxx() functios (longlist.c)                  
00039 //----------------------------------------------------------------------------
00040 
00041 struct LONGLIST {
00042    INT32 NumAlloc;
00043    INT32 num;
00044    INT32 *List;                        //!<  Shouldn't access directly 
00045    UINT8 *flags; 
00046    unsigned sorted:1,
00047       UseBits:1,                       //!<  Use getbit/putbit 
00048        SpareBits:30;
00049    INT32 UserData;                     //!<  Can be used for anything you want 
00050    };
00051 
00052 
00053 //----------------------------------------------------------------------------
00054 //!      Prototypes                                                              
00055 //----------------------------------------------------------------------------
00056 
00057 #if defined(__cplusplus)
00058 extern "C" {
00059 #endif
00060 
00061 //! Free the memory used by a LONGLIST.
00062 //!
00063 //!   Note: There's no LongListAlloc.
00064 void LongListFree (
00065    LONGLIST *list
00066    );
00067 
00068 //! Clear the list.
00069 void LongListClear (
00070    LONGLIST *list
00071    );
00072 
00073 //! Add a value to the list, incrementing the number of elements in the list.
00074 //!
00075 //! Reallocates the list if necessary.
00076 int LongListAdd (
00077    LONGLIST *list, 
00078    INT32 val
00079    );
00080 
00081 //! Checks to see if a value is in a list.
00082 int LongListCheckIn (
00083    LONGLIST *list, 
00084    INT32 val
00085    );
00086 
00087 //!   Add a value to a list, but only if it's not already in the list.
00088 int LongListAddUnique (
00089    LONGLIST *list, 
00090    INT32 val
00091    );
00092 
00093 //! Add a value to the list, incrementing the number of elements in the list.
00094 //!
00095 //! Reallocates the list if necessary.
00096 int LongListAddWithFlag (
00097    LONGLIST *list, 
00098    INT32 val,
00099    UINT8 flag
00100    );
00101 
00102 //!   Add a value to a list, but only if it's not already in the list.
00103 int LongListAddUniqueWithFlag (
00104    LONGLIST *list, 
00105    INT32 val,
00106    UINT8 flag
00107    );
00108 
00109 //! Remove a value from the list.
00110 int LongListRemove (
00111    LONGLIST *list, 
00112    INT32 val
00113    );
00114 
00115 //! Get the first item on the list.
00116 int LongListGetFirst (
00117    LONGLIST *list, 
00118    INT32 *ip, 
00119    INT32 *valp
00120    );
00121 
00122 //! Get the next item on the list. 
00123 int LongListGetNext (
00124    LONGLIST *list, 
00125    INT32 *ip, 
00126    INT32 *valp
00127    );
00128 
00129 //! Get the last item on the list.
00130 int LongListGetLast (
00131    LONGLIST *list, 
00132    INT32 *valp
00133    );
00134 
00135 //! Get the number of bits.
00136 int LongListGetBits (
00137    LONGLIST *list, 
00138    UINT8 **bits, 
00139    INT32 *num
00140    );
00141 
00142 //! Set the number of bits.
00143 int LongListSetBits (
00144    LONGLIST *list, 
00145    UINT8 *bits, 
00146    INT32 num
00147    );
00148 
00149 //! Get the list.
00150 int LongListGetList (
00151    LONGLIST *list, 
00152    INT32 **vals
00153    );
00154 
00155 #if defined(__cplusplus)
00156 }
00157 #endif
00158 
00159 #endif   //!< INC_MI32_LONGLIST_H

Generated on Tue Dec 14 13:18:25 2004 for TNTsdk by  doxygen 1.3.8-20040913