lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


How do I use global variables with alien?
I have some global variables in my C library: how do I read or set the
value from lua? In my C program I have:
int my_global;
int get_my_global()
{
	return my_global;
}
This is only for reading - and it is enough for now.

Or similarly how do I get stdout to use it with fprintf function?
For now I have created function
FILE *
get_stdout()
{
        return stdout;
}
but this only possible if I am interfacing my own c-library.
Is there a way to get hold of stdout without writing my own c-library?

Martin