*
*/
-#include "asterisk/autoconfig.h"
+#include "asterisk/compat.h"
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
#include <errno.h>
#include <time.h>
#include <sys/stat.h>
#include "asterisk/inline_api.h"
-#include "asterisk/compat.h"
-#include "asterisk/compiler.h"
#include "asterisk/endian.h"
#include "asterisk/ast_expr.h"
#include "asterisk/ael_structs.h"
/* Asterisk REQUIRES recursive (not error checking) mutexes
and will not run without them. */
-#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) && defined(PTHREAD_MUTEX_RECURSIVE_NP)
#define PTHREAD_MUTEX_INIT_VALUE PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
#define AST_MUTEX_KIND PTHREAD_MUTEX_RECURSIVE_NP
#else
#define ast_channel_trylock(x) ast_mutex_trylock(&x->lock)
#else
-struct ast_channel;
-
/*! \brief Lock AST channel (and print debugging output)
\note You need to enable DEBUG_CHANNEL_LOCKS for this function */
int ast_channel_lock(struct ast_channel *chan);
if (use_local_dir)
snprintf(fn, sizeof(fn), "./%s", filename);
else
- snprintf(fn, sizeof(fn), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, filename);
+ snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, filename);
}
if (withcomments && cfg && cfg->include_level < 2 ) {
char *vars, *vare;
int pos, brackets, needsub, len;
+ *cp2 = 0; /* just in case there's nothing to do */
whereweare=tmp=cp1;
while (!ast_strlen_zero(whereweare) && count) {
/* Assume we're copying the whole remaining string */
count -= pos;
cp2 += pos;
whereweare += pos;
+ *cp2 = 0;
}
if (nextvar) {
memcpy(cp2, cp4, length);
count -= length;
cp2 += length;
+ *cp2 = 0;
}
} else if (nextexp) {
/* We have an expression. Find the start and end, and determine
ast_log(LOG_DEBUG, "Expression result is '%s'\n", cp2);
count -= length;
cp2 += length;
+ *cp2 = 0;
}
} else
break;