mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Doxygen formatting changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
51
main/io.c
51
main/io.c
@@ -44,13 +44,13 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
#define DEBUG(a)
|
#define DEBUG(a)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*! \brief
|
||||||
* Kept for each file descriptor
|
* Kept for each file descriptor
|
||||||
*/
|
*/
|
||||||
struct io_rec {
|
struct io_rec {
|
||||||
ast_io_cb callback; /* What is to be called */
|
ast_io_cb callback; /*!< What is to be called */
|
||||||
void *data; /* Data to be passed */
|
void *data; /*!< Data to be passed */
|
||||||
int *id; /* ID number */
|
int *id; /*!< ID number */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* These two arrays are keyed with
|
/* These two arrays are keyed with
|
||||||
@@ -62,21 +62,15 @@ struct io_rec {
|
|||||||
|
|
||||||
#define GROW_SHRINK_SIZE 512
|
#define GROW_SHRINK_SIZE 512
|
||||||
|
|
||||||
/* Global variables are now in a struct in order to be
|
/*!<21>\brief Global IO variables are now in a struct in order to be
|
||||||
made threadsafe */
|
made threadsafe */
|
||||||
struct io_context {
|
struct io_context {
|
||||||
/* Poll structure */
|
struct pollfd *fds; /*!< Poll structure */
|
||||||
struct pollfd *fds;
|
struct io_rec *ior; /*!< Associated I/O records */
|
||||||
/* Associated I/O records */
|
unsigned int fdcnt; /*!< First available fd */
|
||||||
struct io_rec *ior;
|
unsigned int maxfdcnt; /*!< Maximum available fd */
|
||||||
/* First available fd */
|
int current_ioc; /*!< Currently used io callback */
|
||||||
unsigned int fdcnt;
|
int needshrink; /*!< Whether something has been deleted */
|
||||||
/* Maximum available fd */
|
|
||||||
unsigned int maxfdcnt;
|
|
||||||
/* Currently used io callback */
|
|
||||||
int current_ioc;
|
|
||||||
/* Whether something has been deleted */
|
|
||||||
int needshrink;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct io_context *io_context_create(void)
|
struct io_context *io_context_create(void)
|
||||||
@@ -112,12 +106,12 @@ void io_context_destroy(struct io_context *ioc)
|
|||||||
free(ioc);
|
free(ioc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! \brief
|
||||||
|
* Grow the size of our arrays.
|
||||||
|
* \return 0 on success or -1 on failure
|
||||||
|
*/
|
||||||
static int io_grow(struct io_context *ioc)
|
static int io_grow(struct io_context *ioc)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Grow the size of our arrays. Return 0 on success or
|
|
||||||
* -1 on failure
|
|
||||||
*/
|
|
||||||
void *tmp;
|
void *tmp;
|
||||||
DEBUG(ast_log(LOG_DEBUG, "io_grow()\n"));
|
DEBUG(ast_log(LOG_DEBUG, "io_grow()\n"));
|
||||||
ioc->maxfdcnt += GROW_SHRINK_SIZE;
|
ioc->maxfdcnt += GROW_SHRINK_SIZE;
|
||||||
@@ -146,13 +140,14 @@ static int io_grow(struct io_context *ioc)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int *ast_io_add(struct io_context *ioc, int fd, ast_io_cb callback, short events, void *data)
|
/*! \brief
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Add a new I/O entry for this file descriptor
|
* Add a new I/O entry for this file descriptor
|
||||||
* with the given event mask, to call callback with
|
* with the given event mask, to call callback with
|
||||||
* data as an argument. Returns NULL on failure.
|
* data as an argument.
|
||||||
|
* \return Returns NULL on failure.
|
||||||
*/
|
*/
|
||||||
|
int *ast_io_add(struct io_context *ioc, int fd, ast_io_cb callback, short events, void *data)
|
||||||
|
{
|
||||||
int *ret;
|
int *ret;
|
||||||
DEBUG(ast_log(LOG_DEBUG, "ast_io_add()\n"));
|
DEBUG(ast_log(LOG_DEBUG, "ast_io_add()\n"));
|
||||||
if (ioc->fdcnt >= ioc->maxfdcnt) {
|
if (ioc->fdcnt >= ioc->maxfdcnt) {
|
||||||
@@ -252,13 +247,13 @@ int ast_io_remove(struct io_context *ioc, int *_id)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ast_io_wait(struct io_context *ioc, int howlong)
|
/*! \brief
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Make the poll call, and call
|
* Make the poll call, and call
|
||||||
* the callbacks for anything that needs
|
* the callbacks for anything that needs
|
||||||
* to be handled
|
* to be handled
|
||||||
*/
|
*/
|
||||||
|
int ast_io_wait(struct io_context *ioc, int howlong)
|
||||||
|
{
|
||||||
int res;
|
int res;
|
||||||
int x;
|
int x;
|
||||||
int origcnt;
|
int origcnt;
|
||||||
|
Reference in New Issue
Block a user