f-stack/dpdk/app/test-eventdev/evt_test.c

43 lines
749 B
C
Raw Normal View History

2019-06-25 11:12:58 +00:00
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2017 Cavium, Inc
2017-04-21 10:43:26 +00:00
*/
#include <stdio.h>
#include <unistd.h>
2017-04-21 10:43:26 +00:00
#include <sys/queue.h>
#include "evt_test.h"
2017-04-21 10:43:26 +00:00
static STAILQ_HEAD(, evt_test_entry) head = STAILQ_HEAD_INITIALIZER(head);
2017-04-21 10:43:26 +00:00
void
evt_test_register(struct evt_test_entry *entry)
2017-04-21 10:43:26 +00:00
{
STAILQ_INSERT_TAIL(&head, entry, next);
}
struct evt_test*
evt_test_get(const char *name)
{
struct evt_test_entry *entry;
if (!name)
return NULL;
2017-04-21 10:43:26 +00:00
STAILQ_FOREACH(entry, &head, next)
if (!strncmp(entry->test.name, name, strlen(name)))
return &entry->test;
return NULL;
}
void
evt_test_dump_names(void)
{
struct evt_test_entry *entry;
2017-04-21 10:43:26 +00:00
STAILQ_FOREACH(entry, &head, next)
if (entry->test.name)
printf("\t %s\n", entry->test.name);
2017-04-21 10:43:26 +00:00
}