...
authoralex <[email protected]>
Sun, 5 Sep 2021 21:28:24 +0000 (14:28 -0700)
committeralex <[email protected]>
Sun, 5 Sep 2021 21:28:24 +0000 (14:28 -0700)
configure.ac
inc/opt.h
src/opt/env.c
src/opt/piecel.c [new file with mode: 0644]
src/opt/set.c

index dfe518cf9e6f3adee00c44f4e6ed3649d3cb68b5..a8c66d4733f5c466007460559376e5c6c9bf0f3c 100644 (file)
@@ -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])
index 15d1b50dda4c993552d5fd4f508c0e5d173bfe85..1188d2f0c06e6bf064299d86d3cab48c2c906b9c 100644 (file)
--- 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
index 7ecd9dcfec89086bb1b55b4c0ec485a0dd267392..0537777fc7ce752017a1cbd2406b4583168b4909 100644 (file)
@@ -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 (file)
index 0000000..3636b57
--- /dev/null
@@ -0,0 +1,5 @@
+#include<opt.h>
+
+int opt_set_piece_length(char *length) {
+       return -1;
+}
index a08c5a658ead579fb8d1127f189a95ecee8147da..18b7e87879c9f6e822aa4678656c1fb20aed6929 100644 (file)
@@ -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}
 };