Skip to content

Commit 6a1fdee

Browse files
author
Release Manager
committed
gh-35895: gap: make libgap APIs for function calls available ... and use them in two places. The rest will be dealt with in a future PR. URL: #35895 Reported by: Max Horn Reviewer(s): Marc Mezzarobba
2 parents 0d8231f + c715f0c commit 6a1fdee

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/sage/libs/gap/element.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ cdef char *capture_stdout(Obj func, Obj obj):
118118
GAP_Enter()
119119
s = NEW_STRING(0)
120120
output_text_string = GAP_ValueGlobalVariable("OutputTextString")
121-
stream = CALL_2ARGS(output_text_string, s, GAP_True)
121+
stream = GAP_CallFunc2Args(output_text_string, s, GAP_True)
122122

123123
l = GAP_NewPlist(1)
124124
GAP_AssList(l, 1, obj)
125125

126126
CALL_WITH_STREAM = GAP_ValueGlobalVariable("CALL_WITH_STREAM")
127-
CALL_3ARGS(CALL_WITH_STREAM, stream, func, l)
127+
GAP_CallFunc3Args(CALL_WITH_STREAM, stream, func, l)
128128
return GAP_CSTR_STRING(s)
129129
finally:
130130
GAP_Leave()

src/sage/libs/gap/gap_includes.pxd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ cdef extern from "gap/libgap-api.h" nogil:
6868
cdef Obj GAP_True
6969
cdef Obj GAP_False
7070

71+
Obj GAP_CallFuncList(Obj func, Obj args);
72+
Obj GAP_CallFuncArray(Obj func, UInt narg, Obj * args);
73+
Obj GAP_CallFunc0Args(Obj func);
74+
Obj GAP_CallFunc1Args(Obj func, Obj a1);
75+
Obj GAP_CallFunc2Args(Obj func, Obj a1, Obj a2);
76+
Obj GAP_CallFunc3Args(Obj func, Obj a1, Obj a2, Obj a3);
77+
7178
bint GAP_IsMacFloat(Obj obj)
7279
double GAP_ValueMacFloat(Obj obj)
7380

0 commit comments

Comments
 (0)