/* create new IRP */
irp = g_new0(IRP, 1); if (irp == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory!"); return NULL;
}
/* insert at end of linked list */ if ((irp_last = devredir_irp_get_last()) == NULL)
{ /* list is empty, this is the first entry */
g_irp_head = irp;
} else
{
irp_last->next = irp;
irp->prev = irp_last;
}
LOG_DEVEL(LOG_LEVEL_DEBUG, "new IRP=%p", irp); return irp;
}
/* create new IRP with space on end for the pathname and a terminator */
irp = (IRP *)g_malloc(sizeof(IRP) + (pathnamelen + 1), 1); if (irp == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory!"); return NULL;
}
/* insert at end of linked list */ if ((irp_last = devredir_irp_get_last()) == NULL)
{ /* list is empty, this is the first entry */
g_irp_head = irp;
} else
{
irp_last->next = irp;
irp->prev = irp_last;
}
LOG_DEVEL(LOG_LEVEL_DEBUG, "new IRP=%p", irp); return irp;
}
if (lirp == NULL)
{ return -1; /* did not find specified irp */
}
if (lirp->prev == NULL)
{ /* we are at head of linked list */ if (lirp->next == NULL)
{ /* only one element in list */
g_free(lirp);
g_irp_head = NULL;
devredir_irp_dump(); // LK_TODO return0;
}
lirp->next->prev = NULL;
g_irp_head = lirp->next;
g_free(lirp);
} elseif (lirp->next == NULL)
{ /* we are at tail of linked list */
lirp->prev->next = NULL;
g_free(lirp);
} else
{ /* we are in between */
lirp->prev->next = lirp->next;
lirp->next->prev = lirp->prev;
g_free(lirp);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.