Revision 350120d2 libavcodec/tableprint.h

View differences:

libavcodec/tableprint.h
25 25

  
26 26
#include <stdint.h>
27 27
#include <stdio.h>
28
#include "libavutil/common.h"
28 29

  
29 30
#define WRITE_1D_FUNC_ARGV(type, linebrk, fmtstr, ...)\
30 31
void write_##type##_array(const type *data, int len)\
......
72 73
/** Write a standard file header */
73 74
void write_fileheader(void);
74 75

  
76
#define WRITE_ARRAY(prefix, type, name)                 \
77
    do {                                                \
78
        const size_t array_size = FF_ARRAY_ELEMS(name); \
79
        printf(prefix" "#type" "#name"[%zu] = {\n",     \
80
               array_size);                             \
81
        write_##type##_array(name, array_size);         \
82
        printf("};\n");                                 \
83
    } while(0)
84

  
85
#define WRITE_2D_ARRAY(prefix, type, name)                              \
86
    do {                                                                \
87
        const size_t array_size1 = FF_ARRAY_ELEMS(name);                \
88
        const size_t array_size2 = FF_ARRAY_ELEMS(name[0]);             \
89
        printf(prefix" "#type" "#name"[%zu][%zu] = {\n",                \
90
               array_size1, array_size2 );                              \
91
        write_##type##_2d_array(name, array_size1, array_size2);        \
92
        printf("};\n");                                                 \
93
    } while(0)
94

  
75 95
#endif /* AVCODEC_TABLEPRINT_H */

Also available in: Unified diff