aboutsummaryrefslogtreecommitdiff
path: root/src/math/arg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/arg.c')
-rw-r--r--src/math/arg.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/math/arg.c b/src/math/arg.c
index 1a0d1ca..be3f92e 100644
--- a/src/math/arg.c
+++ b/src/math/arg.c
@@ -3,4 +3,21 @@
* Copyright (C) 2017 J08nY
*/
#include "arg.h"
-#include "types.h"
+
+
+arg_t *arg_new() {
+ arg_t *arg = pari_malloc(sizeof(arg_t));
+ if (!arg) {
+ perror("Couldn't malloc.");
+ exit(1);
+ }
+ memset(arg, 0, sizeof(arg_t));
+ return arg;
+}
+
+void arg_free(arg_t **arg) {
+ if (*arg) {
+ pari_free(*arg);
+ *arg = NULL;
+ }
+}