/**
 * @file wrtd-internal.h
 *
 * Copyright (c) 2018-2019 CERN (home.cern)
 *
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#ifndef __WRTD_TOOLS_INTERNAL_H__
#define __WRTD_TOOLS_INTERNAL_H__

#include <mockturtle/libmockturtle.h>
#include <libwrtd.h>

struct wrtd_commands {
        const char *name;
        const char *parm;
        const char *desc;
        enum wrtd_status (*handler)(struct wrtd_dev *wrtd,
                                    int argc, char **argv);
};


/**
 * @file wrtd-inout-common.c
 */
extern void help_commands(struct wrtd_commands *cmds);
extern void help_log_level();
extern void help_trig_mode();
extern void help_trig_id();
extern void decode_flags(char *buf, uint32_t flags);
extern void decode_mode(char *buf, int mode);
extern void decode_log_level(char *buf, uint32_t flags);
extern int parse_delay(char *dly, uint64_t *delay_ps);
extern int parse_log_level (char *list[], int count, int *log_level);
extern void ts_add_ps(struct wrtd_tstamp *ts, uint64_t ps);
extern void ts_sub_ps(struct wrtd_tstamp *ts, uint64_t ps);

extern void print_ts(const struct wrtd_tstamp *ts);
extern void print_ns(uint32_t ns);
#endif
