File Makefile changed (mode: 100644) (index 5e19d0a..1c4effd) |
1 |
1 |
SOURCES = $(wildcard *.c) |
SOURCES = $(wildcard *.c) |
2 |
|
DEPS=libtoxcore |
|
|
2 |
|
DEPS=libsodium toxcore |
3 |
3 |
CC=gcc |
CC=gcc |
4 |
4 |
CFLAGS=-g #-std=c99 |
CFLAGS=-g #-std=c99 |
5 |
5 |
CFLAGS += $(shell pkg-config --cflags $(DEPS)) |
CFLAGS += $(shell pkg-config --cflags $(DEPS)) |
6 |
6 |
LDFLAGS=-g -pthread -lm -static -lrt |
LDFLAGS=-g -pthread -lm -static -lrt |
7 |
|
LDFLAGS += $(shell pkg-config --libs $(DEPS)) |
|
|
7 |
|
LDFLAGS += $(shell pkg-config --static --libs $(DEPS)) |
|
8 |
|
DSO_LDFLAGS=-g -pthread -lm -lrt |
|
9 |
|
DSO_LDFLAGS += $(shell pkg-config --libs $(DEPS)) |
8 |
10 |
OBJECTS=$(SOURCES:.c=.o) |
OBJECTS=$(SOURCES:.c=.o) |
9 |
11 |
INCLUDES = $(wildcard *.h) |
INCLUDES = $(wildcard *.h) |
10 |
12 |
|
|
|
... |
... |
gitversion.c: gitversion.h |
19 |
21 |
$(CC) $(CFLAGS) $< -c -o $@ |
$(CC) $(CFLAGS) $< -c -o $@ |
20 |
22 |
|
|
21 |
23 |
tuntox: $(OBJECTS) $(INCLUDES) |
tuntox: $(OBJECTS) $(INCLUDES) |
22 |
|
$(CC) -o $@ $(OBJECTS) -ltoxcore -lpthread $(LDFLAGS) /usr/local/lib/libsodium.a /usr/local/lib/libtoxcore.a |
|
|
24 |
|
$(CC) -o $@ $(OBJECTS) -lpthread $(LDFLAGS) /usr/local/lib/libtoxmessenger.a /usr/local/lib/libtoxcore.a |
|
25 |
|
|
|
26 |
|
tuntox_nostatic: $(OBJECTS) $(INCLUDES) |
|
27 |
|
$(CC) -o $@ $(OBJECTS) -lpthread $(DSO_LDFLAGS) |
23 |
28 |
|
|
24 |
29 |
cscope.out: |
cscope.out: |
25 |
30 |
cscope -bv ./*.[ch] |
cscope -bv ./*.[ch] |
File main.c changed (mode: 100644) (index f9e3092..783b509) |
... |
... |
int send_frame(protocol_frame *frame, uint8_t *data) |
331 |
331 |
|
|
332 |
332 |
for(j = 0; j < i; j++) |
for(j = 0; j < i; j++) |
333 |
333 |
{ |
{ |
334 |
|
tox_iterate(tox); |
|
|
334 |
|
tox_iterate(tox, NULL); |
335 |
335 |
usleep(j * 10000); |
usleep(j * 10000); |
336 |
336 |
} |
} |
337 |
337 |
} |
} |
|
... |
... |
int do_server_loop() |
904 |
904 |
tunnel *tmp = NULL; |
tunnel *tmp = NULL; |
905 |
905 |
TOX_CONNECTION connected = 0; |
TOX_CONNECTION connected = 0; |
906 |
906 |
|
|
907 |
|
tox_callback_friend_lossless_packet(tox, parse_lossless_packet, NULL); |
|
|
907 |
|
tox_callback_friend_lossless_packet(tox, parse_lossless_packet); |
908 |
908 |
|
|
909 |
909 |
tv.tv_sec = 0; |
tv.tv_sec = 0; |
910 |
910 |
tv.tv_usec = 20000; |
tv.tv_usec = 20000; |
|
... |
... |
int do_server_loop() |
918 |
918 |
int select_rv = 0; |
int select_rv = 0; |
919 |
919 |
|
|
920 |
920 |
/* Let tox do its stuff */ |
/* Let tox do its stuff */ |
921 |
|
tox_iterate(tox); |
|
|
921 |
|
tox_iterate(tox, NULL); |
922 |
922 |
|
|
923 |
923 |
/* Get the desired sleep time, used in select() later */ |
/* Get the desired sleep time, used in select() later */ |
924 |
924 |
tox_do_interval_ms = tox_iteration_interval(tox); |
tox_do_interval_ms = tox_iteration_interval(tox); |
|
... |
... |
int main(int argc, char *argv[]) |
1378 |
1378 |
} |
} |
1379 |
1379 |
|
|
1380 |
1380 |
set_tox_username(tox); |
set_tox_username(tox); |
1381 |
|
tox_callback_self_connection_status(tox, handle_connection_status_change, NULL); |
|
|
1381 |
|
tox_callback_self_connection_status(tox, handle_connection_status_change); |
1382 |
1382 |
|
|
1383 |
1383 |
do_bootstrap(tox); |
do_bootstrap(tox); |
1384 |
1384 |
|
|
|
... |
... |
int main(int argc, char *argv[]) |
1411 |
1411 |
tox_printable_id[TOX_ADDRESS_SIZE * 2] = '\0'; |
tox_printable_id[TOX_ADDRESS_SIZE * 2] = '\0'; |
1412 |
1412 |
log_printf(L_INFO, "Using Tox ID: %s\n", tox_printable_id); |
log_printf(L_INFO, "Using Tox ID: %s\n", tox_printable_id); |
1413 |
1413 |
|
|
1414 |
|
tox_callback_friend_request(tox, accept_friend_request, NULL); |
|
|
1414 |
|
tox_callback_friend_request(tox, accept_friend_request); |
1415 |
1415 |
do_server_loop(); |
do_server_loop(); |
1416 |
1416 |
clear_rules(); |
clear_rules(); |
1417 |
1417 |
} |
} |
File util.h changed (mode: 100644) (index 1a210d5..7dced6b) |
... |
... |
void id_to_string(char_t *dest, const char_t *src); |
13 |
13 |
int string_to_id(char_t *w, char_t *a); |
int string_to_id(char_t *w, char_t *a); |
14 |
14 |
void* file_raw(char *path, uint32_t *size); |
void* file_raw(char *path, uint32_t *size); |
15 |
15 |
const char *readable_connection_status(TOX_CONNECTION status); |
const char *readable_connection_status(TOX_CONNECTION status); |
|
16 |
|
int parse_local_port_forward(char *string, int *local_port, char **hostname, int *remote_port); |
|
17 |
|
int parse_pipe_port_forward(char *string, char **hostname, int *remote_port); |
16 |
18 |
|
|
17 |
19 |
#endif |
#endif |