Commit bc66dc45 authored by Max Kellermann's avatar Max Kellermann

server_socket: convert to C++

parent 70879356
...@@ -88,7 +88,6 @@ mpd_headers = \ ...@@ -88,7 +88,6 @@ mpd_headers = \
src/despotify_utils.h \ src/despotify_utils.h \
src/text_input_stream.h \ src/text_input_stream.h \
src/icy_server.h \ src/icy_server.h \
src/server_socket.h \
src/ls.h \ src/ls.h \
src/mixer_api.h \ src/mixer_api.h \
src/mixer_control.h \ src/mixer_control.h \
...@@ -233,7 +232,7 @@ src_mpd_SOURCES = \ ...@@ -233,7 +232,7 @@ src_mpd_SOURCES = \
src/ClientMessage.cxx src/ClientMessage.hxx \ src/ClientMessage.cxx src/ClientMessage.hxx \
src/ClientSubscribe.cxx src/ClientSubscribe.hxx \ src/ClientSubscribe.cxx src/ClientSubscribe.hxx \
src/ClientFile.cxx src/ClientFile.hxx \ src/ClientFile.cxx src/ClientFile.hxx \
src/server_socket.c \ src/ServerSocket.cxx src/ServerSocket.hxx \
src/Listen.cxx src/Listen.hxx \ src/Listen.cxx src/Listen.hxx \
src/Log.cxx src/Log.hxx \ src/Log.cxx src/Log.hxx \
src/ls.cxx \ src/ls.cxx \
...@@ -1301,7 +1300,7 @@ test_run_output_SOURCES = test/run_output.cxx \ ...@@ -1301,7 +1300,7 @@ test_run_output_SOURCES = test/run_output.cxx \
src/AudioCompress/compress.c \ src/AudioCompress/compress.c \
src/ReplayGainInfo.cxx \ src/ReplayGainInfo.cxx \
src/fd_util.c \ src/fd_util.c \
src/server_socket.c src/ServerSocket.cxx
test_read_mixer_LDADD = \ test_read_mixer_LDADD = \
libpcm.a \ libpcm.a \
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
#include "Main.hxx" #include "Main.hxx"
#include "Client.hxx" #include "Client.hxx"
#include "conf.h" #include "conf.h"
#include "ServerSocket.hxx"
extern "C" {
#include "server_socket.h"
}
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -17,12 +17,11 @@ ...@@ -17,12 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef MPD_SERVER_SOCKET_H #ifndef MPD_SERVER_SOCKET_HXX
#define MPD_SERVER_SOCKET_H #define MPD_SERVER_SOCKET_HXX
#include "gerror.h" #include "gerror.h"
#include <stdbool.h>
#include <stddef.h> #include <stddef.h>
struct sockaddr; struct sockaddr;
...@@ -32,10 +31,6 @@ typedef void (*server_socket_callback_t)(int fd, ...@@ -32,10 +31,6 @@ typedef void (*server_socket_callback_t)(int fd,
size_t address_length, int uid, size_t address_length, int uid,
void *ctx); void *ctx);
#ifdef __cplusplus
extern "C" {
#endif
struct server_socket * struct server_socket *
server_socket_new(server_socket_callback_t callback, void *callback_ctx); server_socket_new(server_socket_callback_t callback, void *callback_ctx);
...@@ -94,8 +89,4 @@ bool ...@@ -94,8 +89,4 @@ bool
server_socket_add_path(struct server_socket *ss, const char *path, server_socket_add_path(struct server_socket *ss, const char *path,
GError **error_r); GError **error_r);
#ifdef __cplusplus
}
#endif
#endif #endif
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "page.h" #include "page.h"
#include "icy_server.h" #include "icy_server.h"
#include "fd_util.h" #include "fd_util.h"
#include "server_socket.h" #include "ServerSocket.hxx"
#include <assert.h> #include <assert.h>
......
...@@ -32,6 +32,10 @@ ...@@ -32,6 +32,10 @@
struct sockaddr; struct sockaddr;
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* Creates a socket listening on the specified address. This is a * Creates a socket listening on the specified address. This is a
* shortcut for socket(), bind() and listen(). * shortcut for socket(), bind() and listen().
...@@ -55,4 +59,8 @@ socket_bind_listen(int domain, int type, int protocol, ...@@ -55,4 +59,8 @@ socket_bind_listen(int domain, int type, int protocol,
int int
socket_keepalive(int fd); socket_keepalive(int fd);
#ifdef __cplusplus
}
#endif
#endif #endif
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