standard input / standard output

Pixilang programming language
kmatze
Posts: 45
Joined: Wed Jun 22, 2011 12:36 am

standard input / standard output

Postby kmatze » Thu Feb 09, 2017 1:40 pm

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: 2758
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: standard input / standard output

Postby NightRadio » Mon Feb 13, 2017 12:56 pm

I think yes :)
Try to launch pixilang_console.exe with text_input.pixi example from the examples/console folder

kmatze
Posts: 45
Joined: Wed Jun 22, 2011 12:36 am

Re: standard input / standard output

Postby kmatze » Sat Feb 25, 2017 4:41 pm

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: 2758
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: standard input / standard output

Postby NightRadio » Sun Feb 26, 2017 9:42 am

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: 45
Joined: Wed Jun 22, 2011 12:36 am

Re: standard input / standard output

Postby kmatze » Sun Feb 26, 2017 5:12 pm

ok, thanks.
Maybe a possible future feature?
greetings - kmatze

User avatar
NightRadio
Site Admin
Posts: 2758
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: standard input / standard output

Postby NightRadio » Thu Mar 02, 2017 2:07 pm

Yes, why not :)


Return to “Pixilang”

Who is online

Users browsing this forum: No registered users and 1 guest