Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded struct not generated. #10

Closed
remy-j-a-moueza opened this issue Jun 1, 2013 · 1 comment
Closed

Embedded struct not generated. #10

remy-j-a-moueza opened this issue Jun 1, 2013 · 1 comment

Comments

@remy-j-a-moueza
Copy link

An embedded struct within another struct does not get generated.

On the mongoose.h header, mg_request_info containing a mg_header struct:

// This structure contains information about the HTTP request.
struct mg_request_info {
  const char *request_method; // "GET", "POST", etc
  const char *uri;            // URL-decoded URI
  const char *http_version;   // E.g. "1.0", "1.1"
  const char *query_string;   // URL part after '?', not including '?', or NULL
  const char *remote_user;    // Authenticated user, or NULL if no auth used
  long remote_ip;             // Client's IP address
  int remote_port;            // Client's port
  int is_ssl;                 // 1 if SSL-ed, 0 if not
  void *user_data;            // User data pointer passed to mg_start()

  int num_headers;            // Number of HTTP headers
  struct mg_header {
    const char *name;         // HTTP header name
    const char *value;        // HTTP header value
  } http_headers[64];         // Maximum 64 headers
};

What gets generated is:

struct mg_request_info
{
    const(char)* request_method;
    const(char)* uri;
    const(char)* http_version;
    const(char)* query_string;
    const(char)* remote_user;
    c_long remote_ip;
    int remote_port;
    int is_ssl;
    void* user_data;
    int num_headers;
    mg_header[64] http_headers;
}

mg_header is left undefined.

I would have expected a definition, at least outside of mg_request_info like:

struct mg_header {
    const(char) *name;
    const(char) *value;
}
@jacob-carlborg
Copy link
Owner

Aha, I see. It's the array that's causing the problem. I'll see if I can fix that.

@ciechowoj ciechowoj mentioned this issue Jun 27, 2016
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Jun 28, 2016
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Jul 6, 2016
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Jul 6, 2016
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Jul 6, 2016
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Jul 26, 2016
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Aug 1, 2016
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Aug 3, 2016
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Aug 3, 2016
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Aug 7, 2016
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Aug 7, 2016
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Aug 7, 2016
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Aug 7, 2016
jacob-carlborg added a commit that referenced this issue Aug 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants