Csound Csound-dev Csound-tekno Search About

[Csnd] the CSOUND struct

Date2011-08-23 17:52
FromAdam Puckett
Subject[Csnd] the CSOUND struct
How is it possible for the CSOUND struct to have function types as members?


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-08-23 18:10
FromSteven Yi
SubjectRe: [Csnd] the CSOUND struct
Perhaps a question better for the Csound-dev list, but I'll see if I
can answer it here.  Are you asking about function pointers in the
CSOUND struct?  I'm not quite sure what you are referring to in
"function types".


On Tue, Aug 23, 2011 at 12:52 PM, Adam Puckett  wrote:
> How is it possible for the CSOUND struct to have function types as members?
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-08-23 18:12
FromAdam Puckett
SubjectRe: [Csnd] the CSOUND struct
Yes, function pointers.

On 8/23/11, Steven Yi  wrote:
> Perhaps a question better for the Csound-dev list, but I'll see if I
> can answer it here.  Are you asking about function pointers in the
> CSOUND struct?  I'm not quite sure what you are referring to in
> "function types".
>
>
> On Tue, Aug 23, 2011 at 12:52 PM, Adam Puckett 
> wrote:
>> How is it possible for the CSOUND struct to have function types as
>> members?
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-08-23 18:31
FromSteven Yi
SubjectRe: [Csnd] the CSOUND struct
Well, not sure about the question then.  The use of function pointers
within the struct is pretty straightforward, and you can think of it
as just a pointer, same as MYFLT* or char**, but to a function
instead.  Granted, if you're not used to function pointers in C, the
syntax can be a bit ugly compared to scripting languages.

The CSOUND struct is defined in H/csoundCore.h.  In Top/csound.c, line
91, there's a definition of a statict const cenviron_ that has a sort
of template version of CSOUND.  When you call csoundCreate (line 945),
you'll see a CSOUND struct gets malloc'd, then memset is used to copy
that template version of csound (cenviron_) into the new CSOUND
struct.  That's how the function pointers get assigned.

As this conversation is technical, if there's any further questions
let's take it to the csound-dev list.

Hope that helps!
steven


On Tue, Aug 23, 2011 at 1:12 PM, Adam Puckett  wrote:
> Yes, function pointers.
>
> On 8/23/11, Steven Yi  wrote:
>> Perhaps a question better for the Csound-dev list, but I'll see if I
>> can answer it here.  Are you asking about function pointers in the
>> CSOUND struct?  I'm not quite sure what you are referring to in
>> "function types".
>>
>>
>> On Tue, Aug 23, 2011 at 12:52 PM, Adam Puckett 
>> wrote:
>>> How is it possible for the CSOUND struct to have function types as
>>> members?
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>>
>>>
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"