mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-14 01:38:01 +08:00
Reformatting for better readability
This commit is contained in:
parent
093cd6a6a3
commit
90c67e4226
@ -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">
|
||||
|
||||
|
@ -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);
|
||||
|
13
mongoose.h
13
mongoose.h
@ -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);
|
||||
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
13
src/timer.h
13
src/timer.h
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user