standard input / standard output

Pixilang programming language
Post Reply
kmatze
Posts: 47
Joined: Wed Jun 22, 2011 12:36 am

standard input / standard output

Post by kmatze »

hi nightradio,

is it possible to use pixilang as interpreter to use with c like:

Code: Select all

int main ()
	printf("\npixilang> ");
	for(;;) {
		char buf[4096];
		if(fgets(buf, sizeof(buf), stdin)) {
			do_eval_pixilang("stdin", ++line, buf);
			printf("\npixilang> ");
		} else {
			break;
		}
	}
	return 0;
} 
I use win32 vista and pixilang 3.6 no gl.

Thanks and greetings - kmatze
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: standard input / standard output

Post by NightRadio »

I think yes :)
Try to launch pixilang_console.exe with text_input.pixi example from the examples/console folder
kmatze
Posts: 47
Joined: Wed Jun 22, 2011 12:36 am

Re: standard input / standard output

Post by kmatze »

Oh thank's, but that's not i mean. I try to explain:

my goal is to use pixilang as graphic backend from c. So i need a c-api to
- start pixilang in background (e.g. init pixilang())
- eval pixilang commands (e.g. eval_pixilang (pixilang commands)
- close pixilang (e.g. close_pixilang())
I hope you can understand what i mean.
Thanks and greeting - kmatze
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: standard input / standard output

Post by NightRadio »

Ah, ok. Pixilang can't execute its commands in real time (some dialog with the user). It only can load and execute the whole pixi file.
kmatze
Posts: 47
Joined: Wed Jun 22, 2011 12:36 am

Re: standard input / standard output

Post by kmatze »

ok, thanks.
Maybe a possible future feature?
greetings - kmatze
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: standard input / standard output

Post by NightRadio »

Yes, why not :)
Post Reply