2022-12-14 20:14:54 +01:00
|
|
|
#ifndef CEXP_H
|
|
|
|
#define CEXP_H
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
|
|
|
|
|
|
|
|
struct exp_data{
|
|
|
|
char* name;
|
|
|
|
char* command;
|
|
|
|
int (*func_ptr) (void*);
|
|
|
|
};
|
|
|
|
// Exp list functions
|
|
|
|
void list_add(char* name, char* command, int (*exp_func) (void*));
|
|
|
|
void print_list_items();
|
2023-02-01 13:49:31 +01:00
|
|
|
struct exp_data* get_command(char* command);
|
2022-12-14 20:14:54 +01:00
|
|
|
struct exp_data* get_from_list(int index);
|
|
|
|
void clear_list();
|
|
|
|
|
|
|
|
// Tracing
|
2023-02-01 21:12:16 +01:00
|
|
|
#define PRINT_LINE(msg, args...) fprintf(stdout, msg "\n", ##args)
|
|
|
|
#define TRACE_WARN(msg, args...) fprintf(stdout, "[Warning]: " msg "\n", ##args)
|
|
|
|
#define TRACE_ERROR(msg, args...) fprintf(stderr, "[ERROR]: " msg "\n", ##args)
|
2022-12-14 20:14:54 +01:00
|
|
|
|
|
|
|
#endif
|