Mercurial > dropbear
diff listener.h @ 1460:58a74cb829b8
Pointer parameter could be declared as pointing to const (callback)
author | Francois Perrad <francois.perrad@gadz.org> |
---|---|
date | Sat, 19 Aug 2017 22:39:53 +0200 |
parents | 06d52bcb8094 |
children |
line wrap: on
line diff
--- a/listener.h Sat Aug 19 17:16:13 2017 +0200 +++ b/listener.h Sat Aug 19 22:39:53 2017 +0200 @@ -35,8 +35,8 @@ int index; /* index in the array of listeners */ - void (*acceptor)(struct Listener*, int sock); - void (*cleanup)(struct Listener*); + void (*acceptor)(const struct Listener*, int sock); + void (*cleanup)(const struct Listener*); int type; /* CHANNEL_ID_X11, CHANNEL_ID_AGENT, CHANNEL_ID_TCPDIRECT (for clients), @@ -52,11 +52,11 @@ struct Listener* new_listener(const int socks[], unsigned int nsocks, int type, void* typedata, - void (*acceptor)(struct Listener* listener, int sock), - void (*cleanup)(struct Listener*)); + void (*acceptor)(const struct Listener* listener, int sock), + void (*cleanup)(const struct Listener*)); -struct Listener * get_listener(int type, void* typedata, - int (*match)(void*, void*)); +struct Listener * get_listener(int type, const void* typedata, + int (*match)(const void*, const void*)); void remove_listener(struct Listener* listener);