-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathh2o_configurator_define.rs
47 lines (40 loc) · 1.93 KB
/
h2o_configurator_define.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*It is a function which defines the user under which the server should
handle incoming request.Configurator: *mut h2o_configurator_t is the
configurator to which the command belongs .name: *const libc::c_char is
the name of the command handled by the configurator,example “listen”.
Defined flags are:
*/
fn h2o_configurator__define_command(mut configurator:
*mut h2o_configurator_t,
mut name:
*const libc::c_char,
mut flags:
libc::c_int,
mut cb:
h2o_configurator_command_cb,
mut desc:
*mut *const libc::c_char) {
let mut cmd: *mut h2o_configurator_command_t =
0 as *mut h2o_configurator_command_t;
let fresh3 = (*configurator).commands.size;
(*configurator).commands.size =
(*configurator).commands.size.wrapping_add(1);
cmd = (*configurator).commands.entries.offset(fresh3 as isize);
(*cmd).configurator = configurator;
(*cmd).flags = flags;
(*cmd).name = name;
(*cmd).cb = cb;
(*cmd).description = desc;
}
/*
void h2o_configurator__define_command(h2o_configurator_t *configurator, const char *name, int flags, h2o_configurator_command_cb cb, const char **desc)
{
h2o_configurator_command_t *cmd;
cmd = configurator->commands.entries + configurator->commands.size++;
cmd->configurator = configurator;
cmd->flags = flags;
cmd->name = name;
cmd->cb = cb;
cmd->description = desc;
}
*/