summaryrefslogtreecommitdiff
path: root/Ganlib/src/setara_c.c
diff options
context:
space:
mode:
authorstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
committerstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
commit7dfcc480ba1e19bd3232349fc733caef94034292 (patch)
tree03ee104eb8846d5cc1a981d267687a729185d3f3 /Ganlib/src/setara_c.c
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Ganlib/src/setara_c.c')
-rw-r--r--Ganlib/src/setara_c.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/Ganlib/src/setara_c.c b/Ganlib/src/setara_c.c
new file mode 100644
index 0000000..1cd3918
--- /dev/null
+++ b/Ganlib/src/setara_c.c
@@ -0,0 +1,46 @@
+/*
+ -----------------------------------------------------------------------
+ Copyright (C) 2002 Ecole Polytechnique de Montreal
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ DYNAMIC ALLOCATION/LIBERATION OF MEMORY WITH SETARA/RLSARA IN C.
+
+ SETARA PARAMETERS:
+ LENGTH : NUMBER OF SINGLE PRECISION WORDS TO BE ALLOCATED BY SETARA.
+ IOF : OFFSET OF THE ALLOCATED SPACE.
+
+ RLSARA PARAMETER:
+ BASE : FIRST WORD OF THE MEMORY SPACE TO BE DEALLOCATED.
+
+ -----------------------------------------------------------------------
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include "ganlib.h"
+
+static char AbortString[80];
+
+int_32 * setara_c(int_32 length)
+{
+ char *nomsub="setara_c";
+ int_32 *kaddr;
+
+ kaddr = (int_32 *)malloc(length*sizeof(int_32));
+ if (kaddr == 0) {
+ sprintf(AbortString,"%s: invalid return code %ld length=%d",nomsub,(long)kaddr,(int)length);
+ xabort_c(AbortString);
+ }
+ return kaddr;
+}
+/* Function rlsara_c */
+void rlsara_c(int_32 *iof)
+{
+ free(iof);
+ return;
+}