80 res = stat(filename, &st);
88 if (filename[0] ==
'/') {
90 snprintf(buf, len,
"%s-%s.%s", filename, preflang, ext);
92 snprintf(buf, len,
"%s.%s", filename, ext);
119 e =
strsep(&stringp,
"|");
131 e =
strsep(&stringp,
"|");
139 fd = open(buf, O_RDONLY);
143 lseek(fd, 0, SEEK_SET);
174 #define FORMAT "%10s %10s %50s %10s\n" 175 #define FORMAT2 "%10s %10s %50s %10s\n" 181 e->
command =
"core show image formats";
183 "Usage: core show image formats\n" 184 " Displays currently registered image formats (if any).\n";
199 ast_cli(a->
fd,
"\n%d image format%s registered.\n", count_fmt, count_fmt == 1 ?
"" :
"s");
structure associated with registering an image format
Main Channel structure associated with a channel.
#define AST_CLI_DEFINE(fn, txt,...)
Asterisk locking-related definitions:
static void image_shutdown(void)
Asterisk main include file. File version handling, generic pbx functions.
static int file_exists(char *filename)
int(*const send_image)(struct ast_channel *chan, struct ast_frame *frame)
Display or send an image.
static struct ast_cli_entry cli_image[]
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized...
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
Support for translation of data formats. translate.c.
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
descriptor for a cli entry.
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
#define ast_cli_register_multiple(e, len)
Register multiple commands.
static char * handle_core_show_image_formats(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
void ast_cli(int fd, const char *fmt,...)
int ast_image_init(void)
Initialize image stuff Initializes all the various image stuff. Basically just registers the cli stuf...
static void make_filename(char *buf, int len, const char *filename, const char *preflang, char *ext)
#define ast_verb(level,...)
int ast_supports_images(struct ast_channel *chan)
Check for image support on a channel.
#define ast_strlen_zero(foo)
struct ast_frame *(* read_image)(int fd, int len)
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define AST_RWLIST_INSERT_HEAD
General Asterisk channel definitions for image handling.
General Asterisk PBX channel definitions.
void ast_image_unregister(struct ast_imager *img)
Unregister an image format.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
Asterisk file paths, configured in asterisk.conf.
struct ast_frame * ast_read_image(const char *filename, const char *preflang, struct ast_format *format)
Make an image.
#define AST_RWLIST_TRAVERSE
Scheduler Routines (derived from cheops)
const char * ast_config_AST_DATA_DIR
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
int ast_send_image(struct ast_channel *chan, const char *filename)
Sends an image.
char * strsep(char **str, const char *delims)
Standard Command Line Interface.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Data structure associated with a single frame of data.
const char * ast_channel_language(const struct ast_channel *chan)
#define AST_RWLIST_REMOVE
static snd_pcm_format_t format
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
struct ast_format * format
int ast_image_register(struct ast_imager *img)
Register image format.