This code, IOhannes m zmoelnig 2001-09-13, if I am correct, defines a structure of type " _helloworld " and declares an instance of that structure called t_helloworld.
typedef struct _helloworld {
t_object x_obj;
} t_helloworld;
This is where I get confused. The code below defines a function which has one argument, the variable " x " which is declared as a pointer to type t_helloworld.
void helloworld_bang(t_helloworld *x)
{
post("Hello world !!");
}
How is this possible, if t_helloworld is a structure and not a type? Shouldn't the argument be "...(_helloworld *x)"?
I looked at the example code that comes with puredata, and it follows the exact same format. I compiled the examples and they seem to work fine, so I believe that the code is correct; I just don't understand why.
These code snippets came from IOhannes m Zmoeling's awsome guide to writing externals which can be found here: