Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:31

0001 /*
0002  * Motif
0003  *
0004  * Copyright (c) 1987-2012, The Open Group. All rights reserved.
0005  *
0006  * These libraries and programs are free software; you can
0007  * redistribute them and/or modify them under the terms of the GNU
0008  * Lesser General Public License as published by the Free Software
0009  * Foundation; either version 2 of the License, or (at your option)
0010  * any later version.
0011  *
0012  * These libraries and programs are distributed in the hope that
0013  * they will be useful, but WITHOUT ANY WARRANTY; without even the
0014  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
0015  * PURPOSE. See the GNU Lesser General Public License for more
0016  * details.
0017  *
0018  * You should have received a copy of the GNU Lesser General Public
0019  * License along with these librararies and programs; if not, write
0020  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
0021  * Floor, Boston, MA 02110-1301 USA
0022  * 
0023  */
0024 
0025 #ifndef _LIST_H
0026 #define _LIST_H
0027 
0028 #if defined(VMS) || defined (__VMS)
0029 #include <X11/apienvset.h>
0030 #endif
0031 
0032 #include <Xm/Xm.h>
0033 #include <Xm/Ext.h>
0034 
0035 #ifdef __cplusplus
0036 extern "C" {
0037 #endif
0038 
0039 /************************************************************
0040  *
0041  * Stack Data structure.  
0042  *
0043  ************************************************************/
0044 
0045 typedef struct _XmStackRec {
0046     int top, alloc;         /* The top node of the stack, and the number
0047                    of allocated nodes. */
0048     XtPointer * elems;      /* The stack elements. */
0049 } XmStackRec, *XmStack;
0050 
0051 /************************************************************
0052  *
0053  *  Global function defs.
0054  *
0055  ************************************************************/
0056 
0057 XmStack _XmStackInit(void);
0058 void _XmStackFree(XmStack), _XmStackPush(XmStack, XtPointer);
0059 XtPointer _XmStackPop(XmStack);
0060 
0061 /************************************************************
0062  *
0063  * Queue Data structure.  
0064  *
0065  ************************************************************/
0066 
0067 typedef struct __XmQElem {
0068     struct __XmQElem *next, *prev;  /* doubly linked list. */
0069     XtPointer data;     /* The data associated with this element. */
0070     Boolean alloced;
0071 } _XmQElem;
0072 
0073 typedef struct _XmQueueRec {
0074     _XmQElem *first, *last; /* the first and last elements. */
0075     _XmQElem *free_elems;       /* Unused elements. */
0076 } XmQueueRec, *XmQueue;
0077 
0078 /************************************************************
0079  *
0080  *  Global function defs.
0081  *
0082  ************************************************************/
0083 
0084 XmQueue _XmQueueInit(void);
0085 void _XmQueueFree(XmQueue), _XmQueuePush(XmQueue, XtPointer);
0086 XtPointer _XmQueuePop(XmQueue);
0087 int _XmQueueCount(XmQueue);
0088 
0089 /* 
0090  * Internal functions used only by other parts of the utils library.
0091  */
0092 
0093 void _Xm_AddQueue(XmQueue, _XmQElem *, _XmQElem *);
0094 _XmQElem * _Xm_RemQueue(_XmQElem **);
0095 _XmQElem * _Xm_GetNewElement(XmQueue);
0096 
0097 /************************************************************
0098  *
0099  * New types.
0100  *
0101  ************************************************************/
0102 
0103 typedef _XmQElem XmListElem;
0104 typedef XmQueueRec *XmList;
0105 typedef Boolean (*XmListFunc)(XmListElem *, XtPointer);
0106 
0107 /************************************************************
0108  *
0109  * Macros.
0110  *
0111  ************************************************************/
0112 
0113 #define XmListElemNext(elem) (elem)->next
0114 #define XmListElemPrev(elem) (elem)->prev
0115 #define XmListElemData(elem) (elem)->data
0116 
0117 #define XmListFirst(list) (list)->first
0118 #define XmListLast(list) (list)->last
0119 
0120 /************************************************************
0121  *
0122  *  Global function defs.
0123  *
0124  ************************************************************/
0125 
0126 void _XmListFree(XmList), _XmListRemove(XmList, XmListElem *);
0127 
0128 XmListElem * _XmListAddAfter(XmList, XmListElem *, XtPointer);
0129 XmListElem * _XmListAddBefore(XmList, XmListElem *, XtPointer); 
0130 
0131 XmList _XmListInit(void);
0132 
0133 int _XmListCount(XmList);
0134 
0135 XmListElem *_XmListExec(XmList, XmListElem *, XmListElem *, XmListFunc, XtPointer);
0136 
0137 #ifdef __cplusplus
0138 }   /* Closes scope of 'extern "C"' declaration */
0139 #endif
0140 
0141 #if defined(VMS) || defined (__VMS)
0142 #include <X11/apienvrst.h>
0143 #endif
0144 
0145 /* #ifdef XmRENAME_WIDGETS */
0146 /* #define USE_OLD_NAMES */
0147 /* #endif */
0148 
0149 #ifdef USE_OLD_NAMES
0150 
0151 #define ListAddAfter    _XmListAddAfter
0152 #define ListAddBefore   _XmListAddBefore
0153 #define ListCount   _XmListCount
0154 #define ListExec    _XmListExec
0155 #define ListFree    _XmListFree
0156 #define ListInit    _XmListInit
0157 #define ListRemove  _XmListRemove
0158 #define QueueCount  _XmQueueCount
0159 #define QueueFree   _XmQueueFree
0160 #define QueueInit   _XmQueueInit
0161 #define QueuePop    _XmQueuePop
0162 #define QueuePush   _XmQueuePush
0163 #define StackFree   _XmStackFree
0164 #define StackInit   _XmStackInit
0165 #define StackPop    _XmStackPop
0166 #define StackPush   _XmStackPush
0167 #define _AddQueue   _Xm_AddQueue
0168 #define _GetNewElement  _Xm_GetNewElement
0169 #define _RemQueue   _Xm_RemQueue
0170 
0171 #define Stack       XmStack
0172 #define StackRec    XmStackRec
0173 #define QElem       _XmQElem
0174 #define QueueRec    XmQueueRec
0175 #define Queue       XmQueue
0176 #define ListElem    XmListElem
0177 #define List        XmList
0178 #define ListFunc    XmListFunc
0179 
0180 #define ListElemNext    XmListElemNext
0181 #define ListElemPrev    XmListElemPrev
0182 #define ListElemData    XmListElemData
0183 #define ListFirst   XmListFirst
0184 #define ListLast    XmListLast
0185 
0186 #endif /* USE_OLD_NAMES */
0187 
0188 #endif /* _LIST_H */