Page 1 of 1

standard input / standard output

Posted: Thu Feb 09, 2017 1:40 pm
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

Re: standard input / standard output

Posted: Mon Feb 13, 2017 12:56 pm
by NightRadio
I think yes :)
Try to launch pixilang_console.exe with text_input.pixi example from the examples/console folder

Re: standard input / standard output

Posted: Sat Feb 25, 2017 4:41 pm
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

Re: standard input / standard output

Posted: Sun Feb 26, 2017 9:42 am
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.

Re: standard input / standard output

Posted: Sun Feb 26, 2017 5:12 pm
by kmatze
ok, thanks.
Maybe a possible future feature?
greetings - kmatze

Re: standard input / standard output

Posted: Thu Mar 02, 2017 2:07 pm
by NightRadio
Yes, why not :)