Reformatting for better readability

This commit is contained in:
Sergey Lyubka 2021-11-06 11:29:56 +00:00
parent 093cd6a6a3
commit 90c67e4226
5 changed files with 15 additions and 17 deletions

View File

@ -1239,7 +1239,7 @@ Parameters:
Return value: offset to the next chunk, or 0 if there are no more chunks.
See [examples/form-upload](../examples/form-upload) for full usage example.
See [File upload tutorial](../tutorials/file-upload) for full usage example.
<img src="images/mg_http_next_multipart.png">

View File

@ -3649,7 +3649,7 @@ struct mg_timer *g_timers;
void mg_timer_init(struct mg_timer *t, unsigned long ms, unsigned flags,
void (*fn)(void *), void *arg) {
struct mg_timer tmp = {ms, flags, fn, arg, 0UL, g_timers};
struct mg_timer tmp = {ms, 0UL, flags, fn, arg, g_timers};
*t = tmp;
g_timers = t;
if (flags & MG_TIMER_RUN_NOW) fn(arg);

View File

@ -565,22 +565,21 @@ void mg_log_set_callback(void (*fn)(const void *, size_t, void *), void *param);
struct mg_timer {
unsigned long period_ms; // Timer period in milliseconds
unsigned flags; // Possible flags values below
void (*fn)(void *); // Function to call
void *arg; // Function argument
unsigned long expire; // Expiration timestamp in milliseconds
struct mg_timer *next; // Linkage in g_timers list
};
unsigned flags; // Possible flags values below
#define MG_TIMER_REPEAT 1 // Call function periodically, otherwise run once
#define MG_TIMER_RUN_NOW 2 // Call immediately when timer is set
void (*fn)(void *); // Function to call
void *arg; // Function argument
struct mg_timer *next; // Linkage in g_timers list
};
extern struct mg_timer *g_timers; // Global list of timers
void mg_timer_init(struct mg_timer *, unsigned long ms, unsigned,
void (*fn)(void *), void *);
void mg_timer_free(struct mg_timer *);
void mg_timer_poll(unsigned long uptime_ms);
void mg_timer_poll(unsigned long current_time_ms);

View File

@ -8,7 +8,7 @@ struct mg_timer *g_timers;
void mg_timer_init(struct mg_timer *t, unsigned long ms, unsigned flags,
void (*fn)(void *), void *arg) {
struct mg_timer tmp = {ms, flags, fn, arg, 0UL, g_timers};
struct mg_timer tmp = {ms, 0UL, flags, fn, arg, g_timers};
*t = tmp;
g_timers = t;
if (flags & MG_TIMER_RUN_NOW) fn(arg);

View File

@ -2,19 +2,18 @@
struct mg_timer {
unsigned long period_ms; // Timer period in milliseconds
unsigned flags; // Possible flags values below
void (*fn)(void *); // Function to call
void *arg; // Function argument
unsigned long expire; // Expiration timestamp in milliseconds
struct mg_timer *next; // Linkage in g_timers list
};
unsigned flags; // Possible flags values below
#define MG_TIMER_REPEAT 1 // Call function periodically, otherwise run once
#define MG_TIMER_RUN_NOW 2 // Call immediately when timer is set
void (*fn)(void *); // Function to call
void *arg; // Function argument
struct mg_timer *next; // Linkage in g_timers list
};
extern struct mg_timer *g_timers; // Global list of timers
void mg_timer_init(struct mg_timer *, unsigned long ms, unsigned,
void (*fn)(void *), void *);
void mg_timer_free(struct mg_timer *);
void mg_timer_poll(unsigned long uptime_ms);
void mg_timer_poll(unsigned long current_time_ms);