From: Bert Vermeulen Date: Mon, 18 Nov 2013 00:14:02 +0000 (+0100) Subject: Clean up prototypes X-Git-Tag: libsigrokdecode-0.3.0~225 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=909fbf4181ab401a371265567505ffa1403f73d6;p=libsigrokdecode.git Clean up prototypes --- diff --git a/libsigrokdecode-internal.h b/libsigrokdecode-internal.h index b067a25..8fd9e52 100644 --- a/libsigrokdecode-internal.h +++ b/libsigrokdecode-internal.h @@ -34,9 +34,16 @@ struct srd_session { GSList *callbacks; }; -/*--- controller.c ----------------------------------------------------------*/ +/* srd.c */ SRD_PRIV int srd_decoder_searchpath_add(const char *path); + +/* session.c */ +SRD_PRIV int session_is_valid(struct srd_session *sess); +SRD_PRIV struct srd_pd_callback *srd_pd_output_callback_find(struct srd_session *sess, + int output_type); + +/* instance.c */ SRD_PRIV struct srd_decoder_inst *srd_inst_find_by_obj( const GSList *stack, const PyObject *obj); SRD_PRIV int srd_inst_start(struct srd_decoder_inst *di); @@ -45,18 +52,8 @@ SRD_PRIV int srd_inst_decode(const struct srd_decoder_inst *di, const uint8_t *inbuf, uint64_t inbuflen); SRD_PRIV void srd_inst_free(struct srd_decoder_inst *di); SRD_PRIV void srd_inst_free_all(struct srd_session *sess, GSList *stack); -SRD_PRIV struct srd_pd_callback *srd_pd_output_callback_find(struct srd_session *sess, - int output_type); - -/*--- session.c -------------------------------------------------------------*/ -SRD_PRIV int session_is_valid(struct srd_session *sess); - -/*--- exception.c -----------------------------------------------------------*/ - -SRD_PRIV void srd_exception_catch(const char *format, ...); - -/*--- log.c -----------------------------------------------------------------*/ +/* log.c */ SRD_PRIV int srd_log(int loglevel, const char *format, ...); SRD_PRIV int srd_spew(const char *format, ...); SRD_PRIV int srd_dbg(const char *format, ...); @@ -64,13 +61,15 @@ SRD_PRIV int srd_info(const char *format, ...); SRD_PRIV int srd_warn(const char *format, ...); SRD_PRIV int srd_err(const char *format, ...); -/*--- util.c ----------------------------------------------------------------*/ - +/* util.c */ SRD_PRIV int py_attr_as_str(const PyObject *py_obj, const char *attr, - char **outstr); + char **outstr); SRD_PRIV int py_dictitem_as_str(const PyObject *py_obj, const char *key, - char **outstr); + char **outstr); SRD_PRIV int py_str_as_str(const PyObject *py_str, char **outstr); SRD_PRIV int py_strlist_to_char(const PyObject *py_strlist, char ***outstr); +/* exception.c */ +SRD_PRIV void srd_exception_catch(const char *format, ...); + #endif diff --git a/libsigrokdecode.h b/libsigrokdecode.h index 032d944..3a72d2c 100644 --- a/libsigrokdecode.h +++ b/libsigrokdecode.h @@ -271,20 +271,12 @@ typedef struct { PyObject *sample; } srd_logic; -/*--- controller.c ----------------------------------------------------------*/ +/* srd.c */ SRD_API int srd_init(const char *path); SRD_API int srd_exit(void); -SRD_API int srd_inst_option_set(struct srd_decoder_inst *di, - GHashTable *options); -SRD_API int srd_inst_probe_set_all(struct srd_decoder_inst *di, - GHashTable *probes); -SRD_API struct srd_decoder_inst *srd_inst_new(struct srd_session *sess, - const char *id, GHashTable *options); -SRD_API int srd_inst_stack(struct srd_session *sess, - struct srd_decoder_inst *di_from, struct srd_decoder_inst *di_to); -SRD_API struct srd_decoder_inst *srd_inst_find_by_id(struct srd_session *sess, - const char *inst_id); + +/* session.c */ SRD_API int srd_session_new(struct srd_session **sess); SRD_API int srd_session_start(struct srd_session *sess); SRD_API int srd_session_metadata_set(struct srd_session *sess, int key, @@ -296,21 +288,30 @@ SRD_API int srd_session_destroy(struct srd_session *sess); SRD_API int srd_pd_output_callback_add(struct srd_session *sess, int output_type, srd_pd_output_callback_t cb, void *cb_data); -/*--- decoder.c -------------------------------------------------------------*/ - +/* decoder.c */ 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 char *srd_decoder_doc_get(const struct srd_decoder *dec); SRD_API int srd_decoder_unload(struct srd_decoder *dec); SRD_API int srd_decoder_load_all(void); SRD_API int srd_decoder_unload_all(void); -SRD_API char *srd_decoder_doc_get(const struct srd_decoder *dec); -/*--- log.c -----------------------------------------------------------------*/ +/* instance.c */ +SRD_API int srd_inst_option_set(struct srd_decoder_inst *di, + GHashTable *options); +SRD_API int srd_inst_probe_set_all(struct srd_decoder_inst *di, + GHashTable *probes); +SRD_API struct srd_decoder_inst *srd_inst_new(struct srd_session *sess, + const char *id, GHashTable *options); +SRD_API int srd_inst_stack(struct srd_session *sess, + struct srd_decoder_inst *di_from, struct srd_decoder_inst *di_to); +SRD_API struct srd_decoder_inst *srd_inst_find_by_id(struct srd_session *sess, + const char *inst_id); +/* log.c */ typedef int (*srd_log_callback_t)(void *cb_data, int loglevel, const char *format, va_list args); - SRD_API int srd_log_loglevel_set(int loglevel); SRD_API int srd_log_loglevel_get(void); SRD_API int srd_log_callback_set(srd_log_callback_t cb, void *cb_data); @@ -318,23 +319,20 @@ 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 -------------------------------------------------------------*/ +/* error.c */ +SRD_API const char *srd_strerror(int error_code); +SRD_API const char *srd_strerror_name(int error_code); +/* 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); -/*--- error.c ---------------------------------------------------------------*/ - -SRD_API const char *srd_strerror(int error_code); -SRD_API const char *srd_strerror_name(int error_code); - #include "version.h" #ifdef __cplusplus