From 3f373aabedddf6c16c9e402c036d096dc99a42eb Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Sun, 3 Aug 2014 07:42:24 +0100 Subject: [PATCH] Use new class interface and update copyright information --- include/tr/interface/reader.h | 2 +- include/tr/interface/socket.h | 2 +- include/tr/interface/writer.h | 2 +- include/tr/remote_data.h | 4 ++-- include/tr/socket.h | 8 ++++---- include/tr/stream.h | 3 ++- src/i_reader.c | 2 +- src/i_socket.c | 2 +- src/i_writer.c | 2 +- src/read.c | 2 +- src/remote_data.c | 4 ++-- src/remote_data_set_data.c | 2 +- src/socket.c | 4 ++-- src/socket_accept.c | 2 +- src/socket_close.c | 2 +- src/socket_init.c | 2 +- src/socket_nonblock.c | 2 +- src/socket_shutdown.c | 2 +- src/socket_shutdown_read.c | 2 +- src/socket_shutdown_write.c | 2 +- src/stream.c | 4 ++-- src/tcp_socket.c | 9 +++++++-- src/udp_socket.c | 9 +++++++-- src/write.c | 2 +- 24 files changed, 44 insertions(+), 33 deletions(-) diff --git a/include/tr/interface/reader.h b/include/tr/interface/reader.h index 7739ddd..df7af4b 100644 --- a/include/tr/interface/reader.h +++ b/include/tr/interface/reader.h @@ -6,7 +6,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/tr/interface/socket.h b/include/tr/interface/socket.h index 04f3a87..b561b14 100644 --- a/include/tr/interface/socket.h +++ b/include/tr/interface/socket.h @@ -5,7 +5,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/tr/interface/writer.h b/include/tr/interface/writer.h index b8ea535..85d4fb6 100644 --- a/include/tr/interface/writer.h +++ b/include/tr/interface/writer.h @@ -6,7 +6,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/tr/remote_data.h b/include/tr/remote_data.h index bf26c86..088af63 100644 --- a/include/tr/remote_data.h +++ b/include/tr/remote_data.h @@ -6,7 +6,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,8 +37,8 @@ TR_CLASS(TR_RemoteData) { size_t ndata; TR_Socket socket; }; - TR_INSTANCE_INIT(TR_RemoteData); +TR_CLASSVARS_DECL(TR_RemoteData) {}; extern TR_RemoteData TR_emptyRemoteData; diff --git a/include/tr/socket.h b/include/tr/socket.h index de69b7d..ed4af25 100644 --- a/include/tr/socket.h +++ b/include/tr/socket.h @@ -7,7 +7,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -64,8 +64,8 @@ TR_CLASS(TR_Socket) { int handle; TR_SocketFin fin_state; }; - TR_INSTANCE_INIT(TR_Socket); +TR_CLASSVARS_DECL(TR_Socket) {}; #define TR_socketLog(socket) (((TR_Socket)(socket))->log) #define TR_socketFlags(socket) (((TR_Socket)(socket))->flags) @@ -115,14 +115,14 @@ TR_CLASS(TR_TcpSocket) { int listen; int connected; }; - TR_INSTANCE_INIT(TR_TcpSocket); +TR_CLASSVARS_DECL(TR_TcpSocket) {}; TR_CLASS(TR_UdpSocket) { TR_EXTENDS(TR_Socket); }; - TR_INSTANCE_INIT(TR_UdpSocket); +TR_CLASSVARS_DECL(TR_UdpSocket) {}; typedef int (* TR_socketAction_fptr)(void *); diff --git a/include/tr/stream.h b/include/tr/stream.h index 5d115c8..7f9736f 100644 --- a/include/tr/stream.h +++ b/include/tr/stream.h @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,6 +41,7 @@ TR_CLASS(TR_Stream) { } handle; }; TR_INSTANCE_INIT(TR_Stream); +TR_CLASSVARS_DECL(TR_Stream) {}; ssize_t TR_streamRead(TR_Stream, void *, size_t); ssize_t TR_streamWrite(TR_Stream, void *, size_t); diff --git a/src/i_reader.c b/src/i_reader.c index d1b51fd..1997854 100644 --- a/src/i_reader.c +++ b/src/i_reader.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/i_socket.c b/src/i_socket.c index de543ef..b206622 100644 --- a/src/i_socket.c +++ b/src/i_socket.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/i_writer.c b/src/i_writer.c index 73a3e9b..a6ca64c 100644 --- a/src/i_writer.c +++ b/src/i_writer.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/read.c b/src/read.c index f87f3f4..5af657e 100644 --- a/src/read.c +++ b/src/read.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/remote_data.c b/src/remote_data.c index dcb0661..25a7a2d 100644 --- a/src/remote_data.c +++ b/src/remote_data.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,7 +58,7 @@ remoteDataDtor(void * _this) } TR_INIT_IFACE(TR_Class, remoteDataCtor, remoteDataDtor, NULL); -TR_CREATE_CLASS(TR_RemoteData, NULL, TR_IF(TR_Class)); +TR_CREATE_CLASS(TR_RemoteData, NULL, NULL, TR_IF(TR_Class)); TR_INSTANCE(TR_RemoteData, TR_emptyRemoteData, NULL, 0, NULL, NULL); diff --git a/src/remote_data_set_data.c b/src/remote_data_set_data.c index cc9cfdb..456220d 100644 --- a/src/remote_data_set_data.c +++ b/src/remote_data_set_data.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/socket.c b/src/socket.c index 2cb426e..5fe53be 100644 --- a/src/socket.c +++ b/src/socket.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -89,6 +89,6 @@ socketBind(void * _this) TR_INIT_IFACE(TR_Class, socketCtor, socketDtor, NULL); TR_INIT_IFACE(TR_Socket, socketBind, NULL, NULL); -TR_CREATE_CLASS(TR_Socket, NULL, TR_IF(TR_Class), TR_IF(TR_Socket)); +TR_CREATE_CLASS(TR_Socket, NULL, NULL, TR_IF(TR_Class), TR_IF(TR_Socket)); // vim: set ts=4 sw=4: diff --git a/src/socket_accept.c b/src/socket_accept.c index 6f2d747..c2ad17b 100644 --- a/src/socket_accept.c +++ b/src/socket_accept.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/socket_close.c b/src/socket_close.c index a632d6c..90727e3 100644 --- a/src/socket_close.c +++ b/src/socket_close.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/socket_init.c b/src/socket_init.c index a226554..b582e54 100644 --- a/src/socket_init.c +++ b/src/socket_init.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/socket_nonblock.c b/src/socket_nonblock.c index 0d9873b..35e21ce 100644 --- a/src/socket_nonblock.c +++ b/src/socket_nonblock.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/socket_shutdown.c b/src/socket_shutdown.c index 0e6b6fb..0cb611d 100644 --- a/src/socket_shutdown.c +++ b/src/socket_shutdown.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/socket_shutdown_read.c b/src/socket_shutdown_read.c index a9c2ff3..cddb8e0 100644 --- a/src/socket_shutdown_read.c +++ b/src/socket_shutdown_read.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/socket_shutdown_write.c b/src/socket_shutdown_write.c index 6eba445..e7c4ce3 100644 --- a/src/socket_shutdown_write.c +++ b/src/socket_shutdown_write.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/stream.c b/src/stream.c index a25d443..b4fc60c 100644 --- a/src/stream.c +++ b/src/stream.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,6 +53,6 @@ streamCtor(void * _this, va_list * params) static void streamDtor(void * _this) {} TR_INIT_IFACE(TR_Class, streamCtor, streamDtor, NULL); -TR_CREATE_CLASS(TR_Stream, NULL, TR_IF(TR_Class)); +TR_CREATE_CLASS(TR_Stream, NULL, NULL, TR_IF(TR_Class)); // vim: set ts=4 sw=4: diff --git a/src/tcp_socket.c b/src/tcp_socket.c index 056c229..d617d46 100644 --- a/src/tcp_socket.c +++ b/src/tcp_socket.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -117,6 +117,11 @@ TR_INIT_IFACE( tcpSocketConnect, tcpSocketRecv, tcpSocketSend); -TR_CREATE_CLASS(TR_TcpSocket, TR_Socket, TR_IF(TR_Class), TR_IF(TR_Socket)); +TR_CREATE_CLASS( + TR_TcpSocket, + TR_Socket, + NULL, + TR_IF(TR_Class), + TR_IF(TR_Socket)); // vim: set ts=4 sw=4: diff --git a/src/udp_socket.c b/src/udp_socket.c index 4cd97a7..3103ce6 100644 --- a/src/udp_socket.c +++ b/src/udp_socket.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -98,6 +98,11 @@ udpSocketSend(TR_Socket this, TR_RemoteData data) TR_INIT_IFACE(TR_Class, udpSocketCtor, NULL, NULL); TR_INIT_IFACE(TR_Socket, NULL, NULL, udpSocketRecv, udpSocketSend); -TR_CREATE_CLASS(TR_UdpSocket, TR_Socket, TR_IF(TR_Class), TR_IF(TR_Socket)); +TR_CREATE_CLASS( + TR_UdpSocket, + TR_Socket, + NULL, + TR_IF(TR_Class), + TR_IF(TR_Socket)); // vim: set ts=4 sw=4: diff --git a/src/write.c b/src/write.c index 069c609..e58f911 100644 --- a/src/write.c +++ b/src/write.c @@ -4,7 +4,7 @@ * \author Georg Hopp * * \copyright - * Copyright © 2012 Georg Hopp + * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by