static enum sp_return set_config(struct sp_port *port, struct port_data *data,
const struct sp_port_config *config);
-enum sp_return sp_get_port_by_name(const char *portname, struct sp_port **port_ptr)
+SP_API enum sp_return sp_get_port_by_name(const char *portname, struct sp_port **port_ptr)
{
struct sp_port *port;
enum sp_return ret;
RETURN_OK();
}
-char *sp_get_port_name(const struct sp_port *port)
+SP_API char *sp_get_port_name(const struct sp_port *port)
{
TRACE("%p", port);
RETURN_VALUE("%s", port->name);
}
-char *sp_get_port_description(struct sp_port *port)
+SP_API char *sp_get_port_description(struct sp_port *port)
{
TRACE("%p", port);
RETURN_VALUE("%s", port->description);
}
-enum sp_transport sp_get_port_transport(struct sp_port *port)
+SP_API enum sp_transport sp_get_port_transport(struct sp_port *port)
{
TRACE("%p", port);
RETURN_VALUE("%d", port->transport);
}
-enum sp_return sp_get_port_usb_bus_address(const struct sp_port *port,
- int *usb_bus, int *usb_address)
+SP_API enum sp_return sp_get_port_usb_bus_address(const struct sp_port *port,
+ int *usb_bus,int *usb_address)
{
TRACE("%p", port);
RETURN_OK();
}
-enum sp_return sp_get_port_usb_vid_pid(const struct sp_port *port,
- int *usb_vid, int *usb_pid)
+SP_API enum sp_return sp_get_port_usb_vid_pid(const struct sp_port *port,
+ int *usb_vid, int *usb_pid)
{
TRACE("%p", port);
RETURN_OK();
}
-char *sp_get_port_usb_manufacturer(const struct sp_port *port)
+SP_API char *sp_get_port_usb_manufacturer(const struct sp_port *port)
{
TRACE("%p", port);
RETURN_VALUE("%s", port->usb_manufacturer);
}
-char *sp_get_port_usb_product(const struct sp_port *port)
+SP_API char *sp_get_port_usb_product(const struct sp_port *port)
{
TRACE("%p", port);
RETURN_VALUE("%s", port->usb_product);
}
-char *sp_get_port_usb_serial(const struct sp_port *port)
+SP_API char *sp_get_port_usb_serial(const struct sp_port *port)
{
TRACE("%p", port);
RETURN_VALUE("%s", port->usb_serial);
}
-char *sp_get_port_bluetooth_address(const struct sp_port *port)
+SP_API char *sp_get_port_bluetooth_address(const struct sp_port *port)
{
TRACE("%p", port);
RETURN_VALUE("%s", port->bluetooth_address);
}
-enum sp_return sp_get_port_handle(const struct sp_port *port, void *result_ptr)
+SP_API enum sp_return sp_get_port_handle(const struct sp_port *port,
+ void *result_ptr)
{
TRACE("%p, %p", port, result_ptr);
RETURN_OK();
}
-enum sp_return sp_copy_port(const struct sp_port *port, struct sp_port **copy_ptr)
+SP_API enum sp_return sp_copy_port(const struct sp_port *port,
+ struct sp_port **copy_ptr)
{
TRACE("%p, %p", port, copy_ptr);
RETURN_VALUE("%p", sp_get_port_by_name(port->name, copy_ptr));
}
-void sp_free_port(struct sp_port *port)
+SP_API void sp_free_port(struct sp_port *port)
{
TRACE("%p", port);
RETURN();
}
-struct sp_port **list_append(struct sp_port **list, const char *portname)
+SP_PRIV struct sp_port **list_append(struct sp_port **list,
+ const char *portname)
{
void *tmp;
unsigned int count;
return NULL;
}
-enum sp_return sp_list_ports(struct sp_port ***list_ptr)
+SP_API enum sp_return sp_list_ports(struct sp_port ***list_ptr)
{
struct sp_port **list;
int ret;
}
}
-void sp_free_port_list(struct sp_port **list)
+SP_API void sp_free_port_list(struct sp_port **list)
{
unsigned int i;
CHECK_PORT_HANDLE(); \
} while (0)
-enum sp_return sp_open(struct sp_port *port, enum sp_mode flags)
+SP_API enum sp_return sp_open(struct sp_port *port, enum sp_mode flags)
{
struct port_data data;
struct sp_port_config config;
RETURN_OK();
}
-enum sp_return sp_close(struct sp_port *port)
+SP_API enum sp_return sp_close(struct sp_port *port)
{
TRACE("%p", port);
RETURN_OK();
}
-enum sp_return sp_flush(struct sp_port *port, enum sp_buffer buffers)
+SP_API enum sp_return sp_flush(struct sp_port *port, enum sp_buffer buffers)
{
TRACE("%p, 0x%x", port, buffers);
RETURN_OK();
}
-enum sp_return sp_drain(struct sp_port *port)
+SP_API enum sp_return sp_drain(struct sp_port *port)
{
TRACE("%p", port);
#endif
}
-enum sp_return sp_blocking_write(struct sp_port *port, const void *buf, size_t count, unsigned int timeout)
+SP_API enum sp_return sp_blocking_write(struct sp_port *port, const void *buf,
+ size_t count, unsigned int timeout)
{
TRACE("%p, %p, %d, %d", port, buf, count, timeout);
#endif
}
-enum sp_return sp_nonblocking_write(struct sp_port *port, const void *buf, size_t count)
+SP_API enum sp_return sp_nonblocking_write(struct sp_port *port,
+ const void *buf, size_t count)
{
TRACE("%p, %p, %d", port, buf, count);
#endif
}
-enum sp_return sp_blocking_read(struct sp_port *port, void *buf, size_t count, unsigned int timeout)
+SP_API enum sp_return sp_blocking_read(struct sp_port *port, void *buf,
+ size_t count, unsigned int timeout)
{
TRACE("%p, %p, %d, %d", port, buf, count, timeout);
#endif
}
-enum sp_return sp_nonblocking_read(struct sp_port *port, void *buf, size_t count)
+SP_API enum sp_return sp_nonblocking_read(struct sp_port *port, void *buf,
+ size_t count)
{
TRACE("%p, %p, %d", port, buf, count);
#endif
}
-enum sp_return sp_input_waiting(struct sp_port *port)
+SP_API enum sp_return sp_input_waiting(struct sp_port *port)
{
TRACE("%p", port);
#endif
}
-enum sp_return sp_output_waiting(struct sp_port *port)
+SP_API enum sp_return sp_output_waiting(struct sp_port *port)
{
TRACE("%p", port);
#endif
}
-enum sp_return sp_new_event_set(struct sp_event_set **result_ptr)
+SP_API enum sp_return sp_new_event_set(struct sp_event_set **result_ptr)
{
struct sp_event_set *result;
RETURN_OK();
}
-enum sp_return sp_add_port_events(struct sp_event_set *event_set,
+SP_API enum sp_return sp_add_port_events(struct sp_event_set *event_set,
const struct sp_port *port, enum sp_event mask)
{
TRACE("%p, %p, %d", event_set, port, mask);
RETURN_OK();
}
-void sp_free_event_set(struct sp_event_set *event_set)
+SP_API void sp_free_event_set(struct sp_event_set *event_set)
{
TRACE("%p", event_set);
RETURN();
}
-enum sp_return sp_wait(struct sp_event_set *event_set, unsigned int timeout)
+SP_API enum sp_return sp_wait(struct sp_event_set *event_set,
+ unsigned int timeout)
{
TRACE("%p, %d", event_set, timeout);
RETURN_OK();
}
-enum sp_return sp_new_config(struct sp_port_config **config_ptr)
+SP_API enum sp_return sp_new_config(struct sp_port_config **config_ptr)
{
struct sp_port_config *config;
RETURN_OK();
}
-void sp_free_config(struct sp_port_config *config)
+SP_API void sp_free_config(struct sp_port_config *config)
{
TRACE("%p", config);
RETURN();
}
-enum sp_return sp_get_config(struct sp_port *port, struct sp_port_config *config)
+SP_API enum sp_return sp_get_config(struct sp_port *port,
+ struct sp_port_config *config)
{
struct port_data data;
RETURN_OK();
}
-enum sp_return sp_set_config(struct sp_port *port, const struct sp_port_config *config)
+SP_API enum sp_return sp_set_config(struct sp_port *port,
+ const struct sp_port_config *config)
{
struct port_data data;
struct sp_port_config prev_config;
}
#define CREATE_ACCESSORS(x, type) \
-enum sp_return sp_set_##x(struct sp_port *port, type x) { \
+SP_API enum sp_return sp_set_##x(struct sp_port *port, type x) { \
struct port_data data; \
struct sp_port_config config; \
TRACE("%p, %d", port, x); \
TRY(set_config(port, &data, &config)); \
RETURN_OK(); \
} \
-enum sp_return sp_get_config_##x(const struct sp_port_config *config, type *x) { \
+SP_API enum sp_return sp_get_config_##x(const struct sp_port_config *config, \
+ type *x) { \
TRACE("%p, %p", config, x); \
if (!config) \
RETURN_ERROR(SP_ERR_ARG, "Null config"); \
*x = config->x; \
RETURN_OK(); \
} \
-enum sp_return sp_set_config_##x(struct sp_port_config *config, type x) { \
+SP_API enum sp_return sp_set_config_##x(struct sp_port_config *config, \
+ type x) { \
TRACE("%p, %d", config, x); \
if (!config) \
RETURN_ERROR(SP_ERR_ARG, "Null config"); \
CREATE_ACCESSORS(dsr, enum sp_dsr)
CREATE_ACCESSORS(xon_xoff, enum sp_xonxoff)
-enum sp_return sp_set_config_flowcontrol(struct sp_port_config *config, enum sp_flowcontrol flowcontrol)
+SP_API enum sp_return sp_set_config_flowcontrol(struct sp_port_config *config,
+ enum sp_flowcontrol flowcontrol)
{
if (!config)
RETURN_ERROR(SP_ERR_ARG, "Null configuration");
RETURN_OK();
}
-enum sp_return sp_set_flowcontrol(struct sp_port *port, enum sp_flowcontrol flowcontrol)
+SP_API enum sp_return sp_set_flowcontrol(struct sp_port *port,
+ enum sp_flowcontrol flowcontrol)
{
struct port_data data;
struct sp_port_config config;
RETURN_OK();
}
-enum sp_return sp_get_signals(struct sp_port *port, enum sp_signal *signals)
+SP_API enum sp_return sp_get_signals(struct sp_port *port,
+ enum sp_signal *signals)
{
TRACE("%p, %p", port, signals);
RETURN_OK();
}
-enum sp_return sp_start_break(struct sp_port *port)
+SP_API enum sp_return sp_start_break(struct sp_port *port)
{
TRACE("%p", port);
RETURN_OK();
}
-enum sp_return sp_end_break(struct sp_port *port)
+SP_API enum sp_return sp_end_break(struct sp_port *port)
{
TRACE("%p", port);
RETURN_OK();
}
-int sp_last_error_code(void)
+SP_API int sp_last_error_code(void)
{
TRACE("");
#ifdef _WIN32
#endif
}
-char *sp_last_error_message(void)
+SP_API char *sp_last_error_message(void)
{
TRACE("");
#endif
}
-void sp_free_error_message(char *message)
+SP_API void sp_free_error_message(char *message)
{
TRACE("%s", message);
RETURN();
}
-void sp_set_debug_handler(void (*handler)(const char *format, ...))
+SP_API void sp_set_debug_handler(void (*handler)(const char *format, ...))
{
TRACE("%p", handler);
RETURN();
}
-void sp_default_debug_handler(const char *format, ...)
+SP_API void sp_default_debug_handler(const char *format, ...)
{
va_list args;
va_start(args, format);
va_end(args);
}
-int sp_get_major_package_version(void)
+SP_API int sp_get_major_package_version(void)
{
return SP_PACKAGE_VERSION_MAJOR;
}
-int sp_get_minor_package_version(void)
+SP_API int sp_get_minor_package_version(void)
{
return SP_PACKAGE_VERSION_MINOR;
}
-int sp_get_micro_package_version(void)
+SP_API int sp_get_micro_package_version(void)
{
return SP_PACKAGE_VERSION_MICRO;
}
-const char *sp_get_package_version_string(void)
+SP_API const char *sp_get_package_version_string(void)
{
return SP_PACKAGE_VERSION_STRING;
}
-int sp_get_current_lib_version(void)
+SP_API int sp_get_current_lib_version(void)
{
return SP_LIB_VERSION_CURRENT;
}
-int sp_get_revision_lib_version(void)
+SP_API int sp_get_revision_lib_version(void)
{
return SP_LIB_VERSION_REVISION;
}
-int sp_get_age_lib_version(void)
+SP_API int sp_get_age_lib_version(void)
{
return SP_LIB_VERSION_AGE;
}
-const char *sp_get_lib_version_string(void)
+SP_API const char *sp_get_lib_version_string(void)
{
return SP_LIB_VERSION_STRING;
}