sr: moved sigrok.h so libsigrok/libsigrok.h

All frontends will have to include <libsigrok/libsigrok.h> from now on.
This header includes proto.h and version.h, both installed from the
distribution into $INCLUDE/libsigrok/ as well.

The only dynamically changed header is now version.h, which has both
libsigrok and libtool compile-time versions in it.
This commit is contained in:
Bert Vermeulen 2012-07-05 00:55:07 +02:00
parent 8489264f1e
commit 45c59c8bdd
56 changed files with 156 additions and 130 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
sigrok.h
version.h
ChangeLog

View File

@ -46,8 +46,9 @@ libsigrok_la_LIBADD = \
libsigrok_la_LDFLAGS = $(SR_LIB_LDFLAGS)
include_HEADERS = sigrok.h sigrok-proto.h
noinst_HEADERS = sigrok-internal.h
library_includedir = $(includedir)/libsigrok
library_include_HEADERS = libsigrok.h proto.h version.h
noinst_HEADERS = libsigrok-internal.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libsigrok.pc

View File

@ -18,8 +18,8 @@
*/
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
/**
* Initialize libsigrok.

View File

@ -283,7 +283,7 @@ AC_SUBST(SR_PACKAGE_VERSION_MICRO)
AC_SUBST(SR_PACKAGE_VERSION)
AC_CONFIG_FILES([Makefile
sigrok.h
version.h
hardware/Makefile
hardware/alsa/Makefile
hardware/asix-sigma/Makefile

View File

@ -21,8 +21,8 @@
#include <stdint.h>
#include <string.h>
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
static gpointer new_chunk(struct sr_datastore **ds);

View File

@ -19,8 +19,8 @@
#include <stdio.h>
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
static GSList *devs = NULL;

View File

@ -20,8 +20,8 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
/**
* Remove unused probes from samples.

View File

@ -24,8 +24,8 @@
#include <unistd.h>
#include <string.h>
#include <alsa/asoundlib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#define NUM_PROBES 2
#define SAMPLE_WIDTH 16

View File

@ -27,8 +27,8 @@
#include <glib/gstdio.h>
#include <ftdi.h>
#include <string.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "asix-sigma.h"
#define USB_VENDOR 0xa600

View File

@ -21,8 +21,8 @@
#include <ftdi.h>
#include <glib.h>
#include <string.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "driver.h"
static GSList *dev_insts = NULL;

View File

@ -20,8 +20,8 @@
#include <ftdi.h>
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "driver.h"
/* Probes are numbered 0-7. */

View File

@ -24,8 +24,8 @@
#include <glib.h>
#include <ftdi.h>
#include <stdint.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#define USB_VENDOR_ID 0x0403
#define USB_PRODUCT_ID 0x6001

View File

@ -27,8 +27,8 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
SR_PRIV int ezusb_reset(struct libusb_device_handle *hdl, int set_clear)
{

View File

@ -30,8 +30,8 @@
#endif
#include <stdlib.h>
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
// FIXME: Must be moved, or rather passed as function argument.
#ifdef _WIN32

View File

@ -27,8 +27,8 @@
#include <fcntl.h>
#define pipe(fds) _pipe(fds, 4096, _O_BINARY)
#endif
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* TODO: Number of probes should be configurable. */
#define NUM_PROBES 8

View File

@ -21,8 +21,8 @@
#include "fx2lafw.h"
#include "command.h"
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
SR_PRIV int command_get_fw_version(libusb_device_handle *devhdl,
struct version_info *vi)

View File

@ -21,7 +21,7 @@
#define LIBSIGROK_HARDWARE_FX2LAFW_COMMAND_H
#include <glib.h>
#include "sigrok.h"
#include "libsigrok.h"
/* Protocol commands */
#define CMD_GET_FW_VERSION 0xb0

View File

@ -24,8 +24,8 @@
#include <inttypes.h>
#include <libusb.h>
#include "config.h"
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "fx2lafw.h"
#include "command.h"

View File

@ -22,8 +22,8 @@
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "genericdmm.h"

View File

@ -17,8 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "genericdmm.h"

View File

@ -29,8 +29,8 @@
#include <inttypes.h>
#include <glib.h>
#include <libusb.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "config.h"
#include "dso.h"

View File

@ -19,8 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "config.h"
#include "dso.h"
#include <string.h>

View File

@ -28,8 +28,8 @@
#include <glib.h>
#include <libudev.h>
#include <arpa/inet.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "link-mso19.h"
#define USB_VENDOR "3195"

View File

@ -21,8 +21,8 @@
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#define MIN_NUM_SAMPLES 1

View File

@ -38,8 +38,8 @@
#include <arpa/inet.h>
#endif
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "ols.h"
#ifdef _WIN32

View File

@ -32,7 +32,7 @@
#include <assert.h>
#include "analyzer.h"
#include "gl_usb.h"
#include "sigrok-internal.h"
#include "libsigrok-internal.h"
enum {
HARD_DATA_CHECK_SUM = 0x00,

View File

@ -33,7 +33,7 @@
#define LIBSIGROK_HARDWARE_ZEROPLUS_LOGIC_CUBE_ANALYZER_H
#include <libusb.h>
#include "sigrok.h"
#include "libsigrok.h"
#define STATUS_FLAG_NONE 0x00
#define STATUS_FLAG_RESET 0x01

View File

@ -31,8 +31,8 @@
#include <libusb.h>
#include <stdio.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "gl_usb.h"
#define CTRL_IN (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN | \

View File

@ -33,7 +33,7 @@
#define LIBSIGROK_HARDWARE_ZEROPLUS_LOGIC_CUBE_GL_USB_H
#include <libusb.h>
#include "sigrok.h"
#include "libsigrok.h"
SR_PRIV int gl_read_bulk(libusb_device_handle *devh, void *buffer,
unsigned int size);

View File

@ -25,8 +25,8 @@
#include <glib.h>
#include <libusb.h>
#include "config.h"
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "analyzer.h"
#define USB_VENDOR 0x0c12

View File

@ -23,8 +23,8 @@
#include <dirent.h>
#include <string.h>
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
/*
* This enumerates which driver capabilities correspond to user-settable

View File

@ -23,8 +23,8 @@
#include <fcntl.h>
#include <unistd.h>
#include <sys/time.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#define CHUNKSIZE (512 * 1024)
#define DEFAULT_NUM_PROBES 8

View File

@ -22,8 +22,8 @@
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#define NUM_PACKETS 2048
#define PACKET_SIZE 4096

View File

@ -17,8 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
extern SR_PRIV struct sr_input_format input_chronovu_la8;
extern SR_PRIV struct sr_input_format input_binary;

View File

@ -30,38 +30,6 @@
extern "C" {
#endif
/*
* Package version macros (can be used for conditional compilation).
*/
/** The libsigrok package 'major' version number. */
#define SR_PACKAGE_VERSION_MAJOR @SR_PACKAGE_VERSION_MAJOR@
/** The libsigrok package 'minor' version number. */
#define SR_PACKAGE_VERSION_MINOR @SR_PACKAGE_VERSION_MINOR@
/** The libsigrok package 'micro' version number. */
#define SR_PACKAGE_VERSION_MICRO @SR_PACKAGE_VERSION_MICRO@
/** The libsigrok package version ("major.minor.micro") as string. */
#define SR_PACKAGE_VERSION_STRING "@SR_PACKAGE_VERSION@"
/*
* Library/libtool version macros (can be used for conditional compilation).
*/
/** The libsigrok libtool 'current' version number. */
#define SR_LIB_VERSION_CURRENT @SR_LIB_VERSION_CURRENT@
/** The libsigrok libtool 'revision' version number. */
#define SR_LIB_VERSION_REVISION @SR_LIB_VERSION_REVISION@
/** The libsigrok libtool 'age' version number. */
#define SR_LIB_VERSION_AGE @SR_LIB_VERSION_AGE@
/** The libsigrok libtool version ("current:revision:age") as string. */
#define SR_LIB_VERSION_STRING "@SR_LIB_VERSION@"
/*
* Status/error codes returned by libsigrok functions.
*
@ -521,7 +489,8 @@ struct sr_session {
gboolean running;
};
#include "sigrok-proto.h"
#include "proto.h"
#include "version.h"
#ifdef __cplusplus
}

4
log.c
View File

@ -20,8 +20,8 @@
#include <stdarg.h>
#include <stdio.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* Currently selected libsigrok loglevel. Default: SR_LOG_WARN. */
static int sr_loglevel = SR_LOG_WARN; /* Show errors+warnings per default. */

View File

@ -21,8 +21,8 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
static int data(struct sr_output *o, const uint8_t *data_in,
uint64_t length_in, uint8_t **data_out, uint64_t *length_out)

View File

@ -21,8 +21,8 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
struct context {
unsigned int num_enabled_probes;

View File

@ -22,8 +22,8 @@
#include <string.h>
#include <glib.h>
#include "config.h"
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
struct context {
unsigned int num_enabled_probes;

View File

@ -21,8 +21,8 @@
#include <string.h>
#include <glib.h>
#include "config.h"
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
struct context {
unsigned int num_enabled_probes;

View File

@ -22,8 +22,8 @@
#include <string.h>
#include <glib.h>
#include "config.h"
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
struct context {
unsigned int num_enabled_probes;

View File

@ -28,8 +28,8 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
struct context {
GString *header;

View File

@ -17,8 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
extern SR_PRIV struct sr_output_format output_text_bits;
extern SR_PRIV struct sr_output_format output_text_hex;

View File

@ -21,8 +21,8 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "text.h"
SR_PRIV int init_ascii(struct sr_output *o)

View File

@ -21,8 +21,8 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "text.h"
SR_PRIV int init_bits(struct sr_output *o)

View File

@ -21,8 +21,8 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "text.h"
SR_PRIV int init_hex(struct sr_output *o)

View File

@ -23,8 +23,8 @@
#include <string.h>
#include <glib.h>
#include "config.h"
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "text.h"
SR_PRIV void flush_linebufs(struct context *ctx, uint8_t *outbuf)

View File

@ -23,8 +23,8 @@
#include <string.h>
#include <glib.h>
#include "config.h"
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
struct context {
int num_enabled_probes;

View File

@ -22,8 +22,8 @@
#include <unistd.h>
#include <string.h>
#include <glib.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* demo.c. TODO: Should not be global! */
extern SR_PRIV GIOChannel channels[2];

View File

@ -23,8 +23,8 @@
#include <unistd.h>
#include <sys/time.h>
#include <zip.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
/* size of payloads sent across the session bus */
#define CHUNKSIZE (512 * 1024)

View File

@ -24,8 +24,8 @@
#include <glib.h>
#include <glib/gstdio.h>
#include "config.h"
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
extern struct sr_session *session;
extern SR_PRIV struct sr_dev_driver session_driver;

View File

@ -21,8 +21,8 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "sigrok.h"
#include "sigrok-internal.h"
#include "libsigrok.h"
#include "libsigrok-internal.h"
/**
* Convert a numeric samplerate value to its "natural" string representation.

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "sigrok.h"
#include "libsigrok.h"
SR_API int sr_package_version_major_get(void)
{

56
version.h.in Normal file
View File

@ -0,0 +1,56 @@
/*
* This file is part of the sigrok project.
*
* Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef LIBSIGROK_VERSION_H
#define LIBSIGROK_VERSION_H
/*
* Package version macros (can be used for conditional compilation).
*/
/** The libsigrok package 'major' version number. */
#define SR_PACKAGE_VERSION_MAJOR @SR_PACKAGE_VERSION_MAJOR@
/** The libsigrok package 'minor' version number. */
#define SR_PACKAGE_VERSION_MINOR @SR_PACKAGE_VERSION_MINOR@
/** The libsigrok package 'micro' version number. */
#define SR_PACKAGE_VERSION_MICRO @SR_PACKAGE_VERSION_MICRO@
/** The libsigrok package version ("major.minor.micro") as string. */
#define SR_PACKAGE_VERSION_STRING "@SR_PACKAGE_VERSION@"
/*
* Library/libtool version macros (can be used for conditional compilation).
*/
/** The libsigrok libtool 'current' version number. */
#define SR_LIB_VERSION_CURRENT @SR_LIB_VERSION_CURRENT@
/** The libsigrok libtool 'revision' version number. */
#define SR_LIB_VERSION_REVISION @SR_LIB_VERSION_REVISION@
/** The libsigrok libtool 'age' version number. */
#define SR_LIB_VERSION_AGE @SR_LIB_VERSION_AGE@
/** The libsigrok libtool version ("current:revision:age") as string. */
#define SR_LIB_VERSION_STRING "@SR_LIB_VERSION@"
#endif