relation_list.c   relation_list.c 
skipping to change at line 391 skipping to change at line 391
new = osl_relation_list_clone(l1); new = osl_relation_list_clone(l1);
end = new; end = new;
while (end->next != NULL) while (end->next != NULL)
end = end->next; end = end->next;
end->next = osl_relation_list_clone(l2); end->next = osl_relation_list_clone(l2);
return new; return new;
} }
/** /**
* osl_relation_list_concat_inplace function: * osl_relation_list_add function:
* this function concatenates a relation list to another. No new list is * this function adds a relation list at the end of the relation list
* created: this functions links the two input lists. If the first relation * pointed by l1. No new list is created: this functions links the two
* list is NULL, it is set to the second relation list. * input lists. If the first relation list is NULL, it is set to the
* two lists sent as parameters. * second relation list.
* \param[in,out] l1 Pointer to the first relation list. * \param[in,out] l1 Pointer to the first relation list.
* \param[in] l2 The second relation list. * \param[in] l2 The second relation list.
*/ */
void osl_relation_list_concat_inplace(osl_relation_list_p *l1, void osl_relation_list_add(osl_relation_list_p *l1, osl_relation_list_p l2)
osl_relation_list_p l2) { {
osl_relation_list_p temp; while (*l1 != NULL)
l1 = &((*l1)->next);
if (*l1 == NULL) {
*l1 = l2; *l1 = l2;
return; }
/**
* osl_relation_list_push function:
* this function sees a list of relations as a stack of relations and
* performs the push operation onto this stack.
* \param[in,out] head Pointer to the head of the relation stack.
* \param[in,out] node Relation node to add to the stack. Its next field is
* updated to the previous head of the stack.
*/
void osl_relation_list_push(osl_relation_list_p *head,
osl_relation_list_p node) {
if (node != NULL) {
node->next = *head;
*head = node;
}
}
/**
* osl_relation_list_pop function:
* this function sees a list of relations as a stack of relations and
* performs the pop operation onto this stack.
* \param[in,out] head Pointer to the head of the relation stack. It is
* updated to the previous element in the stack (NULL
* if there is none).
* \return The top element of the stack (detached from the list).
*/
osl_relation_list_p osl_relation_list_pop(osl_relation_list_p *head) {
osl_relation_list_p top = NULL;
if (*head != NULL) {
top = *head;
*head = (*head)->next;
top->next = NULL;
} }
temp = *l1; return top;
while (temp->next != NULL) }
temp = temp->next;
temp->next = l2; /**
* osl_relation_list_dup function:
* this function sees a list of relations as a stack of relations and
* performs the dup operation (duplicate the top element) onto
* this stack.
* \param[in,out] head Pointer to the head of the relation stack. It is
* updated to the new element after duplication.
*/
void osl_relation_list_dup(osl_relation_list_p *head) {
osl_relation_list_p top = osl_relation_list_pop(head);
osl_relation_list_push(head, osl_relation_list_clone(top));
osl_relation_list_push(head, top);
}
/**
* osl_relation_list_drop function:
* this function sees a list of relations as a stack of relations and
* performs the drop operation (pop and destroy popped element) onto
* this stack.
* \param[in,out] head Pointer to the head of the relation stack. It is
* updated to the previous element in the stack (NULL
* if there is none).
*/
void osl_relation_list_drop(osl_relation_list_p *head) {
osl_relation_list_p top = osl_relation_list_pop(head);
osl_relation_list_free(top);
}
/**
* osl_relation_list_destroy function:
* this function sees a list of relations as a stack of relations and
* performs the destroy operation onto this stack, i.e., it completely
* free it.
* \param[in,out] head Pointer to the head of the relation stack.
* Updated to NULL.
*/
void osl_relation_list_destroy(osl_relation_list_p *head) {
while (*head != NULL)
osl_relation_list_drop(head);
} }
/** /**
* osl_relation_list_equal function: * osl_relation_list_equal function:
* This function returns true if the two relation lists are the same, false * This function returns true if the two relation lists are the same, false
* otherwise.. * otherwise..
* \param l1 The first relation list. * \param l1 The first relation list.
* \param l2 The second relation list. * \param l2 The second relation list.
* \return 1 if l1 and l2 are the same (content-wise), 0 otherwise. * \return 1 if l1 and l2 are the same (content-wise), 0 otherwise.
*/ */
 End of changes. 3 change blocks. 
16 lines changed or deleted 88 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/