Skip to content
Snippets Groups Projects
Commit 5cd83dc2 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

List_Pointer_Test

parent 7fb01159
Branches
Tags
No related merge requests found
/* $Id: List.cpp,v 1.9 2000-11-28 08:19:28 geuzaine Exp $ */ /* $Id: List.cpp,v 1.10 2000-12-11 16:22:43 geuzaine Exp $ */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
...@@ -154,6 +154,15 @@ void *List_Pointer_Fast(List_T *liste, int index) ...@@ -154,6 +154,15 @@ void *List_Pointer_Fast(List_T *liste, int index)
return(&liste->array[index * liste->size]); return(&liste->array[index * liste->size]);
} }
void *List_Pointer_Test(List_T *liste, int index)
{
if ((index < 0) || (index >= liste->n))
return NULL;
liste->isorder = 0; /* getdp: a examiner... */
return(&liste->array[index * liste->size]);
}
void List_Sort(List_T *liste, int (*fcmp)(const void *a, const void *b)) void List_Sort(List_T *liste, int (*fcmp)(const void *a, const void *b))
{ {
qsort(liste->array,liste->n,liste->size,fcmp); qsort(liste->array,liste->n,liste->size,fcmp);
......
/* $Id: List.h,v 1.6 2000-11-27 17:13:42 geuzaine Exp $ */ /* $Id: List.h,v 1.7 2000-12-11 16:22:43 geuzaine Exp $ */
#ifndef _LIST_H_ #ifndef _LIST_H_
#define _LIST_H_ #define _LIST_H_
...@@ -30,6 +30,7 @@ void List_Pop(List_T *liste); ...@@ -30,6 +30,7 @@ void List_Pop(List_T *liste);
void *List_Pointer(List_T *liste, int index); void *List_Pointer(List_T *liste, int index);
void *List_Pointer_NoChange(List_T *liste, int index); void *List_Pointer_NoChange(List_T *liste, int index);
void *List_Pointer_Fast(List_T *liste, int index); void *List_Pointer_Fast(List_T *liste, int index);
void *List_Pointer_Test(List_T *liste, int index);
void List_Sort(List_T *liste, int (*fcmp)(const void *a, const void *b)); void List_Sort(List_T *liste, int (*fcmp)(const void *a, const void *b));
int List_Search(List_T *liste, void *data, int (*fcmp)(const void *a, const void *b)); int List_Search(List_T *liste, void *data, int (*fcmp)(const void *a, const void *b));
int List_ISearch(List_T *liste, void *data, int (*fcmp)(const void *a, const void *b)); int List_ISearch(List_T *liste, void *data, int (*fcmp)(const void *a, const void *b));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment