00001 /** 00002 * \file mlist.h <mi32/mlist.h> 00003 * \brief Definitions for Mlist functions and structures 00004 * \deprecated Use MILIST instead 00005 * 00006 * \if NODOC 00007 * $Id: mlist.h_v 1.7 2003/09/17 21:25:21 dwilliss Exp $ 00008 * 00009 * $Log: mlist.h_v $ 00010 * Revision 1.7 2003/09/17 21:25:21 dwilliss 00011 * Document that the thing is deprecate 00012 * (d) 00013 * 00014 * Revision 1.6 2003/09/15 13:49:56 fileserver!dwilliss 00015 * Doxygen 00016 * 00017 * Revision 1.5 2001/12/27 16:34:59 dwilliss 00018 * Gave MLIST a constructor that sets it to 0 so I don't have to do it elsewhere 00019 * 00020 * Revision 1.4 2000/06/22 20:38:02 sparsons 00021 * Genitor documentation. 00022 * 00023 * Revision 1.3 1999/05/07 21:19:29 mju 00024 * Header restruct. 00025 * 00026 * Revision 1.2 1999/04/12 20:19:16 mju 00027 * Fix to hopefully compile in non-C++ mode. 00028 * 00029 * Revision 1.1 1999/04/12 14:38:23 mju 00030 * Initial revision 00031 * 00032 * \endif 00033 **/ 00034 00035 #ifndef INC_MI32_MLIST_H 00036 #define INC_MI32_MLIST_H 00037 00038 #ifndef INC_MI32_STDDEFNS_H 00039 #include <mi32/stddefns.h> 00040 #endif 00041 00042 #ifdef GEOMDLL 00043 #define GEOMLIBEXPORT MI_DLLEXPORT 00044 #else 00045 #define GEOMLIBEXPORT MI_DLLIMPORT 00046 #endif 00047 00048 //---------------------------------------------------------------------------- 00049 //! Structures used by Mlist functions 00050 //---------------------------------------------------------------------------- 00051 00052 struct MLISTNODE { 00053 MLISTNODE *prev, *next; 00054 }; 00055 00056 // Old Linked List implementation 00057 // \deprecated Use MILIST instead 00058 // 00059 // This is a linked-list implementation written before we started using C++ 00060 struct MLIST { 00061 MLISTNODE *head, *tail; 00062 00063 MLIST() : head(0), tail(0) {} 00064 ~MLIST() {} 00065 }; 00066 00067 //! old names for old code 00068 typedef MLIST LINKEDLIST; 00069 typedef MLISTNODE LINKEDLISTNODE; 00070 00071 //---------------------------------------------------------------------------- 00072 //! Prototypes 00073 //---------------------------------------------------------------------------- 00074 00075 #if defined(__cplusplus) 00076 extern "C" { 00077 #endif 00078 00079 //! Add to the head of a Linked List. 00080 //! 00081 //! This function adds a node to the head of list. 00082 //! You can create a linked list of any kind of structure simply by putting a MLISTNODE in 00083 //! the structure. 00084 //! 00085 //! It works best to put the MLISTNODE as the first thing in the structure 00086 //! you want to keep a list of. That way the node.next can be treated as 00087 //! both a pointer to a MLISTNODE (for the purposes of iterating 00088 //! through the list) and a pointer to whatever the structure is. Of 00089 //! course you have to cast it. There are macros for this. 00090 GEOMLIBEXPORT void MlistAddToHead ( 00091 MLIST *list, //!< List to add to 00092 MLISTNODE *node, //!< Node to add 00093 UINT32 flags //!< Flags 00094 ); 00095 00096 //! Add to the tail of a Linked List. 00097 //! 00098 //! This function adds a node to the tail of list. 00099 //! You can create a linked list of any kind of structure simply by putting a MLISTNODE in 00100 //! the structure. 00101 GEOMLIBEXPORT void MlistAddToTail ( 00102 MLIST *list, //!< List to add to 00103 MLISTNODE *node, //!< Node to add 00104 UINT32 flags //!< Flags 00105 ); 00106 00107 //! Remove an item from a linked list. 00108 //! 00109 //! This function removes a node from the list. The node's prev and next fields are set to NULL. 00110 GEOMLIBEXPORT void MlistRemove ( 00111 MLIST *list, //!< List to remove from 00112 MLISTNODE *node, //!< Node to remove 00113 UINT32 flags //!< Flags 00114 ); 00115 00116 #if defined(__cplusplus) 00117 } 00118 #endif 00119 00120 #endif //!< INC_MI32_MLIST_H
1.3.8-20040913