summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-05-22 18:23:56 -0400
committerirungentoo <irungentoo@gmail.com>2015-05-22 18:23:56 -0400
commit8e80ced6cea5c50e628c1931f6b3b764b97efb41 (patch)
tree43d8aaf1500bee9abdbd11be5175990a98414d3b /testing
parent2ba076ac5cc6efb5eb41fb4aa6a77a151885f26c (diff)
Move savedata to options struct.
Add a way to select the type of savedata (normal savedata, load a secret key, potentially others?) to load.
Diffstat (limited to 'testing')
-rw-r--r--testing/irc_syncbot.c2
-rw-r--r--testing/nTox.c14
-rw-r--r--testing/tox_shell.c2
-rw-r--r--testing/tox_sync.c2
4 files changed, 15 insertions, 5 deletions
diff --git a/testing/irc_syncbot.c b/testing/irc_syncbot.c
index 2d326c4b..a4e2254a 100644
--- a/testing/irc_syncbot.c
+++ b/testing/irc_syncbot.c
@@ -222,7 +222,7 @@ Tox *init_tox(int argc, char *argv[])
222 exit(0); 222 exit(0);
223 } 223 }
224 224
225 Tox *tox = tox_new(0, 0, 0, 0); 225 Tox *tox = tox_new(0, 0);
226 226
227 if (!tox) 227 if (!tox)
228 exit(1); 228 exit(1);
diff --git a/testing/nTox.c b/testing/nTox.c
index 77f812b5..03f17da5 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -942,7 +942,17 @@ static Tox *load_data()
942 return 0; 942 return 0;
943 } 943 }
944 944
945 Tox *m = tox_new(0, data, size, NULL); 945 struct Tox_Options options;
946
947 tox_options_default(&options);
948
949 options.savedata_type = TOX_SAVEDATA_TYPE_TOX_SAVE;
950
951 options.savedata_data = data;
952
953 options.savedata_length = size;
954
955 Tox *m = tox_new(&options, NULL);
946 956
947 if (fclose(data_file) < 0) { 957 if (fclose(data_file) < 0) {
948 perror("[!] fclose failed"); 958 perror("[!] fclose failed");
@@ -953,7 +963,7 @@ static Tox *load_data()
953 return m; 963 return m;
954 } 964 }
955 965
956 return tox_new(0, 0, 0, NULL); 966 return tox_new(NULL, NULL);
957} 967}
958 968
959static int save_data(Tox *m) 969static int save_data(Tox *m)
diff --git a/testing/tox_shell.c b/testing/tox_shell.c
index 23fa320a..521e9f36 100644
--- a/testing/tox_shell.c
+++ b/testing/tox_shell.c
@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
95 printf("error setting flags\n"); 95 printf("error setting flags\n");
96 } 96 }
97 97
98 Tox *tox = tox_new(0, 0, 0, 0); 98 Tox *tox = tox_new(0, 0);
99 tox_callback_friend_connection_status(tox, print_online, NULL); 99 tox_callback_friend_connection_status(tox, print_online, NULL);
100 tox_callback_friend_message(tox, print_message, master); 100 tox_callback_friend_message(tox, print_message, master);
101 101
diff --git a/testing/tox_sync.c b/testing/tox_sync.c
index be1fe32d..738c2f2d 100644
--- a/testing/tox_sync.c
+++ b/testing/tox_sync.c
@@ -243,7 +243,7 @@ int main(int argc, char *argv[])
243 exit(0); 243 exit(0);
244 } 244 }
245 245
246 Tox *tox = tox_new(0, 0, 0, 0); 246 Tox *tox = tox_new(0, 0);
247 tox_callback_file_recv_chunk(tox, write_file, NULL); 247 tox_callback_file_recv_chunk(tox, write_file, NULL);
248 tox_callback_file_recv_control(tox, file_print_control, NULL); 248 tox_callback_file_recv_control(tox, file_print_control, NULL);
249 tox_callback_file_recv(tox, file_request_accept, NULL); 249 tox_callback_file_recv(tox, file_request_accept, NULL);