35 return "<BLOCK DEVICE>";
37 return "<CHARACTER DEVICE>";
62 char filemode[4], uid_and_gid[20];
78 snprintf(filemode, 4,
"???");
80 snprintf(filemode, 4,
"%3"PRIo64, entry->
filemode);
82 snprintf(uid_and_gid, 20,
"%"PRId64
"(%"PRId64
")", entry->
user_id, entry->
group_id);
85 "TYPE",
"SIZE",
"NAME",
"UID(GID)",
"UGO",
"MODIFIED",
86 "ACCESSED",
"STATUS_CHANGED");
87 av_log(NULL,
AV_LOG_INFO,
"%-9s %12"PRId64
" %30s %10s %s %16"PRId64
" %16"PRId64
" %16"PRId64
"\n",
105static void usage(
const char *program_name)
107 fprintf(stderr,
"usage: %s input_dir\n"
108 "API example program to show how to list files in directory "
109 "accessed through AVIOContext.\n", program_name);
112int main(
int argc,
char *argv[])
129 return ret < 0 ? 1 : 0;
Libavcodec external API header.
int avio_close_dir(AVIODirContext **s)
Close directory.
int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options)
Open directory for reading.
void avio_free_directory_entry(AVIODirEntry **entry)
Free entry allocated by avio_read_dir().
int avio_read_dir(AVIODirContext *s, AVIODirEntry **next)
Get next directory entry.
@ AVIO_ENTRY_BLOCK_DEVICE
@ AVIO_ENTRY_SYMBOLIC_LINK
@ AVIO_ENTRY_CHARACTER_DEVICE
int main(int argc, char *argv[])
static void usage(const char *program_name)
static const char * type_string(int type)
static int list_op(const char *input_dir)
int avformat_network_deinit(void)
Undo the initialization done by avformat_network_init.
int avformat_network_init(void)
Do global initialization of network libraries.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_log_set_level(int level)
Set the log level.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level.
Describes single entry of the directory.
int64_t user_id
User ID of owner, -1 if unknown.
int type
Type of the entry.
int64_t access_timestamp
Time of last access in microseconds since unix epoch, -1 if unknown.
int64_t status_change_timestamp
Time of last status change in microseconds since unix epoch, -1 if unknown.
int64_t size
File size in bytes, -1 if unknown.
int64_t group_id
Group ID of owner, -1 if unknown.
int64_t modification_timestamp
Time of last modification in microseconds since unix epoch, -1 if unknown.
int64_t filemode
Unix file mode, -1 if unknown.