File: common.c

package info (click to toggle)
gap 4.15.1-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 110,212 kB
  • sloc: ansic: 97,261; xml: 48,343; cpp: 13,946; sh: 4,900; perl: 1,650; javascript: 255; makefile: 252; ruby: 9
file content (25 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Small program to test libgap linkability and basic working
 */
#include "common.h"

void test_eval(const char * cmd)
{
    Obj  res, ires;
    Int  rc, i, ok;
    printf("gap> %s\n", cmd);
    ok = GAP_Enter();
    if (ok) {
        res = GAP_EvalString(cmd);
        rc = GAP_LenList(res);
        for (i = 1; i <= rc; i++) {
            ires = GAP_ElmList(res, i);
            if (GAP_ElmList(ires, 1) == GAP_True) {
                Char * buffer = GAP_CSTR_STRING(GAP_ElmList(ires, 5));
                if (buffer)
                    printf("%s\n", buffer);
            }
        }
    }
    GAP_Leave();
}