Skip to content

Commit 50436b5

Browse files
author
Sebastien Bourdeauducq
committedNov 24, 2011
fpvm: accessor functions
1 parent 60b370e commit 50436b5

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed
 

‎software/include/fpvm/fpvm.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
#define FPVM_MAXERRLEN 64
3838

39+
typedef void (*fpvm_bind_callback)(void *, const char *, int);
40+
3941
struct fpvm_binding {
4042
int isvar;
4143
union {
@@ -49,8 +51,6 @@ struct fpvm_tbinding {
4951
char sym[FPVM_MAXSYMLEN];
5052
};
5153

52-
typedef void (*fpvm_bind_callback)(void *, const char *, int);
53-
5454
struct fpvm_fragment {
5555
char last_error[FPVM_MAXERRLEN];
5656
fpvm_bind_callback bind_callback;
@@ -98,6 +98,8 @@ struct fpvm_fragment {
9898
const char *fpvm_version();
9999

100100
void fpvm_init(struct fpvm_fragment *fragment, int vector_mode);
101+
const char *fpvm_get_last_error(struct fpvm_fragment *fragment);
102+
void fpvm_set_bind_mode(struct fpvm_fragment *fragment, int bind_mode);
101103
void fpvm_set_bind_callback(struct fpvm_fragment *fragment, fpvm_bind_callback callback, void *user);
102104

103105
int fpvm_bind(struct fpvm_fragment *fragment, const char *sym);

‎software/libfpvm/fpvm.c

+10
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,22 @@ void fpvm_init(struct fpvm_fragment *fragment, int vector_mode)
7272
fragment->vector_mode = vector_mode;
7373
}
7474

75+
const char *fpvm_get_last_error(struct fpvm_fragment *fragment)
76+
{
77+
return fragment->last_error;
78+
}
79+
7580
void fpvm_set_bind_callback(struct fpvm_fragment *fragment, fpvm_bind_callback callback, void *user)
7681
{
7782
fragment->bind_callback = callback;
7883
fragment->bind_callback_user = user;
7984
}
8085

86+
void fpvm_set_bind_mode(struct fpvm_fragment *fragment, int bind_mode)
87+
{
88+
fragment->bind_mode = bind_mode;
89+
}
90+
8191
int fpvm_bind(struct fpvm_fragment *fragment, const char *sym)
8292
{
8393
int r;

0 commit comments

Comments
 (0)
Please sign in to comment.