Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fpvm: accessor functions

  • Loading branch information...
commit 50436b5ddcc619b8fd09bccc65f63bd595d7f4a3 1 parent 60b370e
@sbourdeauducq sbourdeauducq authored
Showing with 14 additions and 2 deletions.
  1. +4 −2 software/include/fpvm/fpvm.h
  2. +10 −0 software/libfpvm/fpvm.c
View
6 software/include/fpvm/fpvm.h
@@ -36,6 +36,8 @@
#define FPVM_MAXERRLEN 64
+typedef void (*fpvm_bind_callback)(void *, const char *, int);
+
struct fpvm_binding {
int isvar;
union {
@@ -49,8 +51,6 @@ struct fpvm_tbinding {
char sym[FPVM_MAXSYMLEN];
};
-typedef void (*fpvm_bind_callback)(void *, const char *, int);
-
struct fpvm_fragment {
char last_error[FPVM_MAXERRLEN];
fpvm_bind_callback bind_callback;
@@ -98,6 +98,8 @@ struct fpvm_fragment {
const char *fpvm_version();
void fpvm_init(struct fpvm_fragment *fragment, int vector_mode);
+const char *fpvm_get_last_error(struct fpvm_fragment *fragment);
+void fpvm_set_bind_mode(struct fpvm_fragment *fragment, int bind_mode);
void fpvm_set_bind_callback(struct fpvm_fragment *fragment, fpvm_bind_callback callback, void *user);
int fpvm_bind(struct fpvm_fragment *fragment, const char *sym);
View
10 software/libfpvm/fpvm.c
@@ -72,12 +72,22 @@ void fpvm_init(struct fpvm_fragment *fragment, int vector_mode)
fragment->vector_mode = vector_mode;
}
+const char *fpvm_get_last_error(struct fpvm_fragment *fragment)
+{
+ return fragment->last_error;
+}
+
void fpvm_set_bind_callback(struct fpvm_fragment *fragment, fpvm_bind_callback callback, void *user)
{
fragment->bind_callback = callback;
fragment->bind_callback_user = user;
}
+void fpvm_set_bind_mode(struct fpvm_fragment *fragment, int bind_mode)
+{
+ fragment->bind_mode = bind_mode;
+}
+
int fpvm_bind(struct fpvm_fragment *fragment, const char *sym)
{
int r;

0 comments on commit 50436b5

Please sign in to comment.
Something went wrong with that request. Please try again.