aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/rust/15 polyglot sharedlib/adder.c
blob: 66613edf57d7ca59976a85d0f6c7566343bae04f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include<adder.h>
#include<stdlib.h>

struct _Adder {
    int number;
};

adder* adder_create(int number) {
    adder *a = malloc(sizeof(struct _Adder));
    a->number = number;
    return a;
}

// adder_add is implemented in the Rust file.

void adder_destroy(adder *a) {
    free(a);
}