diff --git a/README b/README index 470ea62..540df59 100644 --- a/README +++ b/README @@ -1,8 +1,8 @@ -empty hi hi must read: http://www.beej.us/guide/bgnet/ - zu c99: http://www.c-plusplus.de/forum/296310-full - +00000000011111111112222222222333333333344444444445555555555666666666677777777778 +1234567890 1234567890 1234567890 1234567890 + 1234567890 1234567890 1234567890 1234567890 diff --git a/src/display.c b/src/display.c index 69746e9..527ad9c 100644 --- a/src/display.c +++ b/src/display.c @@ -43,7 +43,7 @@ static void print_current_image(const struct message* msg, int start, int end) { } -void callback(const struct message *msg) { +void callback(const struct message *msg, const struct prog_info *pinfo) { printf("in callback, tst=%d\n", msg->timestamp); int start; diff --git a/src/display.h b/src/display.h index 96907d2..c85f409 100644 --- a/src/display.h +++ b/src/display.h @@ -3,11 +3,12 @@ #include #include "msg.h" +#include "misc.h" void setup_display(); void cleanup_display(); -void callback(const struct message *msg); +void callback(const struct message *msg, const struct prog_info *pinfo); #endif diff --git a/src/main.c b/src/main.c index 196e690..d02fd41 100644 --- a/src/main.c +++ b/src/main.c @@ -26,6 +26,7 @@ int parseArgs(struct prog_info *pinfo, int argc, char **argv) { printf( " -t when in server mode: update times\n"); printf( " per second. Valid range: 2 - 99\n"); printf( " no use in client mode\n"); + printf( " -v \n"); printf("\n\n"); return -1; } diff --git a/src/net.c b/src/net.c index 8147d1c..46944b7 100644 --- a/src/net.c +++ b/src/net.c @@ -109,7 +109,7 @@ int run_server(const struct prog_info *pinfo) { // lauschangriff: // einfach mal in den äther horchen und alle messages rausnehmen die wo da gibt. // -int run_client(const struct prog_info *pinfo, void (*framecallback)(const struct message *) ) { +int run_client(const struct prog_info *pinfo, void (*framecallback)(const struct message *, const struct prog_info *) ) { struct addrinfo hints, *servinfo; char portbuf[6]; @@ -171,7 +171,7 @@ int run_client(const struct prog_info *pinfo, void (*framecallback)(const struct struct message *msg = (struct message *)malloc(sizeof(struct message)); deserialize(msg, buf); - framecallback(msg); + framecallback(msg, pinfo); } while (strncmp(buf, "exit", 10000)); diff --git a/src/net.h b/src/net.h index 1e70d70..0719433 100644 --- a/src/net.h +++ b/src/net.h @@ -8,6 +8,6 @@ void *get_in_addr(struct sockaddr *sa); int run_server(const struct prog_info *pinfo); -int run_client(const struct prog_info *pinfo,void(*framecallback)(const struct message *)); +int run_client(const struct prog_info *pinfo,void(*framecallback)(const struct message *, const struct prog_info *)); #endif