aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-02 02:33:04 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-02 02:33:04 +0000
commit748f3cf4565a694398bca176faa409e0320c8a68 (patch)
treeee050a5776fcef01d006a9c4e447f3240686014f /include
parent927870cd7d4ae9cda8f269d1ca36373704999a8c (diff)
Add attributes to various API calls, to help track down bugs (and remove a deprecated function)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115157 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/config.h12
-rw-r--r--include/asterisk/logger.h4
-rw-r--r--include/asterisk/sched.h13
3 files changed, 14 insertions, 15 deletions
diff --git a/include/asterisk/config.h b/include/asterisk/config.h
index da88e21a8..0129af456 100644
--- a/include/asterisk/config.h
+++ b/include/asterisk/config.h
@@ -182,8 +182,8 @@ int ast_category_exist(const struct ast_config *config, const char *category_nam
* that unlike the variables in ast_config, the resulting list of variables
* MUST be freed with ast_variables_destroy() as there is no container.
*/
-struct ast_variable *ast_load_realtime(const char *family, ...);
-struct ast_variable *ast_load_realtime_all(const char *family, ...);
+struct ast_variable *ast_load_realtime(const char *family, ...) __attribute__((sentinel));
+struct ast_variable *ast_load_realtime_all(const char *family, ...) __attribute__((sentinel));
/*!
* \brief Retrieve realtime configuration
@@ -194,7 +194,7 @@ struct ast_variable *ast_load_realtime_all(const char *family, ...);
* is thus stored inside a taditional ast_config structure rather than
* just returning a linked list of variables.
*/
-struct ast_config *ast_load_realtime_multientry(const char *family, ...);
+struct ast_config *ast_load_realtime_multientry(const char *family, ...) __attribute__((sentinel));
/*!
* \brief Update realtime configuration
@@ -204,7 +204,7 @@ struct ast_config *ast_load_realtime_multientry(const char *family, ...);
* This function is used to update a parameter in realtime configuration space.
*
*/
-int ast_update_realtime(const char *family, const char *keyfield, const char *lookup, ...);
+int ast_update_realtime(const char *family, const char *keyfield, const char *lookup, ...) __attribute__((sentinel));
/*!
* \brief Create realtime configuration
@@ -212,7 +212,7 @@ int ast_update_realtime(const char *family, const char *keyfield, const char *lo
* This function is used to create a parameter in realtime configuration space.
*
*/
-int ast_store_realtime(const char *family, ...);
+int ast_store_realtime(const char *family, ...) __attribute__((sentinel));
/*!
* \brief Destroy realtime configuration
@@ -223,7 +223,7 @@ int ast_store_realtime(const char *family, ...);
* Additional params are used as keys.
*
*/
-int ast_destroy_realtime(const char *family, const char *keyfield, const char *lookup, ...);
+int ast_destroy_realtime(const char *family, const char *keyfield, const char *lookup, ...) __attribute__((sentinel));
/*!
* \brief Check if realtime engine is configured for family
diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h
index 6a8f24d56..9ed2dc922 100644
--- a/include/asterisk/logger.h
+++ b/include/asterisk/logger.h
@@ -81,8 +81,8 @@ void ast_verbose(const char *fmt, ...)
void ast_child_verbose(int level, const char *fmt, ...)
__attribute__ ((format (printf, 2, 3)));
-int ast_register_verbose(void (*verboser)(const char *string));
-int ast_unregister_verbose(void (*verboser)(const char *string));
+int ast_register_verbose(void (*verboser)(const char *string)) __attribute__((warn_unused_result));
+int ast_unregister_verbose(void (*verboser)(const char *string)) __attribute__((warn_unused_result));
void ast_console_puts(const char *string);
diff --git a/include/asterisk/sched.h b/include/asterisk/sched.h
index 21a1740c3..ed855d562 100644
--- a/include/asterisk/sched.h
+++ b/include/asterisk/sched.h
@@ -155,7 +155,7 @@ char *ast_sched_report(struct sched_context *con, char *buf, int bufsiz, struct
* \param data data to pass to the callback
* \return Returns a schedule item ID on success, -1 on failure
*/
-int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callback, const void *data);
+int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callback, const void *data) __attribute__((warn_unused_result));
/*!
* \brief replace a scheduler entry
@@ -168,7 +168,7 @@ int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callback, co
* \retval -1 failure
* \retval otherwise, returns scheduled item ID
*/
-int ast_sched_replace(int old_id, struct sched_context *con, int when, ast_sched_cb callback, const void *data);
+int ast_sched_replace(int old_id, struct sched_context *con, int when, ast_sched_cb callback, const void *data) __attribute__((warn_unused_result));
/*!Adds a scheduled event with rescheduling support
* \param con Scheduler context to add
@@ -183,7 +183,7 @@ int ast_sched_replace(int old_id, struct sched_context *con, int when, ast_sched
* If callback returns 0, no further events will be re-scheduled
* \return Returns a schedule item ID on success, -1 on failure
*/
-int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb callback, const void *data, int variable);
+int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb callback, const void *data, int variable) __attribute__((warn_unused_result));
/*!
* \brief replace a scheduler entry
@@ -196,7 +196,7 @@ int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb cal
* \retval -1 failure
* \retval otherwise, returns scheduled item ID
*/
-int ast_sched_replace_variable(int old_id, struct sched_context *con, int when, ast_sched_cb callback, const void *data, int variable);
+int ast_sched_replace_variable(int old_id, struct sched_context *con, int when, ast_sched_cb callback, const void *data, int variable) __attribute__((warn_unused_result));
/*! \brief Find a sched structure and return the data field associated with it.
@@ -216,8 +216,7 @@ const void *ast_sched_find_data(struct sched_context *con, int id);
* \param id ID of the scheduled item to delete
* \return Returns 0 on success, -1 on failure
*/
-
-int ast_sched_del(struct sched_context *con, int id);
+int ast_sched_del(struct sched_context *con, int id) __attribute__((warn_unused_result));
/*! \brief Determines number of seconds until the next outstanding event to take place
* Determine the number of seconds until the next outstanding event
@@ -228,7 +227,7 @@ int ast_sched_del(struct sched_context *con, int id);
* \return Returns "-1" if there is nothing there are no scheduled events
* (and thus the poll should not timeout)
*/
-int ast_sched_wait(struct sched_context *con);
+int ast_sched_wait(struct sched_context *con) __attribute__((warn_unused_result));
/*! \brief Runs the queue
* \param con Scheduling context to run