Tweak some comments and whitespace in utils.h

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369666 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2012-07-05 19:22:03 +00:00
parent 70e34d3354
commit 1906601bf4

View File

@@ -195,14 +195,12 @@ extern uint64_t __unsigned_int_flags_dummy64;
#define AST_FLAGS_ALL UINT_MAX #define AST_FLAGS_ALL UINT_MAX
/*! \brief Structure used to handle boolean flags /*! \brief Structure used to handle boolean flags */
*/
struct ast_flags { struct ast_flags {
unsigned int flags; unsigned int flags;
}; };
/*! \brief Structure used to handle a large number of boolean flags == used only in app_dial? /*! \brief Structure used to handle a large number of boolean flags == used only in app_dial? */
*/
struct ast_flags64 { struct ast_flags64 {
uint64_t flags; uint64_t flags;
}; };
@@ -358,14 +356,14 @@ int ast_utils_init(void);
int ast_wait_for_input(int fd, int ms); int ast_wait_for_input(int fd, int ms);
/*! /*!
\brief Try to write string, but wait no more than ms milliseconds * \brief Try to write string, but wait no more than ms milliseconds
before timing out. * before timing out.
*
\note If you are calling ast_carefulwrite, it is assumed that you are calling * \note If you are calling ast_carefulwrite, it is assumed that you are calling
it on a file descriptor that _DOES_ have NONBLOCK set. This way, * it on a file descriptor that _DOES_ have NONBLOCK set. This way,
there is only one system call made to do a write, unless we actually * there is only one system call made to do a write, unless we actually
have a need to wait. This way, we get better performance. * have a need to wait. This way, we get better performance.
*/ */
int ast_carefulwrite(int fd, char *s, int len, int timeoutms); int ast_carefulwrite(int fd, char *s, int len, int timeoutms);
/*! /*!
@@ -431,17 +429,17 @@ int ast_pthread_create_detached_stack(pthread_t *thread, pthread_attr_t *attr, v
/* End of thread management support */ /* End of thread management support */
/*! /*!
\brief Replace '^' in a string with ',' * \brief Replace '^' in a string with ','
\param s String within which to replace characters * \param s String within which to replace characters
*/ */
void ast_replace_subargument_delimiter(char *s); void ast_replace_subargument_delimiter(char *s);
/*! /*!
\brief Process a string to find and replace characters * \brief Process a string to find and replace characters
\param start The string to analyze * \param start The string to analyze
\param find The character to find * \param find The character to find
\param replace_with The character that will replace the one we are looking for * \param replace_with The character that will replace the one we are looking for
*/ */
char *ast_process_quotes_and_slashes(char *start, char find, char replace_with); char *ast_process_quotes_and_slashes(char *start, char find, char replace_with);
long int ast_random(void); long int ast_random(void);
@@ -650,12 +648,12 @@ int _ast_vasprintf(char **ret, const char *file, int lineno, const char *func, c
#if !defined(ast_strdupa) && defined(__GNUC__) #if !defined(ast_strdupa) && defined(__GNUC__)
/*! /*!
\brief duplicate a string in memory from the stack * \brief duplicate a string in memory from the stack
\param s The string to duplicate * \param s The string to duplicate
*
This macro will duplicate the given string. It returns a pointer to the stack * This macro will duplicate the given string. It returns a pointer to the stack
allocatted memory for the new string. * allocatted memory for the new string.
*/ */
#define ast_strdupa(s) \ #define ast_strdupa(s) \
(__extension__ \ (__extension__ \
({ \ ({ \
@@ -668,27 +666,27 @@ int _ast_vasprintf(char **ret, const char *file, int lineno, const char *func, c
#endif #endif
/*! /*!
\brief Disable PMTU discovery on a socket * \brief Disable PMTU discovery on a socket
\param sock The socket to manipulate * \param sock The socket to manipulate
\return Nothing * \return Nothing
*
On Linux, UDP sockets default to sending packets with the Dont Fragment (DF) * On Linux, UDP sockets default to sending packets with the Dont Fragment (DF)
bit set. This is supposedly done to allow the application to do PMTU * bit set. This is supposedly done to allow the application to do PMTU
discovery, but Asterisk does not do this. * discovery, but Asterisk does not do this.
*
Because of this, UDP packets sent by Asterisk that are larger than the MTU * Because of this, UDP packets sent by Asterisk that are larger than the MTU
of any hop in the path will be lost. This function can be called on a socket * of any hop in the path will be lost. This function can be called on a socket
to ensure that the DF bit will not be set. * to ensure that the DF bit will not be set.
*/ */
void ast_enable_packet_fragmentation(int sock); void ast_enable_packet_fragmentation(int sock);
/*! /*!
\brief Recursively create directory path * \brief Recursively create directory path
\param path The directory path to create * \param path The directory path to create
\param mode The permissions with which to try to create the directory * \param mode The permissions with which to try to create the directory
\return 0 on success or an error code otherwise * \return 0 on success or an error code otherwise
*
Creates a directory path, creating parent directories as needed. * Creates a directory path, creating parent directories as needed.
*/ */
int ast_mkdir(const char *path, int mode); int ast_mkdir(const char *path, int mode);
@@ -712,9 +710,9 @@ struct ast_http_digest {
}; };
/*! /*!
*\brief Parse digest authorization header. * \brief Parse digest authorization header.
*\return Returns -1 if we have no auth or something wrong with digest. * \return Returns -1 if we have no auth or something wrong with digest.
*\note This function may be used for Digest request and responce header. * \note This function may be used for Digest request and responce header.
* request arg is set to nonzero, if we parse Digest Request. * request arg is set to nonzero, if we parse Digest Request.
* pedantic arg can be set to nonzero if we need to do addition Digest check. * pedantic arg can be set to nonzero if we need to do addition Digest check.
*/ */
@@ -825,7 +823,7 @@ extern struct ast_eid ast_eid_default;
void ast_set_default_eid(struct ast_eid *eid); void ast_set_default_eid(struct ast_eid *eid);
/*! /*!
* /brief Convert an EID to a string * \brief Convert an EID to a string
* \since 1.6.1 * \since 1.6.1
*/ */
char *ast_eid_to_str(char *s, int maxlen, struct ast_eid *eid); char *ast_eid_to_str(char *s, int maxlen, struct ast_eid *eid);
@@ -856,7 +854,8 @@ int ast_eid_cmp(const struct ast_eid *eid1, const struct ast_eid *eid2);
*/ */
int ast_get_tid(void); int ast_get_tid(void);
/*!\brief Resolve a binary to a full pathname /*!
* \brief Resolve a binary to a full pathname
* \param binary Name of the executable to resolve * \param binary Name of the executable to resolve
* \param fullpath Buffer to hold the complete pathname * \param fullpath Buffer to hold the complete pathname
* \param fullpath_size Size of \a fullpath * \param fullpath_size Size of \a fullpath
@@ -865,7 +864,12 @@ int ast_get_tid(void);
*/ */
char *ast_utils_which(const char *binary, char *fullpath, size_t fullpath_size); char *ast_utils_which(const char *binary, char *fullpath, size_t fullpath_size);
/*! \brief Declare a variable that will call a destructor function when it goes out of scope /*!
* \brief Declare a variable that will call a destructor function when it goes out of scope.
*
* Resource Allocation Is Initialization (RAII) variable declaration.
*
* \since 11.0
* \param vartype The type of the variable * \param vartype The type of the variable
* \param varname The name of the variable * \param varname The name of the variable
* \param initval The initial value of the variable * \param initval The initial value of the variable
@@ -901,11 +905,8 @@ char *ast_utils_which(const char *binary, char *fullpath, size_t fullpath_size);
* return; * return;
* } * }
* do_stuff_with_thing(thing); * do_stuff_with_thing(thing);
* return;
* }
* } * }
* \encode * \encode
*
*/ */
#define RAII_VAR(vartype, varname, initval, dtor) \ #define RAII_VAR(vartype, varname, initval, dtor) \
auto void _dtor_ ## varname (vartype * v); \ auto void _dtor_ ## varname (vartype * v); \