[Cs-dev] Accessing string variables through the API
Date | 2015-03-17 03:30 |
From | Andres Cabrera |
Subject | [Cs-dev] Accessing string variables through the API |
Attachments | None None |
Hi, The current state of string channels through the API causes issues for large strings. The problem is that there are no API methods to resize string variables (accessible from host code), so if string values for a channel are longer than the 128 that are pre-allocated in the init pass for the string variable, there is no way for the invalue callback to resize this data space. Should there be these methods? How would this play with more complex data types (e.g. user defined types) and channels? Cheers, Andrés |
Date | 2015-03-17 12:19 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Accessing string variables through the API |
Can we not resize as needed in the callback, maybe exposing the memory functions to do that? Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 17 Mar 2015, at 03:30, Andres Cabrera |
Date | 2015-03-17 17:34 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] Accessing string variables through the API |
Attachments | None None |
Yes, I think that's the way to go. But this needs to be exposed in some generic way to allow for future usage of channels using any particular type. Maybe the type system could provide resizing functions and then this is what gets exposed. Currently the STRINGDAT struct is deep within the private API, and it's not really generic enough, I think it would be better if we integrate the type system here. Cheers,On Tue, Mar 17, 2015 at 5:19 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: Can we not resize as needed in the callback, maybe exposing the memory functions to do that? |
Date | 2015-03-17 20:56 |
From | Steven Yi |
Subject | Re: [Cs-dev] Accessing string variables through the API |
I double checked, as I thought I might have modified the channels system to use CS_VAR_MEM, so that you can access the type pointer. However, that's not the case unfortunately. Andres: could you file an issue and assign it to me for reworking the channel db for CS_VAR_MEM? We also may want to modify the system to use CS_TYPE's when creating channels, rather than have a separate set of type information like we do now. For things like STRINGDAT, I think we need to have that be public. It's sort of a primitive data type and there's not much one can do for introspection. For CS7 structs, the data type for that should also be exposed. For structs, one can use the CS_TYPE, which has information about the fields of the structure, to interrogate values in a struct variable. On Tue, Mar 17, 2015 at 1:34 PM, Andres Cabrera |