summaryrefslogtreecommitdiffstats
path: root/ppapi/generators/test_cgen/structs.h
blob: 352e08e890c7416401aa83741e02af103d16166f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
 * Copyright (c) 2011 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/* From test_cgen/structs.idl modified Wed Nov 21 11:02:50 2012. */

#ifndef PPAPI_C_TEST_CGEN_STRUCTS_H_
#define PPAPI_C_TEST_CGEN_STRUCTS_H_

#include "ppapi/c/pp_macros.h"
#include "ppapi/c/test_cgen/stdint.h"

/**
 * @file
 * This file will test that the IDL snippet matches the comment.
 */


/**
 * @addtogroup Typedefs
 * @{
 */
/* typedef uint8_t s_array[3]; */
typedef uint8_t s_array[3];
/**
 * @}
 */

/**
 * @addtogroup Enums
 * @{
 */
/* typedef enum { esv1 = 1, esv2 = 2 } senum; */
typedef enum {
  esv1 = 1,
  esv2 = 2
} senum;
/**
 * @}
 */

/**
 * @addtogroup Structs
 * @{
 */
/* struct st1 { int32_t i; senum j; }; */
struct st1 {
  int32_t i;
  senum j;
};

/* struct st2 { s_array pixels[640][480]; }; */
struct st2 {
  s_array pixels[640][480];
};
/**
 * @}
 */

/**
 * @addtogroup Typedefs
 * @{
 */
/* typedef float (*func_t)(const s_array data); */
typedef float (*func_t)(const s_array data);

/* typedef func_t (*findfunc_t)(const char* x); */
typedef func_t (*findfunc_t)(const char* x);
/**
 * @}
 */

/**
 * @addtogroup Structs
 * @{
 */
/*
 * struct sfoo {
 *  s_array screen[480][640];
 *  findfunc_t myfunc;
 * };
 */
struct sfoo {
  s_array screen[480][640];
  findfunc_t myfunc;
};
/**
 * @}
 */

#endif  /* PPAPI_C_TEST_CGEN_STRUCTS_H_ */