aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cm/cm.c5
-rw-r--r--src/ecgen.c4
-rw-r--r--src/io/input.c6
-rw-r--r--src/io/input.h3
-rw-r--r--src/io/output.c14
-rw-r--r--src/io/output.h2
-rw-r--r--src/math/curve.c10
-rw-r--r--src/math/equation.c10
8 files changed, 38 insertions, 16 deletions
diff --git a/src/cm/cm.c b/src/cm/cm.c
index 63a0005..6595226 100644
--- a/src/cm/cm.c
+++ b/src/cm/cm.c
@@ -4,4 +4,7 @@
*/
#include "cm.h"
-int cm_do(config_t *cfg) {} \ No newline at end of file
+int cm_do(config_t *cfg) {
+ //TODO implement
+ return INT_MIN;
+} \ No newline at end of file
diff --git a/src/ecgen.c b/src/ecgen.c
index 724e7e2..4ef3d33 100644
--- a/src/ecgen.c
+++ b/src/ecgen.c
@@ -55,10 +55,10 @@ bool init(void) {
}
// open outfile
- output_init(cfg.output, cfg.append);
+ output_init(&cfg);
// open infile
- input_init(cfg.input);
+ input_init(&cfg);
return true;
}
diff --git a/src/io/input.c b/src/io/input.c
index 263364d..780e4d3 100644
--- a/src/io/input.c
+++ b/src/io/input.c
@@ -93,11 +93,11 @@ GEN read_param(param_t param, const char *prompt, long bits) {
return fread_param(param, stdin, prompt, bits);
}
-void input_init(const char *input) {
+void input_init(config_t *cfg) {
json_set_allocation_functions(pari_malloc, pari_free);
- if (input) {
- in = fopen(input, "r");
+ if (cfg->input) {
+ in = fopen(cfg->input, "r");
delim = ',';
if (!in) {
// fallback to stdin or quit?
diff --git a/src/io/input.h b/src/io/input.h
index 1a3de5b..8cb5b35 100644
--- a/src/io/input.h
+++ b/src/io/input.h
@@ -6,6 +6,7 @@
#define ECGEN_INPUT_H
#include "math/random.h"
+#include "math/types.h"
typedef enum PARAM {
PARAM_PRIME,
@@ -48,7 +49,7 @@ GEN read_param(param_t param, const char *prompt, long bits);
extern FILE *in;
-void input_init(const char *input);
+void input_init(config_t *cfg);
void input_quit(void);
diff --git a/src/io/output.c b/src/io/output.c
index 2e4d82d..1b4b16b 100644
--- a/src/io/output.c
+++ b/src/io/output.c
@@ -50,18 +50,24 @@ void output_csv(FILE *out, const char *format, char delim, GEN vector) {
char *output_sjson(curve_t *curve) {
+ /*
JSON_Value *root_value = json_value_init_object();
JSON_Object *root_object = json_value_get_object(root_value);
char *result = NULL;
+ */
+ //TODO implement
+ return NULL;
}
-void output_json(FILE *out, GEN vector) {}
+void output_json(FILE *out, GEN vector) {
+ //TODO implement
+}
-void output_init(const char *output, bool append) {
+void output_init(config_t *cfg) {
json_set_allocation_functions(pari_malloc, pari_free);
- if (output) {
- out = fopen(output, append ? "a" : "w");
+ if (cfg->output) {
+ out = fopen(cfg->output, cfg->append ? "a" : "w");
if (!out) {
// fallback to stdout and output err
out = stdout;
diff --git a/src/io/output.h b/src/io/output.h
index 3adafce..b2b32ac 100644
--- a/src/io/output.h
+++ b/src/io/output.h
@@ -44,7 +44,7 @@ void output_json(FILE *out, GEN vector);
extern FILE *out;
extern FILE *debug;
-void output_init(const char *output, bool append);
+void output_init(config_t *cfg);
void output_quit(void);
diff --git a/src/math/curve.c b/src/math/curve.c
index 8c8b514..42844ff 100644
--- a/src/math/curve.c
+++ b/src/math/curve.c
@@ -80,9 +80,15 @@ int curve_nonzero(curve_t *curve, config_t *config, ...) {
}
}
-int curve_seed_fp(curve_t *curve, config_t *config, ...) {}
+int curve_seed_fp(curve_t *curve, config_t *config, ...) {
+ //TODO implement
+ return INT_MIN;
+}
-int curve_seed_f2m(curve_t *curve, config_t *config, ...) {}
+int curve_seed_f2m(curve_t *curve, config_t *config, ...) {
+ //TODO implement
+ return INT_MIN;
+}
int curve_seed(curve_t *curve, config_t *config, ...) {
switch (typ(curve->field)) {
diff --git a/src/math/equation.c b/src/math/equation.c
index 1e29ee4..e153405 100644
--- a/src/math/equation.c
+++ b/src/math/equation.c
@@ -34,7 +34,10 @@ int a_one(curve_t *curve, config_t *config, ...) {
return 1;
}
-int a_seed(curve_t *curve, config_t *config, ...) {}
+int a_seed(curve_t *curve, config_t *config, ...) {
+ //TODO implement
+ return INT_MIN;
+}
int b_random(curve_t *curve, config_t *config, ...) {
curve->b = genrand(curve->field);
@@ -57,4 +60,7 @@ int b_one(curve_t *curve, config_t *config, ...) {
return 1;
}
-int b_seed(curve_t *curve, config_t *config, ...) {}
+int b_seed(curve_t *curve, config_t *config, ...) {
+ //TODO implement
+ return INT_MIN;
+}