2021-10-22 13:15:11 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
|
2021-10-24 12:09:00 +00:00
|
|
|
#define MALLOCFAIL -1
|
|
|
|
#define XSLAVESFULL -2
|
|
|
|
|
|
|
|
|
2021-10-22 13:15:11 +00:00
|
|
|
typedef struct XSlaveInfo
|
|
|
|
{
|
|
|
|
char* name;
|
|
|
|
char* dev_node;
|
|
|
|
} XSlaveInfo;
|
|
|
|
|
|
|
|
typedef struct XSalves
|
|
|
|
{
|
|
|
|
XSlaveInfo* slaves;
|
|
|
|
size_t capacity;
|
|
|
|
size_t length;
|
|
|
|
} XSlaves;
|
|
|
|
|
|
|
|
|
|
|
|
XSlaveInfo new_slave_info();
|
|
|
|
void free_slave_info(XSlaveInfo si);
|
|
|
|
|
|
|
|
XSlaves* new_xslaves(size_t capacity);
|
|
|
|
void free_xslaves(XSlaves* slaves);
|
|
|
|
int add_slaveinfo(XSlaves* slaves, char* name, char* dev_node);
|