Browse Source

Use new class interface and update copyright information

1.0.0
Georg Hopp 12 years ago
parent
commit
3f373aabed
  1. 2
      include/tr/interface/reader.h
  2. 2
      include/tr/interface/socket.h
  3. 2
      include/tr/interface/writer.h
  4. 4
      include/tr/remote_data.h
  5. 8
      include/tr/socket.h
  6. 3
      include/tr/stream.h
  7. 2
      src/i_reader.c
  8. 2
      src/i_socket.c
  9. 2
      src/i_writer.c
  10. 2
      src/read.c
  11. 4
      src/remote_data.c
  12. 2
      src/remote_data_set_data.c
  13. 4
      src/socket.c
  14. 2
      src/socket_accept.c
  15. 2
      src/socket_close.c
  16. 2
      src/socket_init.c
  17. 2
      src/socket_nonblock.c
  18. 2
      src/socket_shutdown.c
  19. 2
      src/socket_shutdown_read.c
  20. 2
      src/socket_shutdown_write.c
  21. 4
      src/stream.c
  22. 9
      src/tcp_socket.c
  23. 9
      src/udp_socket.c
  24. 2
      src/write.c

2
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

2
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

2
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

4
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;

8
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 *);

3
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);

2
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

2
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

2
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

2
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

4
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);

2
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

4
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:

2
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

2
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

2
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

2
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

2
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

2
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

2
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

4
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:

9
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:

9
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:

2
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

Loading…
Cancel
Save