SWIG wrapper: Mark ftdi_version_info.version_str and .snapshot_str read only
[libftdi] / bindings / ftdi.i
index 1fc2a59..ace244b 100644 (file)
@@ -3,16 +3,26 @@
 %include "typemaps.i"
 %include "cpointer.i"
 %pointer_functions(unsigned int, uintp);
+%pointer_functions(unsigned char *, ucharp);
+%pointer_functions(char *, charp);
 
 %typemap(in) unsigned char* = char*;
 %ignore ftdi_write_data_async;
 %ignore ftdi_async_complete;
 
+%immutable ftdi_version_info::version_str;
+%immutable ftdi_version_info::snapshot_str;
+
 %include ftdi.h
 %{
 #include <ftdi.h>
 %}
 
+%include ftdi_i.h
+%{
+#include <ftdi_i.h>
+%}
+
 extern "C" {
 
 %apply char *OUTPUT { unsigned char *buf };
@@ -39,12 +49,12 @@ extern "C" {
 %clear unsigned short *status;
 
 %apply char *OUTPUT { unsigned char *output };
-    int  ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output);
+    int  ftdi_eeprom_build(struct ftdi_context *ftdi);
 %clear unsigned char *output;
 
 %apply char *OUTPUT { unsigned char *eeprom };
-    int ftdi_read_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
-    int ftdi_write_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
+    int ftdi_read_eeprom(struct ftdi_context *ftdi);
+    int ftdi_write_eeprom(struct ftdi_context *ftdi);
 %clear unsigned char *eeprom;
 
 %apply int *OUTPUT { unsigned int *chipid };