From: Uwe Hermann Date: Sat, 15 Jan 2011 14:06:58 +0000 (+0100) Subject: Start moving private stuff to sigrok-internal.h. X-Git-Tag: libsigrok-0.1.0~432 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=1483577eed7ac27b8107b1b76e1adc5369745c29 Start moving private stuff to sigrok-internal.h. This is work-in-progress, unfinished. --- diff --git a/Makefile.am b/Makefile.am index 4d532e0c..94672f33 100644 --- a/Makefile.am +++ b/Makefile.am @@ -39,6 +39,7 @@ libsigrok_la_LIBADD = \ output/libsigrokoutput.la include_HEADERS = sigrok.h sigrok-proto.h +noinst_HEADERS = sigrok-internal.h pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libsigrok.pc diff --git a/hardware/common/serial.c b/hardware/common/serial.c index 853c26af..46d4ad05 100644 --- a/hardware/common/serial.c +++ b/hardware/common/serial.c @@ -31,13 +31,14 @@ #include #include #include +#include // FIXME: Must be moved, or rather passed as function argument. #ifdef _WIN32 HANDLE hdl; #endif -char *serial_port_glob[] = { +const char *serial_port_glob[] = { /* Linux */ "/dev/ttyS*", "/dev/ttyUSB*", diff --git a/hardware/link-mso19/link-mso19.c b/hardware/link-mso19/link-mso19.c index 16176ffa..05729556 100644 --- a/hardware/link-mso19/link-mso19.c +++ b/hardware/link-mso19/link-mso19.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "config.h" #include "link-mso19.h" diff --git a/hardware/openbench-logic-sniffer/ols.c b/hardware/openbench-logic-sniffer/ols.c index 3d69dc97..582a258c 100644 --- a/hardware/openbench-logic-sniffer/ols.c +++ b/hardware/openbench-logic-sniffer/ols.c @@ -37,6 +37,7 @@ #endif #include #include +#include #ifdef _WIN32 #define O_NONBLOCK FIONBIO diff --git a/sigrok-internal.h b/sigrok-internal.h new file mode 100644 index 00000000..e8b6fc13 --- /dev/null +++ b/sigrok-internal.h @@ -0,0 +1,34 @@ +/* + * This file is part of the sigrok project. + * + * Copyright (C) 2011 Bert Vermeulen + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef SIGROK_SIGROK_INTERNAL_H +#define SIGROK_SIGROK_INTERNAL_H + +GSList *list_serial_ports(void); +int serial_open(const char *pathname, int flags); +int serial_close(int fd); +int serial_flush(int fd); +int serial_write(int fd, const void *buf, size_t count); +int serial_read(int fd, void *buf, size_t count); +void *serial_backup_params(int fd); +void serial_restore_params(int fd, void *backup); +int serial_set_params(int fd, int speed, int bits, int parity, int stopbits, + int flowcontrol); + +#endif diff --git a/sigrok-proto.h b/sigrok-proto.h index 37d867ed..baa6ea12 100644 --- a/sigrok-proto.h +++ b/sigrok-proto.h @@ -117,17 +117,6 @@ int ezusb_install_firmware(libusb_device_handle *hdl, char *filename); int ezusb_upload_firmware(libusb_device *dev, int configuration, const char *filename); -GSList *list_serial_ports(void); -int serial_open(const char *pathname, int flags); -int serial_close(int fd); -int serial_flush(int fd); -int serial_write(int fd, const void *buf, size_t count); -int serial_read(int fd, void *buf, size_t count); -void *serial_backup_params(int fd); -void serial_restore_params(int fd, void *backup); -int serial_set_params(int fd, int speed, int bits, int parity, int stopbits, - int flowcontrol); - /* libsigrok/hardware/common/misc.c */ /* TODO: Should not be public. */ int opendev2(int device_index, struct sigrok_device_instance **sdi,