=Routine Analyzer Source File Analysis - list.h3

list.h Source Code

LGo to: Contents; Previous section; Beginning of section; Next file in section; Previous file in section.

Q

Routines In This File (Alphabetical)



 Line Name
----- ----0   53 append_list_entry(   55 copy_list/   45 dec_list_entries,   71 dequeue_entry,   70 enqueue_entry*   93 entry_blink*   94 entry_flink/   44 inc_list_entries(   56 init_list.  106 isbegin_of_list+   57 isempty_list,  107 isend_of_list,  104 isfirst_entry+  105 islast_entry+   41 list_entries)   42 list_first(   43 list_last)   95 next_entry(   64 pop_entry1   54 prepend_list_entry)   96 prev_entry)   63 push_entry.   98 set_entry_blink.   97 set_entry_flink-   46 set_list_first,   47 set_list_last


BEGINNING OF FILE


V     1: /****************************************************************************/     2: /*									    */8     3: /*  FACILITY:	Generic Support Library					    */     4: /*									    *//     5: /*  MODULE:	List Management						    */     6: /*									    */O     7: /*  AUTHOR:	Steve Branam, Network Product Support Group, Digital	    */>     8: /*		Equipment Corporation, Littleton, MA, USA.		    */     9: /*									    */V    10: /*  DESCRIPTION: This header file contains all type definitions for the	    */T    11: /*  generic list object types used by Routine Analyzer. Member access	    */V    12: /*  routines (get/set values) and a number of object management routines    */6    13: /*  are implemented here as macros.					    */    14: /*									    */*    15: /*  REVISION HISTORY:							    */    16: /*									    */7    17: /*  V0.1-00 24-AUG-1994 Steve Branam					    */    18: /*									    */(    19: /*	Original version.						    */    20: /*									    */V    21: /****************************************************************************/    22: V    23: /****************************************************************************/    24: /*									    */)    25: /* List object type.							    */    26: /*									    */V    27: /****************************************************************************/    28:     29: typedef struct {E    30:     long    entries;			    /* Number of items in list.	    */I    31:     struct list_entry_hdr		    /* Ptr to first item in list.   */    32: 	    *head;I    33:     struct list_entry_hdr		    /* Ptr to last item in list.    */    34: 	    *tail;    35: } LIST;    36:     37: /*									    */9    38: /* List object member access routines.					    */    39: /*									    */    40: 

eROUTINE list_entries. Go to: mNext routine in file; Routines in this file.



1    41: #define list_entries(l) ((l)->entries)
JEND list_entries. Go to: Beginning of routine.







cROUTINE list_first. Go to: mNext routine in file; Routines in this file.



,    42: #define list_first(l) ((l)->head)
HEND list_first. Go to: Beginning of routine.







bROUTINE list_last. Go to: mNext routine in file; Routines in this file.



+    43: #define list_last(l) ((l)->tail)
GEND list_last. Go to: Beginning of routine.







iROUTINE inc_list_entries. Go to: mNext routine in file; Routines in this file.



7    44: #define inc_list_entries(l) ((l)->entries++)
NEND inc_list_entries. Go to: Beginning of routine.







iROUTINE dec_list_entries. Go to: mNext routine in file; Routines in this file.



7    45: #define dec_list_entries(l) ((l)->entries--)
NEND dec_list_entries. Go to: Beginning of routine.







gROUTINE set_list_first. Go to: mNext routine in file; Routines in this file.



7    46: #define set_list_first(l, p) ((l)->head = p)
LEND set_list_first. Go to: Beginning of routine.







fROUTINE set_list_last. Go to: mNext routine in file; Routines in this file.



6    47: #define set_list_last(l, p) ((l)->tail = p)
KEND set_list_last. Go to: Beginning of routine.





    48:     49: /*									    */6    50: /* List object management routines.					    */    51: /*									    */    52: 

fROUTINE append_list_entry. Go to: mNext routine in file; Routines in this file.



O    53: #define append_list_entry(l, e) insert_list_entry((l), list_last(l), e)
OEND append_list_entry. Go to: Beginning of routine.







kROUTINE prepend_list_entry. Go to: mNext routine in file; Routines in this file.



H    54: #define prepend_list_entry(l, e) insert_list_entry((l), NULL, e)
PEND prepend_list_entry. Go to: Beginning of routine.







bROUTINE copy_list. Go to: mNext routine in file; Routines in this file.



u    55: #define copy_list(s, d) ((d)->head=(s)->head,(d)->tail=(s)->tail,(d)->entries=(s)->entries)
GEND copy_list. Go to: Beginning of routine.







bROUTINE init_list. Go to: mNext routine in file; Routines in this file.



V    56: #define init_list(l) ((l)->head=NULL, (l)->tail=NULL, (l)->entries=0)
GEND init_list. Go to: Beginning of routine.





s

eROUTINE isempty_list. Go to: omNext routine in file; Routines in this file.

>

n6    57: #define isempty_list(l) ((l)->head == NULL)
JEND isempty_list. Go to: Beginning of routine.





i    58:     59: /*									    */tA    60: /* Treat a list as a stack: last-in, first-out.				    */L    61: /*									    */     62: 

cROUTINE push_entry. Go to: nmNext routine in file; Routines in this file.

A

#8    63: #define push_entry(s, e) append_list_entry(s, e)
HEND push_entry. Go to: Beginning of routine.





_

bROUTINE pop_entry. Go to: mNext routine in file; Routines in this file.

i

n?    64: #define pop_entry(s) remove_list_entry(s, list_last(s))H
GEND pop_entry. Go to: Beginning of routine.





0    65:     66: /*									    */=A    67: /* Treat a list as a queue: first-in, first-out.			    */_    68: /*									    */#    69: 

fROUTINE enqueue_entry. Go to: mNext routine in file; Routines in this file.

b

t;    70: #define enqueue_entry(s, e) append_list_entry(s, e)
KEND enqueue_entry. Go to: Beginning of routine.

*



/

fROUTINE dequeue_entry. Go to: mNext routine in file; Routines in this file.



 D    71: #define dequeue_entry(s) remove_list_entry(s, list_first(s))
KEND dequeue_entry. Go to: Beginning of routine.

:



f    72: V    73: /****************************************************************************/    74: /*									    */sV    75: /* List entry header object. Application list entry objects are expected to */P    76: /* define the following as the first element of their structures:	    */    77: /*									    */I1    78: /*	LIST_ENTRY_HDR   entry_hdr;					    */*    79: /*									    */AV    80: /****************************************************************************/    81: '    82: typedef struct list_entry_hdr { I    83:     struct list_entry_hdr		    /* Ptr to next record in list.  */*    84: 	    *flink;H    85:     struct list_entry_hdr		    /* Ptr to previous record.	    */    86: 	    *blink;    87: } LIST_ENTRY_HDR;     88:     89: /*									    */*@    90: /* Entry header object member access routines.				    */    91: /*									    */*    92: 

dROUTINE entry_blink. Go to: mNext routine in file; Routines in this file.

t

n.    93: #define entry_blink(e) ((e)->blink)
IEND entry_blink. Go to: Beginning of routine.





b

dROUTINE entry_flink. Go to: mNext routine in file; Routines in this file.

t

f.    94: #define entry_flink(e) ((e)->flink)
IEND entry_flink. Go to: Beginning of routine.





 

cROUTINE next_entry. Go to: cmNext routine in file; Routines in this file.



 Z    95: #define next_entry(e) ((e) == NULL ? NULL : entry_flink(&((e)->entry_hdr)))
HEND next_entry. Go to: Beginning of routine.





i

cROUTINE prev_entry. Go to: tmNext routine in file; Routines in this file.

_

oZ    96: #define prev_entry(e) ((e) == NULL ? NULL : entry_blink(&((e)->entry_hdr)))
HEND prev_entry. Go to: Beginning of routine.





H

hROUTINE set_entry_flink. Go to: mNext routine in file; Routines in this file.



47    97: #define set_entry_flink(e, p) (e->flink = p)>
MEND set_entry_flink. Go to: Beginning of routine.





>

hROUTINE set_entry_blink. Go to: mNext routine in file; Routines in this file.

E

 7    98: #define set_entry_blink(e, p) (e->blink = p)R
MEND set_entry_blink. Go to: Beginning of routine.

>



R    99:    100: /*									    */A=   101: /* Entry header object management routines.				    */>   102: /*									    */b   103: 

fROUTINE isfirst_entry. Go to: mNext routine in file; Routines in this file.

e

>9   104: #define isfirst_entry(e) (entry_blink(e) == NULL) 
KEND isfirst_entry. Go to: Beginning of routine.

0



o

eROUTINE islast_entry. Go to: tmNext routine in file; Routines in this file.

.

H8   105: #define islast_entry(e) (entry_flink(e) == NULL)
JEND islast_entry. Go to: Beginning of routine.







hROUTINE isbegin_of_list. Go to: mNext routine in file; Routines in this file.

3

n:   106: #define isbegin_of_list(e) (prev_entry(e) == NULL)
MEND isbegin_of_list. Go to: Beginning of routine.

<



>

fROUTINE isend_of_list. Go to: mNext routine in file; Routines in this file.

s

A8   107: #define isend_of_list(e) (next_entry(e) == NULL)
KEND isend_of_list. Go to: Beginning of routine.

1



n   108: 
END OF FILEP TOTAL: 26 routines, 1 Avg Length

LGo to: Contents; Previous section; Beginning of section; Next file in section; Previous file in section.