/[radius]/radius/radiusd/rewrite.y
ViewVC logotype

Diff of /radius/radiusd/rewrite.y

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.50 by gray, Wed Dec 18 16:19:18 2002 UTC revision 1.51 by gray, Fri Apr 18 05:27:10 2003 UTC
# Line 46  typedef long RWSTYPE; Line 46  typedef long RWSTYPE;
46  /*  /*
47   * Generalized list structure   * Generalized list structure
48   */   */
49  typedef struct list_t LIST;  typedef struct rw_list RWLIST;
50  #define LIST(type) \  #define RWLIST(type) \
51          type     *next;\          type     *next;\
52          type     *prev          type     *prev
53    
54  struct list_t {  struct rw_list {
55          LIST(LIST);          RWLIST(RWLIST);
56  };  };
57    
58  /*  /*
# Line 61  struct list_t { Line 61  struct list_t {
61  typedef struct object_t OBJECT ;  typedef struct object_t OBJECT ;
62    
63  #define OBJ(type) \  #define OBJ(type) \
64          LIST(type);\          RWLIST(type);\
65          type    *alloc          type    *alloc
66    
67  struct object_t {  struct object_t {
# Line 1751  yysync() Line 1751  yysync()
1751  /* ****************************************************************************  /* ****************************************************************************
1752   * Generalized list functions   * Generalized list functions
1753   */   */
1754  static LIST *_list_insert(LIST **first, LIST **last, LIST *prev,  static RWLIST *_list_insert(RWLIST **first, RWLIST **last, RWLIST *prev,
1755                           LIST *obj, int before);                           RWLIST *obj, int before);
1756  static LIST *_list_remove(LIST **first, LIST **last, LIST *obj);  static RWLIST *_list_remove(RWLIST **first, RWLIST **last, RWLIST *obj);
1757  static LIST *_list_append(LIST **first, LIST **last, LIST *obj);  static RWLIST *_list_append(RWLIST **first, RWLIST **last, RWLIST *obj);
1758    
1759  #define list_insert(first, last, prev, obj, before) \  #define list_insert(first, last, prev, obj, before) \
1760   _list_insert((LIST**)first,(LIST**)last,(LIST*)prev,(LIST*)obj, before)   _list_insert((RWLIST**)first,(RWLIST**)last,(RWLIST*)prev,(RWLIST*)obj, before)
1761  #define list_remove(first, last, obj) \  #define list_remove(first, last, obj) \
1762   _list_remove((LIST**)first,(LIST**)last,(LIST *)obj)   _list_remove((RWLIST**)first,(RWLIST**)last,(RWLIST *)obj)
1763  #define list_append(first, last, obj) \  #define list_append(first, last, obj) \
1764   _list_append((LIST**)first, (LIST**)last, (LIST*)obj)   _list_append((RWLIST**)first, (RWLIST**)last, (RWLIST*)obj)
1765                    
1766  LIST *  RWLIST *
1767  _list_append(first, last, obj)  _list_append(first, last, obj)
1768          LIST **first, **last, *obj;          RWLIST **first, **last, *obj;
1769  {  {
1770          return list_insert(first, last, *last, obj, 0);          return list_insert(first, last, *last, obj, 0);
1771  }  }
1772    
1773  LIST *  RWLIST *
1774  _list_insert(first, last, prev, obj, before)  _list_insert(first, last, prev, obj, before)
1775          LIST **first, **last, *prev, *obj;          RWLIST **first, **last, *prev, *obj;
1776          int before;          int before;
1777  {  {
1778          LIST   *next;          RWLIST   *next;
1779    
1780          /*          /*
1781           * No first element: initialize whole list           * No first element: initialize whole list
# Line 1815  _list_insert(first, last, prev, obj, bef Line 1815  _list_insert(first, last, prev, obj, bef
1815          return obj;          return obj;
1816  }  }
1817    
1818  LIST *  RWLIST *
1819  _list_remove(first, last, obj)  _list_remove(first, last, obj)
1820          LIST **first, **last, *obj;          RWLIST **first, **last, *obj;
1821  {  {
1822          LIST *temp;          RWLIST *temp;
1823    
1824          if (temp = obj->prev)          if (temp = obj->prev)
1825                  temp->next = obj->next;                  temp->next = obj->next;

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26