Lines Matching defs:lst

43 static inline int domain_list_empty(struct vtd_domain_list *lst)
45 return (lst->head == NULL);
73 // Inserts newd as the new head of lst, a domain list with a size > 1
74 static inline void vtd_insert_new_head(struct vtd_domain *newd, struct vtd_domain_list *lst)
76 newd->next = lst->head;
77 lst->head->prev = newd;
78 lst->head = newd;
81 // Inserts newd as the new tail of lst, a domain list with a size > 1
82 static inline void vtd_insert_new_tail(struct vtd_domain_list *lst, struct vtd_domain *newd)
84 lst->tail->next = newd;
85 newd->prev = lst->tail;
86 lst->tail = newd;
113 // Deletes the head of lst, a domain list with a size > 1.
114 static inline void vtd_delete_head(struct vtd_domain_list *lst)
116 struct vtd_domain *old_head = lst->head;
117 lst->head->next->prev = NULL;
118 lst->head = lst->head->next;
122 // Deletes the tail of lst, a domain list with a size > 1.
123 static inline void vtd_delete_tail(struct vtd_domain_list *lst)
125 struct vtd_domain *old_tail = lst->tail;
126 lst->tail->prev->next = NULL;
127 lst->tail = lst->tail->prev;
141 static inline void vtd_delete_single(struct vtd_domain_list *lst) {
142 free(lst->head);
143 lst->head = NULL;
144 lst->tail = NULL;
147 // Deletes the domain d from the non-empty list of domains lst.
148 static inline void vtd_delete_domain(struct vtd_domain *d, struct vtd_domain_list *lst)
151 assert(lst != NULL);
152 if (lst->head == lst->tail) {
153 vtd_delete_single(lst);
154 } else if (d == lst->head) {
155 vtd_delete_head(lst);
156 } else if (d == lst->tail) {
157 vtd_delete_tail(lst);