Commit f0d92458 authored by Niels Möller's avatar Niels Möller
Browse files

* src/resource.c (init_resource): Renamed from resource_init, for

consistency. Updated all callers.

Rev: src/client_pty.c:1.18
Rev: src/io.c:1.140
Rev: src/resource.c:1.18
Rev: src/resource.h:1.11
Rev: src/server_pty.c:1.21
Rev: src/unix_interact.c:1.9
Rev: src/unix_user.c:1.40
Rev: src/xauth.c:1.2
parent 2c2d7660
...@@ -67,7 +67,7 @@ make_client_tty_resource(struct interact *tty, ...@@ -67,7 +67,7 @@ make_client_tty_resource(struct interact *tty,
struct terminal_attributes *attr) struct terminal_attributes *attr)
{ {
NEW(client_tty_resource, self); NEW(client_tty_resource, self);
resource_init(&self->super, do_kill_client_tty_resource); init_resource(&self->super, do_kill_client_tty_resource);
self->tty = tty; self->tty = tty;
self->attr = attr; self->attr = attr;
...@@ -212,8 +212,8 @@ make_pty_request(struct interact *tty) ...@@ -212,8 +212,8 @@ make_pty_request(struct interact *tty)
req->dims.char_width = req->dims.char_height req->dims.char_width = req->dims.char_height
= req->dims.pixel_width = req->dims.pixel_height = 0; = req->dims.pixel_width = req->dims.pixel_height = 0;
req->super.format_request = do_format_pty_request;
req->super.super.call = do_channel_request_command; req->super.super.call = do_channel_request_command;
req->super.format_request = do_format_pty_request;
req->tty = tty; req->tty = tty;
req->term = term ? make_string(term) : ssh_format(""); req->term = term ? make_string(term) : ssh_format("");
......
...@@ -429,7 +429,7 @@ make_io_backend(void) ...@@ -429,7 +429,7 @@ make_io_backend(void)
{ {
NEW(io_backend, b); NEW(io_backend, b);
resource_init(&b->super, do_kill_io_backend); init_resource(&b->super, do_kill_io_backend);
b->files = NULL; b->files = NULL;
b->signals = NULL; b->signals = NULL;
...@@ -450,7 +450,7 @@ io_signal_handler(struct io_backend *b, ...@@ -450,7 +450,7 @@ io_signal_handler(struct io_backend *b,
struct lsh_callback *action) struct lsh_callback *action)
{ {
NEW(lsh_signal_handler, handler); NEW(lsh_signal_handler, handler);
resource_init(&handler->super, NULL); init_resource(&handler->super, NULL);
handler->next = b->signals; handler->next = b->signals;
handler->flag = flag; handler->flag = flag;
...@@ -468,7 +468,7 @@ io_callout(struct io_backend *b, ...@@ -468,7 +468,7 @@ io_callout(struct io_backend *b,
struct lsh_callback *action) struct lsh_callback *action)
{ {
NEW(lsh_callout, callout); NEW(lsh_callout, callout);
resource_init(&callout->super, NULL); init_resource(&callout->super, NULL);
callout->next = b->callouts; callout->next = b->callouts;
callout->action = action; callout->action = action;
...@@ -883,7 +883,7 @@ init_file(struct io_backend *b, struct lsh_fd *f, int fd, ...@@ -883,7 +883,7 @@ init_file(struct io_backend *b, struct lsh_fd *f, int fd,
const char *label, const char *label,
struct exception_handler *e) struct exception_handler *e)
{ {
resource_init(&f->super, do_kill_fd); init_resource(&f->super, do_kill_fd);
f->fd = fd; f->fd = fd;
f->label = label; f->label = label;
......
...@@ -80,7 +80,7 @@ do_resource_kill(struct resource *self) ...@@ -80,7 +80,7 @@ do_resource_kill(struct resource *self)
{ self->alive = 0; } { self->alive = 0; }
void void
resource_init(struct resource *self, init_resource(struct resource *self,
void (*k)(struct resource *)) void (*k)(struct resource *))
{ {
self->alive = 1; self->alive = 1;
...@@ -188,7 +188,7 @@ struct resource_list * ...@@ -188,7 +188,7 @@ struct resource_list *
empty_resource_list(void) empty_resource_list(void)
{ {
NEW(concrete_resource_list, self); NEW(concrete_resource_list, self);
resource_init(&self->super.super, do_kill_all); init_resource(&self->super.super, do_kill_all);
trace("empty_resource_list: created %xi\n", self); trace("empty_resource_list: created %xi\n", self);
self->super.remember = do_remember_resource; self->super.remember = do_remember_resource;
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#define KILL_RESOURCE(r) ((r)->kill((r))) #define KILL_RESOURCE(r) ((r)->kill((r)))
void void
resource_init(struct resource *self, init_resource(struct resource *self,
void (*k)(struct resource *)); void (*k)(struct resource *));
/* For the resource list. */ /* For the resource list. */
......
...@@ -77,7 +77,7 @@ make_pty_info(void) ...@@ -77,7 +77,7 @@ make_pty_info(void)
{ {
NEW(pty_info, pty); NEW(pty_info, pty);
resource_init(&pty->super, do_kill_pty_info); init_resource(&pty->super, do_kill_pty_info);
pty->tty_name = NULL; pty->tty_name = NULL;
pty->master = pty->slave = -1; pty->master = pty->slave = -1;
return pty; return pty;
......
...@@ -304,7 +304,7 @@ unix_window_change_subscribe(struct interact *s, ...@@ -304,7 +304,7 @@ unix_window_change_subscribe(struct interact *s,
CAST(unix_interact, self, s); CAST(unix_interact, self, s);
NEW(window_subscriber, subscriber); NEW(window_subscriber, subscriber);
resource_init(&subscriber->super, NULL); init_resource(&subscriber->super, NULL);
subscriber->next = self->subscribers; subscriber->next = self->subscribers;
subscriber->callback = callback; subscriber->callback = callback;
......
...@@ -224,7 +224,7 @@ static struct lsh_process * ...@@ -224,7 +224,7 @@ static struct lsh_process *
make_process_resource(pid_t pid, int signal) make_process_resource(pid_t pid, int signal)
{ {
NEW(process_resource, self); NEW(process_resource, self);
resource_init(&self->super.super, do_kill_process); init_resource(&self->super.super, do_kill_process);
self->super.signal = do_signal_process; self->super.signal = do_signal_process;
self->pid = pid; self->pid = pid;
......
...@@ -119,7 +119,7 @@ xauth_lock(const char *name) ...@@ -119,7 +119,7 @@ xauth_lock(const char *name)
NEW(xauth_lock, self); NEW(xauth_lock, self);
int f; int f;
resource_init(&self->super, do_xauth_lock_kill); init_resource(&self->super, do_xauth_lock_kill);
self->c_name = ssh_format("%lz-c", name); self->c_name = ssh_format("%lz-c", name);
self->l_name = ssh_format("%lz-l", name); self->l_name = ssh_format("%lz-l", name);
......
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