内部情報ヘッダファイルの例

サンプルプログラム"draw"の内部情報ヘッダファイルです。

#ifndef SER_shape_i_INCLUDED
#define SER_shape_i_INCLUDED
/************************************************************
 * Internal header file generated by schema compiler
 * Don't edit this file.
 * Schema name  shape
 ************************************************************/
#include <stddef.h>
#include "SER_schema.h"
#include "shape.h"
static int const ser_Polyline_def[] = {
    0,	/* Polyline */
    sizeof(Polyline),
    (int)SER_TYPE_STRUCT,
    1,	/* member num */
    sizeof(Polyline),	/* size */
    1,	/* point */
    offsetof(Polyline, point),
    (int)SER_TYPE_V_ARRAY,
    (int)SER_TYPE_Point,
};

static int const ser_Box_def[] = {
    2,	/* Box */
    sizeof(Box),
    (int)SER_TYPE_STRUCT,
    1,	/* member num */
    sizeof(Box),	/* size */
    1,	/* point */
    offsetof(Box, point),
    (int)SER_TYPE_ARRAY,
    2,	/* size */
    (int)SER_TYPE_Point,
};

static int const ser_Circle_def[] = {
    3,	/* Circle */
    sizeof(Circle),
    (int)SER_TYPE_STRUCT,
    2,	/* member num */
    sizeof(Circle),	/* size */
    4,	/* center */
    offsetof(Circle, center),
    (int)SER_TYPE_Point,
    5,	/* radius */
    offsetof(Circle, radius),
    (int)SER_TYPE_DOUBLE,
};

static int const ser_ShapeType_def[] = {
    6,	/* ShapeType */
    sizeof(ShapeType),
    (int)SER_TYPE_ENUM,
    3,	/* enum num */
    7,	/* POLYLINE_SHAPE */
    8,	/* BOX_SHAPE */
    9,	/* CIRCLE_SHAPE */
};

static int const ser_Shape_def[] = {
    10,	/* Shape */
    sizeof(Shape),
    (int)SER_TYPE_STRUCT,
    3,	/* member num */
    sizeof(Shape),	/* size */
    11,	/* attr */
    offsetof(Shape, attr),
    (int)SER_TYPE_UNION,
    offsetof(Shape, attr.tag) - offsetof(Shape, attr),
    offsetof(Shape, attr.u) - offsetof(Shape, attr),
    (int)SER_TYPE_ShapeType,	/* tag type */
    3,	/* member num */
    sizeof(struct ser_0_tag),	/* size */
    12,	/* polyline */
    (int)SER_TYPE_Polyline,
    13,	/* box */
    (int)SER_TYPE_Box,
    14,	/* circle */
    (int)SER_TYPE_Circle,
    15,	/* prev */
    offsetof(Shape, prev),
    (int)SER_TYPE_POINTER,
    (int)SER_TYPE_Shape,
    16,	/* next */
    offsetof(Shape, next),
    (int)SER_TYPE_POINTER,
    (int)SER_TYPE_Shape,
};

static int const ser_Point_def[] = {
    17,	/* Point */
    sizeof(Point),
    (int)SER_TYPE_STRUCT,
    2,	/* member num */
    sizeof(Point),	/* size */
    18,	/* x */
    offsetof(Point, x),
    (int)SER_TYPE_DOUBLE,
    19,	/* y */
    offsetof(Point, y),
    (int)SER_TYPE_DOUBLE,
};

static Polyline const ser_Polyline_init = {
    NULL,
};

static Box const ser_Box_init = {
    {
        {
            0.000000,
            0.000000,
        },
        {
            0.000000,
            0.000000,
        },
    },
};

static Circle const ser_Circle_init = {
    {
        0.000000,
        0.000000,
    },
    0.000000,
};

static ShapeType const ser_ShapeType_init = POLYLINE_SHAPE;

static Shape const ser_Shape_init = {
    {
        POLYLINE_SHAPE,
        {
            {
                NULL,
            }
        }
    },
    NULL,
    NULL,
};

static Point const ser_Point_init = {
    0.000000,
    0.000000,
};

static char const * const ser_shape_string[] = {
    "Polyline",
    "point",
    "Box",
    "Circle",
    "center",
    "radius",
    "ShapeType",
    "POLYLINE_SHAPE",
    "BOX_SHAPE",
    "CIRCLE_SHAPE",
    "Shape",
    "attr",
    "polyline",
    "box",
    "circle",
    "prev",
    "next",
    "Point",
    "x",
    "y",
};

static ser_SchemaTable const ser_shape_schema_table[] = {
    {
        ser_Polyline_def,
        sizeof(ser_Polyline_def) / sizeof(int),
        &ser_Polyline_init,
    },
    {
        ser_Box_def,
        sizeof(ser_Box_def) / sizeof(int),
        &ser_Box_init,
    },
    {
        ser_Circle_def,
        sizeof(ser_Circle_def) / sizeof(int),
        &ser_Circle_init,
    },
    {
        ser_ShapeType_def,
        sizeof(ser_ShapeType_def) / sizeof(int),
        &ser_ShapeType_init,
    },
    {
        ser_Shape_def,
        sizeof(ser_Shape_def) / sizeof(int),
        &ser_Shape_init,
    },
    {
        ser_Point_def,
        sizeof(ser_Point_def) / sizeof(int),
        &ser_Point_init,
    },
};

static struct SER_Schema_tag const ser_shape_schema = {
    "shape",
    6,
    ser_shape_schema_table,
    20,
    ser_shape_string,
};
SER_Schema SER_shape_schema = &ser_shape_schema;
#endif /* SER_shape_INCLUDED */

ひとつ上のページに戻る | prev(AP向けヘッダファイルの例) | next(コンパイル方法)