X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=sigrok.h.in;h=5e42011cc81dd3c7368e7604d4acab8e9c7a6714;hb=cd853ff0b2b0ad2643d65e73159661e1a3c6bc66;hp=401e94fbeec2c7e0a4f2b428732f2fce069ac316;hpb=69890f7399f086c38670961dc72166f00de89af6;p=libsigrok.git diff --git a/sigrok.h.in b/sigrok.h.in index 401e94fb..5e42011c 100644 --- a/sigrok.h.in +++ b/sigrok.h.in @@ -1,7 +1,7 @@ /* * This file is part of the sigrok project. * - * Copyright (C) 2010 Bert Vermeulen + * Copyright (C) 2012 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 @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#ifndef SIGROK_SIGROK_H -#define SIGROK_SIGROK_H +#ifndef LIBSIGROK_SIGROK_H +#define LIBSIGROK_SIGROK_H #include #include @@ -66,12 +66,31 @@ extern "C" { #define SR_HZ_TO_NS(n) (1000000000 / (n)) /* libsigrok loglevels. */ -#define SR_LOG_NONE 0 -#define SR_LOG_ERR 1 -#define SR_LOG_WARN 2 -#define SR_LOG_INFO 3 -#define SR_LOG_DBG 4 -#define SR_LOG_SPEW 5 +#define SR_LOG_NONE 0 /**< Output no messages at all. */ +#define SR_LOG_ERR 1 /**< Output error messages. */ +#define SR_LOG_WARN 2 /**< Output warnings. */ +#define SR_LOG_INFO 3 /**< Output informational messages. */ +#define SR_LOG_DBG 4 /**< Output debug messages. */ +#define SR_LOG_SPEW 5 /**< Output very noisy debug messages. */ + +/* + * Use SR_API to mark public API symbols, and SR_PRIV for private symbols. + * + * Variables and functions marked 'static' are private already and don't + * need SR_PRIV. However, functions which are not static (because they need + * to be used in other libsigrok-internal files) but are also not meant to + * be part of the public libsigrok API, must use SR_PRIV. + * + * This uses the 'visibility' feature of gcc (requires gcc >= 4.0). + * + * Details: http://gcc.gnu.org/wiki/Visibility + */ + +/* Marks public libsigrok API symbols. */ +#define SR_API __attribute__((visibility("default"))) + +/* Marks private, non-public libsigrok symbols (not part of the API). */ +#define SR_PRIV __attribute__((visibility("hidden"))) typedef int (*sr_receive_data_callback) (int fd, int revents, void *user_data); @@ -88,16 +107,11 @@ enum { SR_DF_END, SR_DF_TRIGGER, SR_DF_LOGIC, - SR_DF_ANALOG, SR_DF_PD, }; struct sr_datafeed_packet { uint16_t type; - /* timeoffset since start, in picoseconds */ - uint64_t timeoffset; - /* duration of data in this packet, in picoseconds */ - uint64_t duration; void *payload; }; @@ -105,7 +119,6 @@ struct sr_datafeed_header { int feed_version; struct timeval starttime; uint64_t samplerate; - int num_analog_probes; int num_logic_probes; }; @@ -173,7 +186,6 @@ struct sr_device { enum { SR_PROBE_TYPE_LOGIC, - SR_PROBE_TYPE_ANALOG, }; struct sr_probe {