Skip to content

struct member expansion #137

@saivert

Description

@saivert

I have a struct:

// FILE object wrapper for vfs access
typedef struct {
    struct DB_vfs_s *vfs;
} DB_FILE;

dstep now looks up struct DB_vfs_s and expands this inside the parent struct while eating all comments before the definition of struct DB_vfs_s. Leading to something like:

// FILE object wrapper for vfs access
struct DB_FILE
{
    // md5 calc control structure (see md5/md5.h)

    // bps must be 32 if this is true

    // lots more comments

    struct DB_vfs_s
    {
        DB_plugin_t plugin;

        // capabilities
        const(char*)* function () get_schemes; // NULL-terminated list of supported schemes, e.g. {"http://", "ftp://", NULL}; can be NULL

and so on...

This is a workaround (C code):

typedef struct DB_vfs_s DB_vfs_t;
// FILE object wrapper for vfs access
typedef struct DB_FILE_s {
    DB_vfs_t *vfs;
} DB_FILE;

but seems like dstep should cope with using struct notation without expanding it inline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions