mirror of
https://github.com/hmaxnl/netex.git
synced 2025-01-18 15:34:20 +01:00
Reworked some headers, make project buildable.
This commit is contained in:
parent
6125824f3d
commit
76aa27a126
|
@ -1,4 +1,5 @@
|
|||
add_executable(netex
|
||||
"list.h"
|
||||
"main.c"
|
||||
"exp_list.c")
|
||||
target_include_directories(netex PRIVATE ${CMAKE_SOURCE_DIR}/src/include)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
#include "cexp.h"
|
||||
#include "list.h"
|
||||
#include "netex.h"
|
||||
|
||||
#define INCREMENT_SIZE 5
|
||||
|
@ -16,7 +16,7 @@ static struct exp_data* list = NULL;
|
|||
void list_add(char* name, char* command, int (*exp_func) (void*))
|
||||
{
|
||||
if (alloc_list() != 0)
|
||||
{ TRACE_ERROR("Unable to allocate memory!"); return; }
|
||||
{ ERROR("Unable to allocate memory!"); return; }
|
||||
list[list_index_count].name = name;
|
||||
list[list_index_count].command = command;
|
||||
list[list_index_count].func_ptr = exp_func;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
target_sources(netex PUBLIC
|
||||
"net.h"
|
||||
"netex.h"
|
||||
"cexp.h"
|
||||
"sockets.h")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef CEXP_H
|
||||
#define CEXP_H
|
||||
#ifndef LIST_H
|
||||
#define LIST_H
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
@ -15,10 +15,4 @@ void print_list_items();
|
|||
struct exp_data* get_command(char* command);
|
||||
struct exp_data* get_from_list(int index);
|
||||
void clear_list();
|
||||
|
||||
// Tracing
|
||||
#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)
|
||||
|
||||
#endif
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user