Commit a69ba104 a69ba10496040a8781dd56be1a362bf5f031b35d by Sergey Poznyakoff

(header_get_value_unfold)

(header_aget_value_unfold,header_get_field_value_unfold)
(header_aget_field_value_unfold): New functions.
1 parent f25a6192
......@@ -90,6 +90,17 @@ extern int header_get_field_name __P ((header_t, size_t index, char *, size_t, s
extern int header_aget_field_value __P ((header_t, size_t index, char **));
extern int header_aget_field_name __P ((header_t, size_t index, char **));
extern int header_get_value_unfold __P((header_t header, const char *name,
char *buffer, size_t buflen,
size_t *pn));
extern int header_aget_value_unfold __P((header_t header, const char *name,
char **pvalue));
extern int header_get_field_value_unfold __P((header_t header, size_t num,
char *buf, size_t buflen,
size_t *nwritten));
extern int header_aget_field_value_unfold __P((header_t header, size_t num,
char **pvalue));
extern int header_get_stream __P ((header_t, stream_t *));
extern int header_set_stream __P ((header_t, stream_t, void *));
......@@ -130,6 +141,7 @@ extern int header_set_fill __P ((header_t,
size_t, off_t,
size_t *)), void *owner));
#ifdef __cplusplus
}
#endif
......
......@@ -606,6 +606,17 @@ header_get_value (header_t header, const char *name, char *buffer,
}
int
header_get_value_unfold (header_t header, const char *name, char *buffer,
size_t buflen, size_t *pn)
{
int rc = header_get_value (header, name, buffer, buflen, pn);
if (rc == 0)
mu_string_unfold (buffer, pn);
return rc;
}
int
header_aget_value (header_t header, const char *name, char **pvalue)
{
char *value;
......@@ -624,6 +635,15 @@ header_aget_value (header_t header, const char *name, char **pvalue)
}
int
header_aget_value_unfold (header_t header, const char *name, char **pvalue)
{
int rc = header_aget_value (header, name, pvalue);
if (rc == 0)
mu_string_unfold (*pvalue, NULL);
return rc;
}
int
header_get_address (header_t header, const char *name, address_t *addr)
{
char* value = NULL;
......@@ -753,6 +773,16 @@ header_get_field_value (header_t header, size_t num, char *buf,
}
int
header_get_field_value_unfold (header_t header, size_t num, char *buf,
size_t buflen, size_t *nwritten)
{
int rc = header_get_field_value (header, num, buf, buflen, nwritten);
if (rc == 0)
mu_string_unfold (buf, nwritten);
return rc;
}
int
header_aget_field_value (header_t header, size_t num, char **pvalue)
{
char *value;
......@@ -772,6 +802,15 @@ header_aget_field_value (header_t header, size_t num, char **pvalue)
}
int
header_aget_field_value_unfold (header_t header, size_t num, char **pvalue)
{
int rc = header_aget_field_value (header, num, pvalue);
if (rc == 0)
mu_string_unfold (*pvalue, NULL);
return rc;
}
int
header_set_lines (header_t header, int (*_lines)
(header_t, size_t *), void *owner)
{
......@@ -1169,3 +1208,4 @@ header_get_stream (header_t header, stream_t *pstream)
*pstream = header->stream;
return 0;
}
......