Skip to content

Commit 52878f3

Browse files
committed
Update to JuliaLibWrapping .h file
1 parent ff8931c commit 52878f3

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

test/trimming/capplication.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
int main() {
55
// Example usage of the functions defined in libsimple.h
6-
CVectorPair_Float32 vecPair;
6+
CVectorPair_float_ vecPair;
77
vecPair.from.length = 3;
88
vecPair.from.data = (float[]){1.0f, 2.0f, 3.0f};
99
vecPair.to.length = 3;

test/trimming/libsimple.h

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
1-
#ifndef SIMPLELIB_H
2-
#define SIMPLELIB_H
3-
4-
#include <stdint.h>
1+
#ifndef JULIALIB_LIBSIMPLE_H
2+
#define JULIALIB_LIBSIMPLE_H
53
#include <stddef.h>
4+
#include <stdint.h>
5+
#include <stdbool.h>
66

7-
struct _MyTwoVec_ {
7+
typedef struct {
8+
int32_t length;
9+
float * data;
10+
} CVector_float_;
11+
typedef struct {
12+
CVector_float_ from;
13+
CVector_float_ to;
14+
} CVectorPair_float_;
15+
typedef struct {
816
int32_t x;
917
int32_t y;
10-
};
11-
typedef struct _MyTwoVec_ MyTwoVec;
12-
13-
struct _CVector_Float32_ {
14-
int32_t length;
15-
float *data;
16-
};
17-
typedef struct _CVector_Float32_ CVector_Float32;
18-
19-
struct _CVectorPair_Float32_ {
20-
CVector_Float32 from;
21-
CVector_Float32 to;
22-
};
23-
typedef struct _CVectorPair_Float32_ CVectorPair_Float32;
24-
25-
float copyto_and_sum(CVectorPair_Float32 fromto);
26-
int32_t countsame(MyTwoVec *list, int32_t length);
18+
} MyTwoVec;
2719

28-
#endif // SIMPLELIB_H
20+
int32_t countsame(MyTwoVec * list, int32_t n);
21+
float copyto_and_sum(CVectorPair_float_ fromto);
22+
#endif // JULIALIB_LIBSIMPLE_H

0 commit comments

Comments
 (0)