78 char *s, *varname=NULL, *file=NULL, *length=NULL, *returnvar=NULL;
80 static int deprecation_warning = 0;
93 if (deprecation_warning++ % 10 == 0)
94 ast_log(
LOG_WARNING,
"ReadFile has been deprecated in favor of Set(%s=${FILE(%s,0,%s)})\n", varname, file, length);
96 if (!varname || !file) {
102 if ((sscanf(length,
"%30d", &len) != 1) || (len < 0)) {
103 ast_log(
LOG_WARNING,
"%s is not a positive number, defaulting length to max\n", length);
110 if (len < strlen(returnvar))
113 ast_log(
LOG_WARNING,
"%s is longer than %d, and %d \n", file, len, (
int)strlen(returnvar));
char * strsep(char **str, const char *delims)
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_strdupa(s)
duplicate a string in memory from the stack
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name...
char * ast_read_textfile(const char *file)
Read a file into asterisk.