aboutsummaryrefslogtreecommitdiffstats
path: root/utils.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-23 23:07:55 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-23 23:07:55 +0000
commit53c06ed2e84df9fa7d95038b341364de90a49524 (patch)
tree5addf8bd3b48b6a76a8a34d414b817c568d535ee /utils.c
parenta6f4e0fac75333eb32e4b471dabd388de02c33ad (diff)
make inlinable functions only need the function body in one file, and respond properly to LOW_MEMORY being defined
make ast_copy_string inlinable, and ast_tvdiff_ms LOW_MEMORY aware git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5992 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils.c')
-rwxr-xr-xutils.c57
1 files changed, 3 insertions, 54 deletions
diff --git a/utils.c b/utils.c
index d8bd34f21..d0ee57d82 100755
--- a/utils.c
+++ b/utils.c
@@ -29,56 +29,16 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/lock.h"
-#include "asterisk/utils.h"
#include "asterisk/io.h"
#include "asterisk/logger.h"
#include "asterisk/md5.h"
+#define AST_API_MODULE /* ensure that inlinable API functions will be built in this module if required */
+#include "asterisk/utils.h"
+
static char base64[64];
static char b2a[256];
-#ifdef LOW_MEMORY
-char *ast_skip_blanks(char *str)
-{
- while (*str && *str < 33)
- str++;
- return str;
-}
-
-char *ast_trim_blanks(char *str)
-{
- char *work = str;
-
- if (work) {
- work += strlen(work) - 1;
- /* It's tempting to only want to erase after we exit this loop,
- but since ast_trim_blanks *could* receive a constant string
- (which we presumably wouldn't have to touch), we shouldn't
- actually set anything unless we must, and it's easier just
- to set each position to \0 than to keep track of a variable
- for it */
- while ((work >= str) && *work < 33)
- *(work--) = '\0';
- }
- return str;
-}
-
-char *ast_skip_nonblanks(char *str)
-{
- while (*str && *str > 32)
- str++;
- return str;
-}
-
-char *ast_strip(char *s)
-{
- s = ast_skip_blanks(s);
- if (s)
- ast_trim_blanks(s);
- return s;
-}
-#endif
-
char *ast_strip_quoted(char *s, const char *beg_quotes, const char *end_quotes)
{
char *e;
@@ -473,17 +433,6 @@ int ast_wait_for_input(int fd, int ms)
return poll(pfd, 1, ms);
}
-void ast_copy_string(char *dst, const char *src, size_t size)
-{
- while (*src && size) {
- *dst++ = *src++;
- size--;
- }
- if (__builtin_expect(!size, 0))
- dst--;
- *dst = '\0';
-}
-
int ast_build_string(char **buffer, size_t *space, const char *fmt, ...)
{
va_list ap;