I structures like the following
typedef struct
{
char *ptr;
size_t used;
size_t size;
} buffer;
typedef struct
{
buffer *request;
buffer *uri;
buffer *orig_uri;
http_method_t http_method;
http_version_t http_version;
buffer *request_line;
/* strings to the header */
buffer *http_host; /* not alloced */
const char *http_range;
const char *http_content_type;
const char *http_if_modified_since;
const char *http_if_none_match;
array *headers;
/* CONTENT */
size_t content_length; /* returned by strtoul() */
/* internal representation */
int accept_encoding;
/* internal */
buffer *pathinfo;
} request;
Now if I want to write(in a text file) the value of the member “http_host” which belongs to the structure “request”. The member “http_host” is actually a “buffer” type, how should I write it? Kindly explain with the syntax.
Have you tried something like this?