[Gambas-user] Memory Stream Help

Randall Morgan rmorgan62 at ...626...
Tue Nov 22 18:56:22 CET 2011


I do the C structures defined. But the functions return pointers to the
structures created by Tidy. So I have to Read the data into my local copy
using the pointer returned. Which I feel is very inefficient. I have just
started to play around with defining offset values for each location in the
structure returned by tidy and simply accessing tidy's structures directly.
I feel this is more efficient that making local copies of the structures.

I am new to Gambas but not programming in general. So any pointer on how
best to work with external libraries would be helpful. Once I have a well
defined interface to the external library I want to package it as a
component. There other external libraries I'd like to package as components
as well. So this is just my first attempted. I've had some minor successes
so far. But I want to make the library wrapper as useful as possible by
including at least a reasonable subset of Tidy's capabilities.

I would love to see some Gambas 3 samples code for reading and writing
c-structures using pointers....



2011/11/21 Benoît Minisini <gambas at ...1...>

> Le 20/11/2011 05:42, Randall Morgan a écrit :
> > Hi All,
> >
> > Can someone give me a sample of using memory streams to read and write
> data
> > to/from memory.
> >
> > I am needing to read data from a C structure allocated by the external
> > library (tidy) with the pointer returned to Gambas.
> >
> > I read the page on external libraries many times before learning the
> Gambas
> > 3 does not allow the use of READ on pointers any longer.
> > This should be updated on the how to use external libraries page in the
> > section "More on Pointers"
> >
> > Still, with the given documentation for Gambas3 I am unable to get my
> > program to compile. So a sample of reading from memory using a pointer
> > would be very helpful.
> >
> > Thanks!
> >
>
> If you have the definition of the C structure, you should use a Gambas
> structure to read or write it.
>
> --
> Benoît Minisini
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
If you ask me if it can be done. The answer is YES, it can always be done.
The correct questions however are... What will it cost, and how long will
it take?



More information about the User mailing list