From: alex Date: Sun, 5 Sep 2021 21:28:24 +0000 (-0700) Subject: ... X-Git-Url: http://git.infiniteadaptability.org/?a=commitdiff_plain;h=908cf97426b2102ac01330dbe1d8077168c5cf76;p=seeder ... --- diff --git a/configure.ac b/configure.ac index dfe518c..a8c66d4 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,7 @@ AC_PROG_CC # Checks for libraries. AC_CHECK_LIB([pthread],[pthread_create]) +AC_CHECK_LIB([sodium],[crypto_hash_sha256_init]) # Checks for header files. AC_CHECK_HEADERS([stdlib.h string.h]) diff --git a/inc/opt.h b/inc/opt.h index 15d1b50..1188d2f 100644 --- a/inc/opt.h +++ b/inc/opt.h @@ -18,5 +18,6 @@ int opt_load_config_file(char*); int opt_load_from_env(); int opt_set(char*,char*); void opt_set_log_level(enum log_level); +int opt_set_piece_length(char*); #endif diff --git a/src/opt/env.c b/src/opt/env.c index 7ecd9dc..0537777 100644 --- a/src/opt/env.c +++ b/src/opt/env.c @@ -13,6 +13,7 @@ int opt_load_from_env() { char *p; CHECK_ENV("CONFIG",opt_load_config_file); + CHECK_ENV("PIECE_LENGTH",opt_set_piece_length); return 1; } diff --git a/src/opt/piecel.c b/src/opt/piecel.c new file mode 100644 index 0000000..3636b57 --- /dev/null +++ b/src/opt/piecel.c @@ -0,0 +1,5 @@ +#include + +int opt_set_piece_length(char *length) { + return -1; +} diff --git a/src/opt/set.c b/src/opt/set.c index a08c5a6..18b7e87 100644 --- a/src/opt/set.c +++ b/src/opt/set.c @@ -6,6 +6,7 @@ struct option_lookup_table_entry { }; struct option_lookup_table_entry option_lookup_table[] = { + {"piece_length",&opt_set_piece_length}, {"watch",&opt_add_watch}, {NULL,NULL} };