#include "libserialport.h"
-struct sp_port_data {
+struct port_data {
#ifdef _WIN32
DCB dcb;
#else
/* Helper functions. */
static int validate_port(struct sp_port *port);
static struct sp_port **list_append(struct sp_port **list, const char *portname);
-static int get_config(struct sp_port *port, struct sp_port_data *data, struct sp_port_config *config);
-static int set_config(struct sp_port *port, struct sp_port_data *data, struct sp_port_config *config);
+static int get_config(struct sp_port *port, struct port_data *data, struct sp_port_config *config);
+static int set_config(struct sp_port *port, struct port_data *data, struct sp_port_config *config);
int sp_get_port_by_name(const char *portname, struct sp_port **port_ptr)
{
return SP_ERR_FAIL;
#else
int flags_local = 0;
- struct sp_port_data data;
+ struct port_data data;
struct sp_port_config config;
int ret;
#endif
}
-static int get_config(struct sp_port *port, struct sp_port_data *data, struct sp_port_config *config)
+static int get_config(struct sp_port *port, struct port_data *data, struct sp_port_config *config)
{
unsigned int i;
return SP_OK;
}
-static int set_config(struct sp_port *port, struct sp_port_data *data, struct sp_port_config *config)
+static int set_config(struct sp_port *port, struct port_data *data, struct sp_port_config *config)
{
unsigned int i;
int sp_set_config(struct sp_port *port, struct sp_port_config *config)
{
- struct sp_port_data data;
+ struct port_data data;
struct sp_port_config prev_config;
TRY(get_config(port, &data, &prev_config));
}
#define CREATE_SETTER(x) int sp_set_##x(struct sp_port *port, int x) { \
- struct sp_port_data data; \
+ struct port_data data; \
struct sp_port_config config; \
TRY(get_config(port, &data, &config)); \
config.x = x; \
int sp_set_flowcontrol(struct sp_port *port, int flowcontrol)
{
- struct sp_port_data data;
+ struct port_data data;
struct sp_port_config config;
TRY(get_config(port, &data, &config));