Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fpvm: accessor functions

  • Loading branch information...
commit 50436b5ddcc619b8fd09bccc65f63bd595d7f4a3 1 parent 60b370e
Sébastien Bourdeauducq authored November 24, 2011
6  software/include/fpvm/fpvm.h
@@ -36,6 +36,8 @@
36 36
 
37 37
 #define FPVM_MAXERRLEN		64
38 38
 
  39
+typedef void (*fpvm_bind_callback)(void *, const char *, int);
  40
+
39 41
 struct fpvm_binding {
40 42
 	int isvar;
41 43
 	union {
@@ -49,8 +51,6 @@ struct fpvm_tbinding {
49 51
 	char sym[FPVM_MAXSYMLEN];
50 52
 };
51 53
 
52  
-typedef void (*fpvm_bind_callback)(void *, const char *, int);
53  
-
54 54
 struct fpvm_fragment {
55 55
 	char last_error[FPVM_MAXERRLEN];
56 56
 	fpvm_bind_callback bind_callback;
@@ -98,6 +98,8 @@ struct fpvm_fragment {
98 98
 const char *fpvm_version();
99 99
 
100 100
 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);
101 103
 void fpvm_set_bind_callback(struct fpvm_fragment *fragment, fpvm_bind_callback callback, void *user);
102 104
 
103 105
 int fpvm_bind(struct fpvm_fragment *fragment, const char *sym);
10  software/libfpvm/fpvm.c
@@ -72,12 +72,22 @@ void fpvm_init(struct fpvm_fragment *fragment, int vector_mode)
72 72
 	fragment->vector_mode = vector_mode;
73 73
 }
74 74
 
  75
+const char *fpvm_get_last_error(struct fpvm_fragment *fragment)
  76
+{
  77
+	return fragment->last_error;
  78
+}
  79
+
75 80
 void fpvm_set_bind_callback(struct fpvm_fragment *fragment, fpvm_bind_callback callback, void *user)
76 81
 {
77 82
 	fragment->bind_callback = callback;
78 83
 	fragment->bind_callback_user = user;
79 84
 }
80 85
 
  86
+void fpvm_set_bind_mode(struct fpvm_fragment *fragment, int bind_mode)
  87
+{
  88
+	fragment->bind_mode = bind_mode;
  89
+}
  90
+
81 91
 int fpvm_bind(struct fpvm_fragment *fragment, const char *sym)
82 92
 {
83 93
 	int r;

0 notes on commit 50436b5

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