#include <stdio.h>
#include "blobmsg.h"
Go to the source code of this file.
|
#define | ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
|
◆ ARRAY_SIZE
#define ARRAY_SIZE |
( |
|
x | ) |
(sizeof(x) / sizeof((x)[0])) |
◆ anonymous enum
◆ check_message()
static int check_message |
( |
struct blob_buf * |
buf | ) |
|
|
static |
Definition at line 110 of file test-blobmsg_check_array.c.
116 fprintf(stderr,
"Policy %s parse failed\n",
array_a);
121 fprintf(stderr,
"%s not found\n",
array_a);
128 fprintf(stderr,
"Failed blobmsg_check_array() (TABLE) on %s (%d)\n",
static void * blob_data(const struct blob_attr *attr)
int blobmsg_check_array(const struct blob_attr *attr, int type)
int blobmsg_parse(const struct blobmsg_policy *policy, int policy_len, struct blob_attr **tb, void *data, unsigned int len)
static size_t blobmsg_data_len(const struct blob_attr *attr)
static char const array_a[]
static int check_table_a_entries(struct blob_attr *attr)
static const struct blobmsg_policy pol_a[]
◆ check_table_a_entries()
static int check_table_a_entries |
( |
struct blob_attr * |
attr | ) |
|
|
static |
Definition at line 48 of file test-blobmsg_check_array.c.
57 fprintf(stderr,
"Process %s: entry %d\n",
array_a, entry_number);
63 fprintf(stderr,
"Policy %s parse failed\n",
array_b);
68 fprintf(stderr,
"%s not found\n",
array_b);
79 fprintf(stderr,
"Failed blobmsg_check_array() (STRING) on %s\n",
95 fprintf(stderr,
"%s contains string: %s\n",
static char * blobmsg_get_string(struct blob_attr *attr)
#define blobmsg_for_each_attr(pos, attr, rem)
static void * blobmsg_data(const struct blob_attr *attr)
static const struct blobmsg_policy pol_b[]
static char const array_b[]
◆ fill_message()
static void fill_message |
( |
struct blob_buf *const |
buf | ) |
|
|
static |
Definition at line 137 of file test-blobmsg_check_array.c.
static void * blobmsg_open_table(struct blob_buf *buf, const char *name)
static void blobmsg_close_table(struct blob_buf *buf, void *cookie)
static int blobmsg_add_string(struct blob_buf *buf, const char *name, const char *string)
static void blobmsg_close_array(struct blob_buf *buf, void *cookie)
static void * blobmsg_open_array(struct blob_buf *buf, const char *name)
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 153 of file test-blobmsg_check_array.c.
163 fprintf(stderr,
"blobmsg_check_array() test passed\n");
168 return result ? EXIT_FAILURE : EXIT_SUCCESS;
static int blobmsg_buf_init(struct blob_buf *buf)
static void fill_message(struct blob_buf *const buf)
static int check_message(struct blob_buf *buf)
◆ array_a
char const array_a[] = "array_a" |
|
static |
◆ array_b
char const array_b[] = "array_b" |
|
static |
◆ pol_a
◆ pol_b