return t->items;
}
-void*
-tr_ptrArrayNth( tr_ptrArray* t,
- int i )
-{
- assert( t );
- assert( i >= 0 );
- assert( i < t->n_items );
-
- return t->items[i];
-}
-
int
tr_ptrArrayInsert( tr_ptrArray * t,
void * ptr,
#ifndef _TR_PTR_ARRAY_H_
#define _TR_PTR_ARRAY_H_
+#include <assert.h>
+
#include "transmission.h"
/**
/** @brief Return the nth item in a tr_ptrArray
@return the nth item in a tr_ptrArray */
-void* tr_ptrArrayNth( tr_ptrArray * array,
- int nth );
+static inline void*
+tr_ptrArrayNth( tr_ptrArray * array, int i )
+{
+ assert( array );
+ assert( i >= 0 );
+ assert( i < array->n_items );
+
+ return array->items[i];
+}
/** @brief Remove the last item from the array and return it
@return the pointer that's been removed from the array