Commit fcafaa73 authored by Sergey Lyubka's avatar Sergey Lyubka

Style fixes in the comments

parent 079b9ec2
...@@ -148,10 +148,11 @@ struct mg_request_info *mg_get_request_info(struct mg_connection *); ...@@ -148,10 +148,11 @@ struct mg_request_info *mg_get_request_info(struct mg_connection *);
// Return: // Return:
// 0 when the connection has been closed // 0 when the connection has been closed
// -1 on error // -1 on error
// number of bytes written on success // >0 number of bytes written on success
int mg_write(struct mg_connection *, const void *buf, size_t len); int mg_write(struct mg_connection *, const void *buf, size_t len);
// Macros for enabling compiler-specific checks for printf-like arguments.
#undef PRINTF_FORMAT_STRING #undef PRINTF_FORMAT_STRING
#if _MSC_VER >= 1400 #if _MSC_VER >= 1400
#include <sal.h> #include <sal.h>
...@@ -170,11 +171,9 @@ int mg_write(struct mg_connection *, const void *buf, size_t len); ...@@ -170,11 +171,9 @@ int mg_write(struct mg_connection *, const void *buf, size_t len);
#define PRINTF_ARGS(x, y) #define PRINTF_ARGS(x, y)
#endif #endif
// Send data to the browser using printf() semantics. // Send data to the client using printf() semantics.
// //
// Works exactly like mg_write(), but allows to do message formatting. // Works exactly like mg_write(), but allows to do message formatting.
// Below are the macros for enabling compiler-specific checks for
// printf-like arguments.
int mg_printf(struct mg_connection *, int mg_printf(struct mg_connection *,
PRINTF_FORMAT_STRING(const char *fmt), ...) PRINTF_ARGS(2, 3); PRINTF_FORMAT_STRING(const char *fmt), ...) PRINTF_ARGS(2, 3);
...@@ -209,7 +208,8 @@ const char *mg_get_header(const struct mg_connection *, const char *name); ...@@ -209,7 +208,8 @@ const char *mg_get_header(const struct mg_connection *, const char *name);
// On success, length of the decoded variable. // On success, length of the decoded variable.
// On error: // On error:
// -1 (variable not found). // -1 (variable not found).
// -2 (destination buffer is NULL, zero length or too small to hold the decoded variable). // -2 (destination buffer is NULL, zero length or too small to hold the
// decoded variable).
// //
// Destination buffer is guaranteed to be '\0' - terminated if it is not // Destination buffer is guaranteed to be '\0' - terminated if it is not
// NULL or zero length. // NULL or zero length.
...@@ -225,8 +225,10 @@ int mg_get_var(const char *data, size_t data_len, ...@@ -225,8 +225,10 @@ int mg_get_var(const char *data, size_t data_len,
// Return: // Return:
// On success, value length. // On success, value length.
// On error: // On error:
// -1 (either "Cookie:" header is not present at all or the requested parameter is not found). // -1 (either "Cookie:" header is not present at all or the requested
// -2 (destination buffer is NULL, zero length or too small to hold the value). // parameter is not found).
// -2 (destination buffer is NULL, zero length or too small to hold the
// value).
int mg_get_cookie(const struct mg_connection *, int mg_get_cookie(const struct mg_connection *,
const char *cookie_name, char *buf, size_t buf_len); const char *cookie_name, char *buf, size_t buf_len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment