00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef MPD_SERVER_SOCKET_H
00021 #define MPD_SERVER_SOCKET_H
00022
00023 #include <stdbool.h>
00024
00025 #include <glib.h>
00026
00027 struct sockaddr;
00028
00029 typedef void (*server_socket_callback_t)(int fd,
00030 const struct sockaddr *address,
00031 size_t address_length, int uid,
00032 void *ctx);
00033
00034 struct server_socket *
00035 server_socket_new(server_socket_callback_t callback, void *callback_ctx);
00036
00037 void
00038 server_socket_free(struct server_socket *ss);
00039
00040 bool
00041 server_socket_open(struct server_socket *ss, GError **error_r);
00042
00043 void
00044 server_socket_close(struct server_socket *ss);
00045
00051 bool
00052 server_socket_add_fd(struct server_socket *ss, int fd, GError **error_r);
00053
00062 bool
00063 server_socket_add_port(struct server_socket *ss, unsigned port,
00064 GError **error_r);
00065
00076 bool
00077 server_socket_add_host(struct server_socket *ss, const char *hostname,
00078 unsigned port, GError **error_r);
00079
00088 bool
00089 server_socket_add_path(struct server_socket *ss, const char *path,
00090 GError **error_r);
00091
00092 #endif