{
    "content": [
        {
            "type": "text",
            "text": "# FFI::Generator (ri)\n\n## Sections\n\n- **FFI::Generator < Object** (1 subsections)\n- **Class methods:**\n- **Instance methods:**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "FFI::Generator",
        "section": "",
        "mode": "ri",
        "summary": null,
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "FFI::Generator < Object",
                "lines": 4,
                "subsections": [
                    {
                        "name": "A simple example",
                        "lines": 39
                    }
                ]
            },
            {
                "name": "Class methods:",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "Instance methods:",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "FFI::Generator < Object": {
                "content": "(from /home/chedong/.local/share/rdoc)\n------------------------------------------------------------------------\nGenerate files with C structs for FFI::Struct and C constants.\n",
                "subsections": [
                    {
                        "name": "A simple example",
                        "content": "In file zlib.rb.ffi:\nmodule Zlib\n@@@\nconstants do |c|\nc.include \"zlib.h\"\nc.const :ZLIBVERNUM\nend\n@@@\n\nclass ZStream < FFI::Struct\n\nstruct do |s|\ns.name \"struct zstreams\"\ns.include \"zlib.h\"\n\ns.field :nextin,   :pointer\ns.field :availin,  :uint\ns.field :totalin,  :ulong\nend\n@@@\nend\nend\n\nTranslate the file:\nrequire \"ffi/tools/generator\"\nFFI::Generator.new \"zlib.rb.ffi\", \"zlib.rb\"\n\nGenerates the file zlib.rb with constant values and offsets:\nmodule Zlib\nZLIBVERNUM = 4784\n\nclass ZStream < FFI::Struct\nlayout :nextin, :pointer, 0,\n:availin, :uint, 8,\n:totalin, :ulong, 16\nend\n\n@see FFI::Generator::Task for easy integration in a Rakefile\n------------------------------------------------------------------------"
                    }
                ]
            },
            "Class methods:": {
                "content": "new\n",
                "subsections": []
            },
            "Instance methods:": {
                "content": "constants\nstruct\ntos\n",
                "subsections": []
            }
        }
    }
}