Also, document the functions in version.c.
* Upon Python errors, return SRD_ERR_PYTHON. If the sigrok decoders
* directory cannot be accessed, return SRD_ERR_DECODERS_DIR.
* If not enough memory could be allocated, return SRD_ERR_MALLOC.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_init(const char *path)
{
* any successful srd_init() calls in between, is not allowed.
*
* @return SRD_OK upon success, a (negative) error code otherwise.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_exit(void)
{
* @return SRD_OK upon success, a (negative) error code otherwise.
*
* @private
+ *
+ * @since 0.1.0
*/
SRD_PRIV int srd_decoder_searchpath_add(const char *path)
{
* @param options A GHashTable of options to set.
*
* @return SRD_OK upon success, a (negative) error code otherwise.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_inst_option_set(struct srd_decoder_inst *di,
GHashTable *options)
* arranged in this order.
*
* @return SRD_OK upon success, a (negative) error code otherwise.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_inst_probe_set_all(struct srd_decoder_inst *di,
GHashTable *new_probes)
*
* @return Pointer to a newly allocated struct srd_decoder_inst, or
* NULL in case of failure.
+ *
+ * @since 0.1.0
*/
SRD_API struct srd_decoder_inst *srd_inst_new(const char *decoder_id,
GHashTable *options)
* @param di_to The instance on top of which di_from will be stacked.
*
* @return SRD_OK upon success, a (negative) error code otherwise.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_inst_stack(struct srd_decoder_inst *di_from,
struct srd_decoder_inst *di_to)
* @param inst_id The instance ID to be found.
*
* @return Pointer to struct srd_decoder_inst, or NULL if not found.
+ *
+ * @since 0.1.0
*/
SRD_API struct srd_decoder_inst *srd_inst_find_by_id(const char *inst_id)
{
* @return Pointer to struct srd_decoder_inst, or NULL if not found.
*
* @private
+ *
+ * @since 0.1.0
*/
SRD_PRIV struct srd_decoder_inst *srd_inst_find_by_obj(const GSList *stack,
const PyObject *obj)
* @return SRD_OK upon success, a (negative) error code otherwise.
*
* @private
+ *
+ * @since 0.1.0
*/
SRD_PRIV int srd_inst_decode(uint64_t start_samplenum,
const struct srd_decoder_inst *di, const uint8_t *inbuf,
* @param samplerate The samplerate of the incoming feed.
*
* @return SRD_OK upon success, a (negative) error code otherwise.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_session_start(int num_probes, int unitsize, uint64_t samplerate)
{
* @param inbuflen Length in bytes of the buffer.
*
* @return SRD_OK upon success, a (negative) error code otherwise.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_session_send(uint64_t start_samplenum, const uint8_t *inbuf,
uint64_t inbuflen)
* callback per output type can be registered.
* @param cb The function to call. Must not be NULL.
* @param cb_data Private data for the callback function. Can be NULL.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_pd_output_callback_add(int output_type,
srd_pd_output_callback_t cb, void *cb_data)
* This is a GSList containing the names of the decoders as strings.
*
* @return List of decoders, NULL if none are supported or loaded.
+ *
+ * @since 0.1.0 (but the API changed in 0.2.0)
*/
SRD_API const GSList *srd_decoder_list(void)
{
* @param id The ID string of the decoder to return.
*
* @return The decoder with the specified ID, or NULL if not found.
+ *
+ * @since 0.1.0
*/
SRD_API struct srd_decoder *srd_decoder_get_by_id(const char *id)
{
* @param module_name The module name to be loaded.
*
* @return SRD_OK upon success, a (negative) error code otherwise.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_decoder_load(const char *module_name)
{
*
* @return A newly allocated buffer containing the protocol decoder's
* documentation. The caller is responsible for free'ing the buffer.
+ *
+ * @since 0.1.0
*/
SRD_API char *srd_decoder_doc_get(const struct srd_decoder *dec)
{
* @param dec The struct srd_decoder to be unloaded.
*
* @return SRD_OK upon success, a (negative) error code otherwise.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_decoder_unload(struct srd_decoder *dec)
{
* Load all installed protocol decoders.
*
* @return SRD_OK upon success, a (negative) error code otherwise.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_decoder_load_all(void)
{
* Unload all loaded protocol decoders.
*
* @return SRD_OK upon success, a (negative) error code otherwise.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_decoder_unload_all(void)
{
* SRD_LOG_WARN, SRD_LOG_INFO, SRD_LOG_DBG, or SRD_LOG_SPEW).
*
* @return SRD_OK upon success, SRD_ERR_ARG upon invalid loglevel.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_log_loglevel_set(int loglevel)
{
* Get the libsigrokdecode loglevel.
*
* @return The currently configured libsigrokdecode loglevel.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_log_loglevel_get(void)
{
* the caller does not need to keep it around.
*
* @return SRD_OK upon success, SRD_ERR_ARG upon invalid logdomain.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_log_logdomain_set(const char *logdomain)
{
* @return A copy of the currently configured libsigrokdecode logdomain
* string. The caller is responsible for g_free()ing the string when
* it is no longer needed.
+ *
+ * @since 0.1.0
*/
SRD_API char *srd_log_logdomain_get(void)
{
* pass any data.
*
* @return SRD_OK upon success, SRD_ERR_ARG upon invalid arguments.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_log_callback_set(srd_log_callback_t cb, void *cb_data)
{
* Additionally, the internal 'srd_log_callback_data' pointer is set to NULL.
*
* @return SRD_OK upon success, a (negative) error code otherwise.
+ *
+ * @since 0.1.0
*/
SRD_API int srd_log_callback_set_default(void)
{
/*
* This file is part of the libsigrokdecode project.
*
- * Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
+ * Copyright (C) 2012-2013 Uwe Hermann <uwe@hermann-uwe.de>
*
* 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
/**
* @file
*
- * Version number querying functions.
+ * Version number querying functions, definitions, and macros.
*/
/**
* @defgroup grp_versions Versions
*
- * Version number querying functions.
+ * Version number querying functions, definitions, and macros.
+ *
+ * This set of API calls returns two different version numbers related
+ * to libsigrokdecode. The "package version" is the release version number
+ * of the libsigrokdecode tarball in the usual "major.minor.micro" format,
+ * e.g. "0.1.0".
+ *
+ * The "library version" is independent of that; it is the libtool version
+ * number in the "current:revision:age" format, e.g. "2:0:0".
+ * See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning for details.
+ *
+ * Both version numbers (and/or individual components of them) can be
+ * retrieved via the API calls at runtime, and/or they can be checked at
+ * compile/preprocessor time using the respective macros.
*
* @{
*/
+/**
+ * Get the major libsigrokdecode package version number.
+ *
+ * @return The major package version number.
+ *
+ * @since 0.1.0
+ */
SRD_API int srd_package_version_major_get(void)
{
return SRD_PACKAGE_VERSION_MAJOR;
}
+/**
+ * Get the minor libsigrokdecode package version number.
+ *
+ * @return The minor package version number.
+ *
+ * @since 0.1.0
+ */
SRD_API int srd_package_version_minor_get(void)
{
return SRD_PACKAGE_VERSION_MINOR;
}
+/**
+ * Get the micro libsigrokdecode package version number.
+ *
+ * @return The micro package version number.
+ *
+ * @since 0.1.0
+ */
SRD_API int srd_package_version_micro_get(void)
{
return SRD_PACKAGE_VERSION_MICRO;
}
+/**
+ * Get the libsigrokdecode package version number as a string.
+ *
+ * @return The package version number string. The returned string is
+ * static and thus should NOT be free'd by the caller.
+ *
+ * @since 0.1.0
+ */
SRD_API const char *srd_package_version_string_get(void)
{
return SRD_PACKAGE_VERSION_STRING;
}
+/**
+ * Get the "current" part of the libsigrokdecode library version number.
+ *
+ * @return The "current" library version number.
+ *
+ * @since 0.1.0
+ */
SRD_API int srd_lib_version_current_get(void)
{
return SRD_LIB_VERSION_CURRENT;
}
+/**
+ * Get the "revision" part of the libsigrokdecode library version number.
+ *
+ * @return The "revision" library version number.
+ *
+ * @since 0.1.0
+ */
SRD_API int srd_lib_version_revision_get(void)
{
return SRD_LIB_VERSION_REVISION;
}
+/**
+ * Get the "age" part of the libsigrokdecode library version number.
+ *
+ * @return The "age" library version number.
+ *
+ * @since 0.1.0
+ */
SRD_API int srd_lib_version_age_get(void)
{
return SRD_LIB_VERSION_AGE;
}
+/**
+ * Get the libsigrokdecode library version number as a string.
+ *
+ * @return The library version number string. The returned string is
+ * static and thus should NOT be free'd by the caller.
+ *
+ * @since 0.1.0
+ */
SRD_API const char *srd_lib_version_string_get(void)
{
return SRD_LIB_VERSION_STRING;