X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=sigrokdecode.h.in;h=ca069c528a3403ac478354267e8ea6ae1cb32f74;hp=7a435bc867c9e388b2b178cfc5bba7b158dd75cd;hb=3bf689988fc1e8db9cb3997039b06f683c413fc1;hpb=14b42dad483c98b3dbf7b389e60b9cede1cd122f diff --git a/sigrokdecode.h.in b/sigrokdecode.h.in index 7a435bc..ca069c5 100644 --- a/sigrokdecode.h.in +++ b/sigrokdecode.h.in @@ -30,6 +30,22 @@ extern "C" { #endif +/** + * @file + * + * The public libsigrokdecode header file to be used by frontends. + * + * This is the only file that libsigrokdecode users (frontends) are supposed + * to use and include. There are other header files which get installed with + * libsigrokdecode, but those are not meant to be used directly by frontends. + * + * The correct way to get/use the libsigrokdecode API functions is: + * + * @code{.c} + * #include + * @endcode + */ + /* * Package version macros (can be used for conditional compilation). */ @@ -99,20 +115,31 @@ extern "C" { * Use SRD_API to mark public API symbols, and SRD_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 + * need SRD_PRIV. However, functions which are not static (because they need * to be used in other libsigrokdecode-internal files) but are also not * meant to be part of the public libsigrokdecode API, must use SRD_PRIV. * * This uses the 'visibility' feature of gcc (requires gcc >= 4.0). * + * This feature is not available on MinGW/Windows, as it is a feature of + * ELF files and MinGW/Windows uses PE files. + * * Details: http://gcc.gnu.org/wiki/Visibility */ /* Marks public libsigrokdecode API symbols. */ +#ifndef _WIN32 #define SRD_API __attribute__((visibility("default"))) +#else +#define SRD_API +#endif /* Marks private, non-public libsigrokdecode symbols (not part of the API). */ +#ifndef _WIN32 #define SRD_PRIV __attribute__((visibility("hidden"))) +#else +#define SRD_PRIV +#endif /* * When adding an output type, don't forget to... @@ -257,7 +284,7 @@ SRD_API int srd_pd_output_callback_add(int output_type, /*--- decoder.c -------------------------------------------------------------*/ -SRD_API GSList *srd_decoder_list(void); +SRD_API const GSList *srd_decoder_list(void); SRD_API struct srd_decoder *srd_decoder_get_by_id(const char *id); SRD_API int srd_decoder_load(const char *name); SRD_API int srd_decoder_unload(struct srd_decoder *dec); @@ -277,6 +304,18 @@ SRD_API int srd_log_callback_set_default(void); SRD_API int srd_log_logdomain_set(const char *logdomain); SRD_API char *srd_log_logdomain_get(void); +/*--- version.c -------------------------------------------------------------*/ + +SRD_API int srd_package_version_major_get(void); +SRD_API int srd_package_version_minor_get(void); +SRD_API int srd_package_version_micro_get(void); +SRD_API const char *srd_package_version_string_get(void); + +SRD_API int srd_lib_version_current_get(void); +SRD_API int srd_lib_version_revision_get(void); +SRD_API int srd_lib_version_age_get(void); +SRD_API const char *srd_lib_version_string_get(void); + #ifdef __cplusplus } #endif