123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- # include "words.h"
- /* FILE
- *
- * file: words.cpp
- *
- *
- */
- /*
- */
- /* INFO del (WithSelect _)
- *
- * remove the preselected item - from the selected point (select)
- *
- * return: void
- *
- *
- */
- void
- words__del (struct Words *this)
- {
- /* IF this->select->prev is not NULL */
- if (this->select->previous != NULL)
- {
- this->select->previous->next = this->select->next;
- }
- else /* */
- {
- /* this->select->next will be first */
- this->head = this->select->next;
- }
-
- /* IF this->select->next is not NULL */
- if (this->select->next != NULL)
- {
- this->select->next->previous = this->select->previous;
- }
- else /* else IF this->select->next is NULL */
- {
- /* this->select->prev will be last */
- this->tail = this->select->previous;
- }
- clear__str (this->select->value);
-
- delete this->select;
- }
- void
- clear__str (char *value)
- {
-
- }
- struct Word*
- words__get(struct Words *this)
- {
- return this->select;
- }
- /* INFO del (WithTail _)
- *
- * remove the last element - from the tail part (tail)
- *
- * return: this->tail element
- *
- *
- */
- void
- del__tail (struct Words *this)
- {
- this->tail->previous->next = NULL;
- this->tail->value->clear ();
- remove = this->tail;
-
- this->tail = this->tail->previous;
- delete remove;
- }
- /* INFO del (WithHead _)
- *
- * remove the first element - from the head part (head)
- *
- * return: this->head element
- *
- *
- */
- void
- del__head (struct Words *this)
- {
- this->head->next->previous = NULL;
- this->head->value->clear ();
-
- Word* remove = this->head;
-
- this->head = this->head->next;
- delete remove;
- }
|