Howdy -<br><br>Now that my MySQL FFI implementation doesn't crash every few moments, I've been able to make some headway into making the API useful. This has been going well, until I hit the row handling MySQL requires. Here's the C example they provide:<br>
<br><br><div style="margin-left: 40px;">MYSQL_ROW row;<br>unsigned int num_fields;<br>unsigned int i;<br></div><br><div style="margin-left: 40px;">num_fields = mysql_num_fields(result);<br>while ((row = mysql_fetch_row(result)))<br>
{<br> unsigned long *lengths;<br> lengths = mysql_fetch_lengths(result);<br> for(i = 0; i < num_fields; i++)<br> {<br> printf("[%.*s] ", (int) lengths[i], <br> row[i] ? row[i] : "NULL");<br>
}<br> printf("\n");<br>}<br></div><br>Apparently, when I call mysql_fetch_row(...) it will return back a big array of character data that is the series of columns. I can index into this array by calling mysql_num_fields and mysql_fetch_lengths.<br>
<br>mysql_fetch_lengths returns back an array of numbers, while the row object is essentially an array.<br><br>Given this, I think I need to focus on how Scheme handles C arrays. What's the cleanest way to handle this? I've found some discussion about cvectors, is that I'm looking for?<br>
<br>Thanks,<br>-Ben<br clear="all"><br>-- <br>Have an idea for software? I can make it happen - <a href="http://www.ideas2executables.com">http://www.ideas2executables.com</a><br>My Blog: <a href="http://benjisimon.blogspot.com">http://benjisimon.blogspot.com</a><br>