mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-30 07:02:24 +03:00
a972778eab
They don't all pass yet, for minor reasons. Coming shortly... Unfortunately the startup overhead for chez is really noticeable here!
33 lines
507 B
C
33 lines
507 B
C
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include "struct.h"
|
|
|
|
char* getString(void *p) {
|
|
return (char*)p;
|
|
}
|
|
|
|
point* mkPoint(int x, int y) {
|
|
point* pt = malloc(sizeof(point));
|
|
pt->x = x;
|
|
pt->y = y;
|
|
return pt;
|
|
}
|
|
|
|
void freePoint(point* pt) {
|
|
free(pt);
|
|
}
|
|
|
|
namedpoint* mkNamedPoint(char* str, point* p) {
|
|
namedpoint* np = malloc(sizeof(namedpoint));
|
|
np->name = str;
|
|
np->pt = p;
|
|
printf("Made it!\n");
|
|
|
|
return np;
|
|
}
|
|
|
|
void freeNamedPoint(namedpoint* np) {
|
|
free(np);
|
|
}
|
|
|